summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2003-08-12 05:18:51 +0000
committerwpaul <wpaul@FreeBSD.org>2003-08-12 05:18:51 +0000
commit1a2d5f38b0e6fb77c067fe3f08059dd9293ab98b (patch)
treef43c7ec569501d8191921219671558aab9d85a13
parentf7a72db8a5fc28c6067312d7e8b803ceda5ba841 (diff)
downloadFreeBSD-src-1a2d5f38b0e6fb77c067fe3f08059dd9293ab98b.zip
FreeBSD-src-1a2d5f38b0e6fb77c067fe3f08059dd9293ab98b.tar.gz
Add support for the Broadcom BCM5901 and BCM5901 rev A2 chips.
These are 10/100 only NICs found on the IBM Thinkpad R40E and G40. These seem to be based on the BCM5705 MAC but with a PHY that doesn't support 1000Mbps modes. Submitted by: Igor Sviridov <sia@nest.org>
-rw-r--r--sys/dev/bge/if_bge.c4
-rw-r--r--sys/dev/bge/if_bgereg.h2
-rw-r--r--sys/dev/mii/brgphy.c30
3 files changed, 31 insertions, 5 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index df389e4..928fe3c 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -154,6 +154,10 @@ static struct bge_type bge_devs[] = {
"Broadcom BCM5705M Gigabit Ethernet" },
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5782,
"Broadcom BCM5782 Gigabit Ethernet" },
+ { BCOM_VENDORID, BCOM_DEVICEID_BCM5901,
+ "Broadcom BCM5901 Fast Ethernet" },
+ { BCOM_VENDORID, BCOM_DEVICEID_BCM5901A2,
+ "Broadcom BCM5901A2 Fast Ethernet" },
{ SK_VENDORID, SK_DEVICEID_ALTIMA,
"SysKonnect Gigabit Ethernet" },
{ ALTIMA_VENDORID, ALTIMA_DEVICE_AC1000,
diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h
index ea09921..02446cf 100644
--- a/sys/dev/bge/if_bgereg.h
+++ b/sys/dev/bge/if_bgereg.h
@@ -1822,6 +1822,8 @@ struct bge_status_block {
#define BCOM_DEVICEID_BCM5705M 0x165D
#define BCOM_DEVICEID_BCM5705M_ALT 0x165E
#define BCOM_DEVICEID_BCM5782 0x1696
+#define BCOM_DEVICEID_BCM5901 0x170D
+#define BCOM_DEVICEID_BCM5901A2 0x170E
/*
* Alteon AceNIC PCI vendor/device ID.
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index 9f6ed9c..ed86ca8a 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -58,6 +58,9 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
#include <dev/bge/if_bgereg.h>
+#include <pci/pcireg.h>
+#include <pci/pcivar.h>
+
#include "miibus_if.h"
static int brgphy_probe(device_t);
@@ -153,6 +156,8 @@ brgphy_attach(dev)
struct mii_attach_args *ma;
struct mii_data *mii;
const char *sep = "";
+ struct bge_softc *bge_sc;
+ int fast_ether_only = FALSE;
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
@@ -186,11 +191,26 @@ brgphy_attach(dev)
sc->mii_capabilities &= ~BMSR_ANEG;
device_printf(dev, " ");
mii_add_media(sc);
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, sc->mii_inst),
- BRGPHY_BMCR_FDX);
- PRINT(", 1000baseTX");
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, sc->mii_inst), 0);
- PRINT("1000baseTX-FDX");
+
+ /* The 590x chips are 10/100 only. */
+
+ bge_sc = mii->mii_ifp->if_softc;
+
+ if (strcmp(mii->mii_ifp->if_name, "bge") == 0 &&
+ pci_get_vendor(bge_sc->bge_dev) == BCOM_VENDORID &&
+ (pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901 ||
+ pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901A2))
+ fast_ether_only = TRUE;
+
+ if (fast_ether_only == FALSE) {
+ ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0,
+ sc->mii_inst), BRGPHY_BMCR_FDX);
+ PRINT(", 1000baseTX");
+ ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T,
+ IFM_FDX, sc->mii_inst), 0);
+ PRINT("1000baseTX-FDX");
+ }
+
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 0);
PRINT("auto");
OpenPOWER on IntegriCloud