summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/brgphy.c
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/brgphy.c
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/brgphy.c')
-rw-r--r--sys/dev/mii/brgphy.c26
1 files changed, 26 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);
OpenPOWER on IntegriCloud