This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM437X: CPSW port assignment help

Part Number: PROCESSOR-SDK-AM437X

I am using a custom board with an am437x processor, with 2 physical ethernet ports on our board.  I would like to be able to switch the physical port assignments so I can control which port is assigned as eth0, and which port is assigned as eth1.  It seems like no matter what settings I adjust in the device tree for my kernel the second port on my board always is assigned eth0, while the first port is assigned eth1.

I would like to reverse those.  The relevant part of the device tree is below.  Can you help me to figure out a way so that I can make sure that the eth0 or eth1 is assigned to the physical port that I desire?

&davinci_mdio_sw {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_default>;
pinctrl-1 = <&davinci_mdio_sleep>;
ethphy0: ethernet-phy@1 {
reg = <1>;
};
ethphy1: ethernet-phy@2 {
reg = <2>;
};
};

&cpsw_port1 {
phy-handle = <&ethphy1>;
phy-mode = "rgmii-rxid";
phys = <&phy_gmii_sel 1 1>;
ti,dual-emac-pvid = <2>;
};

&cpsw_port2 {
phy-handle = <&ethphy0>;
phy-mode = "rgmii-rxid";
phys = <&phy_gmii_sel 2 1>;
ti,dual-emac-pvid = <1>;
};
  • Hi,

    Unfortunately there is not a way to swap ports. We have had this question in the past. On other interfaces this might be something done with udev rules but that would not apply here. The CPSW driver is built into the kernel and the ports always initialize in the order you mention. 

    Best Regards,

    Schuyler