Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp933320rwb; Thu, 1 Dec 2022 10:06:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf7xvLQzFbzkQ5+dSFghiL+MNyM/8VaT8EVKcLus+4bnywRtORoVFKapWl7i+O7YmKPxxrZC X-Received: by 2002:aa7:c841:0:b0:45d:2a5:2db8 with SMTP id g1-20020aa7c841000000b0045d02a52db8mr46114099edt.105.1669917980302; Thu, 01 Dec 2022 10:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669917980; cv=none; d=google.com; s=arc-20160816; b=uhK9UmjBCQ5AN2fgQf6Ze2hd1p60ZHmWKr4RaZRV1Ktrvy1k5XNNPyzpeZPTmJnDYh 3GewPuY9itNhYaXkXj1x+nLk9YKCqNBBj8wV4mAxntwUw9QNBwdNdKSF8zIT/3zvZRq/ VUwRSBpPHf27nlIsLSpPjhIw3ElLESPxQJdgul9t7DOYPEIZ15IFBdR3rAoZ0tVYRNPJ V2n47mj2P178f2slWeuJ5oQx6hspvygZDq1v4e2CDFHWNvKQtgDI0v1lx7wH4RNeMcwb KlGC03YU7TPYkhPse/fLz+3KfGPf1TmDBde+M3JLz+RhAqwEccRQInGdio1xu+olM60k +8Aw== 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=faQVhcObDk/Ia41BxNbpbIfjqc3Bjufuna+wsDfNbK0=; b=sWL4lWpsdMsD2mgJASD0DrZ+lBr0d0spoLkT6wrO2B7D5qdHJQFXQVK4tHS9Skz0Oa nHubt/wGaniu7gv7rI/Jg8J2KIcTa6OR1Cc6z7sZu72j3Y8x2kGlVksHWlUlnaa69RMD R4+aexVQMZJ0AOyFMA4UO/Jvg/t/p3zFCgOVSd1IjMKzTvNkMf2OBlMFoourxUyyCZkZ 44RgKZNK/FYSmt9roNMDLqzHaM+avTbagrIrNPu/XkFmBiB6urwsGMg2Cb30BXsXPrt5 bOTEZkYMyMZtkiimhhyruzeWlqxWgkfZ7HTxVfWM3PsUnUoTuUStC97lMT2Uz5J9VRXR NkOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=niMEmmXr; 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 u24-20020aa7db98000000b0046356ff4d4esi3885272edt.593.2022.12.01.10.05.58; Thu, 01 Dec 2022 10:06:20 -0800 (PST) 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=niMEmmXr; 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 S230256AbiLARpM (ORCPT + 82 others); Thu, 1 Dec 2022 12:45:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230220AbiLARod (ORCPT ); Thu, 1 Dec 2022 12:44:33 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 583CFB71CD for ; Thu, 1 Dec 2022 09:44:30 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id b11so2533990pjp.2 for ; Thu, 01 Dec 2022 09:44:30 -0800 (PST) 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=faQVhcObDk/Ia41BxNbpbIfjqc3Bjufuna+wsDfNbK0=; b=niMEmmXrGxSattyHgjhjqzcSNkMj+QkKL7xGLGgv/eXKo10ztsblF11MnmJZR6N0x/ YFiUs3EmfJiDIL2yk1PAJO7jCaP0XA+m7DWFGUlDmNUKKq2wAj0DQuErqzXRjy6Uduze asuVCDIfEobNtIGxwhmkZfxWL2PXpaTJSdvMeeTNYNJDjiLNE2YvE9O2JRpowGxl3yS1 v5RwH/V6MZVuZGztVUnMQcCagaqpd8Cpc5tGI3RnY13XO8NyrgkhAaiB3GBq/Qsgzbmb cm+ti3bTqm55Rhb9b4+lktod0AonEnuJqdx/Wimfnjvf8um1iDr1WXvBiaAIjlkGFGW3 SkVQ== 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=faQVhcObDk/Ia41BxNbpbIfjqc3Bjufuna+wsDfNbK0=; b=KgF+x4TxibDknGljBIIf5I9VwWxDOPGtIzHeikKHPf+GhOyY/dvFQtdC2eiw2X9079 WcO/ZJlflAMy/ZidRdaHEXhJ63MbHzWPvI71qX+NWFKzBWfK6sQuOVgSuK+kLiSyLYVi aY4ZKBveL3SfljaUqpsSXwl0bXm/fdloCfunVbkOsmo999HjULg191rSb/aoQKxC/+ak z+sW9u5QKbcxyJb7//3/b7fEueiMaou6NeXzWEtf+39RKunw4qKBGPXWtwrtfCd6mGab P1PE1NqdUPEAgM3PuP+3myhs37gh8AeXPiNbRmDhNeJc/iOpLmySZE4S/pfcq71PMhvg 9Zpg== X-Gm-Message-State: ANoB5pl7RCipwkF9ZrQ3EyB1v0suawD3Vsxk/omc2QjCKsVHOC5BWkJI B3cUuFc+j2bx0qtlw+dxTFipVVhuN/wV X-Received: by 2002:a17:902:d4c8:b0:186:9d71:228c with SMTP id o8-20020a170902d4c800b001869d71228cmr50494623plg.109.1669916669826; Thu, 01 Dec 2022 09:44:29 -0800 (PST) Received: from localhost.localdomain ([220.158.159.39]) by smtp.gmail.com with ESMTPSA id p4-20020a170902780400b0016d9b101413sm3898743pll.200.2022.12.01.09.44.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 09:44:29 -0800 (PST) From: Manivannan Sadhasivam To: martin.petersen@oracle.com, jejb@linux.ibm.com, andersson@kernel.org, vkoul@kernel.org Cc: quic_cang@quicinc.com, quic_asutoshd@quicinc.com, linux-arm-msm@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, abel.vesa@linaro.org, alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, Manivannan Sadhasivam Subject: [PATCH v4 07/23] phy: qcom-qmp-ufs: Add HS G4 mode support to SM8150 SoC Date: Thu, 1 Dec 2022 23:13:12 +0530 Message-Id: <20221201174328.870152-8-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221201174328.870152-1-manivannan.sadhasivam@linaro.org> References: <20221201174328.870152-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 UFS PHY in SM8150 SoC is capable of operating at HS G4 mode. Hence, add the required register settings using the tables_hs_g4 struct instance. Signed-off-by: Manivannan Sadhasivam --- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c index 97d0baa9bac3..269f96a0f752 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c @@ -374,6 +374,10 @@ static const struct qmp_phy_init_tbl sm8150_ufsphy_tx[] = { QMP_PHY_INIT_CFG(QSERDES_V4_TX_TRAN_DRVR_EMP_EN, 0x0c), }; +static const struct qmp_phy_init_tbl sm8150_ufsphy_hs_g4_tx[] = { + QMP_PHY_INIT_CFG(QSERDES_V4_TX_LANE_MODE_1, 0x75), +}; + static const struct qmp_phy_init_tbl sm8150_ufsphy_rx[] = { QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_LVL, 0x24), QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_CNTRL, 0x0f), @@ -411,6 +415,25 @@ static const struct qmp_phy_init_tbl sm8150_ufsphy_rx[] = { QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH4, 0xb1), }; +static const struct qmp_phy_init_tbl sm8150_ufsphy_hs_g4_rx[] = { + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x5a), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_PI_CTRL2, 0x81), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_FO_GAIN, 0x0e), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_TERM_BW, 0x6f), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_MEASURE_TIME, 0x20), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_LOW, 0x80), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_HIGH, 0x01), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_LOW, 0x3f), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH, 0xff), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH2, 0xff), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH3, 0x7f), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH4, 0x6c), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_LOW, 0x6d), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH, 0x6d), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH2, 0xed), + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH4, 0x3c), +}; + static const struct qmp_phy_init_tbl sm8150_ufsphy_pcs[] = { QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_RX_SIGDET_CTRL2, 0x6d), QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TX_LARGE_AMP_DRV_LVL, 0x0a), @@ -421,6 +444,11 @@ static const struct qmp_phy_init_tbl sm8150_ufsphy_pcs[] = { QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_MULTI_LANE_CTRL1, 0x02), }; +static const struct qmp_phy_init_tbl sm8150_ufsphy_hs_g4_pcs[] = { + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TX_LARGE_AMP_DRV_LVL, 0x10), + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_BIST_FIXED_PAT_CTRL, 0x0a), +}; + static const struct qmp_phy_init_tbl sm8350_ufsphy_serdes[] = { QMP_PHY_INIT_CFG(QSERDES_V5_COM_SYSCLK_EN_SEL, 0xd9), QMP_PHY_INIT_CFG(QSERDES_V5_COM_HSCLK_SEL, 0x11), @@ -762,6 +790,14 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { .serdes = sm8150_ufsphy_hs_b_serdes, .serdes_num = ARRAY_SIZE(sm8150_ufsphy_hs_b_serdes), }, + .tbls_hs_g4 = { + .tx = sm8150_ufsphy_hs_g4_tx, + .tx_num = ARRAY_SIZE(sm8150_ufsphy_hs_g4_tx), + .rx = sm8150_ufsphy_hs_g4_rx, + .rx_num = ARRAY_SIZE(sm8150_ufsphy_hs_g4_rx), + .pcs = sm8150_ufsphy_hs_g4_pcs, + .pcs_num = ARRAY_SIZE(sm8150_ufsphy_hs_g4_pcs), + }, .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