[PATCH 1/2] arm: dts: ti: Adds device tree nodes for PRU Cores, IEP and eCAP modules of PRU-ICSS2 Instance.

Parvathi Pudi posted 2 patches 2 months, 1 week ago
There is a newer version of this series
[PATCH 1/2] arm: dts: ti: Adds device tree nodes for PRU Cores, IEP and eCAP modules of PRU-ICSS2 Instance.
Posted by Parvathi Pudi 2 months, 1 week ago
From: Roger Quadros <rogerq@ti.com>

The TI Sitara AM57xx series of devices consists of 2 PRU-ICSS instances
(PRU-ICSS1 and PRU-ICSS2). This patch adds the device tree nodes for the
PRU-ICSS2 instance to support DUAL-MAC mode of operation.

Each PRU-ICSS instance consists of two PRU cores along with various
peripherals such as the Interrupt Controller (PRU_INTC), the Industrial
Ethernet Peripheral(IEP), the Real Time Media Independent Interface
controller (MII_RT), and the Enhanced Capture (eCAP) event module.

am57-pruss.dtsi - Adds IEP and eCAP peripheral as child nodes of
the PRUSS subsystem node.

am57xx-idk-common.dtsi - Adds PRU-ICSS2 instance node along with
PRU eth port information and corresponding port configuration. It includes
interrupt mapping for packet reception, HW timestamp collection, and
PRU Ethernet ports in MII mode.

am571x-idk.dts, am572x-idk.dts and am574x-idk.dts - GPIO configuration
along with delay configuration for individual PRU Ethernet port.

Reviewed-by: Mohan Reddy Putluru <pmohan@couthit.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com>
Signed-off-by: Parvathi Pudi <parvathi@couthit.com>
---
 arch/arm/boot/dts/ti/omap/am57-pruss.dtsi     | 11 ++++
 arch/arm/boot/dts/ti/omap/am571x-idk.dts      |  8 ++-
 arch/arm/boot/dts/ti/omap/am572x-idk.dts      | 10 +--
 arch/arm/boot/dts/ti/omap/am574x-idk.dts      | 10 +--
 .../boot/dts/ti/omap/am57xx-idk-common.dtsi   | 61 +++++++++++++++++++
 5 files changed, 91 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/dts/ti/omap/am57-pruss.dtsi b/arch/arm/boot/dts/ti/omap/am57-pruss.dtsi
index 46c5383f0eee..f73316625608 100644
--- a/arch/arm/boot/dts/ti/omap/am57-pruss.dtsi
+++ b/arch/arm/boot/dts/ti/omap/am57-pruss.dtsi
@@ -170,6 +170,17 @@ pruss2_iepclk_mux: iepclk-mux@30 {
 				};
 			};
 
+			pruss2_iep: iep@2e000 {
+				compatible = "ti,am5728-icss-iep";
+				reg = <0x2e000 0x31c>;
+				clocks = <&pruss2_iepclk_mux>;
+			};
+
+			pruss2_ecap: ecap@30000 {
+				compatible = "ti,pruss-ecap";
+				reg = <0x30000 0x60>;
+			};
+
 			pruss2_mii_rt: mii-rt@32000 {
 				compatible = "ti,pruss-mii", "syscon";
 				reg = <0x32000 0x58>;
diff --git a/arch/arm/boot/dts/ti/omap/am571x-idk.dts b/arch/arm/boot/dts/ti/omap/am571x-idk.dts
index 322cf79d22e9..02653b440585 100644
--- a/arch/arm/boot/dts/ti/omap/am571x-idk.dts
+++ b/arch/arm/boot/dts/ti/omap/am571x-idk.dts
@@ -214,5 +214,11 @@ &pruss1_mdio {
 };
 
 &pruss2_mdio {
-	status = "disabled";
+	reset-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
+	reset-delay-us = <2>;   /* PHY datasheet states 1uS min */
+};
+
+&pruss2_eth {
+	ti,pruss-gp-mux-sel = <4>,      /* MII2, needed for PRUSS1_MII0 */
+			      <4>;      /* MII2, needed for PRUSS1_MII1 */
 };
diff --git a/arch/arm/boot/dts/ti/omap/am572x-idk.dts b/arch/arm/boot/dts/ti/omap/am572x-idk.dts
index 94a738cb0a4d..54a8ccb9ca14 100644
--- a/arch/arm/boot/dts/ti/omap/am572x-idk.dts
+++ b/arch/arm/boot/dts/ti/omap/am572x-idk.dts
@@ -28,10 +28,12 @@ &mmc2 {
 	pinctrl-2 = <&mmc2_pins_ddr_rev20>;
 };
 
-&pruss1_mdio {
-	status = "disabled";
+&pruss2_eth0_phy {
+	reset-gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;
+	reset-assert-us = <2>;   /* PHY datasheet states 1uS min */
 };
 
-&pruss2_mdio {
-	status = "disabled";
+&pruss2_eth1_phy {
+	reset-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
+	reset-assert-us = <2>;   /* PHY datasheet states 1uS min */
 };
diff --git a/arch/arm/boot/dts/ti/omap/am574x-idk.dts b/arch/arm/boot/dts/ti/omap/am574x-idk.dts
index 47b9174d2353..47b6c6cb210c 100644
--- a/arch/arm/boot/dts/ti/omap/am574x-idk.dts
+++ b/arch/arm/boot/dts/ti/omap/am574x-idk.dts
@@ -40,10 +40,12 @@ &emif1 {
 	status = "okay";
 };
 
-&pruss1_mdio {
-	status = "disabled";
+&pruss2_eth0_phy {
+	reset-gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;
+	reset-assert-us = <2>;   /* PHY datasheet states 1uS min */
 };
 
-&pruss2_mdio {
-	status = "disabled";
+&pruss2_eth1_phy {
+	reset-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
+	reset-assert-us = <2>;   /* PHY datasheet states 1uS min */
 };
diff --git a/arch/arm/boot/dts/ti/omap/am57xx-idk-common.dtsi b/arch/arm/boot/dts/ti/omap/am57xx-idk-common.dtsi
index 43e3623f079c..2407d5640aed 100644
--- a/arch/arm/boot/dts/ti/omap/am57xx-idk-common.dtsi
+++ b/arch/arm/boot/dts/ti/omap/am57xx-idk-common.dtsi
@@ -155,6 +155,52 @@ src_clk_x1: src_clk_x1 {
 		compatible = "fixed-clock";
 		clock-frequency = <20000000>;
 	};
+
+	/* Dual-MAC Ethernet application node on PRU-ICSS2 */
+	pruss2_eth: pruss2-eth {
+		compatible = "ti,am57-prueth";
+		ti,prus = <&pru2_0>, <&pru2_1>;
+		sram = <&ocmcram1>;
+		ti,mii-rt = <&pruss2_mii_rt>;
+		ti,iep = <&pruss2_iep>;
+		ti,ecap = <&pruss2_ecap>;
+		interrupts = <20 2 2>, <21 3 3>;
+		interrupt-names = "rx_hp", "rx_lp";
+		interrupt-parent = <&pruss2_intc>;
+
+		ethernet-ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			pruss2_emac0: ethernet-port@0 {
+				reg = <0>;
+				phy-handle = <&pruss2_eth0_phy>;
+				phy-mode = "mii";
+				interrupts = <20 2 2>, <26 6 6>, <23 6 6>;
+				interrupt-names = "rx", "emac_ptp_tx",
+								"hsr_ptp_tx";
+				/* Filled in by bootloader */
+				local-mac-address = [00 00 00 00 00 00];
+			};
+
+			pruss2_emac1: ethernet-port@1 {
+				reg = <1>;
+				phy-handle = <&pruss2_eth1_phy>;
+				phy-mode = "mii";
+				interrupts = <21 3 3>, <27 9 7>, <24 9 7>;
+				interrupt-names = "rx", "emac_ptp_tx",
+								"hsr_ptp_tx";
+				/* Filled in by bootloader */
+				local-mac-address = [00 00 00 00 00 00];
+			};
+		};
+	};
+
+};
+
+&pruss2_iep {
+	interrupt-parent = <&pruss2_intc>;
+	interrupts = <7 7 8>;
+	interrupt-names = "iep_cap_cmp";
 };
 
 &dra7_pmx_core {
@@ -606,3 +652,18 @@ dpi_out: endpoint {
 		};
 	};
 };
+
+&pruss2_mdio {
+	status = "okay";
+	pruss2_eth0_phy: ethernet-phy@0 {
+		reg = <0>;
+		interrupt-parent = <&gpio3>;
+		interrupts = <30 IRQ_TYPE_EDGE_FALLING>;
+	};
+
+	pruss2_eth1_phy: ethernet-phy@1 {
+		reg = <1>;
+		interrupt-parent = <&gpio3>;
+		interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
+	};
+};
-- 
2.43.0
Re: [PATCH 1/2] arm: dts: ti: Adds device tree nodes for PRU Cores, IEP and eCAP modules of PRU-ICSS2 Instance.
Posted by Andrew Lunn 2 months, 1 week ago
> +				interrupt-names = "rx", "emac_ptp_tx",
> +								"hsr_ptp_tx";

Something looks wrong with the indentation here. The same happens in
at least one other place.

> +&pruss2_mdio {
> +	status = "okay";
> +	pruss2_eth0_phy: ethernet-phy@0 {
> +		reg = <0>;
> +		interrupt-parent = <&gpio3>;
> +		interrupts = <30 IRQ_TYPE_EDGE_FALLING>;
> +	};
> +
> +	pruss2_eth1_phy: ethernet-phy@1 {
> +		reg = <1>;
> +		interrupt-parent = <&gpio3>;
> +		interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
> +	};


PHY interrupts are 99% level, not edge, because they represent an
interrupt controller in the PHY, and you need to clear all the
interrupts in the controller before it deasserts the interrupt pin.

    Andrew

---
pw-bot: cr
Re: [PATCH 1/2] arm: dts: ti: Adds device tree nodes for PRU Cores, IEP and eCAP modules of PRU-ICSS2 Instance.
Posted by Parvathi Pudi 2 months ago
Hi,

>> +				interrupt-names = "rx", "emac_ptp_tx",
>> +								"hsr_ptp_tx";
> 
> Something looks wrong with the indentation here. The same happens in
> at least one other place.
> 

we will correct the indentation of the interrupt-names property to properly
align the continuation line as shown below.

interrupt-names = "rx", "emac_ptp_tx",
                  "hsr_ptp_tx";

We will make sure to address this in all the applicable places and include
this fix in the next version.


>> +&pruss2_mdio {
>> +	status = "okay";
>> +	pruss2_eth0_phy: ethernet-phy@0 {
>> +		reg = <0>;
>> +		interrupt-parent = <&gpio3>;
>> +		interrupts = <30 IRQ_TYPE_EDGE_FALLING>;
>> +	};
>> +
>> +	pruss2_eth1_phy: ethernet-phy@1 {
>> +		reg = <1>;
>> +		interrupt-parent = <&gpio3>;
>> +		interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
>> +	};
> 
> 
> PHY interrupts are 99% level, not edge, because they represent an
> interrupt controller in the PHY, and you need to clear all the
> interrupts in the controller before it deasserts the interrupt pin.
> 
>    Andrew


Sure, we will check and come back with more details on this.


Thanks and Regards,
Parvathi.
Re: [PATCH 1/2] arm: dts: ti: Adds device tree nodes for PRU Cores, IEP and eCAP modules of PRU-ICSS2 Instance.
Posted by Parvathi Pudi 1 month, 2 weeks ago
Hi,

>>> +				interrupt-names = "rx", "emac_ptp_tx",
>>> +								"hsr_ptp_tx";
>> 
>> Something looks wrong with the indentation here. The same happens in
>> at least one other place.
>> 
> 
> we will correct the indentation of the interrupt-names property to properly
> align the continuation line as shown below.
> 
> interrupt-names = "rx", "emac_ptp_tx",
>                  "hsr_ptp_tx";
> 
> We will make sure to address this in all the applicable places and include
> this fix in the next version.
> 
> 
>>> +&pruss2_mdio {
>>> +	status = "okay";
>>> +	pruss2_eth0_phy: ethernet-phy@0 {
>>> +		reg = <0>;
>>> +		interrupt-parent = <&gpio3>;
>>> +		interrupts = <30 IRQ_TYPE_EDGE_FALLING>;
>>> +	};
>>> +
>>> +	pruss2_eth1_phy: ethernet-phy@1 {
>>> +		reg = <1>;
>>> +		interrupt-parent = <&gpio3>;
>>> +		interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
>>> +	};
>> 
>> 
>> PHY interrupts are 99% level, not edge, because they represent an
>> interrupt controller in the PHY, and you need to clear all the
>> interrupts in the controller before it deasserts the interrupt pin.
>> 
>>    Andrew
> 
> 
> Sure, we will check and come back with more details on this.
> 
> 

We have reviewed and analysed the code, and confirmed that level
low can be used for the PHY interrupt, which seems to be a better
option than using the edge falling.

As shown below, the current interrupt configuration reflects a
level-triggered setup:

root@am57xx-evm:~# cat /proc/interrupts
           CPU0       CPU1    
163:          2          0 48057000.gpio  30 Level     4b2b2400.mdio:00
164:          2          0 48057000.gpio  31 Level     4b2b2400.mdio:01

We can see the IRQ has been changed to Level and the count is incremented
for every link event.

We will update the interrupt type to IRQ_TYPE_LEVEL_LOW as shown below and
share the next version.

+&pruss2_mdio {
+       status = "okay";
+       pruss2_eth0_phy: ethernet-phy@0 {
+               reg = <0>;
+               interrupt-parent = <&gpio3>;
+               interrupts = <30 IRQ_TYPE_LEVEL_LOW>;
+       };
+
+       pruss2_eth1_phy: ethernet-phy@1 {
+               reg = <1>;
+               interrupt-parent = <&gpio3>;
+               interrupts = <31 IRQ_TYPE_LEVEL_LOW>;
+       };
+};


Thanks and Regards,
Parvathi.
Re: [PATCH 1/2] arm: dts: ti: Adds device tree nodes for PRU Cores, IEP and eCAP modules of PRU-ICSS2 Instance.
Posted by Anwar, Md Danish 2 months, 1 week ago

On 10/13/2025 6:22 PM, Parvathi Pudi wrote:
> From: Roger Quadros <rogerq@ti.com>
> 
> The TI Sitara AM57xx series of devices consists of 2 PRU-ICSS instances
> (PRU-ICSS1 and PRU-ICSS2). This patch adds the device tree nodes for the
> PRU-ICSS2 instance to support DUAL-MAC mode of operation.
> 
> Each PRU-ICSS instance consists of two PRU cores along with various
> peripherals such as the Interrupt Controller (PRU_INTC), the Industrial
> Ethernet Peripheral(IEP), the Real Time Media Independent Interface
> controller (MII_RT), and the Enhanced Capture (eCAP) event module.
> 
> am57-pruss.dtsi - Adds IEP and eCAP peripheral as child nodes of
> the PRUSS subsystem node.
> 
> am57xx-idk-common.dtsi - Adds PRU-ICSS2 instance node along with
> PRU eth port information and corresponding port configuration. It includes
> interrupt mapping for packet reception, HW timestamp collection, and
> PRU Ethernet ports in MII mode.
> 
> am571x-idk.dts, am572x-idk.dts and am574x-idk.dts - GPIO configuration
> along with delay configuration for individual PRU Ethernet port.
> 
> Reviewed-by: Mohan Reddy Putluru <pmohan@couthit.com>

Please don't carry internal review tags in upstream patches.

-- 
Thanks and Regards,
Md Danish Anwar
Re: [PATCH 1/2] arm: dts: ti: Adds device tree nodes for PRU Cores, IEP and eCAP modules of PRU-ICSS2 Instance.
Posted by Parvathi Pudi 2 months ago
Hi,


> On 10/13/2025 6:22 PM, Parvathi Pudi wrote:
>> From: Roger Quadros <rogerq@ti.com>
>> 
>> The TI Sitara AM57xx series of devices consists of 2 PRU-ICSS instances
>> (PRU-ICSS1 and PRU-ICSS2). This patch adds the device tree nodes for the
>> PRU-ICSS2 instance to support DUAL-MAC mode of operation.
>> 
>> Each PRU-ICSS instance consists of two PRU cores along with various
>> peripherals such as the Interrupt Controller (PRU_INTC), the Industrial
>> Ethernet Peripheral(IEP), the Real Time Media Independent Interface
>> controller (MII_RT), and the Enhanced Capture (eCAP) event module.
>> 
>> am57-pruss.dtsi - Adds IEP and eCAP peripheral as child nodes of
>> the PRUSS subsystem node.
>> 
>> am57xx-idk-common.dtsi - Adds PRU-ICSS2 instance node along with
>> PRU eth port information and corresponding port configuration. It includes
>> interrupt mapping for packet reception, HW timestamp collection, and
>> PRU Ethernet ports in MII mode.
>> 
>> am571x-idk.dts, am572x-idk.dts and am574x-idk.dts - GPIO configuration
>> along with delay configuration for individual PRU Ethernet port.
>> 
>> Reviewed-by: Mohan Reddy Putluru <pmohan@couthit.com>
> 
> Please don't carry internal review tags in upstream patches.
> 

Sure, we will remove the tag in the next version.


Thanks and Regards,
Parvathi.