diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-09-17 23:31:08 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-09-17 23:31:08 +0000 |
commit | 914cb9a156c846211d381076b4fc5c6939db29fa (patch) | |
tree | 311cb50b919c9c66a96830f8693941b9ff4c64ad /sys/dev/pci | |
parent | b20fbc5b7495b5f8ab5b5baefdf1000ccff07439 (diff) |
add a flag to indicate which boards are only capable of 10/100 modes of
operation.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_bge.c | 19 | ||||
-rw-r--r-- | sys/dev/pci/if_bgereg.h | 4 |
2 files changed, 21 insertions, 2 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index f0c579d546c..baf152c492d 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.179 2006/09/17 22:19:37 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.180 2006/09/17 23:31:07 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1655,6 +1655,7 @@ bge_attach(struct device *parent, struct device *self, void *aux) int rseg, gotenaddr = 0; u_int32_t hwcfg = 0; u_int32_t mac_addr = 0; + u_int32_t misccfg; struct ifnet *ifp; caddr_t kva; #ifdef __sparc64__ @@ -1771,6 +1772,22 @@ bge_attach(struct device *parent, struct device *self, void *aux) PCI_VENDOR(subid) == DELL_VENDORID) sc->bge_no_3_led = 1; + misccfg = CSR_READ_4(sc, BGE_MISC_CFG); + misccfg &= BGE_MISCCFG_BOARD_ID_MASK; + + sc->bge_10_100_only = 0; + if ((BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5703 && + (misccfg == 0x4000 || misccfg == 0x8000)) || + (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5705 && + PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BROADCOM && + (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5901 || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5901A2 || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5705F)) || + (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BROADCOM && + (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5751F || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5753F))) + sc->bge_10_100_only = 1; + /* Try to reset the chip. */ DPRINTFN(5, ("bge_reset\n")); bge_reset(sc); diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h index fcf0be367b4..f164a77e484 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.59 2006/09/17 22:19:38 brad Exp $ */ +/* $OpenBSD: if_bgereg.h,v 1.60 2006/09/17 23:31:07 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1728,6 +1728,7 @@ #define BGE_MISCCFG_RESET_CORE_CLOCKS 0x00000001 #define BGE_MISCCFG_TIMER_PRESCALER 0x000000FE #define BGE_MISCCFG_KEEP_GPHY_POWER 0x04000000 +#define BGE_MISCCFG_BOARD_ID_MASK 0x0001e000 #define BGE_32BITTIME_66MHZ (0x41 << 1) @@ -2363,6 +2364,7 @@ struct bge_softc { u_int8_t bge_asf_mode; u_int8_t bge_pcie; u_int8_t bge_pcix; + u_int8_t bge_10_100_only; struct bge_ring_data *bge_rdata; /* rings */ struct bge_chain_data bge_cdata; /* mbufs */ bus_dmamap_t bge_ring_map; |