All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550
@ 2023-01-19 15:14 Abel Vesa
  2023-01-19 15:14 ` [PATCH v2 1/2] scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5 Abel Vesa
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Abel Vesa @ 2023-01-19 15:14 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Alim Akhtar, Avri Altman, Bart Van Assche,
	Rob Herring, Krzysztof Kozlowski, James E . J . Bottomley,
	Martin K . Petersen
  Cc: linux-arm-msm, linux-scsi, devicetree, Linux Kernel Mailing List

This patchset adds UFS HC support for the new Qualcomm SM8550 SoC.

The v1 was here:
https://lore.kernel.org/all/20221116121732.2731448-1-abel.vesa@linaro.org/

Changes since v1:
 * replaced REG_UFS_PA_LINK_STARTUP_TIMER with REG_UFS_CFG0 and added a
   comment saying that the older version use the first name as reg name
 * moved QUNIPRO_G4_SEL in a separate section dedicated to CFG0 bits
 * forces the update_link_startup_timer condition to be skipped in case
   of HW version 5.x

To: Andy Gross <agross@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Alim Akhtar <alim.akhtar@samsung.com>
To: Avri Altman <avri.altman@wdc.com>
To: Bart Van Assche <bvanassche@acm.org>
To: Rob Herring <robh+dt@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
To: "James E.J. Bottomley" <jejb@linux.ibm.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Abel Vesa (2):
  scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5
  dt-bindings: ufs: qcom: Add SM8550 compatible string

 Documentation/devicetree/bindings/ufs/qcom,ufs.yaml | 2 ++
 drivers/ufs/host/ufs-qcom.c                         | 8 ++++++--
 drivers/ufs/host/ufs-qcom.h                         | 6 +++++-
 3 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5
  2023-01-19 15:14 [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550 Abel Vesa
@ 2023-01-19 15:14 ` Abel Vesa
  2023-01-19 15:14 ` [PATCH v2 2/2] dt-bindings: ufs: qcom: Add SM8550 compatible string Abel Vesa
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Abel Vesa @ 2023-01-19 15:14 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Alim Akhtar, Avri Altman, Bart Van Assche,
	Rob Herring, Krzysztof Kozlowski, James E . J . Bottomley,
	Martin K . Petersen
  Cc: linux-arm-msm, linux-scsi, devicetree, Linux Kernel Mailing List

On SM8550, depending on the Qunipro, we can run with G5 or G4.
For now, when the major version is 5 or above, we go with G5.
Therefore, we need to specifically tell UFS HC that.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
 drivers/ufs/host/ufs-qcom.c | 8 ++++++--
 drivers/ufs/host/ufs-qcom.h | 6 +++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 5e7ba3b6a59d..7b6deef4e49a 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -218,6 +218,10 @@ static void ufs_qcom_select_unipro_mode(struct ufs_qcom_host *host)
 	ufshcd_rmwl(host->hba, QUNIPRO_SEL,
 		   ufs_qcom_cap_qunipro(host) ? QUNIPRO_SEL : 0,
 		   REG_UFS_CFG1);
+
+	if (host->hw_ver.major == 0x05)
+		ufshcd_rmwl(host->hba, QUNIPRO_G4_SEL, 0, REG_UFS_CFG0);
+
 	/* make sure above configuration is applied before we return */
 	mb();
 }
@@ -507,9 +511,9 @@ static int ufs_qcom_cfg_timers(struct ufs_hba *hba, u32 gear,
 		mb();
 	}
 
-	if (update_link_startup_timer) {
+	if (update_link_startup_timer && host->hw_ver.major != 0x5) {
 		ufshcd_writel(hba, ((core_clk_rate / MSEC_PER_SEC) * 100),
-			      REG_UFS_PA_LINK_STARTUP_TIMER);
+			      REG_UFS_CFG0);
 		/*
 		 * make sure that this configuration is applied before
 		 * we return
diff --git a/drivers/ufs/host/ufs-qcom.h b/drivers/ufs/host/ufs-qcom.h
index f744a9e62002..cca773210bcb 100644
--- a/drivers/ufs/host/ufs-qcom.h
+++ b/drivers/ufs/host/ufs-qcom.h
@@ -35,7 +35,8 @@ enum {
 	REG_UFS_PA_ERR_CODE                 = 0xCC,
 	/* On older UFS revisions, this register is called "RETRY_TIMER_REG" */
 	REG_UFS_PARAM0                      = 0xD0,
-	REG_UFS_PA_LINK_STARTUP_TIMER       = 0xD8,
+	/* On older UFS revisions, this register is called "REG_UFS_PA_LINK_STARTUP_TIMER" */
+	REG_UFS_CFG0                        = 0xD8,
 	REG_UFS_CFG1                        = 0xDC,
 	REG_UFS_CFG2                        = 0xE0,
 	REG_UFS_HW_VERSION                  = 0xE4,
@@ -73,6 +74,9 @@ enum {
 #define UFS_CNTLR_2_x_x_VEN_REGS_OFFSET(x)	(0x000 + x)
 #define UFS_CNTLR_3_x_x_VEN_REGS_OFFSET(x)	(0x400 + x)
 
+/* bit definitions for REG_UFS_CFG0 register */
+#define QUNIPRO_G4_SEL		BIT(5)
+
 /* bit definitions for REG_UFS_CFG1 register */
 #define QUNIPRO_SEL		BIT(0)
 #define UFS_PHY_SOFT_RESET	BIT(1)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] dt-bindings: ufs: qcom: Add SM8550 compatible string
  2023-01-19 15:14 [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550 Abel Vesa
  2023-01-19 15:14 ` [PATCH v2 1/2] scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5 Abel Vesa
@ 2023-01-19 15:14 ` Abel Vesa
  2023-02-08 15:28   ` Manivannan Sadhasivam
  2023-02-08 23:08 ` [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550 Martin K. Petersen
  2023-02-14 16:57 ` Martin K. Petersen
  3 siblings, 1 reply; 6+ messages in thread
From: Abel Vesa @ 2023-01-19 15:14 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Alim Akhtar, Avri Altman, Bart Van Assche,
	Rob Herring, Krzysztof Kozlowski, James E . J . Bottomley,
	Martin K . Petersen
  Cc: linux-arm-msm, linux-scsi, devicetree, Linux Kernel Mailing List,
	Krzysztof Kozlowski

Document the compatible for the UFS found on SM8550.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/ufs/qcom,ufs.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml b/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml
index 54f5f8dc5c87..108c281e9d09 100644
--- a/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml
+++ b/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml
@@ -33,6 +33,7 @@ properties:
           - qcom,sm8250-ufshc
           - qcom,sm8350-ufshc
           - qcom,sm8450-ufshc
+          - qcom,sm8550-ufshc
       - const: qcom,ufshc
       - const: jedec,ufs-2.0
 
@@ -106,6 +107,7 @@ allOf:
               - qcom,sm8250-ufshc
               - qcom,sm8350-ufshc
               - qcom,sm8450-ufshc
+              - qcom,sm8550-ufshc
     then:
       properties:
         clocks:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] dt-bindings: ufs: qcom: Add SM8550 compatible string
  2023-01-19 15:14 ` [PATCH v2 2/2] dt-bindings: ufs: qcom: Add SM8550 compatible string Abel Vesa
@ 2023-02-08 15:28   ` Manivannan Sadhasivam
  0 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam @ 2023-02-08 15:28 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Manivannan Sadhasivam, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Alim Akhtar, Avri Altman, Bart Van Assche,
	Rob Herring, Krzysztof Kozlowski, James E . J . Bottomley,
	Martin K . Petersen, linux-arm-msm, linux-scsi, devicetree,
	Linux Kernel Mailing List, Krzysztof Kozlowski

On Thu, Jan 19, 2023 at 05:14:06PM +0200, Abel Vesa wrote:
> Document the compatible for the UFS found on SM8550.
> 
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

Acked-by: Manivannan Sadhasivam <mani@kernel.org>

Thanks,
Mani

> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/ufs/qcom,ufs.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml b/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml
> index 54f5f8dc5c87..108c281e9d09 100644
> --- a/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml
> +++ b/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml
> @@ -33,6 +33,7 @@ properties:
>            - qcom,sm8250-ufshc
>            - qcom,sm8350-ufshc
>            - qcom,sm8450-ufshc
> +          - qcom,sm8550-ufshc
>        - const: qcom,ufshc
>        - const: jedec,ufs-2.0
>  
> @@ -106,6 +107,7 @@ allOf:
>                - qcom,sm8250-ufshc
>                - qcom,sm8350-ufshc
>                - qcom,sm8450-ufshc
> +              - qcom,sm8550-ufshc
>      then:
>        properties:
>          clocks:
> -- 
> 2.34.1
> 

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550
  2023-01-19 15:14 [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550 Abel Vesa
  2023-01-19 15:14 ` [PATCH v2 1/2] scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5 Abel Vesa
  2023-01-19 15:14 ` [PATCH v2 2/2] dt-bindings: ufs: qcom: Add SM8550 compatible string Abel Vesa
@ 2023-02-08 23:08 ` Martin K. Petersen
  2023-02-14 16:57 ` Martin K. Petersen
  3 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2023-02-08 23:08 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Manivannan Sadhasivam, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Alim Akhtar, Avri Altman, Bart Van Assche,
	Rob Herring, Krzysztof Kozlowski, James E . J . Bottomley,
	Martin K . Petersen, linux-arm-msm, linux-scsi, devicetree,
	Linux Kernel Mailing List


Abel,

> This patchset adds UFS HC support for the new Qualcomm SM8550 SoC.

Applied to 6.3/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550
  2023-01-19 15:14 [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550 Abel Vesa
                   ` (2 preceding siblings ...)
  2023-02-08 23:08 ` [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550 Martin K. Petersen
@ 2023-02-14 16:57 ` Martin K. Petersen
  3 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2023-02-14 16:57 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Alim Akhtar, Avri Altman, Bart Van Assche,
	Rob Herring, Krzysztof Kozlowski, James E . J . Bottomley,
	Abel Vesa
  Cc: Martin K . Petersen, linux-arm-msm, linux-scsi, devicetree,
	Linux Kernel Mailing List

On Thu, 19 Jan 2023 17:14:04 +0200, Abel Vesa wrote:

> This patchset adds UFS HC support for the new Qualcomm SM8550 SoC.
> 
> The v1 was here:
> https://lore.kernel.org/all/20221116121732.2731448-1-abel.vesa@linaro.org/
> 
> Changes since v1:
>  * replaced REG_UFS_PA_LINK_STARTUP_TIMER with REG_UFS_CFG0 and added a
>    comment saying that the older version use the first name as reg name
>  * moved QUNIPRO_G4_SEL in a separate section dedicated to CFG0 bits
>  * forces the update_link_startup_timer condition to be skipped in case
>    of HW version 5.x
> 
> [...]

Applied to 6.3/scsi-queue, thanks!

[1/2] scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5
      https://git.kernel.org/mkp/scsi/c/9c02aa24bf40
[2/2] dt-bindings: ufs: qcom: Add SM8550 compatible string
      https://git.kernel.org/mkp/scsi/c/b8c203891121

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-14 16:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 15:14 [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550 Abel Vesa
2023-01-19 15:14 ` [PATCH v2 1/2] scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5 Abel Vesa
2023-01-19 15:14 ` [PATCH v2 2/2] dt-bindings: ufs: qcom: Add SM8550 compatible string Abel Vesa
2023-02-08 15:28   ` Manivannan Sadhasivam
2023-02-08 23:08 ` [PATCH v2 0/2] ufs: host: ufs-qcom: Add support for SM8550 Martin K. Petersen
2023-02-14 16:57 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.