Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp690102qtx; Mon, 31 Oct 2022 11:29:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UyUMd5UETPXg+By6MQodcwg2hrx4cEYH0hmYMa/Jl7MyTIAlbPkHrSudFJTeU2rdZi4+B X-Received: by 2002:a17:90b:48c3:b0:213:b5ad:742d with SMTP id li3-20020a17090b48c300b00213b5ad742dmr13054536pjb.172.1667240945913; Mon, 31 Oct 2022 11:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667240945; cv=none; d=google.com; s=arc-20160816; b=efkDm3VyM2sbktIAs6tATSDW1XotRZLiWSBd4EnWFCrH8WcEqnEuIJEtMlP86I5smQ QqaMIAWbdMPTVi6xLkpv9iAYlWmdsK0J6UWzHk+oApE0rNerQozIVrQDW+rXAw7KIZsQ T+Y3xx8SyjySF16ZVy9L/8TwETwvXnbItQC4Lfj9VvVedeg1g18QRhgV6fGj+sD6OhxT 6mzo0eGTQKNxOrJPV2yP2eqpCgKqTrC5k5ElklffRvtU8O9HjowU5yi7O/8zdQX/2kYb utXMBKhwnjpaDm/4IRCQivchHXuJa0meK3Sk2wCGzdqmq8S6uDKxVyJ/tjRCgFtcgg9S P76g== 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=Rm5YDFlVd6eI/fFgodaIxbvJPfjZlzuthtjzW8r4Yj4=; b=XyHWdi1jis5uTsV3r1MAGVrt0TdRA99vY76yYuqjNKlfwaJUbBi2dX1QG7b71LYuuT t+hsgBXuD+4WraWaPK3V9YzBgUZM1wQdPSR2IOTE6GsPXGphm7e8GOTpzDDwXW6LemuW B6KEn5GvnrFI2ctETF6915mbY7axmTRcJOyWE9FnNI2Rxc2Bpbc8iun49xwrT83coiha ajdG30b40+cKFqkTKNSk5bbRMdJjmfyXBpQfQxuvuqFaSaTwKwFKdE6p2RDi0IIP6am6 EimnmgJqcZn7vg9Nn2IOUci6uZeEs5pgbvS+ZRjUAaArBX7qvEy+EeS2xCLSr9Gyxqqr kFuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="v/CqXyYf"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ix18-20020a170902f81200b001865f96f6f7si8627436plb.104.2022.10.31.11.28.52; Mon, 31 Oct 2022 11:29:05 -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="v/CqXyYf"; 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 S230046AbiJaSDh (ORCPT + 98 others); Mon, 31 Oct 2022 14:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbiJaSDV (ORCPT ); Mon, 31 Oct 2022 14:03:21 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1417513E10 for ; Mon, 31 Oct 2022 11:03:15 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id e129so11340871pgc.9 for ; Mon, 31 Oct 2022 11:03:15 -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=Rm5YDFlVd6eI/fFgodaIxbvJPfjZlzuthtjzW8r4Yj4=; b=v/CqXyYfUoXrwzsXA5qpFQawr6K3iOvMHCF0RCXf54p0u7D7bEb1qakVHo0/vPz0LG a4HvD0DE5snvBA+4mZKPTvwJpDofOKRinef/DqiXHK/4oCXhF5OwB6LKKfwlzrtHDNFm aC2Ikv5ms+PO8O1n7bdcM3sh2hZ1hmi9RSFS9XDkKnhVDt/j4pJEnm+SXDpqXd9g0kHR 2aWCAc1txR/92HuQ0w25pU5ZJcs0Mu+rDWHulhpByoXn8cam5oYZULA2jeTn1KtDIyzi jSjyhWfiThfDhNygBEBKp0pGsRepJurelWNK1yJ5YC7COPT0EyRD89fxP93/gOLu8NWy 6q9Q== 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=Rm5YDFlVd6eI/fFgodaIxbvJPfjZlzuthtjzW8r4Yj4=; b=5Icyn4H6sIboJBoMb8uUZz7JSoLSgFz4KI3wnsQ5QWG4tgHUarRTeT5XDHuNa1Pkq1 6DO6lhnr0p4kLCJwJ6znjShzK1y3CUYouBZ5zUUUNDRk5Towsy2lo1UudeMfNVOqCgzM alBs66xXkJuZ2OONZHOUolvKi4omp3AEua0EeUoi0BWZWVGj2ra4el6iREArjm/SxlPj 8tLwra6lb5CfyrTiP7I+JdGnir+S/LWFKLm3jegfQDiAFSPyRd2pC5IinN4PZBpsbjV6 lbLFI2JtdlRkX+MrKYC3Q3YrNI/7/XUnwwesy3NiXSZ8xEq5a1qq5rCx661KgahfNegM agPA== X-Gm-Message-State: ACrzQf1A2wn2sKwr339GE0APqOC6YpjijNwgy+hDGYFU5FY9AqgyPfh2 3xL9RQXxzpLXbNcXMeFlO4KI X-Received: by 2002:a05:6a00:acc:b0:530:e79e:fc27 with SMTP id c12-20020a056a000acc00b00530e79efc27mr15694724pfl.61.1667239394520; Mon, 31 Oct 2022 11:03:14 -0700 (PDT) Received: from localhost.localdomain ([117.193.209.221]) by smtp.gmail.com with ESMTPSA id q14-20020a170902a3ce00b00186c6d2e7e3sm4742224plb.26.2022.10.31.11.03.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 11:03:13 -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, dmitry.baryshkov@linaro.org, ahalaney@redhat.com, Manivannan Sadhasivam Subject: [PATCH v2 05/15] phy: qcom-qmp-ufs: Move HS Rate B register setting to tables_hs_b Date: Mon, 31 Oct 2022 23:32:07 +0530 Message-Id: <20221031180217.32512-6-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031180217.32512-1-manivannan.sadhasivam@linaro.org> References: <20221031180217.32512-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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=ham 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 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. Reviewed-by: Dmitry Baryshkov Signed-off-by: Manivannan Sadhasivam --- 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, -- 2.25.1