public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: Can Guo <quic_cang@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Can Guo <cang@qti.qualcomm.com>,
	bvanassche@acm.org, stanley.chu@mediatek.com,
	adrian.hunter@intel.com, beanhuo@micron.com, avri.altman@wdc.com,
	junwoo80.lee@samsung.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	"open list:ARM/QUALCOMM SUPPORT" <linux-arm-msm@vger.kernel.org>,
	"open list:GENERIC PHY FRAMEWORK" <linux-phy@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 6/7] phy: qualcomm: phy-qcom-qmp-ufs: Add High Speed Gear 5 support for SM8550
Date: Thu, 9 Nov 2023 08:56:04 +0530	[thread overview]
Message-ID: <20231109032604.GB3752@thinkpad> (raw)
In-Reply-To: <e8fce711-dfe3-612c-dc53-f45418c9dfeb@quicinc.com>

On Wed, Nov 08, 2023 at 05:19:43PM +0800, Can Guo wrote:
> Hi Mani,
> 
> On 11/8/2023 1:49 PM, Manivannan Sadhasivam wrote:
> > On Tue, Nov 07, 2023 at 03:18:09PM +0200, Dmitry Baryshkov wrote:
> > > On Tue, 7 Nov 2023 at 06:47, Can Guo <cang@qti.qualcomm.com> wrote:
> > > > 
> > > > From: Can Guo <quic_cang@quicinc.com>
> > > > 
> > > > On SM8550, two sets of UFS PHY settings are provided, one set is to support
> > > > HS-G5, another set is to support HS-G4 and lower gears. The two sets of PHY
> > > > settings are programming different values to different registers, mixing
> > > > the two sets and/or overwriting one set with another set is definitely not
> > > > blessed by UFS PHY designers. In order to add HS-G5 support for SM8550, we
> > > > need to split the two sets into their dedicated tables, and leave only the
> > > > common settings in the .tlbs. To have the PHY programmed with the correct
> > > > set of PHY settings, the submode passed to PHY driver must be either HS-G4
> > > > or HS-G5.
> > > > 
> > 
> > You should also mention that this issue is also present in G4 supported targets.
> > And a note that it will get fixed later.
> 
> Will this info upset more people? How about I mention this in the cover
> letter?
> 

It is working fine for now and we just want to make sure the sequence is aligned
with HPG. So I don't think it can upset anyone. But yeah, you can just mention
it in the cover letter.

- Mani

> > 
> > > > Signed-off-by: Can Guo <quic_cang@quicinc.com>
> > > > ---
> > > >   drivers/phy/qualcomm/phy-qcom-qmp-pcs-ufs-v6.h     |   2 +
> > > >   drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v6.h |   2 +
> > > >   .../qualcomm/phy-qcom-qmp-qserdes-txrx-ufs-v6.h    |  12 +++
> > > >   drivers/phy/qualcomm/phy-qcom-qmp-ufs.c            | 112 ++++++++++++++++++---
> > > >   4 files changed, 115 insertions(+), 13 deletions(-)
> > > > 
> > > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-ufs-v6.h b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-ufs-v6.h
> > > > index c23d5e4..e563af5 100644
> > > > --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-ufs-v6.h
> > > > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-ufs-v6.h
> > > > @@ -18,6 +18,7 @@
> > > >   #define QPHY_V6_PCS_UFS_BIST_FIXED_PAT_CTRL            0x060
> > > >   #define QPHY_V6_PCS_UFS_TX_HSGEAR_CAPABILITY           0x074
> > > >   #define QPHY_V6_PCS_UFS_RX_HSGEAR_CAPABILITY           0x0bc
> > > > +#define QPHY_V6_PCS_UFS_RX_HS_G5_SYNC_LENGTH_CAPABILITY        0x12c
> > > >   #define QPHY_V6_PCS_UFS_DEBUG_BUS_CLKSEL               0x158
> > > >   #define QPHY_V6_PCS_UFS_LINECFG_DISABLE                        0x17c
> > > >   #define QPHY_V6_PCS_UFS_RX_MIN_HIBERN8_TIME            0x184
> > > > @@ -27,5 +28,6 @@
> > > >   #define QPHY_V6_PCS_UFS_READY_STATUS                   0x1a8
> > > >   #define QPHY_V6_PCS_UFS_TX_MID_TERM_CTRL1              0x1f4
> > > >   #define QPHY_V6_PCS_UFS_MULTI_LANE_CTRL1               0x1fc
> > > > +#define QPHY_V6_PCS_UFS_RX_HSG5_SYNC_WAIT_TIME         0x220
> > > > 
> > > >   #endif
> > > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v6.h b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v6.h
> > > > index f420f8f..ef392ce 100644
> > > > --- a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v6.h
> > > > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v6.h
> > > > @@ -56,6 +56,8 @@
> > > >   #define QSERDES_V6_COM_SYS_CLK_CTRL                            0xe4
> > > >   #define QSERDES_V6_COM_SYSCLK_BUF_ENABLE                       0xe8
> > > >   #define QSERDES_V6_COM_PLL_IVCO                                        0xf4
> > > > +#define QSERDES_V6_COM_CMN_IETRIM                              0xfc
> > > > +#define QSERDES_V6_COM_CMN_IPTRIM                              0x100
> > > >   #define QSERDES_V6_COM_SYSCLK_EN_SEL                           0x110
> > > >   #define QSERDES_V6_COM_RESETSM_CNTRL                           0x118
> > > >   #define QSERDES_V6_COM_LOCK_CMP_EN                             0x120
> > > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-ufs-v6.h b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-ufs-v6.h
> > > > index 15bcb4b..48f31c8 100644
> > > > --- a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-ufs-v6.h
> > > > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-ufs-v6.h
> > > > @@ -10,10 +10,20 @@
> > > >   #define QSERDES_UFS_V6_TX_RES_CODE_LANE_RX                     0x2c
> > > >   #define QSERDES_UFS_V6_TX_RES_CODE_LANE_OFFSET_TX              0x30
> > > >   #define QSERDES_UFS_V6_TX_RES_CODE_LANE_OFFSET_RX              0x34
> > > > +#define QSERDES_UFS_V6_TX_LANE_MODE_1                          0x7c
> > > > +#define QSERDES_UFS_V6_TX_FR_DCC_CTRL                          0x108
> > > > 
> > > >   #define QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE2          0x08
> > > >   #define QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE4          0x10
> > > > +#define QSERDES_UFS_V6_RX_UCDR_FASTLOCK_SO_GAIN_RATE4          0x24
> > > > +#define QSERDES_UFS_V6_RX_UCDR_FASTLOCK_COUNT_HIGH_RATE4       0x54
> > > > +#define QSERDES_UFS_V6_RX_UCDR_FO_GAIN_RATE2                   0xd4
> > > > +#define QSERDES_UFS_V6_RX_UCDR_FO_GAIN_RATE4                   0xdc
> > > > +#define QSERDES_UFS_V6_RX_UCDR_SO_GAIN_RATE4                   0xf0
> > > > +#define QSERDES_UFS_V6_RX_UCDR_PI_CONTROLS                     0xf4
> > > >   #define QSERDES_UFS_V6_RX_VGA_CAL_MAN_VAL                      0x178
> > > > +#define QSERDES_UFS_V6_RX_EQ_OFFSET_ADAPTOR_CNTRL1             0x1bc
> > > > +#define QSERDES_UFS_V6_RX_OFFSET_ADAPTOR_CNTRL3                        0x1c4
> > > >   #define QSERDES_UFS_V6_RX_MODE_RATE_0_1_B0                     0x208
> > > >   #define QSERDES_UFS_V6_RX_MODE_RATE_0_1_B1                     0x20c
> > > >   #define QSERDES_UFS_V6_RX_MODE_RATE_0_1_B3                     0x214
> > > > @@ -25,6 +35,8 @@
> > > >   #define QSERDES_UFS_V6_RX_MODE_RATE3_B5                                0x264
> > > >   #define QSERDES_UFS_V6_RX_MODE_RATE3_B8                                0x270
> > > >   #define QSERDES_UFS_V6_RX_MODE_RATE4_B3                                0x280
> > > > +#define QSERDES_UFS_V6_RX_MODE_RATE4_B4                                0x284
> > > >   #define QSERDES_UFS_V6_RX_MODE_RATE4_B6                                0x28c
> > > > +#define QSERDES_UFS_V6_RX_DLL0_FTUNE_CTRL                      0x2f8
> > > > 
> > > >   #endif
> > > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> > > > index 3927eba..e0a01497 100644
> > > > --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> > > > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> > > > @@ -649,32 +649,51 @@ static const struct qmp_phy_init_tbl sm8550_ufsphy_serdes[] = {
> > > >          QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_SEL_1, 0x11),
> > > >          QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_HS_SWITCH_SEL_1, 0x00),
> > > >          QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP_EN, 0x01),
> > > > -       QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_MAP, 0x04),
> > > > -       QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_IVCO, 0x0f),
> > > > +
> > > >          QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_INITVAL2, 0x00),
> > > >          QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x41),
> > > > -       QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE0, 0x0a),
> > > >          QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE0, 0x18),
> > > >          QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE0, 0x14),
> > > >          QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x7f),
> > > >          QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x06),
> > > > -       QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x4c),
> > > > +};
> > > > +
> > > > +static const struct qmp_phy_init_tbl sm8550_ufsphy_hs_b_serdes[] = {
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_MAP, 0x44),
> > > > +};
> > > > +
> > > > +static const struct qmp_phy_init_tbl sm8550_ufsphy_g4_serdes[] = {
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_MAP, 0x04),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_IVCO, 0x0f),
> > > >          QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE0, 0x0a),
> > > > -       QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE0, 0x18),
> > > > -       QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE0, 0x14),
> > > > -       QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x99),
> > > > -       QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x07),
> > > 
> > > Aside from moving these registers to the HS_G4 table, you are also
> > > changing these registers. It makes me think that there was an error in
> > > the original programming sequence.
> > > If that is correct, could you please split the patch into two pieces:
> > > - Fix programming sequence (add proper Fixes tags)
> > > - Split G4 and G5 tables.
> > 
> > Ack
> > 
> > > 
> > > > +
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE1, 0x4c),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE1, 0x0a),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE1, 0x18),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE1, 0x14),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE1, 0x99),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE1, 0x07),
> > > 
> > > I see all the MODE1 registers being only present in G4 and G5 tables.
> > > Should they be programmed for the modes lower than G4?
> > > 
> > 
> > We use G4 table for all the modes <= G4.
> > 
> > > > +};
> > > > +
> > > > +static const struct qmp_phy_init_tbl sm8550_ufsphy_g5_serdes[] = {
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_IVCO, 0x1f),
> > > > +
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_CMN_IETRIM, 0x1b),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_CMN_IPTRIM, 0x1c),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE0, 0x06),
> > > >   };
> > > > 
> > > >   static const struct qmp_phy_init_tbl sm8550_ufsphy_tx[] = {
> > > > -       QMP_PHY_INIT_CFG(QSERDES_V6_TX_LANE_MODE_1, 0x05),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_TX_LANE_MODE_1, 0x05),
> > > >          QMP_PHY_INIT_CFG(QSERDES_UFS_V6_TX_RES_CODE_LANE_OFFSET_TX, 0x07),
> > > >   };
> > > > 
> > > > +static const struct qmp_phy_init_tbl sm8550_ufsphy_g4_tx[] = {
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_TX_FR_DCC_CTRL, 0x4c),
> > > > +};
> > > > +
> > > >   static const struct qmp_phy_init_tbl sm8550_ufsphy_rx[] = {
> > > > -       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE2, 0x0c),
> > > > -       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE4, 0x0f),
> > > > -       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_VGA_CAL_MAN_VAL, 0x0e),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FO_GAIN_RATE2, 0x0c),
> > > > 
> > > >          QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE_0_1_B0, 0xc2),
> > > >          QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE_0_1_B1, 0xc2),
> > > > @@ -690,14 +709,46 @@ static const struct qmp_phy_init_tbl sm8550_ufsphy_rx[] = {
> > > >          QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE3_B8, 0x02),
> > > >   };
> > > > 
> > > > +static const struct qmp_phy_init_tbl sm8550_ufsphy_g4_rx[] = {
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_VGA_CAL_MAN_VAL, 0x0e),
> > > > +};
> > > > +
> > > > +static const struct qmp_phy_init_tbl sm8550_ufsphy_g5_rx[] = {
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FO_GAIN_RATE4, 0x0c),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_SO_GAIN_RATE4, 0x04),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_EQ_OFFSET_ADAPTOR_CNTRL1, 0x14),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_PI_CONTROLS, 0x07),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_OFFSET_ADAPTOR_CNTRL3, 0x0e),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FASTLOCK_COUNT_HIGH_RATE4, 0x02),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE4, 0x1c),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FASTLOCK_SO_GAIN_RATE4, 0x06),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_VGA_CAL_MAN_VAL, 0x08),
> > > > +
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE4_B3, 0xb9),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE4_B4, 0x4f),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE4_B6, 0xff),
> > > > +       QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_DLL0_FTUNE_CTRL, 0x30),
> > > > +};
> > > > +
> > > >   static const struct qmp_phy_init_tbl sm8550_ufsphy_pcs[] = {
> > > >          QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_SIGDET_CTRL2, 0x69),
> > > >          QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_LARGE_AMP_DRV_LVL, 0x0f),
> > > >          QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_MID_TERM_CTRL1, 0x43),
> > > > -       QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PLL_CNTL, 0x2b),
> > > >          QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_MULTI_LANE_CTRL1, 0x02),
> > > >   };
> > > > 
> > > > +static const struct qmp_phy_init_tbl sm8550_ufsphy_g4_pcs[] = {
> > > > +       QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PLL_CNTL, 0x2b),
> > > > +       QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_HSGEAR_CAPABILITY, 0x04),
> > > > +       QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_HSGEAR_CAPABILITY, 0x04),
> > > > +};
> > > > +
> > > > +static const struct qmp_phy_init_tbl sm8550_ufsphy_g5_pcs[] = {
> > > > +       QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PLL_CNTL, 0x33),
> > > > +       QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_HS_G5_SYNC_LENGTH_CAPABILITY, 0x4f),
> > > > +       QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_HSG5_SYNC_WAIT_TIME, 0x9e),
> > > > +};
> > > > +
> > > >   struct qmp_ufs_offsets {
> > > >          u16 serdes;
> > > >          u16 pcs;
> > > > @@ -731,6 +782,8 @@ struct qmp_phy_cfg {
> > > >          const struct qmp_phy_cfg_tbls tbls_hs_b;
> > > >          /* Additional sequence for HS G4 */
> > > >          const struct qmp_phy_cfg_tbls tbls_hs_g4;
> > > > +       /* Additional sequence for HS G4 */
> > 
> > HS G5
> 
> Sure
> 
> > 
> > > > +       const struct qmp_phy_cfg_tbls tbls_hs_g5;
> > > > 
> > > >          /* clock ids to be requested */
> > > >          const char * const *clk_list;
> > > > @@ -1157,6 +1210,28 @@ static const struct qmp_phy_cfg sm8550_ufsphy_cfg = {
> > > >                  .pcs            = sm8550_ufsphy_pcs,
> > > >                  .pcs_num        = ARRAY_SIZE(sm8550_ufsphy_pcs),
> > > >          },
> > > > +       .tbls_hs_b = {
> > > > +               .serdes         = sm8550_ufsphy_hs_b_serdes,
> > > > +               .serdes_num     = ARRAY_SIZE(sm8550_ufsphy_hs_b_serdes),
> > > > +       },
> > > > +       .tbls_hs_g4 = {
> > > > +               .serdes         = sm8550_ufsphy_g4_serdes,
> > > > +               .serdes_num     = ARRAY_SIZE(sm8550_ufsphy_g4_serdes),
> > > > +               .tx             = sm8550_ufsphy_g4_tx,
> > > > +               .tx_num         = ARRAY_SIZE(sm8550_ufsphy_g4_tx),
> > > > +               .rx             = sm8550_ufsphy_g4_rx,
> > > > +               .rx_num         = ARRAY_SIZE(sm8550_ufsphy_g4_rx),
> > > > +               .pcs            = sm8550_ufsphy_g4_pcs,
> > > > +               .pcs_num        = ARRAY_SIZE(sm8550_ufsphy_g4_pcs),
> > > > +       },
> > > > +       .tbls_hs_g5 = {
> > > > +               .serdes         = sm8550_ufsphy_g5_serdes,
> > > > +               .serdes_num     = ARRAY_SIZE(sm8550_ufsphy_g5_serdes),
> > > > +               .rx             = sm8550_ufsphy_g5_rx,
> > > > +               .rx_num         = ARRAY_SIZE(sm8550_ufsphy_g5_rx),
> > > > +               .pcs            = sm8550_ufsphy_g5_pcs,
> > > > +               .pcs_num        = ARRAY_SIZE(sm8550_ufsphy_g5_pcs),
> > > > +       },
> > > >          .clk_list               = sdm845_ufs_phy_clk_l,
> > > >          .num_clks               = ARRAY_SIZE(sdm845_ufs_phy_clk_l),
> > > >          .vreg_list              = qmp_phy_vreg_l,
> > > > @@ -1222,14 +1297,25 @@ static void qmp_ufs_pcs_init(struct qmp_ufs *qmp, const struct qmp_phy_cfg_tbls
> > > >   static void qmp_ufs_init_registers(struct qmp_ufs *qmp, const struct qmp_phy_cfg *cfg)
> > > >   {
> > > >          qmp_ufs_serdes_init(qmp, &cfg->tbls);
> > > > +       if (qmp->submode == UFS_HS_G4)
> > > > +               qmp_ufs_serdes_init(qmp, &cfg->tbls_hs_g4);
> > > > +       else if (qmp->submode == UFS_HS_G5)
> > > > +               qmp_ufs_serdes_init(qmp, &cfg->tbls_hs_g5);
> > > > +
> > 
> > Should we program submode sequence after HS_B?
> > 
> > - Mani
> > 
> As the UFS PHY HW programming doc mentions, order of these writes is not
> important, so long as they are programmed correctly before release S/W
> reset, then it is fine.
> 
> Thanks,
> Can Guo.
> 
> 

-- 
மணிவண்ணன் சதாசிவம்

  reply	other threads:[~2023-11-09  3:26 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07  4:46 [PATCH v2 0/7] Enable HS-G5 support on SM8550 Can Guo
2023-11-07  4:46 ` [PATCH v2 1/7] scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params Can Guo
2023-11-07 19:36   ` Andrew Halaney
2023-11-08  7:44     ` Can Guo
2023-11-07 20:56   ` Bart Van Assche
2023-11-08  7:48     ` Can Guo
2023-11-07  4:46 ` [PATCH v2 2/7] scsi: ufs: ufs-qcom: Setup host power mode during init Can Guo
2023-11-07 20:14   ` Andrew Halaney
2023-11-08  7:47     ` Can Guo
2023-11-08  5:07   ` Manivannan Sadhasivam
2023-11-08  8:07     ` Can Guo
2023-11-07  4:46 ` [PATCH v2 3/7] scsi: ufs: ufs-qcom: Allow the first init start with the maximum supported gear Can Guo
2023-11-08  5:23   ` Manivannan Sadhasivam
2023-11-08  8:21     ` Can Guo
2023-11-08  8:23       ` Can Guo
2023-11-09  3:47       ` Manivannan Sadhasivam
2023-11-09  4:07         ` Can Guo
2023-11-09  7:47           ` Manivannan Sadhasivam
2023-11-07  4:46 ` [PATCH v2 4/7] scsi: ufs: ufs-qcom: Limit HS-G5 Rate-A to hosts with HW version 5 Can Guo
2023-11-08  5:25   ` Manivannan Sadhasivam
2023-11-08  8:42     ` Can Guo
2023-11-09  3:27       ` Manivannan Sadhasivam
2023-11-07  4:46 ` [PATCH v2 5/7] scsi: ufs: ufs-qcom: Set initial PHY gear to max HS gear for HW ver 5 and newer Can Guo
2023-11-08  5:34   ` Manivannan Sadhasivam
2023-11-08  8:46     ` Can Guo
2023-11-07  4:46 ` [PATCH v2 6/7] phy: qualcomm: phy-qcom-qmp-ufs: Add High Speed Gear 5 support for SM8550 Can Guo
2023-11-07 13:18   ` Dmitry Baryshkov
2023-11-08  5:49     ` Manivannan Sadhasivam
2023-11-08  6:56       ` Dmitry Baryshkov
2023-11-09  3:24         ` Manivannan Sadhasivam
2023-11-09  9:40           ` Dmitry Baryshkov
2023-11-09 10:42             ` Manivannan Sadhasivam
2023-11-09 11:00               ` Dmitry Baryshkov
2023-11-09 16:04                 ` Manivannan Sadhasivam
2023-11-09 22:11                   ` Dmitry Baryshkov
2023-11-10 13:18                     ` Manivannan Sadhasivam
2023-11-10 14:40                       ` Can Guo
2023-11-11  4:12                         ` Manivannan Sadhasivam
2023-11-12  5:13                           ` Can Guo
2023-11-14  6:12                             ` Manivannan Sadhasivam
2023-11-14  9:15                             ` Dmitry Baryshkov
2023-11-15  7:51                               ` Can Guo
2023-11-08  9:19       ` Can Guo
2023-11-09  3:26         ` Manivannan Sadhasivam [this message]
2023-11-08  9:02     ` Can Guo
2023-11-10  8:47   ` neil.armstrong
2023-11-10  9:03     ` Can Guo
2023-11-10  9:17       ` neil.armstrong
2023-11-10  9:32         ` Can Guo
2023-11-10  9:35           ` neil.armstrong
2023-11-07  4:46 ` [PATCH v2 7/7] scsi: ufs: ufs-qcom: Add support for UFS device version detection Can Guo
2023-11-08  5:11 ` [PATCH v2 0/7] Enable HS-G5 support on SM8550 Manivannan Sadhasivam
2023-11-08  8:09   ` Can Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231109032604.GB3752@thinkpad \
    --to=mani@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@qti.qualcomm.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=junwoo80.lee@samsung.com \
    --cc=kishon@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=quic_cang@quicinc.com \
    --cc=stanley.chu@mediatek.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox