Re: [PATCH 1/5] arm64: dts: ti: k3-j7200: Add general purpose timers

From: Nishanth Menon
Date: Wed May 31 2023 - 17:51:57 EST


On 16:02-20230426, Udit Kumar wrote:
[..]

> diff --git a/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi b/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi
> index ef352e32f19d..555bde0e7fda 100644
> --- a/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi
[...]

> + main_timer13: timer@24d0000 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x24d0000 0x00 0x400>;
> + interrupts = <GIC_SPI 237 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&k3_clks 63 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 63 1>;
> + assigned-clock-parents = <&k3_clks 63 2>;
> + power-domains = <&k3_pds 63 TI_SCI_PD_EXCLUSIVE>;

^^ I think you need to use device ID 64 here instead of 63 for the node

Also for odd numbered timers, we need to set the TIMERx_CLKSEL_VD
explicitly for J7200, unfortunately the IDs are different from J721e,
preventing re-use :(

Example:
https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j7200/clocks.html#clocks-for-timer1-device
https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j7200/clocks.html#clocks-for-timer1-clksel-vd-device

> + ti,timer-pwm;
> + };
[...]

> diff --git a/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi
> index 331b4e482e41..1c09e442b379 100644
> --- a/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi
> @@ -34,6 +34,126 @@ k3_reset: reset-controller {
> };
> };
[...]

> + mcu_timer6: timer@40460000 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x40460000 0x00 0x400>;
> + interrupts = <GIC_SPI 822 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&k3_clks 76 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 76 1>;
> + assigned-clock-parents = <&k3_clks 76 2>;
> + power-domains = <&k3_pds 35 TI_SCI_PD_EXCLUSIVE>;
I think this needs to be 76 instead of 35

> + ti,timer-pwm;
> + };
> +

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