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
This commit is contained in:
John Polstra 2002-09-08 19:12:02 +00:00
parent 9339569236
commit b1265c1a98
5 changed files with 32 additions and 3 deletions

View File

@ -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);

View File

@ -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.

View File

@ -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);
}

View File

@ -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

View File

@ -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