All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: sm8350: Correct UFS symbol clocks
@ 2021-12-22  0:26 Bjorn Andersson
  2021-12-22 10:37 ` Vinod Koul
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Andersson @ 2021-12-22  0:26 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Vinod Koul
  Cc: Rob Herring, linux-arm-msm, devicetree, linux-kernel

The introduction of '9a61f813fcc8 ("clk: qcom: regmap-mux: fix parent
clock lookup")' broke UFS support on SM8350.

The cause for this is that the symbol clocks have a specified rate in
the "freq-table-hz" table in the UFS node, which causes the UFS code to
request a rate change, for which the "bi_tcxo" happens to provide the
closest rate.  Prior to the change in regmap-mux it was determined
(incorrectly) that no change was needed and everything worked. Instead
mimic the configuration found in other platforms, by omitting the rate
for the symbol clocks as well to avoid the rate change.

While at it also fill in the dummy symbol clocks that was dropped from
the GCC driver as it was upstreamed.

Fixes: 59c7cf814783 ("arm64: dts: qcom: sm8350: Add UFS nodes")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8350.dtsi | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi
index bc176c252bca..ceb064a83038 100644
--- a/arch/arm64/boot/dts/qcom/sm8350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi
@@ -38,6 +38,24 @@ sleep_clk: sleep-clk {
 			clock-frequency = <32000>;
 			#clock-cells = <0>;
 		};
+
+		ufs_phy_rx_symbol_0_clk: ufs-phy-rx-symbol-0 {
+			compatible = "fixed-clock";
+			clock-frequency = <1000>;
+			#clock-cells = <0>;
+		};
+
+		ufs_phy_rx_symbol_1_clk: ufs-phy-rx-symbol-1 {
+			compatible = "fixed-clock";
+			clock-frequency = <1000>;
+			#clock-cells = <0>;
+		};
+
+		ufs_phy_tx_symbol_0_clk: ufs-phy-tx-symbol-0 {
+			compatible = "fixed-clock";
+			clock-frequency = <1000>;
+			#clock-cells = <0>;
+		};
 	};
 
 	cpus {
@@ -606,9 +624,9 @@ gcc: clock-controller@100000 {
 				 <0>,
 				 <0>,
 				 <0>,
-				 <0>,
-				 <0>,
-				 <0>,
+				 <&ufs_phy_rx_symbol_0_clk>,
+				 <&ufs_phy_rx_symbol_1_clk>,
+				 <&ufs_phy_tx_symbol_0_clk>,
 				 <0>,
 				 <0>;
 		};
@@ -2079,8 +2097,8 @@ ufs_mem_hc: ufshc@1d84000 {
 				<75000000 300000000>,
 				<0 0>,
 				<0 0>,
-				<75000000 300000000>,
-				<75000000 300000000>;
+				<0 0>,
+				<0 0>;
 			status = "disabled";
 		};
 
-- 
2.33.1


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

* Re: [PATCH] arm64: dts: qcom: sm8350: Correct UFS symbol clocks
  2021-12-22  0:26 [PATCH] arm64: dts: qcom: sm8350: Correct UFS symbol clocks Bjorn Andersson
@ 2021-12-22 10:37 ` Vinod Koul
  2021-12-22 16:15   ` Bjorn Andersson
  0 siblings, 1 reply; 3+ messages in thread
From: Vinod Koul @ 2021-12-22 10:37 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, Rob Herring, linux-arm-msm, devicetree, linux-kernel

On 21-12-21, 16:26, Bjorn Andersson wrote:
> The introduction of '9a61f813fcc8 ("clk: qcom: regmap-mux: fix parent
> clock lookup")' broke UFS support on SM8350.
> 
> The cause for this is that the symbol clocks have a specified rate in
> the "freq-table-hz" table in the UFS node, which causes the UFS code to
> request a rate change, for which the "bi_tcxo" happens to provide the
> closest rate.  Prior to the change in regmap-mux it was determined
> (incorrectly) that no change was needed and everything worked. Instead
> mimic the configuration found in other platforms, by omitting the rate
> for the symbol clocks as well to avoid the rate change.
> 
> While at it also fill in the dummy symbol clocks that was dropped from
> the GCC driver as it was upstreamed.
> 
> Fixes: 59c7cf814783 ("arm64: dts: qcom: sm8350: Add UFS nodes")
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sm8350.dtsi | 28 +++++++++++++++++++++++-----
>  1 file changed, 23 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi
> index bc176c252bca..ceb064a83038 100644
> --- a/arch/arm64/boot/dts/qcom/sm8350.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi
> @@ -38,6 +38,24 @@ sleep_clk: sleep-clk {
>  			clock-frequency = <32000>;
>  			#clock-cells = <0>;
>  		};
> +
> +		ufs_phy_rx_symbol_0_clk: ufs-phy-rx-symbol-0 {
> +			compatible = "fixed-clock";
> +			clock-frequency = <1000>;
> +			#clock-cells = <0>;
> +		};
> +
> +		ufs_phy_rx_symbol_1_clk: ufs-phy-rx-symbol-1 {
> +			compatible = "fixed-clock";
> +			clock-frequency = <1000>;
> +			#clock-cells = <0>;
> +		};
> +
> +		ufs_phy_tx_symbol_0_clk: ufs-phy-tx-symbol-0 {
> +			compatible = "fixed-clock";
> +			clock-frequency = <1000>;
> +			#clock-cells = <0>;
> +		};
>  	};
>  
>  	cpus {
> @@ -606,9 +624,9 @@ gcc: clock-controller@100000 {
>  				 <0>,
>  				 <0>,
>  				 <0>,
> -				 <0>,
> -				 <0>,
> -				 <0>,
> +				 <&ufs_phy_rx_symbol_0_clk>,
> +				 <&ufs_phy_rx_symbol_1_clk>,
> +				 <&ufs_phy_tx_symbol_0_clk>,
>  				 <0>,
>  				 <0>;
>  		};
> @@ -2079,8 +2097,8 @@ ufs_mem_hc: ufshc@1d84000 {
>  				<75000000 300000000>,
>  				<0 0>,
>  				<0 0>,
> -				<75000000 300000000>,
> -				<75000000 300000000>;
> +				<0 0>,
> +				<0 0>;

should the rate be zero here?

-- 
~Vinod

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

* Re: [PATCH] arm64: dts: qcom: sm8350: Correct UFS symbol clocks
  2021-12-22 10:37 ` Vinod Koul
@ 2021-12-22 16:15   ` Bjorn Andersson
  0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2021-12-22 16:15 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andy Gross, Rob Herring, linux-arm-msm, devicetree, linux-kernel

On Wed 22 Dec 02:37 PST 2021, Vinod Koul wrote:

> On 21-12-21, 16:26, Bjorn Andersson wrote:
> > The introduction of '9a61f813fcc8 ("clk: qcom: regmap-mux: fix parent
> > clock lookup")' broke UFS support on SM8350.
> > 
> > The cause for this is that the symbol clocks have a specified rate in
> > the "freq-table-hz" table in the UFS node, which causes the UFS code to
> > request a rate change, for which the "bi_tcxo" happens to provide the
> > closest rate.  Prior to the change in regmap-mux it was determined
> > (incorrectly) that no change was needed and everything worked. Instead
> > mimic the configuration found in other platforms, by omitting the rate
> > for the symbol clocks as well to avoid the rate change.
> > 
> > While at it also fill in the dummy symbol clocks that was dropped from
> > the GCC driver as it was upstreamed.
> > 
> > Fixes: 59c7cf814783 ("arm64: dts: qcom: sm8350: Add UFS nodes")
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > ---
> >  arch/arm64/boot/dts/qcom/sm8350.dtsi | 28 +++++++++++++++++++++++-----
> >  1 file changed, 23 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi
> > index bc176c252bca..ceb064a83038 100644
> > --- a/arch/arm64/boot/dts/qcom/sm8350.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi
> > @@ -38,6 +38,24 @@ sleep_clk: sleep-clk {
> >  			clock-frequency = <32000>;
> >  			#clock-cells = <0>;
> >  		};
> > +
> > +		ufs_phy_rx_symbol_0_clk: ufs-phy-rx-symbol-0 {
> > +			compatible = "fixed-clock";
> > +			clock-frequency = <1000>;
> > +			#clock-cells = <0>;
> > +		};
> > +
> > +		ufs_phy_rx_symbol_1_clk: ufs-phy-rx-symbol-1 {
> > +			compatible = "fixed-clock";
> > +			clock-frequency = <1000>;
> > +			#clock-cells = <0>;
> > +		};
> > +
> > +		ufs_phy_tx_symbol_0_clk: ufs-phy-tx-symbol-0 {
> > +			compatible = "fixed-clock";
> > +			clock-frequency = <1000>;
> > +			#clock-cells = <0>;
> > +		};
> >  	};
> >  
> >  	cpus {
> > @@ -606,9 +624,9 @@ gcc: clock-controller@100000 {
> >  				 <0>,
> >  				 <0>,
> >  				 <0>,
> > -				 <0>,
> > -				 <0>,
> > -				 <0>,
> > +				 <&ufs_phy_rx_symbol_0_clk>,
> > +				 <&ufs_phy_rx_symbol_1_clk>,
> > +				 <&ufs_phy_tx_symbol_0_clk>,
> >  				 <0>,
> >  				 <0>;
> >  		};
> > @@ -2079,8 +2097,8 @@ ufs_mem_hc: ufshc@1d84000 {
> >  				<75000000 300000000>,
> >  				<0 0>,
> >  				<0 0>,
> > -				<75000000 300000000>,
> > -				<75000000 300000000>;
> > +				<0 0>,
> > +				<0 0>;
> 
> should the rate be zero here?
> 

It seems that the numbers (75 and 300MHz) are the correct rates for the
symbol clocks.
It's however not clear to me where they are coming from and hence how we
would represent the change of rate in &ufs_phy_?x_symbol_?_clk. Let's
make sure to document this in the commit message...

Thanks,
Bjorn


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

end of thread, other threads:[~2021-12-22 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22  0:26 [PATCH] arm64: dts: qcom: sm8350: Correct UFS symbol clocks Bjorn Andersson
2021-12-22 10:37 ` Vinod Koul
2021-12-22 16:15   ` Bjorn Andersson

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.