linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] riscv: dts: spacemit: uart: set dummy clock to silent dt warning
@ 2025-07-18 15:13 Yixun Lan
  2025-07-19  7:48 ` Vivian Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Yixun Lan @ 2025-07-18 15:13 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti
  Cc: devicetree, linux-riscv, spacemit, linux-kernel, Yixun Lan

sec_uart1 is reserved in DT, and no clock is implemented in the CCF
framework, thus 'make dtbs_check' will eject this warning message:
  serial@f0612000: 'clock-names' is a required property

So, adding a dummy clock to the device tree to fulfill the clock
requirement, then silent this dt check warning.

Signed-off-by: Yixun Lan <dlan@gentoo.org>
---
 arch/riscv/boot/dts/spacemit/k1.dtsi | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
index c0f8c5fca975d73b6ea6886da13fcf55289cb16c..e9b98f2a3b1cc38f569d7de336630df846cbfbe7 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -309,6 +309,13 @@ cluster1_l2_cache: l2-cache1 {
 	};
 
 	clocks {
+		clk_dummy: clock-dummy {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <0>;
+			clock-output-names = "clk_dummy";
+		};
+
 		vctcxo_1m: clock-1m {
 			compatible = "fixed-clock";
 			clock-frequency = <1000000>;
@@ -556,8 +563,9 @@ clint: timer@e4000000 {
 		sec_uart1: serial@f0612000 {
 			compatible = "spacemit,k1-uart", "intel,xscale-uart";
 			reg = <0x0 0xf0612000 0x0 0x100>;
+			clocks = <&clk_dummy>, <&clk_dummy>;
+			clock-names = "core", "bus";
 			interrupts = <43>;
-			clock-frequency = <14857000>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
 			status = "reserved"; /* for TEE usage */

---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250718-02-k1-uart-clock-0beb9ef10fe0

Best regards,
-- 
Yixun Lan


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

* Re: [PATCH] riscv: dts: spacemit: uart: set dummy clock to silent dt warning
  2025-07-18 15:13 [PATCH] riscv: dts: spacemit: uart: set dummy clock to silent dt warning Yixun Lan
@ 2025-07-19  7:48 ` Vivian Wang
  2025-07-19 10:23   ` Yixun Lan
  0 siblings, 1 reply; 3+ messages in thread
From: Vivian Wang @ 2025-07-19  7:48 UTC (permalink / raw)
  To: Yixun Lan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti
  Cc: devicetree, linux-riscv, spacemit, linux-kernel

On 7/18/25 23:13, Yixun Lan wrote:
> sec_uart1 is reserved in DT, and no clock is implemented in the CCF
> framework, thus 'make dtbs_check' will eject this warning message:
>   serial@f0612000: 'clock-names' is a required property
>
> So, adding a dummy clock to the device tree to fulfill the clock
> requirement, then silent this dt check warning.

NAK. This is definitely worse than the warning.

Honestly, if you don't like this warning, I think we should just drop
the node. If not...

>
> Signed-off-by: Yixun Lan <dlan@gentoo.org>
> ---
>  arch/riscv/boot/dts/spacemit/k1.dtsi | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
> index c0f8c5fca975d73b6ea6886da13fcf55289cb16c..e9b98f2a3b1cc38f569d7de336630df846cbfbe7 100644
> --- a/arch/riscv/boot/dts/spacemit/k1.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
> @@ -309,6 +309,13 @@ cluster1_l2_cache: l2-cache1 {
>  	};
>  
>  	clocks {
> +		clk_dummy: clock-dummy {
> +			compatible = "fixed-clock";
> +			#clock-cells = <0>;
> +			clock-frequency = <0>;

That can't be right for UART, which depends on knowing about the baud
clock rate. If we want a fixed clock to represent whatever the "secure"
clock controller has at least it should be set to the nominal frequency.

Vivian "dramforever" Wang

> +			clock-output-names = "clk_dummy";
> +		};
> +
>  		vctcxo_1m: clock-1m {
>  			compatible = "fixed-clock";
>  			clock-frequency = <1000000>;
> @@ -556,8 +563,9 @@ clint: timer@e4000000 {
>  		sec_uart1: serial@f0612000 {
>  			compatible = "spacemit,k1-uart", "intel,xscale-uart";
>  			reg = <0x0 0xf0612000 0x0 0x100>;
> +			clocks = <&clk_dummy>, <&clk_dummy>;
> +			clock-names = "core", "bus";
>  			interrupts = <43>;
> -			clock-frequency = <14857000>;
>  			reg-shift = <2>;
>  			reg-io-width = <4>;
>  			status = "reserved"; /* for TEE usage */
>
> ---
> base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
> change-id: 20250718-02-k1-uart-clock-0beb9ef10fe0
>
> Best regards,


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

* Re: [PATCH] riscv: dts: spacemit: uart: set dummy clock to silent dt warning
  2025-07-19  7:48 ` Vivian Wang
@ 2025-07-19 10:23   ` Yixun Lan
  0 siblings, 0 replies; 3+ messages in thread
From: Yixun Lan @ 2025-07-19 10:23 UTC (permalink / raw)
  To: Vivian Wang
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, devicetree,
	linux-riscv, spacemit, linux-kernel

hi Vivian,

On 15:48 Sat 19 Jul     , Vivian Wang wrote:
> On 7/18/25 23:13, Yixun Lan wrote:
> > sec_uart1 is reserved in DT, and no clock is implemented in the CCF
> > framework, thus 'make dtbs_check' will eject this warning message:
> >   serial@f0612000: 'clock-names' is a required property
> >
> > So, adding a dummy clock to the device tree to fulfill the clock
> > requirement, then silent this dt check warning.
> 
> NAK. This is definitely worse than the warning.
> 
> Honestly, if you don't like this warning, I think we should just drop
> the node. If not...
> 
right, I realised this wasn't a good approach..

I will try in next version to comment out the sec_uart1 node,
unless people have better suggestion..

-- 
Yixun Lan (dlan)

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

end of thread, other threads:[~2025-07-19 10:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-18 15:13 [PATCH] riscv: dts: spacemit: uart: set dummy clock to silent dt warning Yixun Lan
2025-07-19  7:48 ` Vivian Wang
2025-07-19 10:23   ` Yixun Lan

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