diff options
author | ps <ps@FreeBSD.org> | 2004-09-24 22:24:33 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2004-09-24 22:24:33 +0000 |
commit | fd095ca48d37e5ab204d6aa1e65c767330c028ec (patch) | |
tree | aba0582966874b7ecb2affde842d823ac5087130 /sys/dev/mii/brgphy.c | |
parent | 632ac71095e33f5c33298c92cc233b05687316a1 (diff) | |
download | FreeBSD-src-fd095ca48d37e5ab204d6aa1e65c767330c028ec.zip FreeBSD-src-fd095ca48d37e5ab204d6aa1e65c767330c028ec.tar.gz |
Add support for the BCM5750/5751. Unfortunately the documentation
I have from Broadcom does not give much information on these devices,
so the Broadcom Linux driver was used for clues to what these chips
support. It turns out they are similar to the 5705 with the 5751
being the PCI-Express version and needing special work-arounds and
settings.
Diffstat (limited to 'sys/dev/mii/brgphy.c')
-rw-r--r-- | sys/dev/mii/brgphy.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 6680b53..85cf768 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -94,6 +94,7 @@ static void brgphy_loop(struct mii_softc *); static void bcm5401_load_dspcode(struct mii_softc *); static void bcm5411_load_dspcode(struct mii_softc *); static void bcm5703_load_dspcode(struct mii_softc *); +static void bcm5750_load_dspcode(struct mii_softc *); static int brgphy_mii_model; static int @@ -146,6 +147,12 @@ brgphy_probe(dev) return(0); } + if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxBROADCOM && + MII_MODEL(ma->mii_id2) == MII_MODEL_xxBROADCOM_BCM5750) { + device_set_desc(dev, MII_STR_xxBROADCOM_BCM5750); + return(0); + } + return(ENXIO); } @@ -579,6 +586,29 @@ bcm5704_load_dspcode(struct mii_softc *sc) } static void +bcm5750_load_dspcode(struct mii_softc *sc) +{ + static const struct { + int reg; + u_int16_t val; + } dspcode[] = { + { 0x18, 0x0c00 }, + { 0x17, 0x000a }, + { 0x15, 0x310b }, + { 0x17, 0x201f }, + { 0x15, 0x9506 }, + { 0x17, 0x401f }, + { 0x15, 0x14e2 }, + { 0x18, 0x0400 }, + { 0, 0 }, + }; + int i; + + for (i = 0; dspcode[i].reg != 0; i++) + PHY_WRITE(sc, dspcode[i].reg, dspcode[i].val); +} + +static void brgphy_reset(struct mii_softc *sc) { u_int32_t val; @@ -600,6 +630,9 @@ brgphy_reset(struct mii_softc *sc) case MII_MODEL_xxBROADCOM_BCM5704: bcm5704_load_dspcode(sc); break; + case MII_MODEL_xxBROADCOM_BCM5750: + bcm5750_load_dspcode(sc); + break; } ifp = sc->mii_pdata->mii_ifp; |