diff --git a/sys/conf/options b/sys/conf/options index 4121857b3ef3..5dc1b4a2a57a 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -624,6 +624,9 @@ ED_HPP opt_ed.h ED_3C503 opt_ed.h ED_SIC opt_ed.h +# bge driver +BGE_FAKE_AUTONEG opt_bge.h + # wi driver WI_SYMBOL_FIRMWARE opt_wi.h diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index cad9143bd8d3..1633aa37d033 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -108,6 +108,8 @@ __FBSDID("$FreeBSD$"); #include +#include "opt_bge.h" + #define BGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) MODULE_DEPEND(bge, pci, 1, 1, 1); @@ -3454,6 +3456,25 @@ bge_ifmedia_upd(ifp) return(EINVAL); switch(IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: +#ifndef BGE_FAKE_AUTONEG + /* + * The BCM5704 ASIC appears to have a special + * mechanism for programming the autoneg + * advertisement registers in TBI mode. + */ + if (sc->bge_asicrev == 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); + } +#endif break; case IFM_1000_SX: if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) { diff --git a/sys/modules/bge/Makefile b/sys/modules/bge/Makefile index 9a28f3b1dfbf..53d8e54a2657 100644 --- a/sys/modules/bge/Makefile +++ b/sys/modules/bge/Makefile @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/bge KMOD= if_bge -SRCS= if_bge.c miibus_if.h miidevs.h opt_bdg.h device_if.h bus_if.h pci_if.h +SRCS= opt_bge.h if_bge.c miibus_if.h miidevs.h opt_bdg.h device_if.h bus_if.h pci_if.h .include