I have a custom board with an AM3354 processor, the design is based on the EVM and has dual Ethernet jacks.
I've configured each port to a different subnet address and confirmed that I can ping each one from my Ubuntu machine and vice versa. What I want to do now is change which Ethernet jack is identified as "eth0" and which one is "eth1".
On my PCB's silkscreen, P64 comes up as "eth0" and P74 comes up as "eth1":
My goal here is to get P74 to come up as "eth0" instead of P64.
By default my device tree is set as such:
&cpsw_emac0 { phy_id = <&davinci_mdio>, <1>; phy-mode = "rmii"; }; &cpsw_emac1 { phy_id = <&davinci_mdio>, <3>; phy-mode = "rmii"; };
P64 is MII bus address 1 and relates to "eth0". I can confirm this by plugging in the Ethernet cable to P64 and checking the results of ifconfig ie:
[root /]# ifconfig eth0 Link encap:Ethernet HWaddr d0:ff:50:29:e9:0c inet addr:192.168.0.6 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:56
Then I plug in the cable and I can see the TX bytes have increased:
[root /]# ifconfig eth0 Link encap:Ethernet HWaddr d0:ff:50:29:e9:0c inet addr:192.168.0.6 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::d2ff:50ff:fe29:e90c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:578 (578.0 B) Interrupt:56
And then I execute a "ping" test to the Ubuntu machine I'm connected to it is successful:
[root /]# ping 192.168.0.1 -c 3 PING 192.168.0.1 (192.168.0.1): 56 data bytes 64 bytes from 192.168.0.1: seq=0 ttl=64 time=0.838 ms 64 bytes from 192.168.0.1: seq=1 ttl=64 time=0.425 ms 64 bytes from 192.168.0.1: seq=2 ttl=64 time=0.433 ms --- 192.168.0.1 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 0.425/0.565/0.838 ms
Now when I update the device tree such that the address of each "ethX" port are inverted, ie:
&cpsw_emac0 { phy_id = <&davinci_mdio>, <3>; phy-mode = "rmii"; }; &cpsw_emac1 { phy_id = <&davinci_mdio>, <1>; phy-mode = "rmii"; };
I can see that "eth0" now is on P74 as per the ifconfig/plugin Ethernet cable/ifconfig test:
eth0 Link encap:Ethernet HWaddr d0:ff:50:29:e9:0c inet addr:192.168.0.6 Bcast:192.168.0.255 Mask:255.255.255.0 ... RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Insert cable:
[root /]# ifconfig eth0 Link encap:Ethernet HWaddr d0:ff:50:29:e9:0c inet addr:192.168.0.6 Bcast:192.168.0.255 Mask:255.255.255.0 ... RX bytes:0 (0.0 B) TX bytes:578 (578.0 B)
But now the ping commands fail:
[root /]# ping 192.168.0.1 -c 3 PING 192.168.0.1 (192.168.0.1): 56 data bytes --- 192.168.0.1 ping statistics --- 3 packets transmitted, 0 packets received, 100% packet loss
So what am I missing? The "ethX" names clearly switched hardware jacks as expected, but now pings don't work anymore. Is there another step required?