2024-05-08 14:52:18

by Jan Dakinevich

[permalink] [raw]
Subject: [APPROACH 2 1/2] arm64: dts: amlogic: list all slave clocks for audio clock controller

Signed-off-by: Jan Dakinevich <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 27 ++++++++++++++++++++--
arch/arm64/boot/dts/amlogic/meson-g12.dtsi | 26 +++++++++++++++++++--
arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 26 +++++++++++++++++++--
3 files changed, 73 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
index 6d12b760b90f..28f4ec5f39b0 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
@@ -1342,7 +1342,9 @@ clkc_audio: clock-controller@0 {
<&clkc CLKID_HIFI_PLL>,
<&clkc CLKID_FCLK_DIV3>,
<&clkc CLKID_FCLK_DIV4>,
- <&clkc CLKID_GP0_PLL>;
+ <&clkc CLKID_GP0_PLL>,
+ <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>,
+ <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>;
clock-names = "pclk",
"mst_in0",
"mst_in1",
@@ -1351,7 +1353,28 @@ clkc_audio: clock-controller@0 {
"mst_in4",
"mst_in5",
"mst_in6",
- "mst_in7";
+ "mst_in7",
+ "slv_sclk0",
+ "slv_sclk1",
+ "slv_sclk2",
+ "slv_sclk3",
+ "slv_sclk4",
+ "slv_sclk5",
+ "slv_sclk6",
+ "slv_sclk7",
+ "slv_sclk8",
+ "slv_sclk9",
+ "slv_lrclk0",
+ "slv_lrclk1",
+ "slv_lrclk2",
+ "slv_lrclk3",
+ "slv_lrclk4",
+ "slv_lrclk5",
+ "slv_lrclk6",
+ "slv_lrclk7",
+ "slv_lrclk8",
+ "slv_lrclk9";
+

resets = <&reset RESET_AUDIO>;
};
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12.dtsi
index e732df3f3114..af99781f3c4e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12.dtsi
@@ -82,7 +82,9 @@ clkc_audio: clock-controller@0 {
<&clkc CLKID_HIFI_PLL>,
<&clkc CLKID_FCLK_DIV3>,
<&clkc CLKID_FCLK_DIV4>,
- <&clkc CLKID_GP0_PLL>;
+ <&clkc CLKID_GP0_PLL>,
+ <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>,
+ <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>;
clock-names = "pclk",
"mst_in0",
"mst_in1",
@@ -91,7 +93,27 @@ clkc_audio: clock-controller@0 {
"mst_in4",
"mst_in5",
"mst_in6",
- "mst_in7";
+ "mst_in7",
+ "slv_sclk0",
+ "slv_sclk1",
+ "slv_sclk2",
+ "slv_sclk3",
+ "slv_sclk4",
+ "slv_sclk5",
+ "slv_sclk6",
+ "slv_sclk7",
+ "slv_sclk8",
+ "slv_sclk9",
+ "slv_lrclk0",
+ "slv_lrclk1",
+ "slv_lrclk2",
+ "slv_lrclk3",
+ "slv_lrclk4",
+ "slv_lrclk5",
+ "slv_lrclk6",
+ "slv_lrclk7",
+ "slv_lrclk8",
+ "slv_lrclk9";

resets = <&reset RESET_AUDIO>;
};
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
index 643f94d9d08e..24e520c3e2a6 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
@@ -162,7 +162,9 @@ clkc_audio: clock-controller@0 {
<&clkc CLKID_HIFI_PLL>,
<&clkc CLKID_FCLK_DIV3>,
<&clkc CLKID_FCLK_DIV4>,
- <&clkc CLKID_FCLK_DIV5>;
+ <&clkc CLKID_FCLK_DIV5>,
+ <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>,
+ <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>;
clock-names = "pclk",
"mst_in0",
"mst_in1",
@@ -171,7 +173,27 @@ clkc_audio: clock-controller@0 {
"mst_in4",
"mst_in5",
"mst_in6",
- "mst_in7";
+ "mst_in7",
+ "slv_sclk0",
+ "slv_sclk1",
+ "slv_sclk2",
+ "slv_sclk3",
+ "slv_sclk4",
+ "slv_sclk5",
+ "slv_sclk6",
+ "slv_sclk7",
+ "slv_sclk8",
+ "slv_sclk9",
+ "slv_lrclk0",
+ "slv_lrclk1",
+ "slv_lrclk2",
+ "slv_lrclk3",
+ "slv_lrclk4",
+ "slv_lrclk5",
+ "slv_lrclk6",
+ "slv_lrclk7",
+ "slv_lrclk8",
+ "slv_lrclk9";

resets = <&reset RESET_AUDIO>;
};
--
2.34.1



2024-05-08 17:50:26

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [APPROACH 2 1/2] arm64: dts: amlogic: list all slave clocks for audio clock controller

On Wed, May 08, 2024 at 05:42:58PM +0300, Jan Dakinevich wrote:
> Signed-off-by: Jan Dakinevich <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 27 ++++++++++++++++++++--
> arch/arm64/boot/dts/amlogic/meson-g12.dtsi | 26 +++++++++++++++++++--
> arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 26 +++++++++++++++++++--
> 3 files changed, 73 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> index 6d12b760b90f..28f4ec5f39b0 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> @@ -1342,7 +1342,9 @@ clkc_audio: clock-controller@0 {
> <&clkc CLKID_HIFI_PLL>,
> <&clkc CLKID_FCLK_DIV3>,
> <&clkc CLKID_FCLK_DIV4>,
> - <&clkc CLKID_GP0_PLL>;
> + <&clkc CLKID_GP0_PLL>,
> + <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>,
> + <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>;

All 3 cases are just unused clocks on the end. I suppose that's not
always the case. You could just set 'minItems' in the binding to
avoid needing to pad the end and the dts changes.

Rob

2024-05-12 19:07:43

by Jan Dakinevich

[permalink] [raw]
Subject: Re: [APPROACH 2 1/2] arm64: dts: amlogic: list all slave clocks for audio clock controller



On 5/8/24 20:50, Rob Herring wrote:
> On Wed, May 08, 2024 at 05:42:58PM +0300, Jan Dakinevich wrote:
>> Signed-off-by: Jan Dakinevich <[email protected]>
>> ---
>> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 27 ++++++++++++++++++++--
>> arch/arm64/boot/dts/amlogic/meson-g12.dtsi | 26 +++++++++++++++++++--
>> arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 26 +++++++++++++++++++--
>> 3 files changed, 73 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
>> index 6d12b760b90f..28f4ec5f39b0 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
>> +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
>> @@ -1342,7 +1342,9 @@ clkc_audio: clock-controller@0 {
>> <&clkc CLKID_HIFI_PLL>,
>> <&clkc CLKID_FCLK_DIV3>,
>> <&clkc CLKID_FCLK_DIV4>,
>> - <&clkc CLKID_GP0_PLL>;
>> + <&clkc CLKID_GP0_PLL>,
>> + <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>,
>> + <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>;
>
> All 3 cases are just unused clocks on the end. I suppose that's not
> always the case. You could just set 'minItems' in the binding to
> avoid needing to pad the end and the dts changes.
>

You are right. I mistakenly thought that 'minItems' can not be
redefined. But not, it is allowed to redefine it and it works. Thus,
this patch is not needed for this approach.

Anyway, what do you think about first approach? As for me, it is more
simple and readable.

> Rob

--
Best regards
Jan Dakinevich

2024-05-13 13:47:41

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [APPROACH 2 1/2] arm64: dts: amlogic: list all slave clocks for audio clock controller

On Sun, May 12, 2024 at 10:06:23PM +0300, Jan Dakinevich wrote:
>
>
> On 5/8/24 20:50, Rob Herring wrote:
> > On Wed, May 08, 2024 at 05:42:58PM +0300, Jan Dakinevich wrote:
> >> Signed-off-by: Jan Dakinevich <[email protected]>
> >> ---
> >> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 27 ++++++++++++++++++++--
> >> arch/arm64/boot/dts/amlogic/meson-g12.dtsi | 26 +++++++++++++++++++--
> >> arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 26 +++++++++++++++++++--
> >> 3 files changed, 73 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> >> index 6d12b760b90f..28f4ec5f39b0 100644
> >> --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> >> +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
> >> @@ -1342,7 +1342,9 @@ clkc_audio: clock-controller@0 {
> >> <&clkc CLKID_HIFI_PLL>,
> >> <&clkc CLKID_FCLK_DIV3>,
> >> <&clkc CLKID_FCLK_DIV4>,
> >> - <&clkc CLKID_GP0_PLL>;
> >> + <&clkc CLKID_GP0_PLL>,
> >> + <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>,
> >> + <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>;
> >
> > All 3 cases are just unused clocks on the end. I suppose that's not
> > always the case. You could just set 'minItems' in the binding to
> > avoid needing to pad the end and the dts changes.
> >
>
> You are right. I mistakenly thought that 'minItems' can not be
> redefined. But not, it is allowed to redefine it and it works. Thus,
> this patch is not needed for this approach.
>
> Anyway, what do you think about first approach? As for me, it is more
> simple and readable.

I prefer this one as it enforces the order.

Rob