Re: [PATCH 04/14] arch: arm: dts: k3-j7200: Add general purpose timers

2023-05-03 Thread Nishanth Menon
On 09:43-20230503, Udit Kumar wrote:
> There are 20 general purpose timers on j7200 that can be used for things
> like PWM using pwm-omap-dmtimer driver. There are also additional ten
> timers in the MCU domain.
> 
> MCU timer 0 is used by R5 uboot as always on. So change properties
> in u-boot specific files
> 
> Signed-off-by: Udit Kumar 
> ---

NAK. upstream k.org first.

>  .../k3-j7200-common-proc-board-u-boot.dtsi|   7 +
>  arch/arm/dts/k3-j7200-main.dtsi   | 240 ++
>  arch/arm/dts/k3-j7200-mcu-wakeup.dtsi | 130 ++
>  3 files changed, 377 insertions(+)
> 
> diff --git a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi 
> b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
> index f57c2306ba..789dc54617 100644
> --- a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
> +++ b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
> @@ -30,7 +30,14 @@
>   bootph-pre-ram;
>  
>   timer1: timer@4040 {
> + /delete-property/ clocks;
> + /delete-property/ clock-name;
> + /delete-property/ assigned-clocks;
> + /delete-property/ assigned-clock-parents;
> + /delete-property/ power-domains;
> + /delete-property/ ti,timer-pwm;
>   compatible = "ti,omap5430-timer";
> + status = "okay";

Curious: Do we need to delete all these properties, cant we get the R5 SPL to
work with these?

>   reg = <0x0 0x4040 0x0 0x80>;
>   ti,timer-alwon;
>   clock-frequency = <25000>;
> diff --git a/arch/arm/dts/k3-j7200-main.dtsi b/arch/arm/dts/k3-j7200-main.dtsi
> index 138381f43c..54795db9c3 100644
> --- a/arch/arm/dts/k3-j7200-main.dtsi
> +++ b/arch/arm/dts/k3-j7200-main.dtsi
> @@ -795,6 +795,246 @@
>   assigned-clock-parents = <&k3_clks 253 5>;
>   };
>  
> + main_timer0: timer@240 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x240 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 49 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 49 1>;
> + assigned-clock-parents = <&k3_clks 49 2>;
> + power-domains = <&k3_pds 49 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer1: timer@241 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x241 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 50 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 50 1>;
> + assigned-clock-parents = <&k3_clks 50 2>;
> + power-domains = <&k3_pds 50 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer2: timer@242 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x242 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 51 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 51 1>;
> + assigned-clock-parents = <&k3_clks 51 2>;
> + power-domains = <&k3_pds 49 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer3: timer@243 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x243 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 52 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 52 1>;
> + assigned-clock-parents = <&k3_clks 52 2>;
> + power-domains = <&k3_pds 52 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer4: timer@244 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x244 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 53 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 53 1>;
> + assigned-clock-parents = <&k3_clks 53 2>;
> + power-domains = <&k3_pds 53 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer5: timer@245 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x245 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 54 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 54 1>;
> + assigned-clock-parents = <&k3_clks 54 2>;
> + power-domains = <&k3_pds 54 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer6: timer@246 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x246 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 55 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 55 1>;
> + assigned-clock-par

[PATCH 04/14] arch: arm: dts: k3-j7200: Add general purpose timers

2023-05-02 Thread Udit Kumar
There are 20 general purpose timers on j7200 that can be used for things
like PWM using pwm-omap-dmtimer driver. There are also additional ten
timers in the MCU domain.

MCU timer 0 is used by R5 uboot as always on. So change properties
in u-boot specific files

Signed-off-by: Udit Kumar 
---
 .../k3-j7200-common-proc-board-u-boot.dtsi|   7 +
 arch/arm/dts/k3-j7200-main.dtsi   | 240 ++
 arch/arm/dts/k3-j7200-mcu-wakeup.dtsi | 130 ++
 3 files changed, 377 insertions(+)

diff --git a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi 
b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
index f57c2306ba..789dc54617 100644
--- a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
+++ b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
@@ -30,7 +30,14 @@
bootph-pre-ram;
 
timer1: timer@4040 {
+   /delete-property/ clocks;
+   /delete-property/ clock-name;
+   /delete-property/ assigned-clocks;
+   /delete-property/ assigned-clock-parents;
+   /delete-property/ power-domains;
+   /delete-property/ ti,timer-pwm;
compatible = "ti,omap5430-timer";
+   status = "okay";
reg = <0x0 0x4040 0x0 0x80>;
ti,timer-alwon;
clock-frequency = <25000>;
diff --git a/arch/arm/dts/k3-j7200-main.dtsi b/arch/arm/dts/k3-j7200-main.dtsi
index 138381f43c..54795db9c3 100644
--- a/arch/arm/dts/k3-j7200-main.dtsi
+++ b/arch/arm/dts/k3-j7200-main.dtsi
@@ -795,6 +795,246 @@
assigned-clock-parents = <&k3_clks 253 5>;
};
 
+   main_timer0: timer@240 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x240 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 49 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 49 1>;
+   assigned-clock-parents = <&k3_clks 49 2>;
+   power-domains = <&k3_pds 49 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer1: timer@241 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x241 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 50 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 50 1>;
+   assigned-clock-parents = <&k3_clks 50 2>;
+   power-domains = <&k3_pds 50 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer2: timer@242 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x242 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 51 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 51 1>;
+   assigned-clock-parents = <&k3_clks 51 2>;
+   power-domains = <&k3_pds 49 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer3: timer@243 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x243 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 52 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 52 1>;
+   assigned-clock-parents = <&k3_clks 52 2>;
+   power-domains = <&k3_pds 52 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer4: timer@244 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x244 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 53 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 53 1>;
+   assigned-clock-parents = <&k3_clks 53 2>;
+   power-domains = <&k3_pds 53 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer5: timer@245 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x245 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 54 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 54 1>;
+   assigned-clock-parents = <&k3_clks 54 2>;
+   power-domains = <&k3_pds 54 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer6: timer@246 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x246 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 55 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 55 1>;
+   assigned-clock-parents = <&k3_clks 55 2>;
+   power-domains = <&k3_pds 55 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer7: timer@247 {
+   compatible = "ti,am654-timer";
+