From patchwork Sat Oct 29 14:16:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 12715 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1370514wru; Sat, 29 Oct 2022 07:18:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7H9yBWGnCGZaFG5l90N0jKSTg5nQb0azOLPtu6nxy2RdZ/XOKdxD4fwZoZ1u3XdN45f29k X-Received: by 2002:a17:902:a3cc:b0:186:8a1e:4e9f with SMTP id q12-20020a170902a3cc00b001868a1e4e9fmr4544371plb.80.1667053109433; Sat, 29 Oct 2022 07:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667053109; cv=none; d=google.com; s=arc-20160816; b=QhQ0z1tiPG7Pt8k2W49IbBiiwNUX/ay4QsxmEce2OvWoFN1fG/rjvWBfTrDQrnfwFN XpF5SMu8xK66guZVqMmPSIsfe5946SqpgvHFcaWJHppcjFZlv+sWNnEx0N3h3WxOhrUv 6rwh7uW9OGC3bjcVGXGOJGwxY41i1lRmt69BCOdAYLFtcA5odp53yU1GxplZmyMAVQV3 KvfcY2HmeK2Z+umyvlYWrusb6vc4B6tO89paP0u6m53AXJ2aeHMfI12loEx7hTO6o3Es 5i9QOSlqhNimNoLMd2CeKpoR3bdQ6w9Jnrf/XiWS+uUBuEdZBBBkQarz5fhzX/MWWZzN 2Y5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UOMm8BaOvfEJM7NF+uICaNkya2n9h9Ru0iVe5CxvYeE=; b=tPiXGmU/A0gAdkb+fw8W7AAJ5pqjCNrAMNjNC8TaOgclrOZed3jANAu4U3bualY2fA KchPDqFQtTLa0rvvDuu2Icxm2RWbIL62Yl66RVJjeiPcig5KX5fGRngMfVqnmGooRYW7 +bR8GxaZACiR4YakmbBZ3lFyAQx/vvY7+P63Lz83oMvhwXnvC9oZScelCZ9DWxZDBNrx vAtEFrT/fDhM1/KS7NLAP2Sar4fzXIv1qEQHromWRR4je+JMqWWtIKr51X+RyrkdKUn2 PSR9C39tJIEbpC10OEWIWnsfG1eABwuOUZ92b+Hmcjmv4H5G7AjEV7aZtxIAhXKysgwn HioA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cu+M3uSk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u123-20020a626081000000b0056285c5a37asi2011503pfb.55.2022.10.29.07.18.15; Sat, 29 Oct 2022 07:18:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cu+M3uSk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbiJ2ORw (ORCPT + 99 others); Sat, 29 Oct 2022 10:17:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbiJ2OR0 (ORCPT ); Sat, 29 Oct 2022 10:17:26 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50F545F7CB for ; Sat, 29 Oct 2022 07:17:11 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id g62so7082006pfb.10 for ; Sat, 29 Oct 2022 07:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UOMm8BaOvfEJM7NF+uICaNkya2n9h9Ru0iVe5CxvYeE=; b=Cu+M3uSkfljr/GyQWX3BrmFRiA0yhF3F9il+A4srLwErnN2elI4aKL9n4tbUbhmwSj tVb3J86z32atPqD70Nn8G/KGwgChE/T2hx6FIsuZx7orKCz1ozBogB4d7wM0IFVyoJT6 iwurglsAIT+Wsbpx8p1bIdnT5rnB6XOneVPKwrVumQx4jqI0OyDYGMsT65zNB1oH5Rnq Q2eIKlxbAXpe21Q5GA+idVBZUhV8ZxSaCxSYdBFdwglMN+aNuP4SQVHz1EmUMEpJ2mR3 xF6BSzDuuH2LFZL0L4KxGMxIuw4EjrjA8g4zK2UUXyEk4QjZ0T1TYPefZmt0v5yfrT/X s3DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UOMm8BaOvfEJM7NF+uICaNkya2n9h9Ru0iVe5CxvYeE=; b=W85+zKX36UB4XoHE7buIucGM9x0EZjamGez3Ac+5C/AGjO5MXEmhTLIrMnRu7m1jE7 kfGrFydw0pEDiQ94cjcFkVYbWW6vomF9C3gY2sxay8WVmQJoa1cb5cpAJ4ZCPRMXLGOO Vxow4oa8dXdMNACFqonsUiSPFT1/NKfb+lmQmbil4NP8WLMYhN/V/EHyb7ecki5wgyoz rrEUjADsWgPdSRvFRpH6GYCVdWqC3W4EYgAS8abbYu5cGqK+3pcbnAizFxCTATg/TJUV xoyDcQCYvhI2kl5SLR00k+Dw7ChueSC6U/WHKtUh/AcKukrWde4r5Awy1JrzIxoZPQ/f wnMQ== X-Gm-Message-State: ACrzQf1L4WemE0gWmdmto1qTYbTciixAfbg8NUUQxviBQrOZyaysnNev +D5+fJYO1Wt/LkR+++RYmMPH X-Received: by 2002:a63:8942:0:b0:46e:c02e:2eb5 with SMTP id v63-20020a638942000000b0046ec02e2eb5mr4212687pgd.141.1667053030836; Sat, 29 Oct 2022 07:17:10 -0700 (PDT) Received: from localhost.localdomain ([117.193.208.18]) by smtp.gmail.com with ESMTPSA id u4-20020a170902e5c400b001866049ddb1sm1370157plf.161.2022.10.29.07.17.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 07:17:09 -0700 (PDT) From: Manivannan Sadhasivam To: martin.petersen@oracle.com, jejb@linux.ibm.com, andersson@kernel.org, vkoul@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: konrad.dybcio@somainline.org, robh+dt@kernel.org, quic_cang@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-scsi@vger.kernel.org, Manivannan Sadhasivam Subject: [PATCH 05/15] phy: qcom-qmp-ufs: Move HS Rate B register setting to tables_hs_b Date: Sat, 29 Oct 2022 19:46:23 +0530 Message-Id: <20221029141633.295650-6-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221029141633.295650-1-manivannan.sadhasivam@linaro.org> References: <20221029141633.295650-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748031881418770270?= X-GMAIL-MSGID: =?utf-8?q?1748031881418770270?= Since now there is support for configuring the HS Rate B mode properly, let's move the register setting to tables_hs_b struct for all SoCs. This allows the PHY to be configured in Rate A initially and then in Rate B if requested by the UFS driver. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 32 +++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c index fa7457c0202b..c55c85a8f95e 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c @@ -228,8 +228,9 @@ static const struct qmp_phy_init_tbl sm6115_ufsphy_serdes[] = { QMP_PHY_INIT_CFG(QSERDES_COM_BG_TRIM, 0x0f), QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_INITVAL1, 0xff), QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_INITVAL2, 0x00), +}; - /* Rate B */ +static const struct qmp_phy_init_tbl sm6115_ufsphy_hs_b_serdes[] = { QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_MAP, 0x44), }; @@ -305,8 +306,9 @@ static const struct qmp_phy_init_tbl sdm845_ufsphy_serdes[] = { QMP_PHY_INIT_CFG(QSERDES_V3_COM_VCO_TUNE2_MODE1, 0x00), QMP_PHY_INIT_CFG(QSERDES_V3_COM_LOCK_CMP1_MODE1, 0x32), QMP_PHY_INIT_CFG(QSERDES_V3_COM_LOCK_CMP2_MODE1, 0x0f), +}; - /* Rate B */ +static const struct qmp_phy_init_tbl sdm845_ufsphy_hs_b_serdes[] = { QMP_PHY_INIT_CFG(QSERDES_V3_COM_VCO_TUNE_MAP, 0x44), }; @@ -371,8 +373,9 @@ static const struct qmp_phy_init_tbl sm8150_ufsphy_serdes[] = { QMP_PHY_INIT_CFG(QSERDES_V4_COM_LOCK_CMP2_MODE1, 0x0f), QMP_PHY_INIT_CFG(QSERDES_V4_COM_BIN_VCOCAL_CMP_CODE1_MODE1, 0xdd), QMP_PHY_INIT_CFG(QSERDES_V4_COM_BIN_VCOCAL_CMP_CODE2_MODE1, 0x23), +}; - /* Rate B */ +static const struct qmp_phy_init_tbl sm8150_ufsphy_hs_b_serdes[] = { QMP_PHY_INIT_CFG(QSERDES_V4_COM_VCO_TUNE_MAP, 0x06), }; @@ -492,8 +495,9 @@ static const struct qmp_phy_init_tbl sm8350_ufsphy_serdes[] = { QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP2_MODE1, 0x1e), QMP_PHY_INIT_CFG(QSERDES_V5_COM_BIN_VCOCAL_CMP_CODE1_MODE1, 0xdd), QMP_PHY_INIT_CFG(QSERDES_V5_COM_BIN_VCOCAL_CMP_CODE2_MODE1, 0x23), +}; - /* Rate B */ +static const struct qmp_phy_init_tbl sm8350_ufsphy_hs_b_serdes[] = { QMP_PHY_INIT_CFG(QSERDES_V5_COM_VCO_TUNE_MAP, 0x06), }; @@ -746,6 +750,10 @@ static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { .pcs = sdm845_ufsphy_pcs, .pcs_num = ARRAY_SIZE(sdm845_ufsphy_pcs), }, + .tables_hs_b = { + .serdes = sdm845_ufsphy_hs_b_serdes, + .serdes_num = ARRAY_SIZE(sdm845_ufsphy_hs_b_serdes), + }, .clk_list = sdm845_ufs_phy_clk_l, .num_clks = ARRAY_SIZE(sdm845_ufs_phy_clk_l), .vreg_list = qmp_phy_vreg_l, @@ -772,6 +780,10 @@ static const struct qmp_phy_cfg sm6115_ufsphy_cfg = { .pcs = sm6115_ufsphy_pcs, .pcs_num = ARRAY_SIZE(sm6115_ufsphy_pcs), }, + .tables_hs_b = { + .serdes = sm6115_ufsphy_hs_b_serdes, + .serdes_num = ARRAY_SIZE(sm6115_ufsphy_hs_b_serdes), + }, .clk_list = sdm845_ufs_phy_clk_l, .num_clks = ARRAY_SIZE(sdm845_ufs_phy_clk_l), .vreg_list = qmp_phy_vreg_l, @@ -797,6 +809,10 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { .pcs = sm8150_ufsphy_pcs, .pcs_num = ARRAY_SIZE(sm8150_ufsphy_pcs), }, + .tables_hs_b = { + .serdes = sm8150_ufsphy_hs_b_serdes, + .serdes_num = ARRAY_SIZE(sm8150_ufsphy_hs_b_serdes), + }, .clk_list = sdm845_ufs_phy_clk_l, .num_clks = ARRAY_SIZE(sdm845_ufs_phy_clk_l), .vreg_list = qmp_phy_vreg_l, @@ -829,6 +845,10 @@ static const struct qmp_phy_cfg sm8250_ufsphy_cfg = { .pcs = sm8250_ufsphy_hs_g4_pcs, .pcs_num = ARRAY_SIZE(sm8250_ufsphy_hs_g4_pcs), }, + .tables_hs_b = { + .serdes = sm8150_ufsphy_hs_b_serdes, + .serdes_num = ARRAY_SIZE(sm8150_ufsphy_hs_b_serdes), + }, .clk_list = sdm845_ufs_phy_clk_l, .num_clks = ARRAY_SIZE(sdm845_ufs_phy_clk_l), .vreg_list = qmp_phy_vreg_l, @@ -853,6 +873,10 @@ static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { .pcs = sm8350_ufsphy_pcs, .pcs_num = ARRAY_SIZE(sm8350_ufsphy_pcs), }, + .tables_hs_b = { + .serdes = sm8350_ufsphy_hs_b_serdes, + .serdes_num = ARRAY_SIZE(sm8350_ufsphy_hs_b_serdes), + }, .clk_list = sdm845_ufs_phy_clk_l, .num_clks = ARRAY_SIZE(sdm845_ufs_phy_clk_l), .vreg_list = qmp_phy_vreg_l,