Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6096152rwb; Tue, 22 Nov 2022 08:43:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf4EwPweCBcpOF6Cvbes3uGvql80zkpCZt/M3cDfvcFrDazzPp+ib/GaGkNR4LAq7MKW5xYe X-Received: by 2002:a17:902:bd83:b0:180:87d7:9be8 with SMTP id q3-20020a170902bd8300b0018087d79be8mr17701938pls.85.1669135405093; Tue, 22 Nov 2022 08:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669135405; cv=none; d=google.com; s=arc-20160816; b=dr3X/OLMAMMDy7qtCzuGn0bhIgNemO2tlEj8WIJ/9gXy+mpgsq/LsiwzchZbjFTqlC XZbpR4+uBPO9uXxvrdugKuaTt9azZbUpM3RPJaYs0kSZ3kUJVAdRcoZ1ACcrcUfHK5aF Rfv0/fibymcCQorY62rxlyyf2ZD/gdsTt6Tsjamav/Hyw3d/NOeMOCiQDj+WzHp9VJ8A /HtwPVZdT/8mjxA69shj7qjJHCMufT4GUfczMVEERx8079gtjiTkEFH460Wh6SeQW8Kv zvTBMuFG7XczxPSRWA64lTTytQ8Nhp7UVMOksuu5jHqXEBYGtt3fTDWEXj4B//m1P9ef AsYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=T82+qptXBJG7eHFalgFxGvJty6XiRIjJgNv/yNtgHQU=; b=lIjDNP5NN3w/tn09TC58zc7XiX9STVxX3jVsehsacZqbOzAca8Anx5WNw5Wuolb6qd ik2sj5Vygyzu0ZhcYKgQgOiYmlFTN4v7R4AlCCaHdE3zVGllXHrdGMc7t0DA0qOjEt7Q SlJFtZJnEsivGfEu/ZaK5fZphmB9oicDZIwXfMgX3LsE3McRixPMJGISWj5Y8XplThgv qR0ABMmszaPQnmYiF0+bCpg4CjE1CspAIA3dJ0gNGNVGKS34QTsaY/jucMB8P2x6O97n l7iIEW/P7mAykQlTUABrIX9bDgqxiRoFzonNiaxNG0Pk7DaIfY4gWfKg+JX3DHutZsYi GEzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CGayHwcX; 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 jk12-20020a170903330c00b001893740c58asi1157844plb.393.2022.11.22.08.43.12; Tue, 22 Nov 2022 08:43:25 -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=CGayHwcX; 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 S232572AbiKVQVa (ORCPT + 91 others); Tue, 22 Nov 2022 11:21:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233798AbiKVQVP (ORCPT ); Tue, 22 Nov 2022 11:21:15 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF38B2BE for ; Tue, 22 Nov 2022 08:21:12 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id b11so13666990pjp.2 for ; Tue, 22 Nov 2022 08:21:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=T82+qptXBJG7eHFalgFxGvJty6XiRIjJgNv/yNtgHQU=; b=CGayHwcXg4RlZZiXO3+tUzsOCvK8+vITVedxsiYG01Ss5kJwmGUgFPk6owHSTWmQ3W wQHRC3wrfFBRZWEZCf4pFcqI/wGhEGE+cPVCJrqlub2MCcRMFBfJPaANDUjtyVE3Aq8m GcKQxnU7LBJ3O+7SNmIb4f+N2iYtUnI2yTmc253T7s8GhKrujsacLHFDO8Q5T4D8u4+4 BY15dWh/csAxaVDAOpNT80j6yNiGvrffn1tPO5i5P5CPDTrD/wBsnPBweHeKiUOV0BvU nkPn4R701VMBsuQc0Gc1vwVwlIG7eZrcQtz8BJYndEqEKKdSKIs/9D+rkHOJLfLujfvQ FtzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=T82+qptXBJG7eHFalgFxGvJty6XiRIjJgNv/yNtgHQU=; b=zkOA6eIXhESZnKjLHCR2NuiAt/W7AhG3v/oypv4SDfZfoTNn5QoegArXH617KgCMmg F5gmkl9Ya1DvEjqE/WCqSp4aUfoSYvl1M+e5Gp3K+XHXdfViQWaWgt6rMWE98epKOqFe +9ocrEOcHi02tQo9EJfq5MNv7MGxrueyz4niq9VlKAT8RaWJZZaacJu1U8kGaFNLHmBm u4c5O44S1xrGa66DRf9GeXfddS/I/t66/2CghifIBamZSaFfQwUvEbIJbvhPPaiKkFoq jGOb2zYerF6OUvbStFGAAukA/40b2qTZyQ7RCTmdPUAlxzfUnA2NRTE0PRyLkXU8J6vY 6vCQ== X-Gm-Message-State: ANoB5pks4eJ2eztklOjmi1SO367kBcEd1N0WtcfCsD8keoTZ2Rr09All 7ziU24CCOqkdx4hz/FS5GjF3 X-Received: by 2002:a17:90a:2b47:b0:218:9671:3b85 with SMTP id y7-20020a17090a2b4700b0021896713b85mr17801148pjc.4.1669134072427; Tue, 22 Nov 2022 08:21:12 -0800 (PST) Received: from thinkpad ([117.202.191.0]) by smtp.gmail.com with ESMTPSA id mn23-20020a17090b189700b002187a4dd830sm9522876pjb.46.2022.11.22.08.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 08:21:11 -0800 (PST) Date: Tue, 22 Nov 2022 21:51:03 +0530 From: Manivannan Sadhasivam To: Vinod Koul Cc: martin.petersen@oracle.com, jejb@linux.ibm.com, andersson@kernel.org, krzysztof.kozlowski+dt@linaro.org, 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 Subject: Re: [PATCH v2 02/15] phy: qcom-qmp-ufs: Add support for configuring PHY in HS Series B mode Message-ID: <20221122162103.GF157542@thinkpad> References: <20221031180217.32512-1-manivannan.sadhasivam@linaro.org> <20221031180217.32512-3-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 On Fri, Nov 11, 2022 at 12:31:15PM +0530, Vinod Koul wrote: > On 31-10-22, 23:32, Manivannan Sadhasivam wrote: > > Add separate tables_hs_b instance to allow the PHY driver to configure the > > PHY in HS Series B mode. The individual SoC configs need to supply the > > serdes register setting in tables_hs_b and the UFS driver can request the > > Series B mode by calling phy_set_mode() with mode set to PHY_MODE_UFS_HS_B. > > > > Reviewed-by: Dmitry Baryshkov > > Signed-off-by: Manivannan Sadhasivam > > --- > > drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 18 ++++++++++++++++++ > > 1 file changed, 18 insertions(+) > > > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c > > index cdfda4e6d575..4c6a2b5afc9a 100644 > > --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c > > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c > > @@ -20,6 +20,8 @@ > > #include > > #include > > > > +#include > > + > > #include > > > > #include "phy-qcom-qmp.h" > > @@ -549,6 +551,8 @@ struct qmp_phy_cfg { > > > > /* Main init sequence for PHY blocks - serdes, tx, rx, pcs */ > > const struct qmp_phy_cfg_tables tables; > > + /* Additional sequence for HS Series B */ > > + const struct qmp_phy_cfg_tables tables_hs_b; > > what am i missing, where was tables_hs_b added? > This patch adds the infrastructure for HS_B mode. The actual table is added in patch 5/15. Thanks, Mani > > > > /* clock ids to be requested */ > > const char * const *clk_list; > > @@ -582,6 +586,7 @@ struct qmp_phy_cfg { > > * @rx2: iomapped memory space for second lane's rx (in dual lane PHYs) > > * @pcs_misc: iomapped memory space for lane's pcs_misc > > * @qmp: QMP phy to which this lane belongs > > + * @mode: PHY mode configured by the UFS driver > > */ > > struct qmp_phy { > > struct phy *phy; > > @@ -594,6 +599,7 @@ struct qmp_phy { > > void __iomem *rx2; > > void __iomem *pcs_misc; > > struct qcom_qmp *qmp; > > + u32 mode; > > }; > > > > /** > > @@ -983,6 +989,8 @@ static int qmp_ufs_power_on(struct phy *phy) > > int ret; > > > > qmp_ufs_serdes_init(qphy, &cfg->tables); > > + if (qphy->mode == PHY_MODE_UFS_HS_B) > > + qmp_ufs_serdes_init(qphy, &cfg->tables_hs_b); > > > > qmp_ufs_lanes_init(qphy, &cfg->tables); > > > > @@ -1070,6 +1078,15 @@ static int qmp_ufs_disable(struct phy *phy) > > return qmp_ufs_exit(phy); > > } > > > > +static int qmp_ufs_set_mode(struct phy *phy, enum phy_mode mode, int submode) > > +{ > > + struct qmp_phy *qphy = phy_get_drvdata(phy); > > + > > + qphy->mode = mode; > > + > > + return 0; > > +} > > + > > static int qmp_ufs_vreg_init(struct device *dev, const struct qmp_phy_cfg *cfg) > > { > > struct qcom_qmp *qmp = dev_get_drvdata(dev); > > @@ -1105,6 +1122,7 @@ static int qmp_ufs_clk_init(struct device *dev, const struct qmp_phy_cfg *cfg) > > static const struct phy_ops qcom_qmp_ufs_ops = { > > .power_on = qmp_ufs_enable, > > .power_off = qmp_ufs_disable, > > + .set_mode = qmp_ufs_set_mode, > > .owner = THIS_MODULE, > > }; > > > > -- > > 2.25.1 > > -- > ~Vinod -- மணிவண்ணன் சதாசிவம்