Skip to contentSkip to conversation

dt-bindings: timer: Add PWM compatible for X1000 SoC

PATCH In review Aidan MacDonald 3 participants 5 messages Feb 24, 2022 – Apr 22, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 dt-bindings: timer: Add PWM compatible for X1000 SoC

The PWM hardware on the X1000 SoC is almost identical to other Ingenic SoCs, so it can be used with only minor driver changes.

---
It seems Thierry picked up the driver patch separately (thanks for that) so here's the DTS changes on their own. Would've uploaded a v2 sooner but I was busy the past couple weeks and couldn't spend any time on kernel stuff. I guess this isn't a v2 per se, but for completeness:

v1: https://lore.kernel.org/linux-mips/[email protected]/

 Documentation/devicetree/bindings/timer/ingenic,tcu.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/timer/ingenic,tcu.yaml +1 -0
index 7fb37eae9da7..d541cf2067bc 100644
@@ -152,6 +152,7 @@ patternProperties:
           - enum:
               - ingenic,jz4740-pwm
               - ingenic,jz4725b-pwm
+              - ingenic,x1000-pwm
           - items:
               - enum:
                   - ingenic,jz4760-pwm
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 2/2 mips: dts: ingenic: x1000: Add PWM device tree node

Copied from the jz4740 devicetree and trimmed to 5 timers, which is what the hardware supports.

---
 arch/mips/boot/dts/ingenic/x1000.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/mips/boot/dts/ingenic/x1000.dtsi +13 -0
index 8bd27edef216..0dcf37527c8e 100644
@@ -127,6 +127,19 @@ wdt: watchdog@0 {
 			clocks = <&tcu TCU_CLK_WDT>;
 			clock-names = "wdt";
 		};
+
+		pwm: pwm@40 {
+			compatible = "ingenic,x1000-pwm";
+			reg = <0x40 0x80>;
+
+			#pwm-cells = <3>;
+
+			clocks = <&tcu TCU_CLK_TIMER0>, <&tcu TCU_CLK_TIMER1>,
+				 <&tcu TCU_CLK_TIMER2>, <&tcu TCU_CLK_TIMER3>,
+				 <&tcu TCU_CLK_TIMER4>;
+			clock-names = "timer0", "timer1", "timer2",
+				      "timer3", "timer4";
+		};
 	};
 
 	rtc: rtc@10003000 {
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v2 2/2] mips: dts: ingenic: x1000: Add PWM device tree node

Quoted 7 lines · Aidan MacDonald

Copied from the jz4740 devicetree and trimmed to 5 timers, which is what the hardware supports.

---
 arch/mips/boot/dts/ingenic/x1000.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

However I don't see this upstream yet, neither in Linus' tree nor in linux-next. Paul, do you still have this on your radar?

Thierry

Quoted 28 lines
arch/mips/boot/dts/ingenic/x1000.dtsi +13 -0
index 8bd27edef216..0dcf37527c8e 100644
@@ -127,6 +127,19 @@ wdt: watchdog@0 {
 			clocks = <&tcu TCU_CLK_WDT>;
 			clock-names = "wdt";
 		};
+
+		pwm: pwm@40 {
+			compatible = "ingenic,x1000-pwm";
+			reg = <0x40 0x80>;
+
+			#pwm-cells = <3>;
+
+			clocks = <&tcu TCU_CLK_TIMER0>, <&tcu TCU_CLK_TIMER1>,
+				 <&tcu TCU_CLK_TIMER2>, <&tcu TCU_CLK_TIMER3>,
+				 <&tcu TCU_CLK_TIMER4>;
+			clock-names = "timer0", "timer1", "timer2",
+				      "timer3", "timer4";
+		};
 	};
 
 	rtc: rtc@10003000 {
Signature · 1 line
2.34.1
maintainer Reviewed-by
#3 lore raw

Re: [PATCH v2 2/2] mips: dts: ingenic: x1000: Add PWM device tree node

Hi Thierry,

Quoted 11 lines · Thierry Reding
Quoted 7 lines · Aidan MacDonald

Copied from the jz4740 devicetree and trimmed to 5 timers, which is what the hardware supports.

---

  arch/mips/boot/dts/ingenic/x1000.dtsi | 13 +++++++++++++
  1 file changed, 13 insertions(+)

However I don't see this upstream yet, neither in Linus' tree nor in linux-next. Paul, do you still have this on your radar?

I don't have a tree so that would be a patch for Thomas (Cc'd) to go through the linux-mips tree. (Note to Thomas: patch 1 is already applied in the pwm tree)

The changes look good though, so:

Cheers,
-Paul

Quoted 32 lines

Thierry

Quoted 29 lines

diff --git a/arch/mips/boot/dts/ingenic/x1000.dtsi
b/arch/mips/boot/dts/ingenic/x1000.dtsi
index 8bd27edef216..0dcf37527c8e 100644
--- a/arch/mips/boot/dts/ingenic/x1000.dtsi +++ b/arch/mips/boot/dts/ingenic/x1000.dtsi @@ -127,6 +127,19 @@ wdt: watchdog@0 {
clocks = <&tcu TCU_CLK_WDT>; clock-names = "wdt";
};
+
+ pwm: pwm@40 {
+ compatible = "ingenic,x1000-pwm";
+ reg = <0x40 0x80>;
+
+ #pwm-cells = <3>;
+
+ clocks = <&tcu TCU_CLK_TIMER0>, <&tcu TCU_CLK_TIMER1>,
+ <&tcu TCU_CLK_TIMER2>, <&tcu TCU_CLK_TIMER3>,
+ <&tcu TCU_CLK_TIMER4>;
+ clock-names = "timer0", "timer1", "timer2",
+ "timer3", "timer4";
+ };
};

rtc: rtc@10003000 {
--
2.34.1

#4 lore raw
In reply to Aidan MacDonald
Quoted 11 lines · Aidan MacDonald

The PWM hardware on the X1000 SoC is almost identical to other Ingenic SoCs, so it can be used with only minor driver changes.

---
It seems Thierry picked up the driver patch separately (thanks for that) so here's the DTS changes on their own. Would've uploaded a v2 sooner but I was busy the past couple weeks and couldn't spend any time on kernel stuff. I guess this isn't a v2 per se, but for completeness:

Quoted 4 lines

v1: https://lore.kernel.org/linux-mips/[email protected]/

 Documentation/devicetree/bindings/timer/ingenic,tcu.yaml | 1 +
 1 file changed, 1 insertion(+)

Looks like I also somehow ended up applying this snippet, though possibly from the earlier patch.

Thierry