Skip to contentSkip to conversation

Enable eQEP counter driver on BeagleBone Blue

PATCH In review David Lechner 2 participants 6 messages Oct 12, 2020 – Nov 16, 2020

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

cover Enable eQEP counter driver on BeagleBone Blue

This series adds device tree nodes for the eQEP portion of the PWMSS on AM33xx and enables it on BeagleBone Blue.

I actually submitted these a year ago, but it looks like these patches never got applied with the actual eQEP driver when it was merged.

For reference, there was some previous discussion about the clocks in "ARM: dts:
am33xx: Add nodes for eQEP". [1]

[1]: https://lore.kernel.org/linux-omap/[email protected]/

I have also included a new patch to enable the eQEP driver in the defconfig.

David Lechner (3):
ARM: dts: am33xx: Add nodes for eQEP
ARM: dts: am335x-boneblue: Enable eQEP
ARM: omap2plus_defconfig: Enable TI eQEP counter driver

 arch/arm/boot/dts/am335x-boneblue.dts | 54 +++++++++++++++++++++++++++
 arch/arm/boot/dts/am33xx-l4.dtsi      | 27 ++++++++++++++
 arch/arm/configs/omap2plus_defconfig  |  2 +
 3 files changed, 83 insertions(+)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/3 ARM: dts: am33xx: Add nodes for eQEP

This adds new nodes for the Texas Instruments Enhanced Quadrature Encoder Pulse (eQEP) module in the PWM subsystem on AM33XX.

---
 arch/arm/boot/dts/am33xx-l4.dtsi | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
arch/arm/boot/dts/am33xx-l4.dtsi +27 -0
index b88d0caa4b2d..17910268df82 100644
@@ -1924,6 +1924,15 @@ ecap0: ecap@100 {
 					status = "disabled";
 				};
 
+				eqep0: counter@180 {
+					compatible = "ti,am3352-eqep";
+					reg = <0x180 0x80>;
+					clocks = <&l4ls_gclk>;
+					clock-names = "sysclkout";
+					interrupts = <79>;
+					status = "disabled";
+				};
+
 				ehrpwm0: pwm@200 {
 					compatible = "ti,am3352-ehrpwm",
 						     "ti,am33xx-ehrpwm";
@@ -1976,6 +1985,15 @@ ecap1: ecap@100 {
 					status = "disabled";
 				};
 
+				eqep1: counter@180 {
+					compatible = "ti,am3352-eqep";
+					reg = <0x180 0x80>;
+					clocks = <&l4ls_gclk>;
+					clock-names = "sysclkout";
+					interrupts = <88>;
+					status = "disabled";
+				};
+
 				ehrpwm1: pwm@200 {
 					compatible = "ti,am3352-ehrpwm",
 						     "ti,am33xx-ehrpwm";
@@ -2028,6 +2046,15 @@ ecap2: ecap@100 {
 					status = "disabled";
 				};
 
+				eqep2: counter@180 {
+					compatible = "ti,am3352-eqep";
+					reg = <0x180 0x80>;
+					clocks = <&l4ls_gclk>;
+					clock-names = "sysclkout";
+					interrupts = <89>;
+					status = "disabled";
+				};
+
 				ehrpwm2: pwm@200 {
 					compatible = "ti,am3352-ehrpwm",
 						     "ti,am33xx-ehrpwm";
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/3 ARM: dts: am335x-boneblue: Enable eQEP

In reply to David Lechner

This enables the Enhanced Quadrature Encoder Pulse (eQEP) module for connectors E1, E2 and E3 on BeagleBone Blue.

---
 arch/arm/boot/dts/am335x-boneblue.dts | 54 +++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
arch/arm/boot/dts/am335x-boneblue.dts +54 -0
index c696d57cf364..69acaf4ea0f3 100644
@@ -241,6 +241,30 @@ AM33XX_PADCONF(AM335X_PIN_UART0_CTSN, PIN_OUTPUT, MUX_MODE2)		/* (E18) uart0_cts
 			AM33XX_PADCONF(AM335X_PIN_MII1_RXD0, PIN_OUTPUT, MUX_MODE7)		/* (M16) gmii1_rxd0.gpio2[21] */
 		>;
 	};
+
+	/* E1 */
+	eqep0_pins: pinmux_eqep0_pins {
+		pinctrl-single,pins = <
+			AM33XX_PADCONF(AM335X_PIN_MCASP0_AXR0, PIN_INPUT, MUX_MODE1)		/* (B12) mcasp0_aclkr.eQEP0A_in */
+			AM33XX_PADCONF(AM335X_PIN_MCASP0_FSR, PIN_INPUT, MUX_MODE1)		/* (C13) mcasp0_fsr.eQEP0B_in */
+		>;
+	};
+
+	/* E2 */
+	eqep1_pins: pinmux_eqep1_pins {
+		pinctrl-single,pins = <
+			AM33XX_PADCONF(AM335X_PIN_LCD_DATA12, PIN_INPUT, MUX_MODE2)		/* (V2) lcd_data12.eQEP1A_in */
+			AM33XX_PADCONF(AM335X_PIN_LCD_DATA13, PIN_INPUT, MUX_MODE2)		/* (V3) lcd_data13.eQEP1B_in */
+		>;
+	};
+
+	/* E3 */
+	eqep2_pins: pinmux_eqep2_pins {
+		pinctrl-single,pins = <
+			AM33XX_PADCONF(AM335X_PIN_GPMC_AD12, PIN_INPUT, MUX_MODE4)		/* (T12) gpmc_ad12.eQEP2A_in */
+			AM33XX_PADCONF(AM335X_PIN_GPMC_AD13, PIN_INPUT, MUX_MODE4)		/* (R12) gpmc_ad13.eQEP2B_in */
+		>;
+	};
 };
 
 &uart0 {
@@ -419,3 +443,33 @@ ls_buf_en {
 		line-name = "LS_BUF_EN";
 	};
 };
+
+&epwmss0 {
+	status = "okay";
+};
+
+&eqep0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&eqep0_pins>;
+	status = "okay";
+};
+
+&epwmss1 {
+	status = "okay";
+};
+
+&eqep1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&eqep1_pins>;
+	status = "okay";
+};
+
+&epwmss2 {
+	status = "okay";
+};
+
+&eqep2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&eqep2_pins>;
+	status = "okay";
+};
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/3 ARM: omap2plus_defconfig: Enable TI eQEP counter driver

In reply to David Lechner

This enables the TI eQEP counter driver that is used by BeagleBone Blue.

---
 arch/arm/configs/omap2plus_defconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/configs/omap2plus_defconfig +2 -0
index fe383f5a92fb..71b1a8f4c241 100644
@@ -524,6 +524,8 @@ CONFIG_PHY_DM816X_USB=m
 CONFIG_OMAP_USB2=m
 CONFIG_TI_PIPE3=y
 CONFIG_TWL4030_USB=m
+CONFIG_COUNTER=m
+CONFIG_TI_EQEP=m
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 CONFIG_EXT4_FS_SECURITY=y
Signature · 1 line
2.25.1
maintainer
#4 lore raw
In reply to David Lechner
Quoted 5 lines · David Lechner

This series adds device tree nodes for the eQEP portion of the PWMSS on AM33xx and enables it on BeagleBone Blue.

I actually submitted these a year ago, but it looks like these patches never got applied with the actual eQEP driver when it was merged.

Sorry if I dropped these earlier, I guess I though you're reposting the series and untagged them.

Quoted 6 lines

For reference, there was some previous discussion about the clocks in "ARM: dts:
am33xx: Add nodes for eQEP". [1]

[1]: https://lore.kernel.org/linux-omap/[email protected]/

I have also included a new patch to enable the eQEP driver in the defconfig.

Great, thanks applying these into omap-for-v5.11/dt and defconfig branches.

Regards,

Tony

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#5 lore raw
Quoted 9 lines · Tony Lindgren
Quoted 5 lines · David Lechner

This series adds device tree nodes for the eQEP portion of the PWMSS on AM33xx and enables it on BeagleBone Blue.

I actually submitted these a year ago, but it looks like these patches never got applied with the actual eQEP driver when it was merged.

Sorry if I dropped these earlier, I guess I though you're reposting the series and untagged them.

No worries, I forgot about them too. :-)

Quoted 14 lines
Quoted 7 lines

For reference, there was some previous discussion about the clocks in "ARM: dts:
am33xx: Add nodes for eQEP". [1]

[1]: https://lore.kernel.org/linux-omap/[email protected]/

I have also included a new patch to enable the eQEP driver in the defconfig.

Great, thanks applying these into omap-for-v5.11/dt and defconfig branches.

Regards,

Tony