summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2003-07-16 00:09:56 +0000
committerwpaul <wpaul@FreeBSD.org>2003-07-16 00:09:56 +0000
commite611c416998a4d947f82577fc6d0507a5dbd56f0 (patch)
treef818757ae33508b65cd8a7c6e007210e8174151c /sys/dev/mii
parenta54595f215d4214fd4bf8611ab2de5ebb1cc5f69 (diff)
downloadFreeBSD-src-e611c416998a4d947f82577fc6d0507a5dbd56f0.zip
FreeBSD-src-e611c416998a4d947f82577fc6d0507a5dbd56f0.tar.gz
Add support for the BCM5705 and its ilk. Changes:
- 5705 doesn't support jumbo frames - Statistics must be read from registers - RX return ring must be capped at 512 entries - Omit initialization of certain device blocks - Acknowledge link change interrupts by setting the 'link changed' bit in the status register (used to have no effect) - Remember to toggle the MI completion bit too - Set the mbuf low watermark differently (on-chip memory buffers, not BSD mbufs) - Don't enable Ethernet@WireSpeed feature for certain 5705 chip revs - Add additional PCI IDs for 5705 and 5782 parts - Add a forgotten 5704 PCI ID Most changes ripped kicking and screaming from the Broadcom linux driver. Thanks to Paul Saab for sanity testing. (My lack of sanity has been confirmed.)
Diffstat (limited to 'sys/dev/mii')
-rw-r--r--sys/dev/mii/brgphy.c26
-rw-r--r--sys/dev/mii/miidevs1
2 files changed, 27 insertions, 0 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index 614d0af..9f6ed9c 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -54,6 +54,9 @@ __FBSDID("$FreeBSD$");
#include "miidevs.h"
#include <dev/mii/brgphyreg.h>
+#include <net/if_arp.h>
+#include <machine/bus.h>
+#include <dev/bge/if_bgereg.h>
#include "miibus_if.h"
@@ -133,6 +136,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_BCM5705) {
+ device_set_desc(dev, MII_STR_xxBROADCOM_BCM5705);
+ return(0);
+ }
+
return(ENXIO);
}
@@ -552,6 +561,8 @@ static void
brgphy_reset(struct mii_softc *sc)
{
u_int32_t val;
+ struct ifnet *ifp;
+ struct bge_softc *bge_sc;
mii_phy_reset(sc);
@@ -570,6 +581,21 @@ brgphy_reset(struct mii_softc *sc)
break;
}
+ ifp = sc->mii_pdata->mii_ifp;
+ bge_sc = ifp->if_softc;
+
+ /*
+ * Don't enable Ethernet@WireSpeed for the 5700 or the
+ * 5705 A1 and A2 chips. Make sure we only do this test
+ * on "bge" NICs, since other drivers may use this same
+ * PHY subdriver.
+ */
+ if (strcmp(ifp->if_name, "bge") == 0 &&
+ (bge_sc->bge_asicrev == BGE_ASICREV_BCM5700 ||
+ bge_sc->bge_chipid == BGE_CHIPID_BCM5705_A1 ||
+ bge_sc->bge_chipid == BGE_CHIPID_BCM5705_A2))
+ return;
+
/* Enable Ethernet@WireSpeed. */
PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x7007);
val = PHY_READ(sc, BRGPHY_MII_AUXCTL);
diff --git a/sys/dev/mii/miidevs b/sys/dev/mii/miidevs
index 6bac515..d57c890 100644
--- a/sys/dev/mii/miidevs
+++ b/sys/dev/mii/miidevs
@@ -116,6 +116,7 @@ model xxBROADCOM BCM5411 0x0007 BCM5411 10/100/1000baseTX PHY
model xxBROADCOM BCM5701 0x0011 BCM5701 10/100/1000baseTX PHY
model xxBROADCOM BCM5703 0x0016 BCM5703 10/100/1000baseTX PHY
model xxBROADCOM BCM5704 0x0019 BCM5704 10/100/1000baseTX PHY
+model xxBROADCOM BCM5705 0x001a BCM5705 10/100/1000baseTX PHY
/* Davicom Semiconductor PHYs */
model xxDAVICOM DM9101 0x0000 DM9101 10/100 media interface
OpenPOWER on IntegriCloud