2023-07-31 14:50:13

by Francesco Dolcini

[permalink] [raw]
Subject: [PATCH v1 1/4] arm64: dts: ti: k3-am62x: Enable AUDIO_REFCLKx

From: Jai Luthra <[email protected]>

On AM62-based SoCs the AUDIO_REFCLKx clocks can be used as an input to
external peripherals when configured through CTRL_MMR, so add the
clock nodes.

Signed-off-by: Jai Luthra <[email protected]>
Signed-off-by: Francesco Dolcini <[email protected]>
---
arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 18 ++++++++++++++++++
arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 18 ++++++++++++++++++
2 files changed, 36 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
index 33b6aadc9083..3a1b387bbf49 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
@@ -60,6 +60,24 @@ epwm_tbclk: clock@4130 {
reg = <0x4130 0x4>;
#clock-cells = <1>;
};
+
+ audio_refclk0: clock@82e0 {
+ compatible = "ti,am62-audio-refclk";
+ reg = <0x82e0 0x4>;
+ clocks = <&k3_clks 157 0>;
+ assigned-clocks = <&k3_clks 157 0>;
+ assigned-clock-parents = <&k3_clks 157 8>;
+ #clock-cells = <0>;
+ };
+
+ audio_refclk1: clock@82e4 {
+ compatible = "ti,am62-audio-refclk";
+ reg = <0x82e4 0x4>;
+ clocks = <&k3_clks 157 10>;
+ assigned-clocks = <&k3_clks 157 10>;
+ assigned-clock-parents = <&k3_clks 157 18>;
+ #clock-cells = <0>;
+ };
};

dmss: bus@48000000 {
diff --git a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
index 8397cb80f559..30b163a9b248 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
@@ -60,6 +60,24 @@ epwm_tbclk: clock-controller@4130 {
reg = <0x4130 0x4>;
#clock-cells = <1>;
};
+
+ audio_refclk0: clock@82e0 {
+ compatible = "ti,am62-audio-refclk";
+ reg = <0x82e0 0x4>;
+ clocks = <&k3_clks 157 0>;
+ assigned-clocks = <&k3_clks 157 0>;
+ assigned-clock-parents = <&k3_clks 157 8>;
+ #clock-cells = <0>;
+ };
+
+ audio_refclk1: clock@82e4 {
+ compatible = "ti,am62-audio-refclk";
+ reg = <0x82e4 0x4>;
+ clocks = <&k3_clks 157 10>;
+ assigned-clocks = <&k3_clks 157 10>;
+ assigned-clock-parents = <&k3_clks 157 18>;
+ #clock-cells = <0>;
+ };
};

dmss: bus@48000000 {
--
2.25.1



2023-08-02 12:12:20

by Jai Luthra

[permalink] [raw]
Subject: Re: [PATCH v1 1/4] arm64: dts: ti: k3-am62x: Enable AUDIO_REFCLKx

Hi Francesco,

Thank you for posting this patch.

On Jul 31, 2023 at 16:21:32 +0200, Francesco Dolcini wrote:
> From: Jai Luthra <[email protected]>
>
> On AM62-based SoCs the AUDIO_REFCLKx clocks can be used as an input to
> external peripherals when configured through CTRL_MMR, so add the
> clock nodes.
>
> Signed-off-by: Jai Luthra <[email protected]>
> Signed-off-by: Francesco Dolcini <[email protected]>
> ---
> arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 18 ++++++++++++++++++
> arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 18 ++++++++++++++++++

Given currently none of the AM62A boards are using the refclks, can you
drop those or just mark the nodes as disabled. Whoever is the first user
can enable them.

With that change, LGTM.
Not sure if I can provide an R-by tag, given I'm the author.

> 2 files changed, 36 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> index 33b6aadc9083..3a1b387bbf49 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
> @@ -60,6 +60,24 @@ epwm_tbclk: clock@4130 {
> reg = <0x4130 0x4>;
> #clock-cells = <1>;
> };
> +
> + audio_refclk0: clock@82e0 {
> + compatible = "ti,am62-audio-refclk";
> + reg = <0x82e0 0x4>;
> + clocks = <&k3_clks 157 0>;
> + assigned-clocks = <&k3_clks 157 0>;
> + assigned-clock-parents = <&k3_clks 157 8>;
> + #clock-cells = <0>;
> + };
> +
> + audio_refclk1: clock@82e4 {
> + compatible = "ti,am62-audio-refclk";
> + reg = <0x82e4 0x4>;
> + clocks = <&k3_clks 157 10>;
> + assigned-clocks = <&k3_clks 157 10>;
> + assigned-clock-parents = <&k3_clks 157 18>;
> + #clock-cells = <0>;
> + };
> };
>
> dmss: bus@48000000 {
> diff --git a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
> index 8397cb80f559..30b163a9b248 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
> @@ -60,6 +60,24 @@ epwm_tbclk: clock-controller@4130 {
> reg = <0x4130 0x4>;
> #clock-cells = <1>;
> };
> +
> + audio_refclk0: clock@82e0 {
> + compatible = "ti,am62-audio-refclk";
> + reg = <0x82e0 0x4>;
> + clocks = <&k3_clks 157 0>;
> + assigned-clocks = <&k3_clks 157 0>;
> + assigned-clock-parents = <&k3_clks 157 8>;
> + #clock-cells = <0>;
> + };
> +
> + audio_refclk1: clock@82e4 {
> + compatible = "ti,am62-audio-refclk";
> + reg = <0x82e4 0x4>;
> + clocks = <&k3_clks 157 10>;
> + assigned-clocks = <&k3_clks 157 10>;
> + assigned-clock-parents = <&k3_clks 157 18>;
> + #clock-cells = <0>;
> + };
> };
>
> dmss: bus@48000000 {
> --
> 2.25.1
>
>

--
Thanks,
Jai

GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145


Attachments:
(No filename) (2.83 kB)
signature.asc (849.00 B)
Download all attachments

2023-08-02 12:24:36

by Francesco Dolcini

[permalink] [raw]
Subject: Re: [PATCH v1 1/4] arm64: dts: ti: k3-am62x: Enable AUDIO_REFCLKx



Il 2 agosto 2023 13:23:50 CEST, Jai Luthra <[email protected]> ha scritto:
>Hi Francesco,
>
>Thank you for posting this patch.
>
>On Jul 31, 2023 at 16:21:32 +0200, Francesco Dolcini wrote:
>> From: Jai Luthra <[email protected]>
>>
>> On AM62-based SoCs the AUDIO_REFCLKx clocks can be used as an input to
>> external peripherals when configured through CTRL_MMR, so add the
>> clock nodes.
>>
>> Signed-off-by: Jai Luthra <[email protected]>
>> Signed-off-by: Francesco Dolcini <[email protected]>
>> ---
>> arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 18 ++++++++++++++++++
>> arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 18 ++++++++++++++++++
>
>Given currently none of the AM62A boards are using the refclks, can you
>drop those or just mark the nodes as disabled. Whoever is the first user
>can enable them.

I can drop the 2 clocks from AM62A, however, should we really do it? These clocks exist and they are just defined in the DTS, they are not going to be enabled if not used, "ti,am62-epwm-tbclk" is also not disabled for example.

Francesco


2023-08-02 14:00:41

by Francesco Dolcini

[permalink] [raw]
Subject: Re: [PATCH v1 1/4] arm64: dts: ti: k3-am62x: Enable AUDIO_REFCLKx

On Wed, Aug 02, 2023 at 08:32:44AM -0500, Nishanth Menon wrote:
> On 13:37-20230802, Francesco Dolcini wrote:
> > Il 2 agosto 2023 13:23:50 CEST, Jai Luthra <[email protected]> ha scritto:
> > >On Jul 31, 2023 at 16:21:32 +0200, Francesco Dolcini wrote:
> > >> From: Jai Luthra <[email protected]>
> > >>
> > >> On AM62-based SoCs the AUDIO_REFCLKx clocks can be used as an input to
> > >> external peripherals when configured through CTRL_MMR, so add the
> > >> clock nodes.
> > >>
> > >> Signed-off-by: Jai Luthra <[email protected]>
> > >> Signed-off-by: Francesco Dolcini <[email protected]>
> > >> ---
> > >> arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 18 ++++++++++++++++++
> > >> arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 18 ++++++++++++++++++
> > >
> > >Given currently none of the AM62A boards are using the refclks, can you
> > >drop those or just mark the nodes as disabled. Whoever is the first user
> > >can enable them.
> >
> > I can drop the 2 clocks from AM62A, however, should we really do it?
> > These clocks exist and they are just defined in the DTS, they are
> > not going to be enabled if not used, "ti,am62-epwm-tbclk" is also
> > not disabled for example.
>
> Overall, the SoC clock as such has nothing to do with board specific, so
> leave it default (enabled) in SoC.dts - just want to make sure that the
> clk-parent selection doesn't get in the way of platforms and is a sane
> default.

When I looked into that, months ago, this looked to me the correct and a
sane default. I had the same in our downstream way before the addition
from Jai Luthra to the SoC dtsi.

Not sure if Jai can add more on that regard.

> pll2_hsdiv8 output - which looks like the default mux value anyways..
> I am ok for it being explicit, but wondering if that works for boards
> that do not use this default.

IFF needed, it would be very easy to just override from the board dts,
using the labels that are already there (audio_refclk0, audio_refclk1).

> (sidenote): Fransesco - your new mail client has line wrap issues ;)
Yep, I had the crazy idea to reply from my mobile phone while having a
walk. It's already a success that I did not top post ;-)

Francesco


2023-08-02 14:28:54

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH v1 1/4] arm64: dts: ti: k3-am62x: Enable AUDIO_REFCLKx

On 13:37-20230802, Francesco Dolcini wrote:
>
>
> Il 2 agosto 2023 13:23:50 CEST, Jai Luthra <[email protected]> ha scritto:
> >Hi Francesco,
> >
> >Thank you for posting this patch.
> >
> >On Jul 31, 2023 at 16:21:32 +0200, Francesco Dolcini wrote:
> >> From: Jai Luthra <[email protected]>
> >>
> >> On AM62-based SoCs the AUDIO_REFCLKx clocks can be used as an input to
> >> external peripherals when configured through CTRL_MMR, so add the
> >> clock nodes.
> >>
> >> Signed-off-by: Jai Luthra <[email protected]>
> >> Signed-off-by: Francesco Dolcini <[email protected]>
> >> ---
> >> arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 18 ++++++++++++++++++
> >> arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 18 ++++++++++++++++++
> >
> >Given currently none of the AM62A boards are using the refclks, can you
> >drop those or just mark the nodes as disabled. Whoever is the first user
> >can enable them.
>
> I can drop the 2 clocks from AM62A, however, should we really do it? These clocks exist and they are just defined in the DTS, they are not going to be enabled if not used, "ti,am62-epwm-tbclk" is also not disabled for example.

Overall, the SoC clock as such has nothing to do with board specific, so
leave it default (enabled) in SoC.dts - just want to make sure that the
clk-parent selection doesn't get in the way of platforms and is a sane
default.

I find audio clock muxing a bit of a pain (only next to DSS clocking,
but that is another story).. so will depend on you folks for help.
Looking at https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am62ax/clocks.html#clocks-for-board0-device
and Clocking spec, setting this:
+ assigned-clocks = <&k3_clks 157 0>;
+ assigned-clock-parents = <&k3_clks 157 8>;
as default implies:
pll2_hsdiv8 output - which looks like the default mux value anyways.. I
am ok for it being explicit, but wondering if that works for boards that
do not use this default.

Could you guys confirm?

(sidenote): Fransesco - your new mail client has line wrap issues ;)
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D

2023-08-02 15:01:50

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH v1 1/4] arm64: dts: ti: k3-am62x: Enable AUDIO_REFCLKx

On 15:41-20230802, Francesco Dolcini wrote:
> On Wed, Aug 02, 2023 at 08:32:44AM -0500, Nishanth Menon wrote:
> > On 13:37-20230802, Francesco Dolcini wrote:
> > > Il 2 agosto 2023 13:23:50 CEST, Jai Luthra <[email protected]> ha scritto:
> > > >On Jul 31, 2023 at 16:21:32 +0200, Francesco Dolcini wrote:
> > > >> From: Jai Luthra <[email protected]>
> > > >>
> > > >> On AM62-based SoCs the AUDIO_REFCLKx clocks can be used as an input to
> > > >> external peripherals when configured through CTRL_MMR, so add the
> > > >> clock nodes.
> > > >>
> > > >> Signed-off-by: Jai Luthra <[email protected]>
> > > >> Signed-off-by: Francesco Dolcini <[email protected]>
> > > >> ---
> > > >> arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 18 ++++++++++++++++++
> > > >> arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 18 ++++++++++++++++++
> > > >
> > > >Given currently none of the AM62A boards are using the refclks, can you
> > > >drop those or just mark the nodes as disabled. Whoever is the first user
> > > >can enable them.
> > >
> > > I can drop the 2 clocks from AM62A, however, should we really do it?
> > > These clocks exist and they are just defined in the DTS, they are
> > > not going to be enabled if not used, "ti,am62-epwm-tbclk" is also
> > > not disabled for example.
> >
> > Overall, the SoC clock as such has nothing to do with board specific, so
> > leave it default (enabled) in SoC.dts - just want to make sure that the
> > clk-parent selection doesn't get in the way of platforms and is a sane
> > default.
>
> When I looked into that, months ago, this looked to me the correct and a
> sane default. I had the same in our downstream way before the addition
> from Jai Luthra to the SoC dtsi.
>
> Not sure if Jai can add more on that regard.
>
> > pll2_hsdiv8 output - which looks like the default mux value anyways..
> > I am ok for it being explicit, but wondering if that works for boards
> > that do not use this default.
>
> IFF needed, it would be very easy to just override from the board dts,
> using the labels that are already there (audio_refclk0, audio_refclk1).

Jai: This sounds sane to me, if you are OK as well, I'd appreciate a reviewed-by

>
> > (sidenote): Fransesco - your new mail client has line wrap issues ;)
> Yep, I had the crazy idea to reply from my mobile phone while having a
> walk. It's already a success that I did not top post ;-)

hehe ;)

--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D

2023-08-03 06:06:10

by Jai Luthra

[permalink] [raw]
Subject: Re: [PATCH v1 1/4] arm64: dts: ti: k3-am62x: Enable AUDIO_REFCLKx

Hi Nishanth, Francesco,

On Aug 02, 2023 at 09:00:20 -0500, Nishanth Menon wrote:
> On 15:41-20230802, Francesco Dolcini wrote:
> > On Wed, Aug 02, 2023 at 08:32:44AM -0500, Nishanth Menon wrote:
> > > On 13:37-20230802, Francesco Dolcini wrote:
> > > > Il 2 agosto 2023 13:23:50 CEST, Jai Luthra <[email protected]> ha scritto:
> > > > >On Jul 31, 2023 at 16:21:32 +0200, Francesco Dolcini wrote:
> > > > >> From: Jai Luthra <[email protected]>
> > > > >>
> > > > >> On AM62-based SoCs the AUDIO_REFCLKx clocks can be used as an input to
> > > > >> external peripherals when configured through CTRL_MMR, so add the
> > > > >> clock nodes.
> > > > >>
> > > > >> Signed-off-by: Jai Luthra <[email protected]>
> > > > >> Signed-off-by: Francesco Dolcini <[email protected]>
> > > > >> ---
> > > > >> arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 18 ++++++++++++++++++
> > > > >> arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 18 ++++++++++++++++++
> > > > >
> > > > >Given currently none of the AM62A boards are using the refclks, can you
> > > > >drop those or just mark the nodes as disabled. Whoever is the first user
> > > > >can enable them.
> > > >
> > > > I can drop the 2 clocks from AM62A, however, should we really do it?
> > > > These clocks exist and they are just defined in the DTS, they are
> > > > not going to be enabled if not used, "ti,am62-epwm-tbclk" is also
> > > > not disabled for example.
> > >
> > > Overall, the SoC clock as such has nothing to do with board specific, so
> > > leave it default (enabled) in SoC.dts - just want to make sure that the
> > > clk-parent selection doesn't get in the way of platforms and is a sane
> > > default.
> >
> > When I looked into that, months ago, this looked to me the correct and a
> > sane default. I had the same in our downstream way before the addition
> > from Jai Luthra to the SoC dtsi.
> >
> > Not sure if Jai can add more on that regard.
> >
> > > pll2_hsdiv8 output - which looks like the default mux value anyways..
> > > I am ok for it being explicit, but wondering if that works for boards
> > > that do not use this default.
> >
> > IFF needed, it would be very easy to just override from the board dts,
> > using the labels that are already there (audio_refclk0, audio_refclk1).
>
> Jai: This sounds sane to me, if you are OK as well, I'd appreciate a reviewed-by
>

Makes sense, most external peripherals would prefer that default PLL as
parent - for other usecases what Francesco said can work.

Reviewed-by: Jai Luthra <[email protected]>

> >
> > > (sidenote): Fransesco - your new mail client has line wrap issues ;)
> > Yep, I had the crazy idea to reply from my mobile phone while having a
> > walk. It's already a success that I did not top post ;-)
>
> hehe ;)
>
> --
> Regards,
> Nishanth Menon
> Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
>

--
Thanks,
Jai

GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145


Attachments:
(No filename) (2.99 kB)
signature.asc (849.00 B)
Download all attachments