Embedded switch instead of stadard PHY

Damjan Marion damjan.marion at gmail.com
Sat May 7 17:44:55 UTC 2011


Hi,


I would like to implement support for embedded switch on WRT350Nv2 router which is based on 88F5181L SoC (ARM). FreeBSD already have support for embedded gigabit card (if_mge) but in case if this router MAC is connected directly to 8-port ethernet chip (88E6131). If I use MII_PHY_ANY scan founds following PHYs on miibus:

mge0: <Marvell Gigabit Ethernet controller> mem 0xf1072000-0xf1073fff irq 18,19,20,21,22 on simplebus0
miibus0: <MII bus> on mge0
e1000phy0: <Marvell 88E1000 Gigabit PHY> PHY 12 on miibus0
e1000phy0: id1=0x0141, id2=0x0c00 
e1000phy1: <Marvell 88E1000 Gigabit PHY> PHY 13 on miibus0
e1000phy1: id1=0x0141, id2=0x0c00 
e1000phy2: <Marvell 88E1000 Gigabit PHY> PHY 14 on miibus0
e1000phy2: id1=0x0141, id2=0x0c00 
e1000phy3: <Marvell 88E1000 Gigabit PHY> PHY 15 on miibus0
e1000phy3: id1=0x0141, id2=0x0c00 
ukphy0: <Generic IEEE 802.3u media interface> PHY 20 on miibus0
ukphy0:  
ukphy1: <Generic IEEE 802.3u media interface> PHY 21 on miibus0
ukphy1:  
ukphy2: <Generic IEEE 802.3u media interface> PHY 22 on miibus0
ukphy2:  
ukphy3: <Generic IEEE 802.3u media interface> PHY 23 on miibus0

if_mge MAC is connected to port 3 of E6131 and port 3 acts in reverse-GMII mode to simulate PHY side.

Reason for output above is that E6131 uses non-standard registers on multiple device addresses and on some of them mii_attach fails, and on another it false detects PHY (20-23 above).

I would like to hear form more experienced people how to implement this properly, as it is obvious that it cannot be addressed with existing routines.

On linux this is implemented as dsa driver (Distributed Switch Architecture) which supports several similar devices (net/dsa/*).

Thanks in advance,

Damjan


More information about the freebsd-hackers mailing list