Skip to contentSkip to conversation

Add DTS node for FTM PWM

PATCH New Xiubo Li 3 participants 8 messages Mar 24, 2014 – Jul 30, 2014 Device tree bindings

lore
Share & tools
lore

Xiubo Li

author
#0 lore raw

v2 cover Add DTS node for FTM PWM

Changes in v2:
- Fix the issues pointed by Shawn.

Xiubo Li (3):
ARM: dts: vf610: Add Freescale FTM PWM node. ==> resend v10
ARM: dts: vf610-twr: Add PWM0's pinctrl node ==> new
ARM: dts: vf610-twr: Enables FTM PWM device. ==> resend v10

 arch/arm/boot/dts/vf610-twr.dts | 17 +++++++++++++++++
 arch/arm/boot/dts/vf610.dtsi    | 13 +++++++++++++
 2 files changed, 30 insertions(+)
Signature · 1 line
1.8.4
author
#1 lore raw

PATCH v2 1/3 ARM: dts: vf610: Add Freescale FTM PWM node.

This adds devicetree node for VF610, and there are 8 channels supported.

---
 arch/arm/boot/dts/vf610.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/vf610.dtsi +13 -0
index acf544e..2a7917e 100644
@@ -183,6 +183,19 @@
 				clock-names = "pit";
 			};
 
+			pwm0: pwm at 40038000 {
+				compatible = "fsl,vf610-ftm-pwm";
+				#pwm-cells = <3>;
+				reg = <0x40038000 0x1000>;
+				clock-names = "ftm_sys", "ftm_ext",
+					      "ftm_fix", "ftm_cnt_clk_en";
+				clocks = <&clks VF610_CLK_FTM0>,
+					<&clks VF610_CLK_FTM0_EXT_SEL>,
+					<&clks VF610_CLK_FTM0_FIX_SEL>,
+					<&clks VF610_CLK_FTM0_EXT_FIX_EN>;
+				status = "disabled";
+			};
+
 			adc0: adc at 4003b000 {
 				compatible = "fsl,vf610-adc";
 				reg = <0x4003b000 0x1000>;
Signature · 1 line
1.8.4
author
#2 lore raw

PATCH v2 2/3 ARM: dts: vf610-twr: Add PWM0's pinctrl node

In reply to Xiubo Li
---
 arch/arm/boot/dts/vf610-twr.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm/boot/dts/vf610-twr.dts +11 -0
index f3af8ea..3fabdb5 100644
@@ -213,6 +213,17 @@
 			>;
 		};
 
+		pinctrl_pwm0: pwm0grp {
+			fsl,pins = <
+				VF610_PAD_PTB0__FTM0_CH0		0x1582
+				VF610_PAD_PTB1__FTM0_CH1		0x1582
+				VF610_PAD_PTB2__FTM0_CH2		0x1582
+				VF610_PAD_PTB3__FTM0_CH3		0x1582
+				VF610_PAD_PTB6__FTM0_CH6		0x1582
+				VF610_PAD_PTB7__FTM0_CH7		0x1582
+			>;
+		};
+
 		pinctrl_sai2: sai2grp {
 			fsl,pins = <
 				VF610_PAD_PTA16__SAI2_TX_BCLK		0x02ed
Signature · 1 line
1.8.4
#3 lore raw

PATCH v2 2/3 ARM: dts: vf610-twr: Add PWM0's pinctrl node

Quoted 5 lines · Li.Xiubo at freescale.com

---
arch/arm/boot/dts/vf610-twr.dts | 11 +++++++++++

1 file changed, 11 insertions(+)
Quoted 8 lines
(quoted diff) +0 -0

b/arch/arm/boot/dts/vf610-twr.dts index f3af8ea..3fabdb5 100644 --- a/arch/arm/boot/dts/vf610-twr.dts +++ b/arch/arm/boot/dts/vf610-twr.dts @@ -213,6 +213,17 @@

			>;
		};

+ pinctrl_pwm0: pwm0grp { + fsl,pins = < + VF610_PAD_PTB0__FTM0_CH0

Hi Xiubo,

I think you added this for the tower audio board? Maybe the beeper? Are these lines needed?

+ VF610_PAD_PTB6__FTM0_CH6 0x1582
+ VF610_PAD_PTB7__FTM0_CH7 0x1582

According to my tower schematics, PTB6 routes to the Primary B35/GPIO4, and B40/FTM0CH6/PWM4 and to the jumpers J23. PTB7 routes to B39/FTM0CH7/PWM5, EIRQ3/B55/B56, and jumper J24. I think that most people have some tower serial card which can also route these lines and/or they are sent to the OpenSDA chip which does a ttyACM (USB serial) on all Tower main boards.

Did you just add all FTM channels 0-7 in the DTS? Or are each and every one mapped to a pin on the expansion/riser boards. Could we remove the two lines above and use,

	pinctrl_uart2: uart2grp {
		fsl,pins = <
                        VF610_PAD_PTB6__UART2_TX                0x21a2
                        VF610_PAD_PTB7__UART2_RX                0x21a1
		>;
	};

So that the PTB6/7 map to UART2? Or are these indeed a conflict with some audio board (or other)? I think it might be valuable to add the 'ttyLP2' to the vf610-twr. An MMC image could echo 'wrong serial port, set J23/24' for instance to tell people that the serial console was not connected properly (or something else). People may also wish to use a serial interface for other peripherals or as a 2nd debug port.

Thanks,
Bill Pringlemeir.

#4 lore raw

PATCH v2 2/3 ARM: dts: vf610-twr: Add PWM0's pinctrl node

Hi Bill Pringlemeir,

Quoted 7 lines
Quoted 7 lines
(quoted diff) +0 -0

b/arch/arm/boot/dts/vf610-twr.dts index f3af8ea..3fabdb5 100644 --- a/arch/arm/boot/dts/vf610-twr.dts +++ b/arch/arm/boot/dts/vf610-twr.dts @@ -213,6 +213,17 @@

			>;
		};
Quoted 5 lines
Quoted 1 line

+ pinctrl_pwm0: pwm0grp { + fsl,pins = < + VF610_PAD_PTB0__FTM0_CH0

Hi Xiubo,

I think you added this for the tower audio board? Maybe the beeper?

For the PWM leds and beepers, for now only the ch0~ch3 are used here.

Quoted 23 lines

Are these lines needed?

arch/arm/boot/dts/vf610-twr.dts +2 -0
+	VF610_PAD_PTB6__FTM0_CH6		0x1582
+	VF610_PAD_PTB7__FTM0_CH7		0x1582

According to my tower schematics, PTB6 routes to the Primary B35/GPIO4, and B40/FTM0CH6/PWM4 and to the jumpers J23. PTB7 routes to B39/FTM0CH7/PWM5, EIRQ3/B55/B56, and jumper J24. I think that most people have some tower serial card which can also route these lines and/or they are sent to the OpenSDA chip which does a ttyACM (USB serial) on all Tower main boards.

Did you just add all FTM channels 0-7 in the DTS? Or are each and every one mapped to a pin on the expansion/riser boards. Could we remove the two lines above and use,

	pinctrl_uart2: uart2grp {
		fsl,pins = <
                        VF610_PAD_PTB6__UART2_TX                0x21a2
                        VF610_PAD_PTB7__UART2_RX                0x21a1
		>;
	};
Quoted 2 lines

So that the PTB6/7 map to UART2? Or are these indeed a conflict with some audio board (or other)?

There hasn't any confliction with audio board as far as I know. I think they can be removed.

Quoted 6 lines

I think it might be valuable to add the
'ttyLP2' to the vf610-twr. An MMC image could echo 'wrong serial port, set J23/24' for instance to tell people that the serial console was not connected properly (or something else). People may also wish to use a serial interface for other peripherals or as a 2nd debug port.

Hum, if so I think it's okay.

@Shawn,

Do you have any comments here ?

Thanks,

BRs
Xiubo

Quoted 2 lines

Thanks,
Bill Pringlemeir.

#5 lore raw

PATCH v2 2/3 ARM: dts: vf610-twr: Add PWM0's pinctrl node

Quoted 7 lines · On Wed, Jul 30, 2014 at 10:11:48AM +0800, Xiubo Li-B47053 wrote:
Quoted 6 lines

I think it might be valuable to add the
'ttyLP2' to the vf610-twr. An MMC image could echo 'wrong serial port, set J23/24' for instance to tell people that the serial console was not connected properly (or something else). People may also wish to use a serial interface for other peripherals or as a 2nd debug port.

Quoted 5 lines

Hum, if so I think it's okay.

@Shawn,

Do you have any comments here ?

I'm fine with leaving the pins to serial interface, if it makes the most sense to most people, which sounds like the case from your discussion.

Shawn

author
#6 lore raw

PATCH v2 3/3 ARM: dts: vf610-twr: Enables FTM PWM device.

In reply to Xiubo Li
---
 arch/arm/boot/dts/vf610-twr.dts | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/vf610-twr.dts +6 -0
index 3fabdb5..c016ec8 100644
@@ -245,6 +245,12 @@
 	};
 };
 
+&pwm0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm0>;
+	status = "okay";
+};
+
 &sai2 {
 	#sound-dai-cells = <0>;
 	pinctrl-names = "default";
Signature · 1 line
1.8.4
Applied
#7 lore raw

v2 cover Add DTS node for FTM PWM

In reply to Xiubo Li
Quoted 4 lines · Xiubo Li

Xiubo Li (3):
ARM: dts: vf610: Add Freescale FTM PWM node. ==> resend v10
ARM: dts: vf610-twr: Add PWM0's pinctrl node ==> new
ARM: dts: vf610-twr: Enables FTM PWM device. ==> resend v10

Applied all, thanks.