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.

AM4378: Ethernet interface names(eth0 & eth1) swapping on custom AM437x hardware with dual ethernet.

Part Number: AM4378
Other Parts Discussed in Thread: AM4372

Hi,


We are in process of swapping the ethernet interface names (eth0 & eth1) on our variant board (board is configured for dual ethernet). Not able to swap ethernet interface names with following s/w options.

Please refer to below logs and device tree changes. Could you please help us with pointers?

At this point of time we are looking for only software side change.

Board: Custom board based on AM437X.
TISDK: ti-processor-sdk-linux-am437x-evm-06.03.00.106
Linux: linux-4.19.94

Existing DT snippet:

&mac {

   pinctrl-names = "default";

    pinctrl-0 = <&cpsw1_default>, <&cpsw2_default>;

    dual_emac = <1>;

    status = "okay";

};

&cpsw_emac0 {

    phy_id = <&davinci_mdio>, <0>;

    phy-mode = "rmii";

    dual_emac_res_vlan = <1>;

};

&cpsw_emac1 {

    phy_id = <&davinci_mdio>, <1>;

    phy-mode = "rmii";

    dual_emac_res_vlan = <2>;

};

&davinci_mdio {

    pinctrl-names = "default";

    pinctrl-0 = <&davinci_mdio_default>;

    status = "okay";

};

&phy_sel {

    rmii-clock-ext = <1>;

};

cpsw1_default: cpsw1_default {                            //for EMAC 0
pinctrl-single,pins = <
/* Slave 1 */
AM4372_IOPAD(0x90c, PIN_INPUT | MUX_MODE1) /* (B14) mii1_crs.rmii1_crs_dv */
AM4372_IOPAD(0x910, PIN_INPUT | MUX_MODE1) /* (B13) mii1_rx_er.rmii1_rxer */
AM4372_IOPAD(0x914, PIN_OUTPUT | MUX_MODE1) /* (A13) mii1_tx_en.rmii1_txen */
AM4372_IOPAD(0x928, PIN_OUTPUT | MUX_MODE1) /* (B15) mii1_txd0.rmii1_txd0 */
AM4372_IOPAD(0x924, PIN_OUTPUT | MUX_MODE1) /* (A14) mii1_txd1.rmii1_txd1 */
AM4372_IOPAD(0x940, PIN_INPUT | MUX_MODE1) /* (F17) mii1_rxd0.rmii1_rxd0 */
AM4372_IOPAD(0x93c, PIN_INPUT | MUX_MODE1) /* (B16) mii1_rxd1.rmii1_rxd1 */
AM4372_IOPAD(0x944, PIN_INPUT | MUX_MODE0) /* (A16) rmii1_ref_clk.rmii1_refclk */
>;
};

cpsw2_default: cpsw2_default {                       //for EMAC1
pinctrl-single,pins = < 
/* Slave 2*/
AM4372_IOPAD(0x864, PIN_INPUT | MUX_MODE8) /* (B4) gpmc_a9.rmii2_crs_dv */
AM4372_IOPAD(0x874, PIN_INPUT | MUX_MODE3) /* (B3) gpmc_wpn.rmii2_rxer */
AM4372_IOPAD(0x840, PIN_OUTPUT | MUX_MODE3) /* (C3) gpmc_a0.rmii2_txen */
AM4372_IOPAD(0x854, PIN_OUTPUT | MUX_MODE3) /* (E7) gpmc_a5.rmii2_txd0 */
AM4372_IOPAD(0x850, PIN_OUTPUT | MUX_MODE3) /* (D7) gpmc_a4.rmii2_txd1 */
AM4372_IOPAD(0x86c, PIN_INPUT | MUX_MODE3) /* (D8) gpmc_a11.rmii2_rxd0 */
AM4372_IOPAD(0x868, PIN_INPUT | MUX_MODE3) /* (G8) gpmc_a10.rmii2_rxd1 */
AM4372_IOPAD(0x908, PIN_INPUT | MUX_MODE1) /* (D16) mii1_col.rmii2_refclk */
>;
};

SW option : when dual emac configuration is set  with emac1--> dual_emac_res_vlan = <1>; & emac0--> dual_emac_res_vlan = <2> Interfaces not  swapped .

DT_snippet with SW_option:

&cpsw_emac0 {

    phy_id = <&davinci_mdio>, <0>;

    phy-mode = "rmii";

    dual_emac_res_vlan = <2>;

};

&cpsw_emac1 {

    phy_id = <&davinci_mdio>, <1>;

    phy-mode = "rmii";

    dual_emac_res_vlan = <1>;

};

LOG_Snippet:

[    1.822331] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp@44000000/ethernet@4a100000/mdio@4a101000[0]'

[    1.822351] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp@44000000/ethernet@4a100000/mdio@4a101000[0]'

[    1.916830] cpsw 4a100000.ethernet: Detected MACID = 14:42:fc:94:c7:b5

[    1.923686] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4

[    1.930158] cpsw 4a100000.ethernet: ALE Table size 1024

[    1.935462] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)

[    1.943662] cpsw 4a100000.ethernet: cpsw: Detected MACID = 14:42:fc:94:c7:b7

[    2.334058] cpuidle: enable-method property 'ti,am4372' found operations

[   12.557596] net eth0: initializing cpsw version 1.15 (0)

[   12.676903] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

[   12.775342] net eth1: initializing cpsw version 1.15 (0)

[   12.892682] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready.

Note:  when dual emac configuration is set  with emac1-->phyid=0 & emac0-->phyid=1,  Interfaces got swapped but ethernet activity is not happening which is an expected behavior for our hardware configuration.

Regards

Sathish

  • TI Team,

    Additional comments:

    As the original e2e thread suggested, swapping the order of the ports in the device tree should reverse the enumeration.

    However, I see too that it did not seem to resolve this effectively.

    Customer has had no success swapping the order of enumeration, they need TI Ethernet experts help or some example on how to achieve that.

     

    Can I first ask (if since last Wed) this is still a problem for you?

    Yes, this is still a problem for us

     

    Can I also ask which Linux Build and TI [AM437x] SDK versions are you using?

    Board: Custom board based on AM437X.
    TISDK: ti-processor-sdk-linux-am437x-evm-06.03.00.106
    Linux: linux-4.19.94

    TY,

    CY