Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp938873rwb; Thu, 1 Dec 2022 10:10:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf757RTFKxNnkfn4IZAyyIobR1uvk46yZZNvCN5aSk3biw83WSx+9Kvb+wj01AOqMHZyejUx X-Received: by 2002:a17:906:2607:b0:7c0:a110:4b89 with SMTP id h7-20020a170906260700b007c0a1104b89mr6967177ejc.763.1669918202237; Thu, 01 Dec 2022 10:10:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669918202; cv=none; d=google.com; s=arc-20160816; b=kqmzmXx2H0HM3p9que3iP/cghB4Fb3jJ6pS+tSVU/EEtReCZGnzxXW3Lr5QJcGpvAl l+sRK7JOVlXqvLh07mru1hTMuNq6pNgf6xT7z0vriRiRCZ+j1EeH33P2A/l3d0tqhtW8 toyd5YsIGccSYGq0J05+AC6xnufMvcjKA+jtAByMRCp6lssCJNchcA8B+eDM2gBJzgfu Pjt8E2nhavwD7uGuUn3HCjEF598QXgVa8CEw8aNr21ymaN5WHwne0r/07jf1OESRz0/y vWK4oT8sdO6dXu2VNy9Inx9u/F2cHYZcg0Vz5SSTty2TOoU4jnKvHlhllRpNE4kt0unB /Iww== 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=0EwbwxScxAH0Ye5HC8kecov46MNjbALXnqq/6xD/uZI=; b=yVqWJ16Z5V9tqbJNXIVX+5Z0ePw3JtPXY7CHd7AjT8FTaVbKbOBQMEzM4NQCJrwx3I ynTdatEp8OD2uBdRZgBBXICZ811unVzq8naltSOxB6G9Chh0HVm3HJ7aU/QRqnGd/OW1 8K+H9CkuSXKa2yUlLv3L/4PX2F1B3HcU4MQI/R0z/IIWggBlMGg/N74NHSbSrfw/6AcB phUahAtuGHv/OOIPptAJHjpjdtmol2Hhdv3sVTHhhgKgjHJl0XAIripSSucY90mUPQS7 ZfEbL35bThml5c3h4YHM7BVzTAw6MWEIXLYNQIvNAnYFrXkorviKMRfOgAB+C3butn/A HSYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t+B+gdvW; 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 tz14-20020a170907c78e00b007b2bddc9b87si3541570ejc.306.2022.12.01.10.09.40; Thu, 01 Dec 2022 10:10:02 -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=t+B+gdvW; 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 S230193AbiLARon (ORCPT + 82 others); Thu, 1 Dec 2022 12:44:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbiLARoW (ORCPT ); Thu, 1 Dec 2022 12:44:22 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24EE7B71EE for ; Thu, 1 Dec 2022 09:44:17 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id y17so2329773plp.3 for ; Thu, 01 Dec 2022 09:44:17 -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=0EwbwxScxAH0Ye5HC8kecov46MNjbALXnqq/6xD/uZI=; b=t+B+gdvWpTyroYE+SGEqX9/YuhL5Dufp6zJbMHpPHKhyaoEcktAaFKu/KlVFq2Akzm pW2nsD9QNakchPgTAfPcv6qm/0opGtV3Hscm7fhTCw9FwPmXqVvGXHZ93ulLzlegBNlI oQvRpUkMTWVh8sfqCYPG/SAd6CcqbDdRLU2nUAwwP2qb3rjSKrRmzZ8LBt53Z7Kk84bM 62exduN0roGn38WL9Y/U2Sm7JXUPt0SMU5w51yQSxCnSXOmtEPZ2khFbr2CyV4dxlWWO YKdzwsXrLB/HBc3E2WQhbQwRgjwNbqk0vBscGy8L9eaNluH6S6hiJPzLCsBH8+rIBLiN mhHA== 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=0EwbwxScxAH0Ye5HC8kecov46MNjbALXnqq/6xD/uZI=; b=WE2r6PFjVhCSpBfIVDujeqLIJY/NM1wx3Co3krPwQopW5JQ3TTq1R1rjj0GPSfncU5 jOia9buL6tLu7eAxoYj58AXwwxRBq+4SOBPBsdwRrOwlqaT+RlGMaJvF8GhNMOvfK0yQ esC3LaUckg2SVdtMjpLf/rpctXGcbPdBSwzOlmEmTJPp6NnlLhyOafyFQJxMQ3yz9KSE Q4Y14bxRZMOwvBi8DEC+73NoQUlwuMQYhhLPclYt9FGVFEhdWPmfJSC3qEI3GTLlFI9r Bfi9ewo2raTLgP2NF1oAlG6VuSudfJjmvy1qM1fE2mhe7kTU2AMgqfoEwwR1ohGFqNRY 86kA== X-Gm-Message-State: ANoB5plReP1ZQUsGygfWEBe9IXG3JTA2kIu91VM2WtDvE3vYdnnn942C MqI2j3LMl7r05aikxUdrS0M1 X-Received: by 2002:a17:902:e94e:b0:186:5613:becf with SMTP id b14-20020a170902e94e00b001865613becfmr37192236pll.46.1669916656633; Thu, 01 Dec 2022 09:44:16 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 09:44:15 -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 05/23] phy: qcom-qmp-ufs: Add support for configuring PHY in HS G4 mode Date: Thu, 1 Dec 2022 23:13:10 +0530 Message-Id: <20221201174328.870152-6-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=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 Add separate tables_hs_g4 instance to allow the PHY driver to configure the PHY in HS G4 mode. The individual SoC configs need to supply the Rx, Tx and PCS register setting in tables_hs_g4 and the UFS driver can request the Hs G4 mode by calling phy_set_mode_ext() with submode set to UFS_HS_G4. Reviewed-by: Dmitry Baryshkov Signed-off-by: Manivannan Sadhasivam --- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c index 2d5dd336aeb2..82be9b754e8e 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c @@ -20,6 +20,7 @@ #include #include +#include #include "phy-qcom-qmp.h" /* QPHY_SW_RESET bit */ @@ -549,6 +550,8 @@ struct qmp_phy_cfg { const struct qmp_phy_cfg_tbls tbls; /* Additional sequence for HS Series B */ const struct qmp_phy_cfg_tbls tbls_hs_b; + /* Additional sequence for HS G4 */ + const struct qmp_phy_cfg_tbls tbls_hs_g4; /* clock ids to be requested */ const char * const *clk_list; @@ -583,6 +586,7 @@ struct qmp_ufs { struct phy *phy; u32 mode; + u32 submode; }; static inline void qphy_setbits(void __iomem *base, u32 offset, u32 val) @@ -847,7 +851,11 @@ static void qmp_ufs_init_registers(struct qmp_ufs *qmp, const struct qmp_phy_cfg if (qmp->mode == PHY_MODE_UFS_HS_B) qmp_ufs_serdes_init(qmp, &cfg->tbls_hs_b); qmp_ufs_lanes_init(qmp, &cfg->tbls); + if (qmp->submode == UFS_HS_G4) + qmp_ufs_lanes_init(qmp, &cfg->tbls_hs_g4); qmp_ufs_pcs_init(qmp, &cfg->tbls); + if (qmp->submode == UFS_HS_G4) + qmp_ufs_pcs_init(qmp, &cfg->tbls_hs_g4); } static int qmp_ufs_com_init(struct qmp_ufs *qmp) @@ -1021,6 +1029,7 @@ static int qmp_ufs_set_mode(struct phy *phy, enum phy_mode mode, int submode) struct qmp_ufs *qmp = phy_get_drvdata(phy); qmp->mode = mode; + qmp->submode = submode; return 0; } -- 2.25.1