2020-10-13 10:40:15

by David Lechner

[permalink] [raw]
Subject: [PATCH 0/3] 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(+)

--
2.25.1


2020-10-13 10:41:02

by David Lechner

[permalink] [raw]
Subject: [PATCH 3/3] ARM: omap2plus_defconfig: Enable TI eQEP counter driver

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

Signed-off-by: David Lechner <[email protected]>
---
arch/arm/configs/omap2plus_defconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index fe383f5a92fb..71b1a8f4c241 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -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
--
2.25.1

2020-10-13 10:41:21

by David Lechner

[permalink] [raw]
Subject: [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.

Signed-off-by: David Lechner <[email protected]>
---
arch/arm/boot/dts/am33xx-l4.dtsi | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi
index b88d0caa4b2d..17910268df82 100644
--- a/arch/arm/boot/dts/am33xx-l4.dtsi
+++ b/arch/arm/boot/dts/am33xx-l4.dtsi
@@ -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";
--
2.25.1

2020-10-13 10:42:45

by David Lechner

[permalink] [raw]
Subject: [PATCH 2/3] ARM: dts: am335x-boneblue: Enable eQEP

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

Signed-off-by: David Lechner <[email protected]>
---
arch/arm/boot/dts/am335x-boneblue.dts | 54 +++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-boneblue.dts b/arch/arm/boot/dts/am335x-boneblue.dts
index c696d57cf364..69acaf4ea0f3 100644
--- a/arch/arm/boot/dts/am335x-boneblue.dts
+++ b/arch/arm/boot/dts/am335x-boneblue.dts
@@ -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";
+};
--
2.25.1

2020-11-16 11:41:44

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH 0/3] Enable eQEP counter driver on BeagleBone Blue

* David Lechner <[email protected]> [201013 00:13]:
> 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.

> 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

2020-11-17 03:19:07

by David Lechner

[permalink] [raw]
Subject: Re: [PATCH 0/3] Enable eQEP counter driver on BeagleBone Blue

On 11/16/20 5:36 AM, Tony Lindgren wrote:
> * David Lechner <[email protected]> [201013 00:13]:
>> 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. :-)

>
>> 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
>