From: Roger Quadros The TI Sitara AM571x device has two PRU-ICSS subsystems: PRU-ICSS1 and PRU-ICSS2. DUAL-MAC Ethernet support is already available on PRU-ICSS2. This patch adds device tree support to enable DUAL-MAC mode on PRU-ICSS1 for the AM571x IDK board. Each PRU-ICSS contains two PRU cores and several peripherals, including the Interrupt Controller, IEP, MII_RT, MDIO, and eCAP. This patch also adds the IEP and eCAP child nodes for PRU-ICSS1, making its layout consistent with PRU-ICSS2. am57-pruss.dtsi: Adds the IEP and eCAP child nodes for PRU-ICSS1. am571x-idk.dts: Adds the PRU-ICSS1 DUAL-MAC Ethernet node, enables the PRU-ICSS1 MDIO bus, adds the two external PHYs, and configures the required pin multiplexing and interrupts. Signed-off-by: Roger Quadros Signed-off-by: Andrew F. Davis Signed-off-by: Murali Karicheri Signed-off-by: Parvathi Pudi --- arch/arm/boot/dts/ti/omap/am57-pruss.dtsi | 11 ++++ arch/arm/boot/dts/ti/omap/am571x-idk.dts | 65 ++++++++++++++++++++++- 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/ti/omap/am57-pruss.dtsi b/arch/arm/boot/dts/ti/omap/am57-pruss.dtsi index f73316625608..1579f284cb6e 100644 --- a/arch/arm/boot/dts/ti/omap/am57-pruss.dtsi +++ b/arch/arm/boot/dts/ti/omap/am57-pruss.dtsi @@ -61,6 +61,17 @@ pruss1_iepclk_mux: iepclk-mux@30 { }; }; + pruss1_iep: iep@2e000 { + compatible = "ti,am5728-icss-iep"; + reg = <0x2e000 0x31c>; + clocks = <&pruss1_iepclk_mux>; + }; + + pruss1_ecap: ecap@30000 { + compatible = "ti,pruss-ecap"; + reg = <0x30000 0x60>; + }; + pruss1_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 02653b440585..e74c154b1940 100644 --- a/arch/arm/boot/dts/ti/omap/am571x-idk.dts +++ b/arch/arm/boot/dts/ti/omap/am571x-idk.dts @@ -165,6 +165,53 @@ blue3-led { default-state = "off"; }; }; + + /* Dual mac ethernet application node on icss1 */ + pruss1-eth { + compatible = "ti,am57-prueth"; + ti,prus = <&pru1_0>, <&pru1_1>; + ti,pruss-gp-mux-sel = <0>, /* GP, default */ + <4>; /* MII2, for PRUSS1_MII1 */ + sram = <&ocmcram1>; + ti,mii-rt = <&pruss1_mii_rt>; + ti,iep = <&pruss1_iep>; + ti,ecap = <&pruss1_ecap>; + interrupts = <20 2 2>, <21 3 3>; + interrupt-names = "rx_hp", "rx_lp"; + interrupt-parent = <&pruss1_intc>; + + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + pruss1_emac0: ethernet-port@0 { + reg = <0>; + phy-handle = <&pruss1_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]; + }; + + pruss1_emac1: ethernet-port@1 { + reg = <1>; + phy-handle = <&pruss1_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]; + }; + }; + }; +}; + +&pruss1_iep { + interrupt-parent = <&pruss1_intc>; + interrupts = <7 7 8>; + interrupt-names = "iep_cap_cmp"; }; &extcon_usb2 { @@ -210,7 +257,23 @@ &mmc2 { }; &pruss1_mdio { - status = "disabled"; + status = "okay"; + reset-gpios = <&gpio5 8 GPIO_ACTIVE_LOW>; + reset-delay-us = <2>; /* PHY datasheet states 1uS min */ + #address-cells = <1>; + #size-cells = <0>; + + pruss1_eth0_phy: ethernet-phy@0 { + reg = <0>; + interrupt-parent = <&gpio3>; + interrupts = <28 IRQ_TYPE_LEVEL_LOW>; + }; + + pruss1_eth1_phy: ethernet-phy@1 { + reg = <1>; + interrupt-parent = <&gpio3>; + interrupts = <29 IRQ_TYPE_LEVEL_LOW>; + }; }; &pruss2_mdio { -- 2.43.0