AR# 59554

PetaLinux - What Is The Correct Device Tree (DTS) Syntax for Dual Ethernet (MIO configuration) in Zynq-7000 ?

Description

I am using both Zynq-7000 PS GEM peripherals via the MIO pins.

What is the proper syntax for the device tree nodes?

Solution

When using both Ethernet (GEM) peripherals in the Zynq-7000 PS via MIO it is important to remember that one GEM will become the MDIO master for both peripherals.

This is the important distinction from other configurations.

The example below can be used as a reference.

It is important to keep in mind that on a shared MDIO interface (such as the one demonstrated below), the PHYs should avoid using the MDIO broadcast address (PHY address 0) for proper operation:

ps7_ethernet_0: ps7-ethernet@e000b000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "xlnx,ps7-ethernet-1.00.a";
interrupt-parent = <&ps7_scugic_0>;
interrupts = < 0 22 1 >;
phy-handle = <&phy0>;
phy-mode = "rgmii";
reg = < 0xe000b000 0x1000 >;
xlnx,enet-slcr-1000mbps-div0 = <0xa>;
xlnx,enet-slcr-1000mbps-div1 = <0x1>;
xlnx,enet-slcr-100mbps-div0 = <0xa>;
xlnx,enet-slcr-100mbps-div1 = <0x5>;
xlnx,enet-slcr-10mbps-div0 = <0xa>;
xlnx,enet-slcr-10mbps-div1 = <0x32>;
xlnx,ptp-enet-clock = <120833336>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
phy0: phy@16 {
compatible = "marvell,88e1116r";
device_type = "ethernet-phy";
reg = <16>;
} ;
phy1: phy@17 {
compatible = "marvell,88e1116r";
device_type = "ethernet-phy";
reg = <17>;
} ;
} ;
} ;
ps7_ethernet_1: ps7-ethernet@e000c000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "xlnx,ps7-ethernet-1.00.a";
interrupt-parent = <&ps7_scugic_0>;
interrupts = < 0 45 1 >;
phy-handle = <&phy1>;
phy-mode = "rgmii";
reg = < 0xe000c000 0x1000 >;
xlnx,enet-slcr-1000mbps-div0 = <0xa>;
xlnx,enet-slcr-1000mbps-div1 = <0x1>;
xlnx,enet-slcr-100mbps-div0 = <0xa>;
xlnx,enet-slcr-100mbps-div1 = <0x5>;
xlnx,enet-slcr-10mbps-div0 = <0xa>;
xlnx,enet-slcr-10mbps-div1 = <0x32>;
xlnx,ptp-enet-clock = <120833336>;
} ;

AR# 59554
Date 06/08/2020
Status Active
Type General Article
Devices
Tools