diff options
Diffstat (limited to 'sys/dev/pci/if_bge.c')
-rw-r--r-- | sys/dev/pci/if_bge.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 3c4833b28a4..769c48d9d56 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.69 2005/06/29 04:25:10 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.70 2005/07/01 20:47:50 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -3164,6 +3164,23 @@ bge_ifmedia_upd(ifp) return(EINVAL); switch(IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: + /* + * The BCM5704 ASIC appears to have a special + * mechanism for programming the autoneg + * advertisement registers in TBI mode. + */ + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5704) { + uint32_t sgdig; + CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0); + sgdig = CSR_READ_4(sc, BGE_SGDIG_CFG); + sgdig |= BGE_SGDIGCFG_AUTO| + BGE_SGDIGCFG_PAUSE_CAP| + BGE_SGDIGCFG_ASYM_PAUSE; + CSR_WRITE_4(sc, BGE_SGDIG_CFG, + sgdig|BGE_SGDIGCFG_SEND); + DELAY(5); + CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig); + } break; case IFM_1000_SX: if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) { |