All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: ti: k3-am64-mcu: explicitly assign UART base clock rates
@ 2022-04-11 12:11 ` Matthias Schiffer
  0 siblings, 0 replies; 4+ messages in thread
From: Matthias Schiffer @ 2022-04-11 12:11 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo
  Cc: Rob Herring, Krzysztof Kozlowski, linux-arm-kernel, devicetree,
	linux-kernel, Matthias Schiffer

We found that (at least some versions of) the sci-fw do not assign the
expected base clock rate of 48 MHz for the UARTs in the MCU domain,
leading to incorrect baud rates when used from Linux. Use
assigned-clock-rates to fix this issue.

Fixes: 8abae9389bdb ("arm64: dts: ti: Add support for AM642 SoC")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

I'm not sure if this is the best fix. Should the clock-frequency
property simply be removed, so the frequency is queried from the clock
driver instead?

 arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
index 2bb5c9ff172c..69b0f127eea5 100644
--- a/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
@@ -15,6 +15,8 @@ mcu_uart0: serial@4a00000 {
 		power-domains = <&k3_pds 149 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 149 0>;
 		clock-names = "fclk";
+		assigned-clocks = <&k3_clks 149 0>;
+		assigned-clock-rates = <48000000>;
 	};
 
 	mcu_uart1: serial@4a10000 {
@@ -26,6 +28,8 @@ mcu_uart1: serial@4a10000 {
 		power-domains = <&k3_pds 160 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 160 0>;
 		clock-names = "fclk";
+		assigned-clocks = <&k3_clks 160 0>;
+		assigned-clock-rates = <48000000>;
 	};
 
 	mcu_i2c0: i2c@4900000 {
-- 
2.25.1


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

* [PATCH] arm64: dts: ti: k3-am64-mcu: explicitly assign UART base clock rates
@ 2022-04-11 12:11 ` Matthias Schiffer
  0 siblings, 0 replies; 4+ messages in thread
From: Matthias Schiffer @ 2022-04-11 12:11 UTC (permalink / raw)
  To: Nishanth Menon, Vignesh Raghavendra, Tero Kristo
  Cc: Rob Herring, Krzysztof Kozlowski, linux-arm-kernel, devicetree,
	linux-kernel, Matthias Schiffer

We found that (at least some versions of) the sci-fw do not assign the
expected base clock rate of 48 MHz for the UARTs in the MCU domain,
leading to incorrect baud rates when used from Linux. Use
assigned-clock-rates to fix this issue.

Fixes: 8abae9389bdb ("arm64: dts: ti: Add support for AM642 SoC")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

I'm not sure if this is the best fix. Should the clock-frequency
property simply be removed, so the frequency is queried from the clock
driver instead?

 arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
index 2bb5c9ff172c..69b0f127eea5 100644
--- a/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
@@ -15,6 +15,8 @@ mcu_uart0: serial@4a00000 {
 		power-domains = <&k3_pds 149 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 149 0>;
 		clock-names = "fclk";
+		assigned-clocks = <&k3_clks 149 0>;
+		assigned-clock-rates = <48000000>;
 	};
 
 	mcu_uart1: serial@4a10000 {
@@ -26,6 +28,8 @@ mcu_uart1: serial@4a10000 {
 		power-domains = <&k3_pds 160 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 160 0>;
 		clock-names = "fclk";
+		assigned-clocks = <&k3_clks 160 0>;
+		assigned-clock-rates = <48000000>;
 	};
 
 	mcu_i2c0: i2c@4900000 {
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: ti: k3-am64-mcu: explicitly assign UART base clock rates
  2022-04-11 12:11 ` Matthias Schiffer
@ 2022-04-15  7:40   ` Vignesh Raghavendra
  -1 siblings, 0 replies; 4+ messages in thread
From: Vignesh Raghavendra @ 2022-04-15  7:40 UTC (permalink / raw)
  To: Matthias Schiffer, Nishanth Menon, Tero Kristo
  Cc: Rob Herring, Krzysztof Kozlowski, linux-arm-kernel, devicetree,
	linux-kernel



On 11/04/22 5:41 pm, Matthias Schiffer wrote:
> We found that (at least some versions of) the sci-fw do not assign the
> expected base clock rate of 48 MHz for the UARTs in the MCU domain,
> leading to incorrect baud rates when used from Linux. Use
> assigned-clock-rates to fix this issue.
> 
> Fixes: 8abae9389bdb ("arm64: dts: ti: Add support for AM642 SoC")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> 
> I'm not sure if this is the best fix. Should the clock-frequency
> property simply be removed, so the frequency is queried from the clock
> driver instead?
> 

I think its better to drop clock-frequency. Driver can setup DLL/DLH to
get appropriate baudrate as per frequency queried from clock driver

>  arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
> index 2bb5c9ff172c..69b0f127eea5 100644
> --- a/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
> @@ -15,6 +15,8 @@ mcu_uart0: serial@4a00000 {
>  		power-domains = <&k3_pds 149 TI_SCI_PD_EXCLUSIVE>;
>  		clocks = <&k3_clks 149 0>;
>  		clock-names = "fclk";
> +		assigned-clocks = <&k3_clks 149 0>;
> +		assigned-clock-rates = <48000000>;
>  	};
>  
>  	mcu_uart1: serial@4a10000 {
> @@ -26,6 +28,8 @@ mcu_uart1: serial@4a10000 {
>  		power-domains = <&k3_pds 160 TI_SCI_PD_EXCLUSIVE>;
>  		clocks = <&k3_clks 160 0>;
>  		clock-names = "fclk";
> +		assigned-clocks = <&k3_clks 160 0>;
> +		assigned-clock-rates = <48000000>;
>  	};
>  
>  	mcu_i2c0: i2c@4900000 {

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

* Re: [PATCH] arm64: dts: ti: k3-am64-mcu: explicitly assign UART base clock rates
@ 2022-04-15  7:40   ` Vignesh Raghavendra
  0 siblings, 0 replies; 4+ messages in thread
From: Vignesh Raghavendra @ 2022-04-15  7:40 UTC (permalink / raw)
  To: Matthias Schiffer, Nishanth Menon, Tero Kristo
  Cc: Rob Herring, Krzysztof Kozlowski, linux-arm-kernel, devicetree,
	linux-kernel



On 11/04/22 5:41 pm, Matthias Schiffer wrote:
> We found that (at least some versions of) the sci-fw do not assign the
> expected base clock rate of 48 MHz for the UARTs in the MCU domain,
> leading to incorrect baud rates when used from Linux. Use
> assigned-clock-rates to fix this issue.
> 
> Fixes: 8abae9389bdb ("arm64: dts: ti: Add support for AM642 SoC")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> 
> I'm not sure if this is the best fix. Should the clock-frequency
> property simply be removed, so the frequency is queried from the clock
> driver instead?
> 

I think its better to drop clock-frequency. Driver can setup DLL/DLH to
get appropriate baudrate as per frequency queried from clock driver

>  arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
> index 2bb5c9ff172c..69b0f127eea5 100644
> --- a/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi
> @@ -15,6 +15,8 @@ mcu_uart0: serial@4a00000 {
>  		power-domains = <&k3_pds 149 TI_SCI_PD_EXCLUSIVE>;
>  		clocks = <&k3_clks 149 0>;
>  		clock-names = "fclk";
> +		assigned-clocks = <&k3_clks 149 0>;
> +		assigned-clock-rates = <48000000>;
>  	};
>  
>  	mcu_uart1: serial@4a10000 {
> @@ -26,6 +28,8 @@ mcu_uart1: serial@4a10000 {
>  		power-domains = <&k3_pds 160 TI_SCI_PD_EXCLUSIVE>;
>  		clocks = <&k3_clks 160 0>;
>  		clock-names = "fclk";
> +		assigned-clocks = <&k3_clks 160 0>;
> +		assigned-clock-rates = <48000000>;
>  	};
>  
>  	mcu_i2c0: i2c@4900000 {

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-04-15  7:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 12:11 [PATCH] arm64: dts: ti: k3-am64-mcu: explicitly assign UART base clock rates Matthias Schiffer
2022-04-11 12:11 ` Matthias Schiffer
2022-04-15  7:40 ` Vignesh Raghavendra
2022-04-15  7:40   ` Vignesh Raghavendra

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.