Skip to contentSkip to conversation

ARM: dtsi: add pwm node for sun8i.

PATCH Superseded hao_zhang 3 participants 4 messages Feb 25, 2018 – May 14, 2018

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

hao_zhang

author
#0 lore raw

PATCH v2 2/4 ARM: dtsi: add pwm node for sun8i.

This patch adds pwm node for sun8i.

---
 arch/arm/boot/dts/sun8i-r40.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/sun8i-r40.dtsi +13 -0
index 173dcc1..99a0261 100644
@@ -295,6 +295,11 @@
 				bias-pull-up;
 			};
 
+			pwm_ch0_pin: pwm-ch0-pin {
+				pins = "PB2";
+				function = "pwm";
+			};
+
 			uart0_pb_pins: uart0-pb-pins {
 				pins = "PB22", "PB23";
 				function = "uart0";
@@ -306,6 +311,14 @@
 			reg = <0x01c20c90 0x10>;
 		};
 
+		pwm: pwm at 1c23400 {
+			     compatible = "allwinner,sun8i-r40-pwm";
+			     reg = <0x01c23400 0x154>;
+			     clocks = <&osc24M>;
+			     #pwm-cells = <3>;
+			     status = "disabled";
+		};
+
 		uart0: serial at 1c28000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28000 0x400>;
Signature · 1 line
2.7.4
#1 lore raw
Quoted 24 lines · hao_zhang

This patch adds pwm node for sun8i.

---
 arch/arm/boot/dts/sun8i-r40.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/sun8i-r40.dtsi +5 -0
index 173dcc1..99a0261 100644
@@ -295,6 +295,11 @@
 				bias-pull-up;
 			};
 
+			pwm_ch0_pin: pwm-ch0-pin {
+				pins = "PB2";
+				function = "pwm";
+			};
+
 			uart0_pb_pins: uart0-pb-pins {
 				pins = "PB22", "PB23";
 				function = "uart0";

arch/arm/boot/dts/sun8i-r40.dtsi line 316

Quoted 6 lines
arch/arm/boot/dts/sun8i-r40.dtsi +3 -0
@@ -306,6 +311,14 @@
 			reg = <0x01c20c90 0x10>;
 		};
 
+		pwm: pwm at 1c23400 {
+			     compatible = "allwinner,sun8i-r40-pwm";
+			     reg = <0x01c23400 0x154>;

The size must be the size of the whole memory block allocated to the controller, so that would be 0x400 in this case.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180226/01b8f6e2/attachment-0001.sig>
#2 lore raw
In reply to hao_zhang

Hi,

The subject line should mention the R40, there are far too many sun8i SoCs.

Quoted 24 lines · hao_zhang

This patch adds pwm node for sun8i.

---
 arch/arm/boot/dts/sun8i-r40.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/sun8i-r40.dtsi +5 -0
index 173dcc1..99a0261 100644
@@ -295,6 +295,11 @@
 				bias-pull-up;
 			};
 
+			pwm_ch0_pin: pwm-ch0-pin {
+				pins = "PB2";
+				function = "pwm";
+			};
+
 			uart0_pb_pins: uart0-pb-pins {
 				pins = "PB22", "PB23";
 				function = "uart0";

arch/arm/boot/dts/sun8i-r40.dtsi line 316

Quoted 6 lines
arch/arm/boot/dts/sun8i-r40.dtsi +3 -0
@@ -306,6 +311,14 @@
 			reg = <0x01c20c90 0x10>;
 		};
 
+		pwm: pwm at 1c23400 {
+			     compatible = "allwinner,sun8i-r40-pwm";
+			     reg = <0x01c23400 0x154>;

Following my comments on the binding document:

			interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;

arch/arm/boot/dts/sun8i-r40.dtsi line 317

Quoted 1 line
arch/arm/boot/dts/sun8i-r40.dtsi +1 -0
+			     clocks = <&osc24M>;

And possibly multiple clocks here (though I fail to find the APB1 clock being exposed by our CCU).

Cheers,
Andre.

Quoted 8 lines
arch/arm/boot/dts/sun8i-r40.dtsi +4 -0
+			     #pwm-cells = <3>;
+			     status = "disabled";
+		};
+
 		uart0: serial at 1c28000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28000 0x400>;
author
#3 lore raw

2018-02-28 9:53 GMT+08:00 Andr? Przywara <[email protected]>:

Quoted 3 lines

Hi,

The subject line should mention the R40, there are far too many sun8i SoCs.

Okey.

Quoted 34 lines · hao_zhang
Quoted 24 lines

This patch adds pwm node for sun8i.

---
 arch/arm/boot/dts/sun8i-r40.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/sun8i-r40.dtsi +5 -0
index 173dcc1..99a0261 100644
@@ -295,6 +295,11 @@
                              bias-pull-up;
                      };
 
+                     pwm_ch0_pin: pwm-ch0-pin {
+                             pins = "PB2";
+                             function = "pwm";
+                     };
+
                      uart0_pb_pins: uart0-pb-pins {
                              pins = "PB22", "PB23";
                              function = "uart0";

arch/arm/boot/dts/sun8i-r40.dtsi line 316

Quoted 6 lines
arch/arm/boot/dts/sun8i-r40.dtsi +3 -0
@@ -306,6 +311,14 @@
                      reg = <0x01c20c90 0x10>;
              };
 
+             pwm: pwm at 1c23400 {
+                          compatible = "allwinner,sun8i-r40-pwm";
+                          reg = <0x01c23400 0x154>;

Following my comments on the binding document:

Quoted 6 lines
                        interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;

arch/arm/boot/dts/sun8i-r40.dtsi line 317

Quoted 1 line
arch/arm/boot/dts/sun8i-r40.dtsi +1 -0
+                          clocks = <&osc24M>;

And possibly multiple clocks here (though I fail to find the APB1 clock being exposed by our CCU).

It seem CCU dosen't support APB1 clock for R40 PWM...

Quoted 13 lines

Cheers,
Andre.

Quoted 8 lines
arch/arm/boot/dts/sun8i-r40.dtsi +4 -0
+                          #pwm-cells = <3>;
+                          status = "disabled";
+             };
+
              uart0: serial at 1c28000 {
                      compatible = "snps,dw-apb-uart";
                      reg = <0x01c28000 0x400>;