Re: [RFC PATCH 0/3] Make TI dmtimer features more usable

From: Tony Lindgren
Date: Mon Oct 31 2022 - 08:07:18 EST


* Tony Lindgren <tony@xxxxxxxxxxx> [221031 11:46]:
> I have only lightly tested this so far to make sure I get clock output on
> k3-am625-sk on TIMER_IO2 at user expansion connector pin 10.

For reference, I used something like the patch below to configure the timer2
for clock output.

Regards,

Tony

8< ---------------------
diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
--- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
@@ -143,6 +143,25 @@ led-0 {
default-state = "off";
};
};
+
+ main_pwm2: dmtimer-main-pwm-2 {
+ pinctrl-0 = <&main_timer2_pins_default>;
+ pinctrl-names = "default";
+ compatible = "ti,omap-dmtimer-pwm";
+ #pwm-cells = <3>;
+ ti,timers = <&main_timer2>;
+ interrupts-extended = <&main_timer2 2 IRQ_TYPE_EDGE_RISING>,
+ <&main_timer2 1 IRQ_TYPE_EDGE_RISING>,
+ <&main_timer2 0 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "compare", "overflow", "match";
+ clocks = <&main_timer2>;
+ };
+};
+
+&main_timer2 {
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ #clock-cells = <0>;
};

&main_pmx0 {
@@ -270,6 +289,13 @@ AM62X_IOPAD(0x07c, PIN_OUTPUT, 7) /* (P25) GPMC0_CLK.GPIO0_31 */
>;
};

+ main_timer2_pins_default: main-timer2-pins-default {
+ pinctrl-single,pins = <
+ /* (C15) PADCFG_CTRL_PADCONFIG118 0x000f41d8 TIMER_IO2 */
+ AM65X_IOPAD(0x1d8, PIN_OUTPUT, 2)
+ >;
+ };
+
main_gpio1_ioexp_intr_pins_default: main-gpio1-ioexp-intr-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x01d4, PIN_INPUT, 7) /* (B15) UART0_RTSn.GPIO1_23 */