Part Number:OCTVO-3P-AM335X
We have a Custom board utilizing an AM335x and are trying to interface the ethernet subsystem to an external switch utilizing both mii controllers. GMII1 is connected to a LAN8710A phy while GMII2 is connected to a 5-Port Micrel KSZ8995XA Switch. The device tree has been configured in dual_emac mode as follows:
ethernet@4a100000 { compatible = "ti,am335x-cpsw", "ti,cpsw"; ti,hwmods = "cpgmac0"; clocks = <0x3e 0x3f>; clock-names = "fck", "cpts"; cpdma_channels = <0x8>; ale_entries = <0x400>; bd_ram_size = <0x2000>; mac_control = <0x20>; slaves = <0x2>; active_slave = <0x0>; cpts_clock_mult = <0x80000000>; cpts_clock_shift = <0x1d>; reg = <0x4a100000 0x800 0x4a101200 0x100>; #address-cells = <0x1>; #size-cells = <0x1>; interrupts = <0x28 0x29 0x2a 0x2b>; ranges; syscon = <0x5>; status = "okay"; pinctrl-names = "default", "sleep"; pinctrl-0 = <0x40 0x59>; pinctrl-1 = <0x41>; dual_emac=<1>; linux,phandle = <0xcb>; phandle = <0xcb>; mdio@4a101000 { compatible = "ti,cpsw-mdio", "ti,davinci_mdio"; #address-cells = <0x1>; #size-cells = <0x0>; ti,hwmods = "davinci_mdio"; bus_freq = <0xf4240>; reg = <0x4a101000 0x100>; status = "okay"; pinctrl-names = "default", "sleep"; pinctrl-0 = <0x42>; pinctrl-1 = <0x43>; linux,phandle = <0x44>; phandle = <0x44>; }; slave@4a100200 { phy_id = <0x44>,<0>; phy-mode = "mii"; dual_emac_res_vlan = <1>; status = "okay"; }; slave@4a100300 { phy_id = <0x44>,<1>; phy-mode = "mii"; dual_emac_res_vlan = <2>; status = "okay"; };
The problem that is occurring is that during uBoot, the davinci_mdio drivers properly detect 6 different phy_ids from 0 (LAN8710) and 1-5(KSZ8995XA), but the cpsw will only attach itself to port 1 on the switch. If I plug into ports 2-5 I can see there is a link detection via an external hub, but linux will still not detect a connection due to the mdio only monitoring port 1. How could I modify the cpsw subsystem to allow for usage of all 5 ports on the second ethernet interface? The following messages from uBoot appear:
root@arm:~# dmesg | grep mdio
[ 1.582544] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[ 1.590249] davinci_mdio 4a101000.mdio: detected phy mask ffffffc0
[ 1.596865] davinci_mdio: dt: updated phy_id[0] from phy_mask[ffffffc0]
[ 1.603540] davinci_mdio: dt: updated phy_id[1] from phy_mask[ffffffc0]
[ 1.655727] libphy: 4a101000.mdio: probed
[ 1.659815] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[ 1.668997] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver unknown
[ 1.677040] davinci_mdio 4a101000.mdio: phy[2]: device 4a101000.mdio:02, driver unknown
[ 1.685081] davinci_mdio 4a101000.mdio: phy[3]: device 4a101000.mdio:03, driver unknown
[ 1.693122] davinci_mdio 4a101000.mdio: phy[4]: device 4a101000.mdio:04, driver unknown
[ 1.701162] davinci_mdio 4a101000.mdio: phy[5]: device 4a101000.mdio:05, driver unknown
[ 10.435942] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[ 13.270365] Generic PHY 4a101000.mdio:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=4a101000.mdio:01, irq=POLL)
[ 14.280006] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
root@arm:~# dmesg | grep eth
[ 1.710089] cpsw 4a100000.ethernet: Detected MACID = 98:84:e3:93:ac:b9
[ 1.716766] cpsw 4a100000.ethernet: cpts: overflow check period 1250 (jiffies)
[ 1.724866] cpsw 4a100000.ethernet: cpsw: Detected MACID = 98:84:e3:93:ac:bb
[ 10.294757] net eth0: initializing cpsw version 1.12 (0)
[ 10.307124] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[ 10.333143] cpsw 4a100000.ethernet: ALE Table size 1024
[ 10.516808] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 13.266952] net eth1: initializing cpsw version 1.12 (0)
[ 13.266966] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[ 13.266972] cpsw 4a100000.ethernet: ALE Table size 1024
[ 13.309176] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 13.642743] using random self ethernet address
[ 13.651194] using random host ethernet address
[ 13.794406] using random self ethernet address
[ 13.805871] using random host ethernet address
[ 14.142252] net eth0: initializing cpsw version 1.12 (0)
[ 14.357619] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 17.412018] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[ 17.442821] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 17.569929] 8021q: adding VLAN 0 to HW filter on device eth0
[ 17.582374] 8021q: adding VLAN 0 to HW filter on device eth1