diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/mii/brgphy.c | 25 | ||||
-rw-r--r-- | sys/dev/pci/if_bge.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/if_bgereg.h | 15 |
3 files changed, 36 insertions, 9 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 7283de7f4b2..e35ee7fe46a 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: brgphy.c,v 1.75 2008/03/02 16:05:26 brad Exp $ */ +/* $OpenBSD: brgphy.c,v 1.76 2008/04/20 01:32:43 brad Exp $ */ /* * Copyright (c) 2000 @@ -91,6 +91,7 @@ void brgphy_bcm54k2_dspcode(struct mii_softc *); void brgphy_adc_bug(struct mii_softc *); void brgphy_5704_a0_bug(struct mii_softc *); void brgphy_ber_bug(struct mii_softc *); +void brgphy_crc_bug(struct mii_softc *); void brgphy_jumbo_settings(struct mii_softc *); void brgphy_eth_wirespeed(struct mii_softc *); @@ -501,6 +502,8 @@ brgphy_reset(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x0400); } + if (bge_sc->bge_flags & BGE_PHY_CRC_BUG) + brgphy_crc_bug(sc); /* Set Jumbo frame settings in the PHY. */ if (bge_sc->bge_flags & BGE_JUMBO_CAP) @@ -671,6 +674,26 @@ brgphy_ber_bug(struct mii_softc *sc) PHY_WRITE(sc, dspcode[i].reg, dspcode[i].val); } +/* BCM5701 A0/B0 CRC bug workaround */ +void +brgphy_crc_bug(struct mii_softc *sc) +{ + static const struct { + int reg; + uint16_t val; + } dspcode[] = { + { BRGPHY_MII_DSP_ADDR_REG, 0x0a75 }, + { 0x1c, 0x8c68 }, + { 0x1c, 0x8d68 }, + { 0x1c, 0x8c68 }, + { 0, 0 }, + }; + int i; + + for (i = 0; dspcode[i].reg != 0; i++) + PHY_WRITE(sc, dspcode[i].reg, dspcode[i].val); +} + void brgphy_jumbo_settings(struct mii_softc *sc) { diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 16d19c15c27..8459839c612 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.224 2008/04/03 22:50:24 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.225 2008/04/20 01:32:43 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1920,6 +1920,9 @@ bge_attach(struct device *parent, struct device *self, void *aux) BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906) sc->bge_flags |= BGE_NO_ETH_WIRE_SPEED; + if (sc->bge_chipid == BGE_CHIPID_BCM5701_A0 || + sc->bge_chipid == BGE_CHIPID_BCM5701_B0) + sc->bge_flags |= BGE_PHY_CRC_BUG; if (BGE_CHIPREV(sc->bge_chipid) == BGE_CHIPREV_5703_AX || BGE_CHIPREV(sc->bge_chipid) == BGE_CHIPREV_5704_AX) sc->bge_flags |= BGE_PHY_ADC_BUG; diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h index 4b1bf3d2416..4a6a84bc4c3 100644 --- a/sys/dev/pci/if_bgereg.h +++ b/sys/dev/pci/if_bgereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bgereg.h,v 1.82 2008/04/03 22:50:24 brad Exp $ */ +/* $OpenBSD: if_bgereg.h,v 1.83 2008/04/20 01:32:43 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -2434,12 +2434,13 @@ struct bge_softc { #define BGE_10_100_ONLY 0x00000400 #define BGE_PHY_FIBER_TBI 0x00000800 #define BGE_PHY_FIBER_MII 0x00001000 -#define BGE_PHY_ADC_BUG 0x00002000 -#define BGE_PHY_5704_A0_BUG 0x00004000 -#define BGE_PHY_JITTER_BUG 0x00008000 -#define BGE_PHY_BER_BUG 0x00010000 -#define BGE_PHY_ADJUST_TRIM 0x00020000 -#define BGE_NO_ETH_WIRE_SPEED 0x00040000 +#define BGE_PHY_CRC_BUG 0x00002000 +#define BGE_PHY_ADC_BUG 0x00004000 +#define BGE_PHY_5704_A0_BUG 0x00008000 +#define BGE_PHY_JITTER_BUG 0x00010000 +#define BGE_PHY_BER_BUG 0x00020000 +#define BGE_PHY_ADJUST_TRIM 0x00040000 +#define BGE_NO_ETH_WIRE_SPEED 0x00080000 bus_dma_tag_t bge_dmatag; u_int32_t bge_chipid; |