From: brad Date: Thu, 17 Jul 2008 19:59:44 +0000 (+0000) Subject: Add a flag and allow the driver to identify the BCM5788 chipsets. They're X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=94ac933cd7cee6a80ce9c3a4b4ce0b3d6e9dd2ea;p=openbsd Add a flag and allow the driver to identify the BCM5788 chipsets. They're slightly different from the other chipsets using the BCM5705 ASIC. ok jsg@ --- diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index cb093f3301e..e03ff01db23 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.237 2008/07/16 03:56:25 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.238 2008/07/17 19:59:44 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1897,6 +1897,11 @@ bge_attach(struct device *parent, struct device *self, void *aux) misccfg = CSR_READ_4(sc, BGE_MISC_CFG); misccfg &= BGE_MISCCFG_BOARD_ID_MASK; + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5705 && + (misccfg == BGE_MISCCFG_BOARD_ID_5788 || + misccfg == BGE_MISCCFG_BOARD_ID_5788M)) + sc->bge_flags |= BGE_IS_5788; + if ((BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5703 && (misccfg == 0x4000 || misccfg == 0x8000)) || (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5705 && diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h index c482e2481b7..8f2571d8929 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.84 2008/07/16 03:56:25 brad Exp $ */ +/* $OpenBSD: if_bgereg.h,v 1.85 2008/07/17 19:59:44 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1802,8 +1802,10 @@ /* Misc. config register */ #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_5788 0x00010000 +#define BGE_MISCCFG_BOARD_ID_5788M 0x00018000 #define BGE_MISCCFG_BOARD_ID_MASK 0x0001e000 +#define BGE_MISCCFG_KEEP_GPHY_POWER 0x04000000 #define BGE_32BITTIME_66MHZ (0x41 << 1) @@ -2440,6 +2442,7 @@ struct bge_softc { #define BGE_PHY_BER_BUG 0x00020000 #define BGE_PHY_ADJUST_TRIM 0x00040000 #define BGE_NO_ETH_WIRE_SPEED 0x00080000 +#define BGE_IS_5788 0x00100000 bus_dma_tag_t bge_dmatag; u_int32_t bge_chipid;