ARM: dts: exynos: Add assigned clock parent to CMU in Exynos3250
Subsystems (2)
Krzysztof Kozlowski
maintainerPATCH v2 1/3 ARM: dts: exynos: Add assigned clock parent to CMU in Exynos3250
Commit 52005dece527 ("ARM: dts: Add assigned clock parents to CMU node for exynos3250") added assigned clocks under Clock Management Unit to fix hangs when accessing ISP registers.
However the dtschema expects "clocks" property if "assigned-clocks" are used. Add reference to input clock, the parent used in "assigned-clock-parents" to silence the dtschema warnings:
arch/arm/boot/dts/exynos3250-artik5-eval.dt.yaml: clock-controller@10030000: 'clocks' is a dependency of 'assigned-clocks'
---
Changes since v1:
1. Add clocks property.
This is a v2 for:
https://lore.kernel.org/linux-samsung-soc/20200901101534.GE23793@kozik-lap/T/#me85ac382b847dadbc3f6ebf30e94e70b5df1ebb6
--- arch/arm/boot/dts/exynos3250.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/exynos3250.dtsi +1 -0
@@ -214,6 +214,7 @@ compatible = "samsung,exynos3250-cmu"; reg = <0x10030000 0x20000>; #clock-cells = <1>; + clocks = <&cmu CLK_FIN_PLL>; assigned-clocks = <&cmu CLK_MOUT_ACLK_400_MCUISP_SUB>, <&cmu CLK_MOUT_ACLK_266_SUB>; assigned-clock-parents = <&cmu CLK_FIN_PLL>,
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH v2 2/3 ARM: dts: exynos: Add assigned clock parent to CMU in Exynos4412 Odroid
Commit 68605101460e ("ARM: dts: exynos: Add support for audio over HDMI for Odroid X/X2/U3") added assigned clocks under Clock Management Unit.
However the dtschema expects "clocks" property if "assigned-clocks" are used. Add reference to input clock, the parent used in "assigned-clock-parents" to silence the dtschema warnings:
arch/arm/boot/dts/exynos4412-odroidu3.dt.yaml: clock-controller@10030000: 'clocks' is a dependency of 'assigned-clocks'
--- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/exynos4412-odroid-common.dtsi +1 -0
@@ -120,6 +120,7 @@ }; &clock { + clocks = <&clock CLK_FOUT_EPLL>; assigned-clocks = <&clock CLK_FOUT_EPLL>; assigned-clock-rates = <45158401>; };
Signature · 1 line
2.17.1
Re: [PATCH v2 2/3] ARM: dts: exynos: Add assigned clock parent to CMU in Exynos4412 Odroid
Hi Krzysztof,
Quoted 19 lines · Krzysztof Kozlowski
Commit
68605101460e("ARM: dts: exynos: Add support for audio over HDMI for Odroid X/X2/U3") added assigned clocks under Clock Management Unit.However the dtschema expects "clocks" property if "assigned-clocks" are used. Add reference to input clock, the parent used in "assigned-clock-parents" to silence the dtschema warnings:
arch/arm/boot/dts/exynos4412-odroidu3.dt.yaml: clock-controller@10030000: 'clocks' is a dependency of 'assigned-clocks'Signed-off-by Krzysztof Kozlowski <[email protected]>--- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm/boot/dts/exynos4412-odroid-common.dtsi +0
-0
arch/arm/boot/dts/exynos4412-odroid-common.dtsi line 123
Quoted 4 lines
arch/arm/boot/dts/exynos4412-odroid-common.dtsi +1
-0@@ -120,6 +120,7 @@ }; &clock { + clocks = <&clock CLK_FOUT_EPLL>;
This should be one of xusbxti or xxti, because this is the proper input clock for the clock controller. However in case of Exynos4, those clocks needs much more cleanup. For the historical reasons, they don't use generic 'fixed-clock' property, but the custom one and they are no instantiated by clock framework, but the exynos4 clock driver...
arch/arm/boot/dts/exynos4412-odroid-common.dtsi line 126
Quoted 3 lines
arch/arm/boot/dts/exynos4412-odroid-common.dtsi +0
-0assigned-clocks = <&clock CLK_FOUT_EPLL>; assigned-clock-rates = <45158401>; };
Best regards
Signature · 2 lines
Marek Szyprowski, PhD Samsung R&D Institute Poland
Krzysztof Kozlowski
maintainerRe: [PATCH v2 2/3] ARM: dts: exynos: Add assigned clock parent to CMU in Exynos4412 Odroid
Quoted 24 lines · Marek Szyprowski
Hi Krzysztof,
Quoted 21 lines · Krzysztof Kozlowski
Commit
68605101460e("ARM: dts: exynos: Add support for audio over HDMI for Odroid X/X2/U3") added assigned clocks under Clock Management Unit.However the dtschema expects "clocks" property if "assigned-clocks" are used. Add reference to input clock, the parent used in "assigned-clock-parents" to silence the dtschema warnings:
arch/arm/boot/dts/exynos4412-odroidu3.dt.yaml: clock-controller@10030000: 'clocks' is a dependency of 'assigned-clocks'Signed-off-by Krzysztof Kozlowski <[email protected]>--- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm/boot/dts/exynos4412-odroid-common.dtsi +0
-0@@ -120,6 +120,7 @@ };
Quoted 8 lines
arch/arm/boot/dts/exynos4412-odroid-common.dtsi line 123
Quoted 2 lines
arch/arm/boot/dts/exynos4412-odroid-common.dtsi +1
-0&clock { + clocks = <&clock CLK_FOUT_EPLL>;This should be one of xusbxti or xxti, because this is the proper input clock for the clock controller. However in case of Exynos4, those clocks needs much more cleanup. For the historical reasons, they don't use generic 'fixed-clock' property, but the custom one and they are no instantiated by clock framework, but the exynos4 clock driver...
Indeed, so it would be like:
&clock {
clocks = <&clock CLK_XUSBXTI>;
};... or convert the driver to take external clocks while keeping the ABI (and being bisectable).
Best regards,
Krzysztof
Quoted 10 lines
arch/arm/boot/dts/exynos4412-odroid-common.dtsi line 126
Quoted 4 lines
arch/arm/boot/dts/exynos4412-odroid-common.dtsi +0
-0assigned-clocks = <&clock CLK_FOUT_EPLL>; assigned-clock-rates = <45158401>; };Best regards
Signature · 2 lines
Marek Szyprowski, PhD Samsung R&D Institute Poland
Krzysztof Kozlowski
maintainerPATCH v2 3/3 ARM: dts: exynos: Add assigned clock parent to CMU in Exynos5422 Odroid XU3
In reply to Krzysztof KozlowskiCommit 78a68acf3d33 ("ARM: dts: exynos: Switch to dedicated Odroid XU3 sound card binding") added assigned clocks under sound device node.
However the dtschema expects "clocks" property if "assigned-clocks" are used. Add reference to input clock, the parent used in "assigned-clock-parents" to silence the dtschema warnings:
arch/arm/boot/dts/exynos5422-odroidxu3.dt.yaml: sound: 'clocks' is a dependency of 'assigned-clocks'
--- arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi +5 -0
@@ -29,6 +29,11 @@ "HiFi Playback", "Mixer DAI TX", "Mixer DAI RX", "HiFi Capture"; + clocks = <&clock CLK_FOUT_EPLL>, + <&clock CLK_MOUT_EPLL>, + <&clock CLK_MOUT_MAU_EPLL>, + <&clock CLK_MAU_EPLL>, + <&clock_audss EXYNOS_MOUT_AUDSS>; assigned-clocks = <&clock CLK_MOUT_EPLL>, <&clock CLK_MOUT_MAU_EPLL>, <&clock CLK_MOUT_USER_MAU_EPLL>,
Signature · 1 line
2.17.1
Re: [PATCH v2 3/3] ARM: dts: exynos: Add assigned clock parent to CMU in Exynos5422 Odroid XU3
Quoted 6 lines · Krzysztof Kozlowski
Commit
78a68acf3d33("ARM: dts: exynos: Switch to dedicated Odroid XU3 sound card binding") added assigned clocks under sound device node.However the dtschema expects "clocks" property if "assigned-clocks" are used. Add reference to input clock, the parent used in "assigned-clock-parents" to silence the dtschema warnings:
I'm afraid it doesn't improve anything, we just add another violation of the DT binding rules as the 'sound' node doesn't represent a real HW and shouldn't have 'clocks' property. Instead we could move the assigned-clock* properties to the I2S node, as in below patch. I have tested that already on xu3.
----------------------------------8<--------------------------- From f98d2f5ac86d1ae13a77ef481fcbf073a1740f26 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <[email protected]>
Date: Fri, 4 Sep 2020 12:02:11 +0200
Subject: [PATCH] ARM: dts: samsung: odroid-xu3: Move assigned-clock*
properties to i2s0 node
The purpose of those assigned-clock-* properties is to configure clock for for the I2S device so move them to respective node.
This suppresses the dtbs_check warning:arch/arm/boot/dts/exynos5422-odroidxu3.dt.yaml: sound: 'clocks' is a dependency of 'assigned-clocks'
--- arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi | 60 ++++++++++------------- 1 file changed, 27 insertions(+), 33 deletions(-)
arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi +27 -33
@@ -29,30 +29,6 @@ "HiFi Playback", "Mixer DAI TX", "Mixer DAI RX", "HiFi Capture"; - assigned-clocks = <&clock CLK_MOUT_EPLL>, - <&clock CLK_MOUT_MAU_EPLL>, - <&clock CLK_MOUT_USER_MAU_EPLL>, - <&clock_audss EXYNOS_MOUT_AUDSS>, - <&clock_audss EXYNOS_MOUT_I2S>, - <&clock_audss EXYNOS_DOUT_SRP>, - <&clock_audss EXYNOS_DOUT_AUD_BUS>, - <&clock_audss EXYNOS_DOUT_I2S>; - - assigned-clock-parents = <&clock CLK_FOUT_EPLL>, - <&clock CLK_MOUT_EPLL>, - <&clock CLK_MOUT_MAU_EPLL>, - <&clock CLK_MAU_EPLL>, - <&clock_audss EXYNOS_MOUT_AUDSS>; - - assigned-clock-rates = <0>, - <0>, - <0>, - <0>, - <0>, - <196608001>, - <(196608002 / 2)>, - <196608000>; - cpu { sound-dai = <&i2s0 0>, <&i2s0 1>; };
@@ -62,13 +38,6 @@ }; }; -&clock_audss { - assigned-clocks = <&clock_audss EXYNOS_DOUT_SRP>, - <&clock CLK_FOUT_EPLL>; - assigned-clock-rates = <(196608000 / 256)>, - <196608000>; -}; - &hsi2c_5 { status = "okay"; max98090: max98090@10 {
@@ -84,6 +53,31 @@ &i2s0 { status = "okay"; - assigned-clocks = <&i2s0 CLK_I2S_RCLK_SRC>; - assigned-clock-parents = <&clock_audss EXYNOS_SCLK_I2S>; + assigned-clocks = <&clock CLK_MOUT_EPLL>, + <&clock CLK_MOUT_MAU_EPLL>, + <&clock CLK_MOUT_USER_MAU_EPLL>, + <&clock_audss EXYNOS_MOUT_AUDSS>, + <&clock_audss EXYNOS_MOUT_I2S>, + <&i2s0 CLK_I2S_RCLK_SRC>, + <&clock_audss EXYNOS_DOUT_SRP>, + <&clock_audss EXYNOS_DOUT_AUD_BUS>, + <&clock_audss EXYNOS_DOUT_I2S>; + + assigned-clock-parents = <&clock CLK_FOUT_EPLL>, + <&clock CLK_MOUT_EPLL>, + <&clock CLK_MOUT_MAU_EPLL>, + <&clock CLK_MAU_EPLL>, + <&clock_audss EXYNOS_MOUT_AUDSS>, + <&clock_audss EXYNOS_SCLK_I2S>; + + assigned-clock-rates = <0>, + <0>, + <0>, + <0>, + <0>, + <0>, + <196608001>, + <(196608002 / 2)>, + <196608000>; + };
Signature · 3 lines
2.7.4 ----------------------------------8<---------------------------
Re: [PATCH v2 3/3] ARM: dts: exynos: Add assigned clock parent to CMU in Exynos5422 Odroid XU3
Quoted 21 lines · Sylwester Nawrocki
Quoted 6 lines · Krzysztof Kozlowski
Commit
78a68acf3d33("ARM: dts: exynos: Switch to dedicated Odroid XU3 sound card binding") added assigned clocks under sound device node.However the dtschema expects "clocks" property if "assigned-clocks" are used. Add reference to input clock, the parent used in "assigned-clock-parents" to silence the dtschema warnings:
I'm afraid it doesn't improve anything, we just add another violation of the DT binding rules as the 'sound' node doesn't represent a real HW and shouldn't have 'clocks' property. Instead we could move the assigned-clock* properties to the I2S node, as in below patch. I have tested that already on xu3.
----------------------------------8<--------------------------- From
f98d2f5ac86d1ae13a77ef481fcbf073a1740f26Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <[email protected]>
Date: Fri, 4 Sep 2020 12:02:11 +0200
Subject: [PATCH] ARM: dts: samsung: odroid-xu3: Move assigned-clock*
properties to i2s0 node
Quoted 6 lines
The purpose of those assigned-clock-* properties is to configure clock for for the I2S device so move them to respective node.
This suppresses the
dtbs_checkwarning:arch/arm/boot/dts/exynos5422-odroidxu3.dt.yaml: sound: 'clocks' is a dependency of 'assigned-clocks'
Thanks, this is a good idea.
Applied.
Best regards,
Krzysztof
Hi Krzysztof,
Quoted 28 lines · Krzysztof Kozlowski
Commit
52005dece527("ARM: dts: Add assigned clock parents to CMU node for exynos3250") added assigned clocks under Clock Management Unit to fix hangs when accessing ISP registers.However the dtschema expects "clocks" property if "assigned-clocks" are used. Add reference to input clock, the parent used in "assigned-clock-parents" to silence the dtschema warnings:
arch/arm/boot/dts/exynos3250-artik5-eval.dt.yaml: clock-controller@10030000: 'clocks' is a dependency of 'assigned-clocks'Signed-off-by Krzysztof Kozlowski <[email protected]>---
Changes since v1:
1. Add clocks property.This is a v2 for:
https://lore.kernel.org/linux-samsung-soc/20200901101534.GE23793@kozik-lap/T/#me85ac382b847dadbc3f6ebf30e94e70b5df1ebb6--- arch/arm/boot/dts/exynos3250.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm/boot/dts/exynos3250.dtsi +0
-0
arch/arm/boot/dts/exynos3250.dtsi line 217
Quoted 4 lines
arch/arm/boot/dts/exynos3250.dtsi +1
-0@@ -214,6 +214,7 @@ compatible = "samsung,exynos3250-cmu"; reg = <0x10030000 0x20000>; #clock-cells = <1>; + clocks = <&cmu CLK_FIN_PLL>;
This is not a correct input clock for this CMU. Please assign it to xusbxti, xxti or xtcxo in the respective board dts, as this is a board property.
arch/arm/boot/dts/exynos3250.dtsi line 220
Quoted 3 lines
arch/arm/boot/dts/exynos3250.dtsi +0
-0assigned-clocks = <&cmu CLK_MOUT_ACLK_400_MCUISP_SUB>, <&cmu CLK_MOUT_ACLK_266_SUB>; assigned-clock-parents = <&cmu CLK_FIN_PLL>,
Best regards
Signature · 2 lines
Marek Szyprowski, PhD Samsung R&D Institute Poland
Krzysztof Kozlowski
maintainerQuoted 26 lines · Marek Szyprowski
Hi Krzysztof,
Quoted 23 lines · Krzysztof Kozlowski
Commit
52005dece527("ARM: dts: Add assigned clock parents to CMU node for exynos3250") added assigned clocks under Clock Management Unit to fix hangs when accessing ISP registers.However the dtschema expects "clocks" property if "assigned-clocks" are used. Add reference to input clock, the parent used in "assigned-clock-parents" to silence the dtschema warnings:
arch/arm/boot/dts/exynos3250-artik5-eval.dt.yaml: clock-controller@10030000: 'clocks' is a dependency of 'assigned-clocks'Signed-off-by Krzysztof Kozlowski <[email protected]>---
Changes since v1:
1. Add clocks property.This is a v2 for:
https://lore.kernel.org/linux-samsung-soc/20200901101534.GE23793@kozik-lap/T/#me85ac382b847dadbc3f6ebf30e94e70b5df1ebb6--- arch/arm/boot/dts/exynos3250.dtsi | 1 + 1 file changed, 1 insertion(+)
Quoted 13 lines
arch/arm/boot/dts/exynos3250.dtsi line 217
Quoted 9 lines
arch/arm/boot/dts/exynos3250.dtsi +1
-0@@ -214,6 +214,7 @@ compatible = "samsung,exynos3250-cmu"; reg = <0x10030000 0x20000>; #clock-cells = <1>; + clocks = <&cmu CLK_FIN_PLL>;This is not a correct input clock for this CMU. Please assign it to xusbxti, xxti or xtcxo in the respective board dts, as this is a board property.
Makes sense, although all this is kind of a hack as neither the bindings nor the driver take the input clock.
Best regards,
Krzysztof
Quoted 10 lines
arch/arm/boot/dts/exynos3250.dtsi line 220
Quoted 4 lines
arch/arm/boot/dts/exynos3250.dtsi +0
-0assigned-clocks = <&cmu CLK_MOUT_ACLK_400_MCUISP_SUB>, <&cmu CLK_MOUT_ACLK_266_SUB>; assigned-clock-parents = <&cmu CLK_FIN_PLL>,Best regards
Signature · 2 lines
Marek Szyprowski, PhD Samsung R&D Institute Poland
Quoted 13 lines · Krzysztof Kozlowski
Quoted 4 lines
Quoted 4 lines
arch/arm/boot/dts/exynos3250.dtsi +0
-0Quoted 8 lines
arch/arm/boot/dts/exynos3250.dtsi line 217
Quoted 5 lines
arch/arm/boot/dts/exynos3250.dtsi +1
-0@@ -214,6 +214,7 @@ compatible = "samsung,exynos3250-cmu"; reg = <0x10030000 0x20000>; #clock-cells = <1>; + clocks = <&cmu CLK_FIN_PLL>;This is not a correct input clock for this CMU. Please assign it to xusbxti, xxti or xtcxo in the respective board dts, as this is a board property.
Quoted 2 lines
Makes sense, although all this is kind of a hack as neither the bindings nor the driver take the input clock.
I think we should update the bindings so possible input clocks to the CMU are documented for all SoCs. This is actually a bug in the clock controller DT bindings that the input clocks are missing. Then the driver would handle both the old and the updated bindings but the "clocks" property would be documented as mandatory. I will try to have a look at this.