Re: [PATCH v2 2/2] arm: dts: k3-am64: Sync DT with Linux v6.5-rc1

2023-08-01 Thread Nishanth Menon
On 15:27-20230731, Roger Quadros wrote:
> Sync all am642-evm/am642-sk related DT files
> with Linux v6.5-rc1.
> 
> - drop timer1 in favor of main_timer0 in am64-main.dtsi.
> Need to delete clock & power domain properties of
> main_timer1 in -r5.dts else won't boot.
> - drop cpsw3g custom DT property 'mac_efuse' and custom
> DT node cpsw-phy-sel as driver picks these from standard
> property/node.
> 
> Signed-off-by: Roger Quadros 
> ---
>  arch/arm/dts/k3-am64-main.dtsi| 171 +++--
>  arch/arm/dts/k3-am64-mcu.dtsi |  53 +++-
>  arch/arm/dts/k3-am64-thermal.dtsi |  33 +
>  arch/arm/dts/k3-am64.dtsi |  22 +---
>  arch/arm/dts/k3-am642-evm-u-boot.dtsi |  42 ++-
>  arch/arm/dts/k3-am642-evm.dts | 173 --
>  arch/arm/dts/k3-am642-r5-evm.dts  |  26 +++-
>  arch/arm/dts/k3-am642-r5-sk.dts   |  31 -
>  arch/arm/dts/k3-am642-sk-u-boot.dtsi  |  43 ++-
>  arch/arm/dts/k3-am642-sk.dts  | 166 +---
>  arch/arm/dts/k3-am642.dtsi|   1 +
>  11 files changed, 587 insertions(+), 174 deletions(-)
>  create mode 100644 arch/arm/dts/k3-am64-thermal.dtsi
> 
> diff --git a/arch/arm/dts/k3-am64-main.dtsi b/arch/arm/dts/k3-am64-main.dtsi
> index 5e8036f32d..1664d9f024 100644
> --- a/arch/arm/dts/k3-am64-main.dtsi
> +++ b/arch/arm/dts/k3-am64-main.dtsi
> @@ -228,12 +228,161 @@
>   };
>   };
>  
> + main_timer0: timer@240 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x240 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 36 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 36 1>;
> + assigned-clock-parents = <&k3_clks 36 2>;
> + power-domains = <&k3_pds 36 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer1: timer@241 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x241 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 37 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 37 1>;
> + assigned-clock-parents = <&k3_clks 37 2>;
> + power-domains = <&k3_pds 37 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer2: timer@242 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x242 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 38 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 38 1>;
> + assigned-clock-parents = <&k3_clks 38 2>;
> + power-domains = <&k3_pds 38 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer3: timer@243 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x243 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 39 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 39 1>;
> + assigned-clock-parents = <&k3_clks 39 2>;
> + power-domains = <&k3_pds 39 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer4: timer@244 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x244 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 40 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 40 1>;
> + assigned-clock-parents = <&k3_clks 40 2>;
> + power-domains = <&k3_pds 40 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer5: timer@245 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x245 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 41 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 41 1>;
> + assigned-clock-parents = <&k3_clks 41 2>;
> + power-domains = <&k3_pds 41 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer6: timer@246 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x246 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 42 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 42 1>;
> + assigned-clock-parents = <&k3_clks 42 2>;
> + power-domains = <&k3_pds 42 TI_SCI_PD_EXCLUSIVE>;
> + ti,timer-pwm;
> + };
> +
> + main_timer7: timer@247 {
> + compatible = "ti,am654-timer";
> + reg = <0x00 0x247 0x00 0x400>;
> + interrupts = ;
> + clocks = <&k3_clks 43 1>;
> + clock-names = "fck";
> + assigned-clocks = <&k3_clks 

Re: [PATCH v2 2/2] arm: dts: k3-am64: Sync DT with Linux v6.5-rc1

2023-08-01 Thread Nishanth Menon
On 15:27-20230731, Roger Quadros wrote:
> Sync all am642-evm/am642-sk related DT files
> with Linux v6.5-rc1.
> 
> - drop timer1 in favor of main_timer0 in am64-main.dtsi.
> Need to delete clock & power domain properties of
> main_timer1 in -r5.dts else won't boot.

As we discussed in IRC, we should document the rationale

> - drop cpsw3g custom DT property 'mac_efuse' and custom
> DT node cpsw-phy-sel as driver picks these from standard
> property/node.
> 
> Signed-off-by: Roger Quadros 
> ---
[...]

> diff --git a/arch/arm/dts/k3-am642-r5-evm.dts 
> b/arch/arm/dts/k3-am642-r5-evm.dts
> index b49064181a..fd9e9a6489 100644
> --- a/arch/arm/dts/k3-am642-r5-evm.dts
> +++ b/arch/arm/dts/k3-am642-r5-evm.dts

Same with the evm and sk dts files.

> @@ -13,12 +13,17 @@
>  / {
>   chosen {
>   stdout-path = "serial2:115200n8";
> - tick-timer = &timer1;
>   };
>  
>   aliases {
>   remoteproc0 = &sysctrler;
>   remoteproc1 = &a53_0;
> + serial1 = &main_uart1;
> + serial2 = &main_uart0;
> + i2c0 = &main_i2c0;
> + mmc0 = &sdhci0;
> + mmc1 = &sdhci1;
> + ethernet0 = &cpsw_port1;

Why do we need any of these?
>   };
>  
>   memory@8000 {

We dont need this either.
> @@ -210,6 +215,13 @@
>   AM64X_IOPAD(0x0144, PIN_OUTPUT, 4) /* (Y11) 
> PRG1_PRU1_GPO15.RGMII2_TX_CTL */
>   >;
>   };
> +
> + main_i2c0_pins_default: main-i2c0-default-pins {
> + pinctrl-single,pins = <
> + AM64X_IOPAD(0x0260, PIN_INPUT_PULLUP, 0) /* (A18) 
> I2C0_SCL */
> + AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) 
> I2C0_SDA */
> + >;
> + };

we should drop all the pinmuxes - they come in from board.dts.

>  };
>  
>  &dmsc {
> @@ -227,6 +239,7 @@
>   /delete-property/ clock-names;
>   pinctrl-names = "default";
>   pinctrl-0 = <&main_uart0_pins_default>;
> + current-speed = <115200>;
>   status = "okay";
>  };
>  
> @@ -267,6 +280,10 @@
>  
>  /* EEPROM might be read before SYSFW is available */
>  &main_i2c0 {
> + status = "okay";
> + pinctrl-names = "default";
> + pinctrl-0 = <&main_i2c0_pins_default>;
> + clock-frequency = <40>;
>   /delete-property/ power-domains;
>  };


We should be inheriting stuff from board.dts.
>  
> @@ -282,4 +299,11 @@
>   pinctrl-0 = <&main_usb0_pins_default>;
>  };
>  
> +&main_timer0 {
> + /delete-property/ clocks;
> + /delete-property/ assigned-clocks;
> + /delete-property/ assigned-clock-parents;
> + /delete-property/ power-domains;

This needs documentation.

> +};
> +
>  #include "k3-am642-evm-u-boot.dtsi"
> diff --git a/arch/arm/dts/k3-am642-r5-sk.dts b/arch/arm/dts/k3-am642-r5-sk.dts
> index 32d4c31728..5487973e6e 100644
> --- a/arch/arm/dts/k3-am642-r5-sk.dts
> +++ b/arch/arm/dts/k3-am642-r5-sk.dts
> @@ -15,12 +15,17 @@
>  / {
>   chosen {
>   stdout-path = "serial2:115200n8";
> - tick-timer = &timer1;
>   };
>  
>   aliases {
>   remoteproc0 = &sysctrler;
>   remoteproc1 = &a53_0;
> + serial1 = &main_uart1;
> + serial2 = &main_uart0;
> + i2c0 = &main_i2c0;
> + mmc1 = &sdhci1;
> + ethernet0 = &cpsw_port1;
> + ethernet1 = &cpsw_port2;
>   };
>  
>   memory@8000 {
> @@ -178,6 +183,13 @@
>   AM64X_IOPAD(0x0144, PIN_OUTPUT, 4) /* (Y11) 
> PRG1_PRU1_GPO15.RGMII2_TX_CTL */
>   >;
>   };
> +
> + main_i2c0_pins_default: main-i2c0-default-pins {
> + pinctrl-single,pins = <
> + AM64X_IOPAD(0x0260, PIN_INPUT_PULLUP, 0) /* (A18) 
> I2C0_SCL */
> + AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) 
> I2C0_SDA */
> + >;
> + };
>  };
>  
>  &dmsc {
> @@ -189,12 +201,22 @@
>   ti,secure-host;
>  };
>  
> +/* EEPROM might be read before SYSFW is available */
> +&main_i2c0 {
> + status = "okay";
> + pinctrl-names = "default";
> + pinctrl-0 = <&main_i2c0_pins_default>;
> + clock-frequency = <40>;
> + /delete-property/ power-domains;
> +};
> +
>  &main_uart0 {
>   /delete-property/ power-domains;
>   /delete-property/ clocks;
>   /delete-property/ clock-names;
>   pinctrl-names = "default";
>   pinctrl-0 = <&main_uart0_pins_default>;
> + current-speed = <115200>;
>   status = "okay";
>  };
>  
> @@ -264,4 +286,11 @@
>   };
>  };
>  
> +&main_timer0 {
> + /delete-property/ clocks;
> + /delete-property/ assigned-clocks;
> + /delete-property/ assigned-clock-parents;
> + /delete-property/ power-domains;
> +};
> +
>  #include "k3-am642-sk-u-boot.dtsi"

Move the u-boot.dtsi include to the very top after board.dts is
included. - Same with the evm dts.


-- 
Regards,
Nishanth Menon
Key (0xDDB58

[PATCH v2 2/2] arm: dts: k3-am64: Sync DT with Linux v6.5-rc1

2023-07-31 Thread Roger Quadros
Sync all am642-evm/am642-sk related DT files
with Linux v6.5-rc1.

- drop timer1 in favor of main_timer0 in am64-main.dtsi.
Need to delete clock & power domain properties of
main_timer1 in -r5.dts else won't boot.
- drop cpsw3g custom DT property 'mac_efuse' and custom
DT node cpsw-phy-sel as driver picks these from standard
property/node.

Signed-off-by: Roger Quadros 
---
 arch/arm/dts/k3-am64-main.dtsi| 171 +++--
 arch/arm/dts/k3-am64-mcu.dtsi |  53 +++-
 arch/arm/dts/k3-am64-thermal.dtsi |  33 +
 arch/arm/dts/k3-am64.dtsi |  22 +---
 arch/arm/dts/k3-am642-evm-u-boot.dtsi |  42 ++-
 arch/arm/dts/k3-am642-evm.dts | 173 --
 arch/arm/dts/k3-am642-r5-evm.dts  |  26 +++-
 arch/arm/dts/k3-am642-r5-sk.dts   |  31 -
 arch/arm/dts/k3-am642-sk-u-boot.dtsi  |  43 ++-
 arch/arm/dts/k3-am642-sk.dts  | 166 +---
 arch/arm/dts/k3-am642.dtsi|   1 +
 11 files changed, 587 insertions(+), 174 deletions(-)
 create mode 100644 arch/arm/dts/k3-am64-thermal.dtsi

diff --git a/arch/arm/dts/k3-am64-main.dtsi b/arch/arm/dts/k3-am64-main.dtsi
index 5e8036f32d..1664d9f024 100644
--- a/arch/arm/dts/k3-am64-main.dtsi
+++ b/arch/arm/dts/k3-am64-main.dtsi
@@ -228,12 +228,161 @@
};
};
 
+   main_timer0: timer@240 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x240 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 36 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 36 1>;
+   assigned-clock-parents = <&k3_clks 36 2>;
+   power-domains = <&k3_pds 36 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer1: timer@241 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x241 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 37 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 37 1>;
+   assigned-clock-parents = <&k3_clks 37 2>;
+   power-domains = <&k3_pds 37 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer2: timer@242 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x242 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 38 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 38 1>;
+   assigned-clock-parents = <&k3_clks 38 2>;
+   power-domains = <&k3_pds 38 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer3: timer@243 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x243 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 39 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 39 1>;
+   assigned-clock-parents = <&k3_clks 39 2>;
+   power-domains = <&k3_pds 39 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer4: timer@244 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x244 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 40 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 40 1>;
+   assigned-clock-parents = <&k3_clks 40 2>;
+   power-domains = <&k3_pds 40 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer5: timer@245 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x245 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 41 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 41 1>;
+   assigned-clock-parents = <&k3_clks 41 2>;
+   power-domains = <&k3_pds 41 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer6: timer@246 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x246 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 42 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 42 1>;
+   assigned-clock-parents = <&k3_clks 42 2>;
+   power-domains = <&k3_pds 42 TI_SCI_PD_EXCLUSIVE>;
+   ti,timer-pwm;
+   };
+
+   main_timer7: timer@247 {
+   compatible = "ti,am654-timer";
+   reg = <0x00 0x247 0x00 0x400>;
+   interrupts = ;
+   clocks = <&k3_clks 43 1>;
+   clock-names = "fck";
+   assigned-clocks = <&k3_clks 43 1>;
+   assigned-clock-parents = <&k3_clks 43 2>;
+   power-domains = <&k3_pds 43 TI_SCI_PD