linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jack Pham <jackp@codeaurora.org>
To: Vinod Koul <vkoul@kernel.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
	linux-arm-msm@vger.kernel.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Asutosh Das <asutoshd@codeaurora.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] phy: qcom-qmp: Add UFS v4 registers found in SM8350
Date: Mon, 25 Jan 2021 09:36:42 -0800	[thread overview]
Message-ID: <20210125173641.GA27487@jackp-linux.qualcomm.com> (raw)
In-Reply-To: <20210125100906.4004908-4-vkoul@kernel.org>

Hi Vinod,

On Mon, Jan 25, 2021 at 03:39:05PM +0530, Vinod Koul wrote:
> Add the registers for few new registers found in SM8350. Also the UFS
> phy used in SM8350 seems to have different offsets than V4 phy, although
> it claims it is v4 phy, so add the new offsets with SM8350 tag instead
> of V4 tag.

Actually I believe SM8350 UFS PHY is on V5, as the internal IP revision
shows 5.0.0. So IMO some of the below definitions should just be using
the V5 macros for consistency with the ones I recently added for USB3.

And like USB3 QMP, it seems we have mixed usage of V4/V5 macros in the
sequence tables, mainly wherever the offsets are identical between IP
revisions. Hope this doesn't turn out to be a maintenance nightmare...

> ---
>  drivers/phy/qualcomm/phy-qcom-qmp.h | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.h b/drivers/phy/qualcomm/phy-qcom-qmp.h
> index dff7be5a1cc1..bba1d5e3eb73 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp.h
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp.h
> @@ -451,6 +451,7 @@
>  #define QSERDES_V4_TX_RES_CODE_LANE_OFFSET_RX 		0x40
>  #define QSERDES_V4_TX_LANE_MODE_1			0x84
>  #define QSERDES_V4_TX_LANE_MODE_2			0x88
> +#define QSERDES_V4_TX_LANE_MODE_3			0x8C
>  #define QSERDES_V4_TX_RCV_DETECT_LVL_2			0x9c
>  #define QSERDES_V4_TX_PWM_GEAR_1_DIVIDER_BAND0_1	0xd8
>  #define QSERDES_V4_TX_PWM_GEAR_2_DIVIDER_BAND0_1	0xdC
> @@ -459,6 +460,13 @@
>  #define QSERDES_V4_TX_TRAN_DRVR_EMP_EN			0xb8
>  #define QSERDES_V4_TX_PI_QEC_CTRL		0x104
>  
> +/* Only for SM8350 QMP V4 Phy TX offsets different from V4 */
> +#define QSERDES_SM8350_TX_PWM_GEAR_1_DIVIDER_BAND0_1	0x178
> +#define QSERDES_SM8350_TX_PWM_GEAR_2_DIVIDER_BAND0_1	0x17c
> +#define QSERDES_SM8350_TX_PWM_GEAR_3_DIVIDER_BAND0_1	0x180
> +#define QSERDES_SM8350_TX_PWM_GEAR_4_DIVIDER_BAND0_1	0x184
> +#define QSERDES_SM8350_TX_TRAN_DRVR_EMP_EN		0xc0

These could be augmented to the V5 TX defintions? Although they are not
present for USB, so not sure if you want to add "V5_UFS" to the prefix.
But since they are at offsets past the end of the USB TX bank it should
also be ok to share in the QSERDES_V5_TX namespace.

> +
>  /* Only for QMP V4 PHY - RX registers */
>  #define QSERDES_V4_RX_UCDR_FO_GAIN			0x008
>  #define QSERDES_V4_RX_UCDR_SO_GAIN			0x014
> @@ -514,6 +522,24 @@
>  #define QSERDES_V4_RX_DCC_CTRL1				0x1bc
>  #define QSERDES_V4_RX_VTH_CODE				0x1c4
>  
> +/* Only for SM8350 QMP V4 Phy RX offsets different from V4 */
> +#define QSERDES_SM8350_RX_RX_MODE_00_LOW		0x15c
> +#define QSERDES_SM8350_RX_RX_MODE_00_HIGH		0x160
> +#define QSERDES_SM8350_RX_RX_MODE_00_HIGH2		0x164
> +#define QSERDES_SM8350_RX_RX_MODE_00_HIGH3		0x168
> +#define QSERDES_SM8350_RX_RX_MODE_00_HIGH4		0x16c
> +#define QSERDES_SM8350_RX_RX_MODE_01_LOW		0x170
> +#define QSERDES_SM8350_RX_RX_MODE_01_HIGH		0x174
> +#define QSERDES_SM8350_RX_RX_MODE_01_HIGH2		0x178
> +#define QSERDES_SM8350_RX_RX_MODE_01_HIGH3		0x17c
> +#define QSERDES_SM8350_RX_RX_MODE_01_HIGH4		0x180
> +#define QSERDES_SM8350_RX_RX_MODE_10_LOW		0x184
> +#define QSERDES_SM8350_RX_RX_MODE_10_HIGH		0x188
> +#define QSERDES_SM8350_RX_RX_MODE_10_HIGH2		0x18c
> +#define QSERDES_SM8350_RX_RX_MODE_10_HIGH3		0x190
> +#define QSERDES_SM8350_RX_RX_MODE_10_HIGH4		0x194
> +#define QSERDES_SM8350_RX_DCC_CTRL1			0x1a8

These are identical to the "V5" offsets I had added for SM8350 USB.

Thanks,
Jack
-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  parent reply	other threads:[~2021-01-25 17:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 10:09 [PATCH 0/4] Add Support for SM8350 UFS Vinod Koul
2021-01-25 10:09 ` [PATCH 1/4] scsi: dt-bindings: ufs: Add sm8250, sm8350 compatible strings Vinod Koul
2021-01-25 17:10   ` Bjorn Andersson
2021-01-25 10:09 ` [PATCH 2/4] dt-bindings: phy: qcom,qmp: Add SM8350 UFS PHY bindings Vinod Koul
2021-01-25 17:10   ` Bjorn Andersson
2021-01-25 10:09 ` [PATCH 3/4] phy: qcom-qmp: Add UFS v4 registers found in SM8350 Vinod Koul
2021-01-25 17:11   ` Bjorn Andersson
2021-01-25 17:36   ` Jack Pham [this message]
2021-01-25 10:09 ` [PATCH 4/4] phy: qcom-qmp: Add support for SM8350 UFS phy Vinod Koul
2021-01-25 17:11   ` Bjorn Andersson

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=20210125173641.GA27487@jackp-linux.qualcomm.com \
    --to=jackp@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=asutoshd@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=kishon@ti.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).