From patchwork Sat Jan 14 07:10:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 43705 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp163674wrn; Fri, 13 Jan 2023 23:12:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXte5PM/HfRClz0yetdatEM6+o7Ylk4uZbSHM8C9EINiYfWbcdJ1vtlTIUgIj01m2U3R7449 X-Received: by 2002:a17:902:eb8b:b0:192:fb94:a40e with SMTP id q11-20020a170902eb8b00b00192fb94a40emr34776017plg.62.1673680326919; Fri, 13 Jan 2023 23:12:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673680326; cv=none; d=google.com; s=arc-20160816; b=x68sf3zAof9GL4qT5mjdTKTf/sztCqrd6ktgqwRIqer0qCqC57+ZO/ElyVluhCihFR krQknrRdh7SAkC6fVb92fWiIbL2t5WOdNnuwO7+UTVeoCki8tcNmJVtKQLqg7+lR1qD2 2443ObutEjfz2pt4sdoRmJVaz5Y5k2GbjzjG8vrpdhDI8sJJR012OnjbXEemhiFjmIPs 9CVbe2DVBiAItj3KFiDTiLH7nRKijUtdw/WjMJI1l/GmlIn/ELP10hTeDG+aAbO7Umik LVwX5bTaHZihhtatWhZ1lG7NwqSyNGDKmQNDJquC9lF8KsQkyyElynf9VJahOhi71gdj 6JEg== 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=P6UnC1hlB+v3q7qNl2UemN8iZ10TjdJQ4rcW+wGUH18=; b=cIh+W8Zo8RzShUpfpMdff7lCe8xm4anZKsbLeRC/DXHvz/LQkgnRECmG7rld+V0xkz 7lSkezkDAFJsFGEshkR7sNM1oZm/BTnVHDeTvNhOteejVZ5mBpzM1c/PcUYeKY3Pjf9F olYHKDQ49rHV6Z3dQSsYz3Z1C3DhmdhLqaQBCUKXgnX6/AT/gZVqAEby3iSOasS0AXlP wYeQE1wuHe/D0u3+iKmfxOF5HCH0bWJ35oewH2LBxKcOPw586H+t91MmoqFa/Yq26RSl ZJr6/tnOnIHnEal42XFlaNm0s6FWp/8dv3D6wgyc8VxpPqU4JI1X9LZEr7RtAMJTNls7 RSMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="p1sC9W/b"; 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 r11-20020a170903410b00b001947e1a94d5si724597pld.575.2023.01.13.23.11.54; Fri, 13 Jan 2023 23:12:06 -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="p1sC9W/b"; 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 S229805AbjANHLP (ORCPT + 99 others); Sat, 14 Jan 2023 02:11:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbjANHKw (ORCPT ); Sat, 14 Jan 2023 02:10:52 -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 653FD7AA5 for ; Fri, 13 Jan 2023 23:10:37 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id b17so18057971pld.7 for ; Fri, 13 Jan 2023 23:10:37 -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=P6UnC1hlB+v3q7qNl2UemN8iZ10TjdJQ4rcW+wGUH18=; b=p1sC9W/bZo/ItmyrTIHt2xlM6iwiYlknA+/cMq7ZU7odrL229sHachfoLeG7s7Fzgp RNi5j2zJgxM26lTWW8h5pNHH3cHGrJsT7TGo0mbr/5euin0VEvUnAM4kZUMKWYugbLSW Q9Un7615SFMEm5jMG8DexEY/wLIbFbXT61F6rJEbEPCF4O666JIIMIyDCt8mQE6MpVtU 7+XFGv733tlgswRD5DcVSpVF024Pxvj77NsZiVxmUemSysPfj/paLpxKJKGglPbFbwGq HCpdT0pnPRXfnV7aWI4OL8QWDXU0YN+W+5hv6VMhR1yMZuuGc23gT7aUOf+bIjNiq0vB ql/g== 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=P6UnC1hlB+v3q7qNl2UemN8iZ10TjdJQ4rcW+wGUH18=; b=1MNmXaGyINRWjQWm7WvGvLSD5WpohUiXmfl55yF3IAwyLZvhbFfl9WR3OhApWmXJE8 CoIy5oKQL3zgYYwiOu3wFqUMPKThj756qvBiTJG1uWs/PfBRHReBMfvnV3id+gFXkEkR K7MhSFSdk5MVB+eTOhN7k7Q+zN/878TYVGI3UhtmCBbUO0Mx6Jf9q2iu2WSi4VBVScaK fttFnpEi0UrBW8ePdqRGKe7bg3Fvu/PH7QIglpl5BZKXtXSFMBCSyU3/DqLk8Ds++OpI RxLuHvmlyZbzuvIXD7hEnXIz36iLdEuGxY8jHUuA/lVRRtOU/6fpBFf0JCyQO2lbeWXr PYRg== X-Gm-Message-State: AFqh2koWjvoiUSYg1QXEGgNyAPvYCatcv41J0p3lTM394HKoU6lZDoGj sEuWZYx3JM715DybtyiblpQi X-Received: by 2002:a17:902:b10d:b0:194:4339:112e with SMTP id q13-20020a170902b10d00b001944339112emr15728704plr.60.1673680236797; Fri, 13 Jan 2023 23:10:36 -0800 (PST) Received: from localhost.localdomain ([220.158.159.156]) by smtp.gmail.com with ESMTPSA id q10-20020a170902e30a00b00192a04bc620sm15225358plc.295.2023.01.13.23.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 23:10:35 -0800 (PST) From: Manivannan Sadhasivam To: vkoul@kernel.org Cc: andersson@kernel.org, quic_cang@quicinc.com, quic_asutoshd@quicinc.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, dmitry.baryshkov@linaro.org, ahalaney@redhat.com, abel.vesa@linaro.org, Manivannan Sadhasivam Subject: [PATCH v6 05/12] phy: qcom-qmp-ufs: Add support for configuring PHY in HS G4 mode Date: Sat, 14 Jan 2023 12:40:02 +0530 Message-Id: <20230114071009.88102-6-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230114071009.88102-1-manivannan.sadhasivam@linaro.org> References: <20230114071009.88102-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?1754981022608621961?= X-GMAIL-MSGID: =?utf-8?q?1754981022608621961?= 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 Tested-by: Andrew Halaney # Qdrive3/sa8540p-ride 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 91285ddd663e..bb329cfbb96d 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" #include "phy-qcom-qmp-pcs-ufs-v2.h" #include "phy-qcom-qmp-pcs-ufs-v3.h" @@ -554,6 +555,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; @@ -588,6 +591,7 @@ struct qmp_ufs { struct phy *phy; u32 mode; + u32 submode; }; static inline void qphy_setbits(void __iomem *base, u32 offset, u32 val) @@ -854,7 +858,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) @@ -1028,6 +1036,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; }