diff options
author | jdp <jdp@FreeBSD.org> | 2002-09-08 19:12:02 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 2002-09-08 19:12:02 +0000 |
commit | 48dd5385115e2ca11641982d65c4e823e8c7045b (patch) | |
tree | bae99161b0597732c8614eb22c7088ccd2ab5bd9 | |
parent | 8eb0cb6eaa0f426e61d107c77fb69aba222cc993 (diff) | |
download | FreeBSD-src-48dd5385115e2ca11641982d65c4e823e8c7045b.zip FreeBSD-src-48dd5385115e2ca11641982d65c4e823e8c7045b.tar.gz |
Add support for the BCM5703x chips. I do not have one of these
cards to test; however the submitter reports that this patch works
with the on-board interface on the IBM x235 server.
Submitted by: Jung-uk Kim <jkim@niksun.com>
MFC after: 1 month
-rw-r--r-- | sys/dev/bge/if_bge.c | 22 | ||||
-rw-r--r-- | sys/dev/bge/if_bgereg.h | 4 | ||||
-rw-r--r-- | sys/dev/mii/brgphy.c | 6 | ||||
-rw-r--r-- | sys/dev/mii/miidevs | 1 | ||||
-rw-r--r-- | sys/dev/mii/miidevs.h | 2 |
5 files changed, 32 insertions, 3 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index afa963f..d3771f9 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -141,6 +141,8 @@ static struct bge_type bge_devs[] = { "Broadcom BCM5700 Gigabit Ethernet" }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5701, "Broadcom BCM5701 Gigabit Ethernet" }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5703X, + "Broadcom BCM5703X Gigabit Ethernet" }, { SK_VENDORID, SK_DEVICEID_ALTIMA, "SysKonnect Gigabit Ethernet" }, { ALTIMA_VENDORID, ALTIMA_DEVICE_AC1000, @@ -481,8 +483,12 @@ bge_miibus_readreg(dev, phy, reg) sc = device_get_softc(dev); ifp = &sc->arpcom.ac_if; - if (sc->bge_asicrev == BGE_ASICREV_BCM5701_B5 && phy != 1) - return(0); + if (phy != 1) + switch(sc->bge_asicrev) { + case BGE_ASICREV_BCM5701_B5: + case BGE_ASICREV_BCM5703_A2: + return(0); + } CSR_WRITE_4(sc, BGE_MI_COMM, BGE_MICMD_READ|BGE_MICOMM_BUSY| BGE_MIPHY(phy)|BGE_MIREG(reg)); @@ -1481,6 +1487,7 @@ bge_attach(dev) struct ifnet *ifp; struct bge_softc *sc; u_int32_t hwcfg = 0; + u_int32_t mac_addr = 0; int unit, error = 0, rid; s = splimp(); @@ -1569,7 +1576,16 @@ bge_attach(dev) /* * Get station address from the EEPROM. */ - if (bge_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr, + mac_addr = bge_readmem_ind(sc, 0x0c14); + if ((mac_addr >> 16) == 0x484b) { + sc->arpcom.ac_enaddr[0] = (u_char)(mac_addr >> 8); + sc->arpcom.ac_enaddr[1] = (u_char)mac_addr; + mac_addr = bge_readmem_ind(sc, 0x0c18); + sc->arpcom.ac_enaddr[2] = (u_char)(mac_addr >> 24); + sc->arpcom.ac_enaddr[3] = (u_char)(mac_addr >> 16); + sc->arpcom.ac_enaddr[4] = (u_char)(mac_addr >> 8); + sc->arpcom.ac_enaddr[5] = (u_char)mac_addr; + } else if (bge_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr, BGE_EE_MAC_OFFSET + 2, ETHER_ADDR_LEN)) { printf("bge%d: failed to read station address\n", unit); bge_release_resources(sc); diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h index 6b8aa52..667c413 100644 --- a/sys/dev/bge/if_bgereg.h +++ b/sys/dev/bge/if_bgereg.h @@ -221,6 +221,9 @@ #define BGE_ASICREV_BCM5701_B0 0x01000000 #define BGE_ASICREV_BCM5701_B2 0x01020000 #define BGE_ASICREV_BCM5701_B5 0x01050000 +#define BGE_ASICREV_BCM5703_A0 0x10000000 +#define BGE_ASICREV_BCM5703_A1 0x10010000 +#define BGE_ASICREV_BCM5703_A2 0x10020000 /* shorthand one */ #define BGE_ASICREV_BCM5700 0x71000000 @@ -1781,6 +1784,7 @@ struct bge_status_block { #define BCOM_VENDORID 0x14E4 #define BCOM_DEVICEID_BCM5700 0x1644 #define BCOM_DEVICEID_BCM5701 0x1645 +#define BCOM_DEVICEID_BCM5703X 0x16A7 /* * Alteon AceNIC PCI vendor/device ID. diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index fb8a9b8..3f534d5 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -119,6 +119,12 @@ static int 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_BCM5703) { + device_set_desc(dev, MII_STR_xxBROADCOM_BCM5703); + return(0); + } + return(ENXIO); } diff --git a/sys/dev/mii/miidevs b/sys/dev/mii/miidevs index 27d7a2e..82efd89 100644 --- a/sys/dev/mii/miidevs +++ b/sys/dev/mii/miidevs @@ -113,6 +113,7 @@ model xxBROADCOM BCM5400 0x0004 Broadcom 1000baseTX PHY model xxBROADCOM BCM5401 0x0005 BCM5401 10/100/1000baseTX PHY 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 /* Davicom Semiconductor PHYs */ model xxDAVICOM DM9101 0x0000 DM9101 10/100 media interface diff --git a/sys/dev/mii/miidevs.h b/sys/dev/mii/miidevs.h index 69cdae2..ed4e6c0 100644 --- a/sys/dev/mii/miidevs.h +++ b/sys/dev/mii/miidevs.h @@ -132,6 +132,8 @@ #define MII_STR_xxBROADCOM_BCM5411 "BCM5411 10/100/1000baseTX PHY" #define MII_MODEL_xxBROADCOM_BCM5701 0x0011 #define MII_STR_xxBROADCOM_BCM5701 "BCM5701 10/100/1000baseTX PHY" +#define MII_MODEL_xxBROADCOM_BCM5703 0x0016 +#define MII_STR_xxBROADCOM_BCM5703 "BCM5703 10/100/1000baseTX PHY" /* Davicom Semiconductor PHYs */ #define MII_MODEL_xxDAVICOM_DM9101 0x0000 |