arm64: dts: ti: k3-am62: Add general purpose timers for am62
Subsystems (2)
PATCH 1/2 arm64: dts: ti: k3-am62: Add general purpose timers for am62
There are 8 general purpose timers on am65 that can be used for things like PWM using pwm-omap-dmtimer driver. There are also additional four timers in the MCU domain that do not have interrupts routable for Linux.
We configure the timers with the 25 MHz input clock by default as the 32.768 kHz clock may not be wired on the device. We leave the MCU domain timers clock mux unconfigured, and mark the MCU domain timers reserved. The MCU domain timers are likely reserved by the software for the ESM module.
Compared to am65, the timers on am62 do not have a dedicated IO mux for the timers. On am62, the timers have different interrupts, clocks and power domains compared to am65, and the MCU timers are at a different IO address.
--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 97 ++++++++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi | 45 +++++++++++ 2 files changed, 142 insertions(+)
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +97 -0
@@ -186,6 +186,103 @@ main_pmx0: pinctrl@f4000 { pinctrl-single,function-mask = <0xffffffff>; }; + main_timer0: timer@2400000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2400000 0x00 0x400>; + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 36 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 36 2>; + assigned-clock-parents = <&k3_clks 36 3>; + power-domains = <&k3_pds 36 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer1: timer@2410000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2410000 0x00 0x400>; + interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 37 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 37 2>; + assigned-clock-parents = <&k3_clks 37 3>; + power-domains = <&k3_pds 37 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer2: timer@2420000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2420000 0x00 0x400>; + interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 38 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 38 2>; + assigned-clock-parents = <&k3_clks 38 3>; + power-domains = <&k3_pds 38 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer3: timer@2430000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2430000 0x00 0x400>; + interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 39 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 39 2>; + assigned-clock-parents = <&k3_clks 39 3>; + power-domains = <&k3_pds 39 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer4: timer@2440000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2440000 0x00 0x400>; + interrupts = <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 40 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 40 2>; + assigned-clock-parents = <&k3_clks 40 3>; + power-domains = <&k3_pds 40 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer5: timer@2450000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2450000 0x00 0x400>; + interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 41 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 41 2>; + assigned-clock-parents = <&k3_clks 41 3>; + power-domains = <&k3_pds 41 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer6: timer@2460000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2460000 0x00 0x400>; + interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 42 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 42 2>; + assigned-clock-parents = <&k3_clks 42 3>; + power-domains = <&k3_pds 42 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer7: timer@2470000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2470000 0x00 0x400>; + interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 43 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 43 2>; + assigned-clock-parents = <&k3_clks 43 3>; + power-domains = <&k3_pds 43 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_uart0: serial@2800000 { compatible = "ti,am64-uart", "ti,am654-uart"; reg = <0x00 0x02800000 0x00 0x100>;
arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi +45 -0
51 lines not on this page · raw message
Signature · 1 line
2.37.1
PATCH 2/2 arm64: dts: ti: k3-am625-sk: Use pwm-led instead of gpio-led
On am625, pad c17 can be used either in gpio mode or pwm mode to control the connected led. Let's change to use pwm-led for additional brighness control.
The pwm controller is dmtimer7 for pad C17. We configure it for 128 Hz rate (1000000000 / 7812500) similar to what has been done elsewhere for pwm-leds.
--- arch/arm64/boot/dts/ti/k3-am625-sk.dts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/ti/k3-am625-sk.dts +12 -5
@@ -131,18 +131,25 @@ vdd_sd_dv: regulator-4 { }; leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; - pinctrl-0 = <&usr_led_pins_default>; + compatible = "pwm-leds"; led-0 { label = "am62-sk:green:heartbeat"; - gpios = <&main_gpio1 49 GPIO_ACTIVE_HIGH>; + pwms = <&main_pwm7 0 7812500 0>; + max-brightness = <255>; linux,default-trigger = "heartbeat"; function = LED_FUNCTION_HEARTBEAT; default-state = "off"; }; }; + + main_pwm7: dmtimer-main-pwm-7 { + pinctrl-0 = <&usr_led_pins_default>; + pinctrl-names = "default"; + compatible = "ti,omap-dmtimer-pwm"; + #pwm-cells = <3>; + ti,timers = <&main_timer7>; + }; }; &main_pmx0 {
@@ -203,7 +210,7 @@ AM62X_IOPAD(0x240, PIN_INPUT, 0) /* (D17) MMC1_SDCD */ usr_led_pins_default: usr-led-pins-default { pinctrl-single,pins = < - AM62X_IOPAD(0x244, PIN_OUTPUT, 7) /* (C17) MMC1_SDWP.GPIO1_49 */ + AM62X_IOPAD(0x244, PIN_OUTPUT, 2) /* (C17) MMC1_SDWP.TIMER_IO7 */ >; };
Signature · 1 line
2.37.1
Vignesh Raghavendra
maintainerQuoted 30 lines · Tony Lindgren
There are 8 general purpose timers on am65 that can be used for things like PWM using pwm-omap-dmtimer driver. There are also additional four timers in the MCU domain that do not have interrupts routable for Linux.
We configure the timers with the 25 MHz input clock by default as the 32.768 kHz clock may not be wired on the device. We leave the MCU domain timers clock mux unconfigured, and mark the MCU domain timers reserved. The MCU domain timers are likely reserved by the software for the ESM module.
Compared to am65, the timers on am62 do not have a dedicated IO mux for the timers. On am62, the timers have different interrupts, clocks and power domains compared to am65, and the MCU timers are at a different IO address.
Cc Keerthy <[email protected]>Cc Nishanth Menon <[email protected]>Cc Vignesh Raghavendra <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 97 ++++++++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi | 45 +++++++++++ 2 files changed, 142 insertions(+)arch/arm64/boot/dts/ti/k3-am62-main.dtsi +0
-0@@ -186,6 +186,103 @@ main_pmx0: pinctrl@f4000 { pinctrl-single,function-mask = <0xffffffff>; };
arch/arm64/boot/dts/ti/k3-am62-main.dtsi main_pmx0: pinctrl@f4000 { · line 197
Quoted 10 lines
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +9
-0+ main_timer0: timer@2400000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2400000 0x00 0x400>; + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 36 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 36 2>; + assigned-clock-parents = <&k3_clks 36 3>; + power-domains = <&k3_pds 36 TI_SCI_PD_EXCLUSIVE>;
I end up with
make dtbs_check
+/workdir/arch/arm64/boot/dts/ti/k3-am625-sk.dtb: timer@4800000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' +/workdir/arch/arm64/boot/dts/ti/k3-am625-sk.dtb: timer@4810000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' +/workdir/arch/arm64/boot/dts/ti/k3-am625-sk.dtb: timer@4820000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' +/workdir/arch/arm64/boot/dts/ti/k3-am625-sk.dtb: timer@4830000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+'
Looks like schema does not describe power-domains :(
[...]
Regards
Vignesh
Quoted 24 lines · Vignesh Raghavendra
arch/arm64/boot/dts/ti/k3-am62-main.dtsi main_pmx0: pinctrl@f4000 { · line 197
Quoted 13 lines · Tony Lindgren
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +9
-0@@ -186,6 +186,103 @@ main_pmx0: pinctrl@f4000 { pinctrl-single,function-mask = <0xffffffff>; }; + main_timer0: timer@2400000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2400000 0x00 0x400>; + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 36 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 36 2>; + assigned-clock-parents = <&k3_clks 36 3>; + power-domains = <&k3_pds 36 TI_SCI_PD_EXCLUSIVE>;I end up with
make
dtbs_check(quoted diff) +4
-0+/workdir/arch/arm64/boot/dts/ti/k3-am625-sk.dtb: timer@4800000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' +/workdir/arch/arm64/boot/dts/ti/k3-am625-sk.dtb: timer@4810000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' +/workdir/arch/arm64/boot/dts/ti/k3-am625-sk.dtb: timer@4820000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' +/workdir/arch/arm64/boot/dts/ti/k3-am625-sk.dtb: timer@4830000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+'
Quoted 1 line
Looks like schema does not describe power-domains :(
Thanks for catching it, I've sent a patch for the binding for this at [0] below.
Regards,
Tony
[0] https://lore.kernel.org/linux-devicetree/[email protected]/T/#u
Hi,
Quoted 176 lines · Tony Lindgren
There are 8 general purpose timers on am65 that can be used for things like PWM using pwm-omap-dmtimer driver. There are also additional four timers in the MCU domain that do not have interrupts routable for Linux.
We configure the timers with the 25 MHz input clock by default as the 32.768 kHz clock may not be wired on the device. We leave the MCU domain timers clock mux unconfigured, and mark the MCU domain timers reserved. The MCU domain timers are likely reserved by the software for the ESM module.
Compared to am65, the timers on am62 do not have a dedicated IO mux for the timers. On am62, the timers have different interrupts, clocks and power domains compared to am65, and the MCU timers are at a different IO address.
Cc Keerthy <[email protected]>Cc Nishanth Menon <[email protected]>Cc Vignesh Raghavendra <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 97 ++++++++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi | 45 +++++++++++ 2 files changed, 142 insertions(+)arch/arm64/boot/dts/ti/k3-am62-main.dtsi +97
-0@@ -186,6 +186,103 @@ main_pmx0: pinctrl@f4000 { pinctrl-single,function-mask = <0xffffffff>; }; + main_timer0: timer@2400000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2400000 0x00 0x400>; + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 36 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 36 2>; + assigned-clock-parents = <&k3_clks 36 3>; + power-domains = <&k3_pds 36 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer1: timer@2410000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2410000 0x00 0x400>; + interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 37 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 37 2>; + assigned-clock-parents = <&k3_clks 37 3>; + power-domains = <&k3_pds 37 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer2: timer@2420000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2420000 0x00 0x400>; + interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 38 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 38 2>; + assigned-clock-parents = <&k3_clks 38 3>; + power-domains = <&k3_pds 38 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer3: timer@2430000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2430000 0x00 0x400>; + interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 39 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 39 2>; + assigned-clock-parents = <&k3_clks 39 3>; + power-domains = <&k3_pds 39 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer4: timer@2440000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2440000 0x00 0x400>; + interrupts = <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 40 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 40 2>; + assigned-clock-parents = <&k3_clks 40 3>; + power-domains = <&k3_pds 40 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer5: timer@2450000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2450000 0x00 0x400>; + interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 41 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 41 2>; + assigned-clock-parents = <&k3_clks 41 3>; + power-domains = <&k3_pds 41 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer6: timer@2460000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2460000 0x00 0x400>; + interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 42 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 42 2>; + assigned-clock-parents = <&k3_clks 42 3>; + power-domains = <&k3_pds 42 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_timer7: timer@2470000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x2470000 0x00 0x400>; + interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&k3_clks 43 2>; + clock-names = "fck"; + assigned-clocks = <&k3_clks 43 2>; + assigned-clock-parents = <&k3_clks 43 3>; + power-domains = <&k3_pds 43 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + }; + + main_uart0: serial@2800000 { compatible = "ti,am64-uart", "ti,am654-uart"; reg = <0x00 0x02800000 0x00 0x100>;arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi +38
-0@@ -14,6 +14,51 @@ mcu_pmx0: pinctrl@4084000 { pinctrl-single,function-mask = <0xffffffff>; }; + /* + * The MCU domain timer interrupts are routed only to the ESM module, + * and not currently available for Linux. The MCU domain timers are + * of limited use without interrupts, and likely reserved by the ESM. + */ + mcu_timer0: timer@4800000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x4800000 0x00 0x400>; + clocks = <&k3_clks 35 2>; + clock-names = "fck"; + power-domains = <&k3_pds 35 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + status = "reserved"; + }; + + mcu_timer1: timer@4810000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x4810000 0x00 0x400>; + clocks = <&k3_clks 48 2>; + clock-names = "fck"; + power-domains = <&k3_pds 48 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + status = "reserved"; + }; + + mcu_timer2: timer@4820000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x4820000 0x00 0x400>; + clocks = <&k3_clks 49 2>; + clock-names = "fck"; + power-domains = <&k3_pds 49 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + status = "reserved"; + }; + + mcu_timer3: timer@4830000 { + compatible = "ti,am654-timer"; + reg = <0x00 0x4830000 0x00 0x400>;
arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi mcu_pmx0: pinctrl@4084000 { · line 64
Quoted 10 lines
arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi +7
-0+ clocks = <&k3_clks 50 2>; + clock-names = "fck"; + power-domains = <&k3_pds 50 TI_SCI_PD_EXCLUSIVE>; + ti,timer-pwm; + status = "reserved"; + }; + mcu_uart0: serial@4a00000 { compatible = "ti,am64-uart", "ti,am654-uart"; reg = <0x00 0x04a00000 0x00 0x100>;
The "power-domains" property fix for the binding was merged recently.
Signature · 2 lines
Regards, Georgi
Re: [PATCH 2/2] arm64: dts: ti: k3-am625-sk: Use pwm-led instead of gpio-led
In reply to Tony LindgrenHi,
Quoted 50 lines · Tony Lindgren
On am625, pad c17 can be used either in gpio mode or pwm mode to control the connected led. Let's change to use pwm-led for additional brighness control.
The pwm controller is dmtimer7 for pad C17. We configure it for 128 Hz rate (1000000000 / 7812500) similar to what has been done elsewhere for pwm-leds.
Cc Keerthy <[email protected]>Cc Nishanth Menon <[email protected]>Cc Vignesh Raghavendra <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- arch/arm64/boot/dts/ti/k3-am625-sk.dts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)arch/arm64/boot/dts/ti/k3-am625-sk.dts +11
-4@@ -131,18 +131,25 @@ vdd_sd_dv: regulator-4 { }; leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; - pinctrl-0 = <&usr_led_pins_default>; + compatible = "pwm-leds"; led-0 { label = "am62-sk:green:heartbeat"; - gpios = <&main_gpio1 49 GPIO_ACTIVE_HIGH>; + pwms = <&main_pwm7 0 7812500 0>; + max-brightness = <255>; linux,default-trigger = "heartbeat"; function = LED_FUNCTION_HEARTBEAT; default-state = "off"; }; }; + + main_pwm7: dmtimer-main-pwm-7 { + pinctrl-0 = <&usr_led_pins_default>; + pinctrl-names = "default"; + compatible = "ti,omap-dmtimer-pwm"; + #pwm-cells = <3>; + ti,timers = <&main_timer7>; + }; }; &main_pmx0 {
arch/arm64/boot/dts/ti/k3-am625-sk.dts AM62X_IOPAD(0x240, PIN_INPUT, 0) /* (D17) MMC1_SDCD */ · line 216
Quoted 8 lines
arch/arm64/boot/dts/ti/k3-am625-sk.dts +1
-1@@ -203,7 +210,7 @@ AM62X_IOPAD(0x240, PIN_INPUT, 0) /* (D17) MMC1_SDCD */ usr_led_pins_default: usr-led-pins-default { pinctrl-single,pins = < - AM62X_IOPAD(0x244, PIN_OUTPUT, 7) /* (C17) MMC1_SDWP.GPIO1_49 */ + AM62X_IOPAD(0x244, PIN_OUTPUT, 2) /* (C17) MMC1_SDWP.TIMER_IO7 */ >; };
Looking good on SK-AM625 E3.
Just for a reference, I also checked the PWM output for TIMER_IO2 (C15) and TIMER_IO3 (E15).
Signature · 2 lines
Regards, Georgi