Enable eQEP DT support for Sitara K3 platforms
Subsystems (5)
v4 cover Enable eQEP DT support for Sitara K3 platforms
This patch series adds eQEP DT nodes for K3 Sitara devices:
- AM62x
- AM62ax
- AM62px
- AM64x
The series also allows the eQEP driver to be built for K3 architecture.
Changes since v3:
- Fix pinmux label name
- Fix eQEP node comment
v3: https://lore.kernel.org/linux-devicetree/[email protected]/
v2: https://lore.kernel.org/linux-devicetree/[email protected]/
v1: https://lore.kernel.org/linux-devicetree/[email protected]/
Judith Mendez (8):
dt-bindings: counter: Add new ti,am62-eqep compatible counter/ti-eqep: Add new ti-am62-eqep compatible
arm64: dts: ti: k3-am62-main: Add eQEP nodes
arm64: dts: ti: k3-am62a-main: Add eQEP nodes
arm64: dts: ti: k3-am62p-main: Add eQEP nodes
arm64: dts: ti: k3-am64-main: Add eQEP nodes
arm64: dts: ti: k3-am64x-sk: Enable eQEP
counter: ti-eqep: Allow eQEP driver to be built for K3 devices
.../devicetree/bindings/counter/ti-eqep.yaml | 44 ++++++++++++++++--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 27 ++++++++++++ arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 27 ++++++++++++ arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 27 ++++++++++++ arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 27 ++++++++++++ arch/arm64/boot/dts/ti/k3-am642-sk.dts | 17 +++++++ drivers/counter/Kconfig | 2 +- drivers/counter/ti-eqep.c | 1 + 8 files changed, 166 insertions(+), 6 deletions(-)
Signature · 1 line
2.45.1
PATCH v4 1/8 dt-bindings: counter: Add new ti,am62-eqep compatible
Add new compatible ti,am62-eqep for TI K3 devices. If a device uses this compatible, require power-domains property.
Since there is only one functional and interface clock for eqep, clock-names is not really required, so removed from required section, make it optional for ti,am3352-eqep compatible, and update the example.
The clock-name also changed for TI K3 SoCs so do not allow clock-names property for the new compatible.
While we are here, add an example using ti,am62-eqep compatible.
---
Changes since v3:
- No change
--- .../devicetree/bindings/counter/ti-eqep.yaml | 44 ++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/counter/ti-eqep.yaml +39 -5
@@ -11,7 +11,9 @@ maintainers: properties: compatible: - const: ti,am3352-eqep + enum: + - ti,am3352-eqep + - ti,am62-eqep reg: maxItems: 1
@@ -21,19 +23,35 @@ properties: maxItems: 1 clocks: - description: The clock that determines the SYSCLKOUT rate for the eQEP - peripheral. + description: The functional and interface clock that determines the clock + rate for the eQEP peripheral. maxItems: 1 clock-names: const: sysclkout + power-domains: + maxItems: 1 + +allOf: + - if: + properties: + compatible: + contains: + enum: + - ti,am62-eqep + then: + properties: + clock-names: false + + required: + - power-domains + required: - compatible - reg - interrupts - clocks - - clock-names additionalProperties: false
@@ -43,8 +61,24 @@ examples: compatible = "ti,am3352-eqep"; reg = <0x180 0x80>; clocks = <&l4ls_gclk>; - clock-names = "sysclkout"; interrupts = <79>; }; + - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/soc/ti,sci_pm_domain.h> + + bus { + #address-cells = <2>; + #size-cells = <2>; + eqep1: counter@23210000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23210000 0x00 0x100>; + power-domains = <&k3_pds 60 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 60 0>; + interrupts = <GIC_SPI 117 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + }; ...
Signature · 1 line
2.45.1
Re: [PATCH v4 1/8] dt-bindings: counter: Add new ti,am62-eqep compatible
Quoted 8 lines · Judith Mendez
Add new compatible ti,am62-eqep for TI K3 devices. If a device uses this compatible, require power-domains property.
Since there is only one functional and interface clock for eqep, clock-names is not really required, so removed from required section, make it optional for ti,am3352-eqep compatible, and update the example.
...
Documentation/devicetree/bindings/counter/ti-eqep.yaml examples: · line 75
Quoted 12 lines
interrupts = <79>; };Documentation/devicetree/bindings/counter/ti-eqep.yaml +9
-0+ - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/soc/ti,sci_pm_domain.h> + + bus { + #address-cells = <2>; + #size-cells = <2>; + eqep1: counter@23210000 {
No need for label
Documentation/devicetree/bindings/counter/ti-eqep.yaml examples: · line 81
Quoted 6 lines
Documentation/devicetree/bindings/counter/ti-eqep.yaml +6
-0+ compatible = "ti,am62-eqep"; + reg = <0x00 0x23210000 0x00 0x100>; + power-domains = <&k3_pds 60 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 60 0>; + interrupts = <GIC_SPI 117 IRQ_TYPE_EDGE_RISING>; + status = "disabled";
Drop... which also points to another comment - since this was no-op and example is basically the same, then just don't add it. No point.
Documentation/devicetree/bindings/counter/ti-eqep.yaml examples: · line 83
Quoted 3 lines
Documentation/devicetree/bindings/counter/ti-eqep.yaml +2
-0+ }; + };
Best regards,
Krzysztof
Re: [PATCH v4 1/8] dt-bindings: counter: Add new ti,am62-eqep compatible
Hi Krzysztof,
Quoted 35 lines · Krzysztof Kozlowski
Quoted 8 lines · Judith Mendez
Add new compatible ti,am62-eqep for TI K3 devices. If a device uses this compatible, require power-domains property.
Since there is only one functional and interface clock for eqep, clock-names is not really required, so removed from required section, make it optional for ti,am3352-eqep compatible, and update the example.
...
Documentation/devicetree/bindings/counter/ti-eqep.yaml examples: · line 75
Quoted 12 lines
interrupts = <79>; };Documentation/devicetree/bindings/counter/ti-eqep.yaml +9
-0+ - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/soc/ti,sci_pm_domain.h> + + bus { + #address-cells = <2>; + #size-cells = <2>; + eqep1: counter@23210000 {No need for label
Documentation/devicetree/bindings/counter/ti-eqep.yaml examples: · line 81
Quoted 6 lines
Documentation/devicetree/bindings/counter/ti-eqep.yaml +6
-0+ compatible = "ti,am62-eqep"; + reg = <0x00 0x23210000 0x00 0x100>; + power-domains = <&k3_pds 60 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 60 0>; + interrupts = <GIC_SPI 117 IRQ_TYPE_EDGE_RISING>; + status = "disabled";
Quoted 2 lines
Drop... which also points to another comment - since this was no-op and example is basically the same, then just don't add it. No point.
Ok, then I will drop the new example, thanks.
BTW..
In the existing example for ti,am3352-eqep compatible, do you know if it is appropriate to drop clock-names from the example if it is no longer required?
~ Judith
Quoted 8 lines
Documentation/devicetree/bindings/counter/ti-eqep.yaml examples: · line 83
Quoted 4 lines
Documentation/devicetree/bindings/counter/ti-eqep.yaml +2
-0+ }; + };Best regards,
Krzysztof
Re: [PATCH v4 1/8] dt-bindings: counter: Add new ti,am62-eqep compatible
Quoted 42 lines · Judith Mendez
Hi Krzysztof,
Quoted 35 lines · Krzysztof Kozlowski
Quoted 8 lines · Judith Mendez
Add new compatible ti,am62-eqep for TI K3 devices. If a device uses this compatible, require power-domains property.
Since there is only one functional and interface clock for eqep, clock-names is not really required, so removed from required section, make it optional for ti,am3352-eqep compatible, and update the example.
...
Documentation/devicetree/bindings/counter/ti-eqep.yaml examples: · line 75
Quoted 12 lines
interrupts = <79>; };Documentation/devicetree/bindings/counter/ti-eqep.yaml +9
-0+ - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/soc/ti,sci_pm_domain.h> + + bus { + #address-cells = <2>; + #size-cells = <2>; + eqep1: counter@23210000 {No need for label
Documentation/devicetree/bindings/counter/ti-eqep.yaml examples: · line 81
Quoted 6 lines
Documentation/devicetree/bindings/counter/ti-eqep.yaml +6
-0+ compatible = "ti,am62-eqep"; + reg = <0x00 0x23210000 0x00 0x100>; + power-domains = <&k3_pds 60 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 60 0>; + interrupts = <GIC_SPI 117 IRQ_TYPE_EDGE_RISING>; + status = "disabled";Quoted 2 lines
Drop... which also points to another comment - since this was no-op and example is basically the same, then just don't add it. No point.
Quoted 7 lines
Ok, then I will drop the new example, thanks.
BTW..
In the existing example for ti,am3352-eqep compatible, do you know if it is appropriate to drop clock-names from the example if it is no longer required?
It does not really matter.
Best regards,
Krzysztof
Re: [PATCH v4 1/8] dt-bindings: counter: Add new ti,am62-eqep compatible
Hi,
Quoted 45 lines · Krzysztof Kozlowski
Quoted 44 lines · Judith Mendez
Hi Krzysztof,
Quoted 35 lines · Krzysztof Kozlowski
Quoted 8 lines · Judith Mendez
Add new compatible ti,am62-eqep for TI K3 devices. If a device uses this compatible, require power-domains property.
Since there is only one functional and interface clock for eqep, clock-names is not really required, so removed from required section, make it optional for ti,am3352-eqep compatible, and update the example.
...
Documentation/devicetree/bindings/counter/ti-eqep.yaml examples: · line 75
Quoted 12 lines
interrupts = <79>; };Documentation/devicetree/bindings/counter/ti-eqep.yaml +9
-0+ - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/soc/ti,sci_pm_domain.h> + + bus { + #address-cells = <2>; + #size-cells = <2>; + eqep1: counter@23210000 {No need for label
Documentation/devicetree/bindings/counter/ti-eqep.yaml examples: · line 81
Quoted 6 lines
Documentation/devicetree/bindings/counter/ti-eqep.yaml +6
-0+ compatible = "ti,am62-eqep"; + reg = <0x00 0x23210000 0x00 0x100>; + power-domains = <&k3_pds 60 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 60 0>; + interrupts = <GIC_SPI 117 IRQ_TYPE_EDGE_RISING>; + status = "disabled";Quoted 2 lines
Drop... which also points to another comment - since this was no-op and example is basically the same, then just don't add it. No point.
Ok, then I will drop the new example, thanks.
Quoted 8 lines
Quoted 5 lines
BTW..
In the existing example for ti,am3352-eqep compatible, do you know if it is appropriate to drop clock-names from the example if it is no longer required?It does not really matter.
Understood, thanks.
Quoted 3 lines
Best regards,
Krzysztof
PATCH v4 2/8 counter/ti-eqep: Add new ti-am62-eqep compatible
In reply to Judith MendezAdd new compatible for ti-am62-eqep for TI K3 SoC's.
---
Changes since v3:
- No change
--- drivers/counter/ti-eqep.c | 1 + 1 file changed, 1 insertion(+)
drivers/counter/ti-eqep.c +1 -0
@@ -439,6 +439,7 @@ static int ti_eqep_remove(struct platform_device *pdev)static const struct of_device_id ti_eqep_of_match[] = { { .compatible ="ti,am3352-eqep" , }, + { .compatible ="ti,am62-eqep" , }, { }, };MODULE_DEVICE_TABLE (of, ti_eqep_of_match);
Signature · 1 line
2.45.1
PATCH v4 3/8 arm64: dts: ti: k3-am62-main: Add eQEP nodes
In reply to Judith MendezAdd eQEP device tree nodes 0-2 for AM625 SoC.
---
Changes since v3:
- No change
--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +27 -0
@@ -846,6 +846,33 @@ ecap2: pwm@23120000 { status = "disabled"; }; + eqep0: counter@23200000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23200000 0x00 0x100>; + power-domains = <&k3_pds 59 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 59 0>; + interrupts = <GIC_SPI 116 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + + eqep1: counter@23210000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23210000 0x00 0x100>; + power-domains = <&k3_pds 60 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 60 0>; + interrupts = <GIC_SPI 117 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + + eqep2: counter@23220000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23220000 0x00 0x100>; + power-domains = <&k3_pds 62 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 62 0>; + interrupts = <GIC_SPI 118 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + main_mcan0: can@20701000 { compatible = "bosch,m_can"; reg = <0x00 0x20701000 0x00 0x200>,
Signature · 1 line
2.45.1
PATCH v4 4/8 arm64: dts: ti: k3-am62a-main: Add eQEP nodes
In reply to Judith MendezAdd eQEP device tree nodes 0-2 for AM62A7 SoC.
---
Changes since v3:
- No change
--- arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+)
arch/arm64/boot/dts/ti/k3-am62a-main.dtsi +27 -0
@@ -909,6 +909,33 @@ ecap2: pwm@23120000 { status = "disabled"; }; + eqep0: counter@23200000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23200000 0x00 0x100>; + power-domains = <&k3_pds 59 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 59 0>; + interrupts = <GIC_SPI 116 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + + eqep1: counter@23210000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23210000 0x00 0x100>; + power-domains = <&k3_pds 60 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 60 0>; + interrupts = <GIC_SPI 117 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + + eqep2: counter@23220000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23220000 0x00 0x100>; + power-domains = <&k3_pds 62 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 62 0>; + interrupts = <GIC_SPI 118 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + mcasp0: audio-controller@2b00000 { compatible = "ti,am33xx-mcasp-audio"; reg = <0x00 0x02b00000 0x00 0x2000>,
Signature · 1 line
2.45.1
PATCH v4 5/8 arm64: dts: ti: k3-am62p-main: Add eQEP nodes
In reply to Judith MendezAdd eQEP device tree nodes 0-2 for AM62P5 SoC.
---
Changes since v3:
- No change
--- arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+)
arch/arm64/boot/dts/ti/k3-am62p-main.dtsi +27 -0
@@ -857,6 +857,33 @@ ecap2: pwm@23120000 { status = "disabled"; }; + eqep0: counter@23200000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23200000 0x00 0x100>; + power-domains = <&k3_pds 59 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 59 0>; + interrupts = <GIC_SPI 116 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + + eqep1: counter@23210000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23210000 0x00 0x100>; + power-domains = <&k3_pds 60 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 60 0>; + interrupts = <GIC_SPI 117 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + + eqep2: counter@23220000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23220000 0x00 0x100>; + power-domains = <&k3_pds 62 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 62 0>; + interrupts = <GIC_SPI 118 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + main_mcan0: can@20701000 { compatible = "bosch,m_can"; reg = <0x00 0x20701000 0x00 0x200>,
Signature · 1 line
2.45.1
PATCH v4 6/8 arm64: dts: ti: k3-am64-main: Add eQEP nodes
In reply to Judith MendezAdd eQEP device tree nodes 0-2 for AM642 SoC.
---
Changes since v3:
- No change
--- arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
arch/arm64/boot/dts/ti/k3-am64-main.dtsi +27 -0
@@ -1171,6 +1171,33 @@ ecap2: pwm@23120000 { status = "disabled"; }; + eqep0: counter@23200000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23200000 0x00 0x100>; + power-domains = <&k3_pds 59 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 59 0>; + interrupts = <GIC_SPI 116 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + + eqep1: counter@23210000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23210000 0x00 0x100>; + power-domains = <&k3_pds 60 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 60 0>; + interrupts = <GIC_SPI 117 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + + eqep2: counter@23220000 { + compatible = "ti,am62-eqep"; + reg = <0x00 0x23220000 0x00 0x100>; + power-domains = <&k3_pds 62 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 62 0>; + interrupts = <GIC_SPI 118 IRQ_TYPE_EDGE_RISING>; + status = "disabled"; + }; + main_rti0: watchdog@e000000 { compatible = "ti,j7-rti-wdt"; reg = <0x00 0xe000000 0x00 0x100>;
Signature · 1 line
2.45.1
PATCH v4 7/8 arm64: dts: ti: k3-am64x-sk: Enable eQEP
In reply to Judith MendezThere are 3 instances of eQEP on AM64x. Only EQEP0 signals can be routed to the user expansion so enable only EQEP0 in k3-am642-sk.dts.
---
Changes since v3:
- Fix pinmux label name
- Fix eQEP node comment
--- arch/arm64/boot/dts/ti/k3-am642-sk.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/arm64/boot/dts/ti/k3-am642-sk.dts +17 -0
@@ -357,6 +357,16 @@ main_ecap0_pins_default: main-ecap0-default-pins { AM64X_IOPAD(0x0270, PIN_INPUT, 0) /* (D18) ECAP0_IN_APWM_OUT */ >; }; + + main_eqep0_pins_default: main-eqep0-default-pins { + pinctrl-single,pins = < + AM64X_IOPAD(0x00a0, PIN_INPUT, 3) /* (N16) GPMC0_WPn.EQEP0_A */ + AM64X_IOPAD(0x00a4, PIN_INPUT, 3) /* (N17) GPMC0_DIR.EQEP0_B */ + AM64X_IOPAD(0x00ac, PIN_INPUT, 3) /* (R20) GPMC0_CSn1.EQEP0_I */ + AM64X_IOPAD(0x00a8, PIN_INPUT, 3) /* (R19) GPMC0_CSn0.EQEP0_S */ + >; + }; + main_wlan_en_pins_default: main-wlan-en-default-pins { pinctrl-single,pins = < AM64X_IOPAD(0x00c4, PIN_OUTPUT_PULLUP, 7) /* (V8) GPIO0_48 */
@@ -672,3 +682,10 @@ &ecap0 { pinctrl-names = "default"; pinctrl-0 = <&main_ecap0_pins_default>; }; + +&eqep0 { + status = "okay"; + /* EQEP0 A & B available on pins 18 & 22 of J4 header */ + pinctrl-names = "default"; + pinctrl-0 = <&main_eqep0_pins_default>; +};
Signature · 1 line
2.45.1
PATCH v4 8/8 counter: ti-eqep: Allow eQEP driver to be built for K3 devices
In reply to Judith MendezTI K3 SoC's support eQEP hardware, so add ARCH_K3 to the depends so the TI eQEP driver can be built for K3 devices.
---
Changes since v3:
- No change
--- drivers/counter/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/counter/Kconfig +1 -1
@@ -138,7 +138,7 @@ config TI_ECAP_CAPTURE config TI_EQEP tristate "TI eQEP counter driver" - depends on (SOC_AM33XX || COMPILE_TEST) + depends on SOC_AM33XX || ARCH_K3 || COMPILE_TEST select REGMAP_MMIO help Select this option to enable the Texas Instruments Enhanced Quadrature
Signature · 1 line
2.45.1