linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Fixes/improvements for SM6350 UFS
@ 2025-03-14  9:17 Luca Weiss
  2025-03-14  9:17 ` [PATCH 1/3] arm64: dts: qcom: sm6350: Fix wrong order of freq-table-hz for UFS Luca Weiss
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Luca Weiss @ 2025-03-14  9:17 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: ~postmarketos/upstreaming, phone-devel, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel, Luca Weiss, stable

Fix the order of the freq-table-hz property, then convert to OPP tables
and add interconnect support for UFS for the SM6350 SoC.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
Luca Weiss (3):
      arm64: dts: qcom: sm6350: Fix wrong order of freq-table-hz for UFS
      arm64: dts: qcom: sm6350: Add OPP table support to UFSHC
      arm64: dts: qcom: sm6350: Add interconnect support to UFS

 arch/arm64/boot/dts/qcom/sm6350.dtsi | 49 ++++++++++++++++++++++++++++--------
 1 file changed, 39 insertions(+), 10 deletions(-)
---
base-commit: eea255893718268e1ab852fb52f70c613d109b99
change-id: 20250314-sm6350-ufs-things-53c5de9fec5e

Best regards,
-- 
Luca Weiss <luca.weiss@fairphone.com>


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

* [PATCH 1/3] arm64: dts: qcom: sm6350: Fix wrong order of freq-table-hz for UFS
  2025-03-14  9:17 [PATCH 0/3] Fixes/improvements for SM6350 UFS Luca Weiss
@ 2025-03-14  9:17 ` Luca Weiss
  2025-03-14 22:03   ` Konrad Dybcio
  2025-03-14  9:17 ` [PATCH 2/3] arm64: dts: qcom: sm6350: Add OPP table support to UFSHC Luca Weiss
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Luca Weiss @ 2025-03-14  9:17 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: ~postmarketos/upstreaming, phone-devel, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel, Luca Weiss, stable

During upstreaming the order of clocks was adjusted to match the
upstream sort order, but mistakently freq-table-hz wasn't re-ordered
with the new order.

Fix that by moving the entry for the ICE clk to the last place.

Fixes: 5a814af5fc22 ("arm64: dts: qcom: sm6350: Add UFS nodes")
Cc: <stable@vger.kernel.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 arch/arm64/boot/dts/qcom/sm6350.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index 00ad1d09a19558d9e2bc61f1a81a36d466adc88e..e6df0b7dae8baf39bfa7ff3856759e8cd200f0c8 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -1177,11 +1177,11 @@ ufs_mem_hc: ufshc@1d84000 {
 				<0 0>,
 				<0 0>,
 				<37500000 150000000>,
-				<75000000 300000000>,
 				<0 0>,
 				<0 0>,
 				<0 0>,
-				<0 0>;
+				<0 0>,
+				<75000000 300000000>;
 
 			status = "disabled";
 		};

-- 
2.48.1


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

* [PATCH 2/3] arm64: dts: qcom: sm6350: Add OPP table support to UFSHC
  2025-03-14  9:17 [PATCH 0/3] Fixes/improvements for SM6350 UFS Luca Weiss
  2025-03-14  9:17 ` [PATCH 1/3] arm64: dts: qcom: sm6350: Fix wrong order of freq-table-hz for UFS Luca Weiss
@ 2025-03-14  9:17 ` Luca Weiss
  2025-03-14 22:08   ` Konrad Dybcio
  2025-03-14  9:17 ` [PATCH 3/3] arm64: dts: qcom: sm6350: Add interconnect support to UFS Luca Weiss
  2025-07-16  7:15 ` [PATCH 0/3] Fixes/improvements for SM6350 UFS Luca Weiss
  3 siblings, 1 reply; 10+ messages in thread
From: Luca Weiss @ 2025-03-14  9:17 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: ~postmarketos/upstreaming, phone-devel, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel, Luca Weiss

UFS host controller, when scaling gears, should choose appropriate
performance state of RPMh power domain controller along with clock
frequency. So let's add the OPP table support to specify both clock
frequency and RPMh performance states replacing the old "freq-table-hz"
property.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 arch/arm64/boot/dts/qcom/sm6350.dtsi | 42 +++++++++++++++++++++++++++---------
 1 file changed, 32 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index e6df0b7dae8baf39bfa7ff3856759e8cd200f0c8..77ca8990c7a096f40aab5666da9f69465f59b71e 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -1172,18 +1172,40 @@ ufs_mem_hc: ufshc@1d84000 {
 				 <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>,
 				 <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>,
 				 <&gcc GCC_UFS_PHY_ICE_CORE_CLK>;
-			freq-table-hz =
-				<50000000 200000000>,
-				<0 0>,
-				<0 0>,
-				<37500000 150000000>,
-				<0 0>,
-				<0 0>,
-				<0 0>,
-				<0 0>,
-				<75000000 300000000>;
+
+			operating-points-v2 = <&ufs_opp_table>;
 
 			status = "disabled";
+
+			ufs_opp_table: opp-table {
+				compatible = "operating-points-v2";
+
+				opp-50000000 {
+					opp-hz = /bits/ 64 <50000000>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <37500000>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <75000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+				};
+
+				opp-200000000 {
+					opp-hz = /bits/ 64 <200000000>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <150000000>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <0>,
+						 /bits/ 64 <300000000>;
+					required-opps = <&rpmhpd_opp_nom>;
+				};
+			};
 		};
 
 		ufs_mem_phy: phy@1d87000 {

-- 
2.48.1


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

* [PATCH 3/3] arm64: dts: qcom: sm6350: Add interconnect support to UFS
  2025-03-14  9:17 [PATCH 0/3] Fixes/improvements for SM6350 UFS Luca Weiss
  2025-03-14  9:17 ` [PATCH 1/3] arm64: dts: qcom: sm6350: Fix wrong order of freq-table-hz for UFS Luca Weiss
  2025-03-14  9:17 ` [PATCH 2/3] arm64: dts: qcom: sm6350: Add OPP table support to UFSHC Luca Weiss
@ 2025-03-14  9:17 ` Luca Weiss
  2025-03-14 22:08   ` Konrad Dybcio
  2025-07-16  7:15 ` [PATCH 0/3] Fixes/improvements for SM6350 UFS Luca Weiss
  3 siblings, 1 reply; 10+ messages in thread
From: Luca Weiss @ 2025-03-14  9:17 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: ~postmarketos/upstreaming, phone-devel, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel, Luca Weiss

Define the two NoC paths used by UFS: ufs-ddr and cpu-ufs.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 arch/arm64/boot/dts/qcom/sm6350.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index 77ca8990c7a096f40aab5666da9f69465f59b71e..b26ee8cf66a3f53b6068efdd05ab4347fb175c61 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -1175,6 +1175,13 @@ ufs_mem_hc: ufshc@1d84000 {
 
 			operating-points-v2 = <&ufs_opp_table>;
 
+			interconnects = <&aggre1_noc MASTER_UFS_MEM QCOM_ICC_TAG_ALWAYS
+					 &clk_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>,
+					<&gem_noc MASTER_AMPSS_M0 QCOM_ICC_TAG_ACTIVE_ONLY
+					 &config_noc SLAVE_UFS_MEM_CFG QCOM_ICC_TAG_ACTIVE_ONLY>;
+			interconnect-names = "ufs-ddr",
+					     "cpu-ufs";
+
 			status = "disabled";
 
 			ufs_opp_table: opp-table {

-- 
2.48.1


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

* Re: [PATCH 1/3] arm64: dts: qcom: sm6350: Fix wrong order of freq-table-hz for UFS
  2025-03-14  9:17 ` [PATCH 1/3] arm64: dts: qcom: sm6350: Fix wrong order of freq-table-hz for UFS Luca Weiss
@ 2025-03-14 22:03   ` Konrad Dybcio
  0 siblings, 0 replies; 10+ messages in thread
From: Konrad Dybcio @ 2025-03-14 22:03 UTC (permalink / raw)
  To: Luca Weiss, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: ~postmarketos/upstreaming, phone-devel, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel, stable

On 3/14/25 10:17 AM, Luca Weiss wrote:
> During upstreaming the order of clocks was adjusted to match the
> upstream sort order, but mistakently freq-table-hz wasn't re-ordered
> with the new order.
> 
> Fix that by moving the entry for the ICE clk to the last place.
> 
> Fixes: 5a814af5fc22 ("arm64: dts: qcom: sm6350: Add UFS nodes")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH 2/3] arm64: dts: qcom: sm6350: Add OPP table support to UFSHC
  2025-03-14  9:17 ` [PATCH 2/3] arm64: dts: qcom: sm6350: Add OPP table support to UFSHC Luca Weiss
@ 2025-03-14 22:08   ` Konrad Dybcio
  2025-03-17 12:12     ` Luca Weiss
  0 siblings, 1 reply; 10+ messages in thread
From: Konrad Dybcio @ 2025-03-14 22:08 UTC (permalink / raw)
  To: Luca Weiss, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: ~postmarketos/upstreaming, phone-devel, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel

On 3/14/25 10:17 AM, Luca Weiss wrote:
> UFS host controller, when scaling gears, should choose appropriate
> performance state of RPMh power domain controller along with clock
> frequency. So let's add the OPP table support to specify both clock
> frequency and RPMh performance states replacing the old "freq-table-hz"
> property.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---

[...]

> +
> +			ufs_opp_table: opp-table {
> +				compatible = "operating-points-v2";
> +
> +				opp-50000000 {
> +					opp-hz = /bits/ 64 <50000000>,
> +						 /bits/ 64 <0>,
> +						 /bits/ 64 <0>,
> +						 /bits/ 64 <37500000>,

This rate on this clk requires opp_svs (not low_svs)

with that:

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH 3/3] arm64: dts: qcom: sm6350: Add interconnect support to UFS
  2025-03-14  9:17 ` [PATCH 3/3] arm64: dts: qcom: sm6350: Add interconnect support to UFS Luca Weiss
@ 2025-03-14 22:08   ` Konrad Dybcio
  0 siblings, 0 replies; 10+ messages in thread
From: Konrad Dybcio @ 2025-03-14 22:08 UTC (permalink / raw)
  To: Luca Weiss, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: ~postmarketos/upstreaming, phone-devel, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel

On 3/14/25 10:17 AM, Luca Weiss wrote:
> Define the two NoC paths used by UFS: ufs-ddr and cpu-ufs.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH 2/3] arm64: dts: qcom: sm6350: Add OPP table support to UFSHC
  2025-03-14 22:08   ` Konrad Dybcio
@ 2025-03-17 12:12     ` Luca Weiss
  2025-03-18 10:24       ` Konrad Dybcio
  0 siblings, 1 reply; 10+ messages in thread
From: Luca Weiss @ 2025-03-17 12:12 UTC (permalink / raw)
  To: Konrad Dybcio, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: ~postmarketos/upstreaming, phone-devel, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel

Hi Konrad,

On Fri Mar 14, 2025 at 11:08 PM CET, Konrad Dybcio wrote:
> On 3/14/25 10:17 AM, Luca Weiss wrote:
>> UFS host controller, when scaling gears, should choose appropriate
>> performance state of RPMh power domain controller along with clock
>> frequency. So let's add the OPP table support to specify both clock
>> frequency and RPMh performance states replacing the old "freq-table-hz"
>> property.
>> 
>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>> ---
>
> [...]
>
>> +
>> +			ufs_opp_table: opp-table {
>> +				compatible = "operating-points-v2";
>> +
>> +				opp-50000000 {
>> +					opp-hz = /bits/ 64 <50000000>,
>> +						 /bits/ 64 <0>,
>> +						 /bits/ 64 <0>,
>> +						 /bits/ 64 <37500000>,
>
> This rate on this clk requires opp_svs (not low_svs)

Not sure where you're seeing this?

This is from my msm-4.19 tree:

gcc_ufs_phy_axi_clk_src:
    .rate_max = (unsigned long[VDD_NUM]) { [VDD_LOWER] = 50000000,
gcc_ufs_phy_unipro_core_clk_src:
    .rate_max = (unsigned long[VDD_NUM]) { [VDD_LOWER] = 37500000,
gcc_ufs_phy_ice_core_clk_src:
    .rate_max = (unsigned long[VDD_NUM]) { [VDD_LOWER] = 75000000,

[VDD_LOWER] = RPMH_REGULATOR_LEVEL_LOW_SVS,

My intepretation for this is we need low_svs?

Regards
Luca

>
> with that:
>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>
> Konrad


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

* Re: [PATCH 2/3] arm64: dts: qcom: sm6350: Add OPP table support to UFSHC
  2025-03-17 12:12     ` Luca Weiss
@ 2025-03-18 10:24       ` Konrad Dybcio
  0 siblings, 0 replies; 10+ messages in thread
From: Konrad Dybcio @ 2025-03-18 10:24 UTC (permalink / raw)
  To: Luca Weiss, Konrad Dybcio, Bjorn Andersson, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: ~postmarketos/upstreaming, phone-devel, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel

On 3/17/25 1:12 PM, Luca Weiss wrote:
> Hi Konrad,
> 
> On Fri Mar 14, 2025 at 11:08 PM CET, Konrad Dybcio wrote:
>> On 3/14/25 10:17 AM, Luca Weiss wrote:
>>> UFS host controller, when scaling gears, should choose appropriate
>>> performance state of RPMh power domain controller along with clock
>>> frequency. So let's add the OPP table support to specify both clock
>>> frequency and RPMh performance states replacing the old "freq-table-hz"
>>> property.
>>>
>>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>>> ---
>>
>> [...]
>>
>>> +
>>> +			ufs_opp_table: opp-table {
>>> +				compatible = "operating-points-v2";
>>> +
>>> +				opp-50000000 {
>>> +					opp-hz = /bits/ 64 <50000000>,
>>> +						 /bits/ 64 <0>,
>>> +						 /bits/ 64 <0>,
>>> +						 /bits/ 64 <37500000>,
>>
>> This rate on this clk requires opp_svs (not low_svs)
> 
> Not sure where you're seeing this?
> 
> This is from my msm-4.19 tree:
> 
> gcc_ufs_phy_axi_clk_src:
>     .rate_max = (unsigned long[VDD_NUM]) { [VDD_LOWER] = 50000000,
> gcc_ufs_phy_unipro_core_clk_src:
>     .rate_max = (unsigned long[VDD_NUM]) { [VDD_LOWER] = 37500000,
> gcc_ufs_phy_ice_core_clk_src:
>     .rate_max = (unsigned long[VDD_NUM]) { [VDD_LOWER] = 75000000,
> 
> [VDD_LOWER] = RPMH_REGULATOR_LEVEL_LOW_SVS,
> 
> My intepretation for this is we need low_svs?

Hm, I took another look and it seems you're right, I must have misread

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH 0/3] Fixes/improvements for SM6350 UFS
  2025-03-14  9:17 [PATCH 0/3] Fixes/improvements for SM6350 UFS Luca Weiss
                   ` (2 preceding siblings ...)
  2025-03-14  9:17 ` [PATCH 3/3] arm64: dts: qcom: sm6350: Add interconnect support to UFS Luca Weiss
@ 2025-07-16  7:15 ` Luca Weiss
  3 siblings, 0 replies; 10+ messages in thread
From: Luca Weiss @ 2025-07-16  7:15 UTC (permalink / raw)
  To: Luca Weiss, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: ~postmarketos/upstreaming, phone-devel, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel, stable

Hi Bjorn,

On Fri Mar 14, 2025 at 10:17 AM CET, Luca Weiss wrote:
> Fix the order of the freq-table-hz property, then convert to OPP tables
> and add interconnect support for UFS for the SM6350 SoC.
>
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
> Luca Weiss (3):
>       arm64: dts: qcom: sm6350: Fix wrong order of freq-table-hz for UFS
>       arm64: dts: qcom: sm6350: Add OPP table support to UFSHC
>       arm64: dts: qcom: sm6350: Add interconnect support to UFS

Could you please pick up this series? Konrad already gave his R-b a
while ago.

Regards
Luca

>
>  arch/arm64/boot/dts/qcom/sm6350.dtsi | 49 ++++++++++++++++++++++++++++--------
>  1 file changed, 39 insertions(+), 10 deletions(-)
> ---
> base-commit: eea255893718268e1ab852fb52f70c613d109b99
> change-id: 20250314-sm6350-ufs-things-53c5de9fec5e
>
> Best regards,


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

end of thread, other threads:[~2025-07-16  7:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-14  9:17 [PATCH 0/3] Fixes/improvements for SM6350 UFS Luca Weiss
2025-03-14  9:17 ` [PATCH 1/3] arm64: dts: qcom: sm6350: Fix wrong order of freq-table-hz for UFS Luca Weiss
2025-03-14 22:03   ` Konrad Dybcio
2025-03-14  9:17 ` [PATCH 2/3] arm64: dts: qcom: sm6350: Add OPP table support to UFSHC Luca Weiss
2025-03-14 22:08   ` Konrad Dybcio
2025-03-17 12:12     ` Luca Weiss
2025-03-18 10:24       ` Konrad Dybcio
2025-03-14  9:17 ` [PATCH 3/3] arm64: dts: qcom: sm6350: Add interconnect support to UFS Luca Weiss
2025-03-14 22:08   ` Konrad Dybcio
2025-07-16  7:15 ` [PATCH 0/3] Fixes/improvements for SM6350 UFS Luca Weiss

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).