diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_bge.c | 31 | ||||
-rw-r--r-- | sys/dev/pci/if_bgereg.h | 4 |
2 files changed, 29 insertions, 6 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index f88221e42e0..667a3d228e0 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.289 2009/12/17 00:55:19 sthen Exp $ */ +/* $OpenBSD: if_bge.c,v 1.290 2010/01/09 06:19:01 naddy Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -287,9 +287,15 @@ const struct pci_matchid bge_devices[] = { { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5906 }, { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5906M }, { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57760 }, + { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57761 }, + { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57765 }, { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57780 }, + { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57781 }, + { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57785 }, { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57788 }, { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57790 }, + { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57791 }, + { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57795 }, { PCI_VENDOR_FUJITSU, PCI_PRODUCT_FUJITSU_PW008GE4 }, { PCI_VENDOR_FUJITSU, PCI_PRODUCT_FUJITSU_PW008GE5 }, @@ -400,6 +406,7 @@ static const struct bge_revision bge_majorrevs[] = { { BGE_ASICREV_BCM5906, "unknown BCM5906" }, { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { BGE_ASICREV_BCM5717, "unknown BCM5717" }, + { BGE_ASICREV_BCM57765, "unknown BCM57765" }, { 0, NULL } }; @@ -1346,7 +1353,8 @@ bge_blockinit(struct bge_softc *sc) /* Configure mbuf pool watermarks */ /* new Broadcom docs strongly recommend these: */ if (BGE_IS_5705_PLUS(sc) && - BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5717) { + BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5717 && + BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM57765) { CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0); if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906) { @@ -1403,7 +1411,8 @@ bge_blockinit(struct bge_softc *sc) /* Initialize the standard RX ring control block */ rcb = &sc->bge_rdata->bge_info.bge_std_rx_rcb; BGE_HOSTADDR(rcb->bge_hostaddr, BGE_RING_DMA_ADDR(sc, bge_rx_std_ring)); - if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717) + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717 || + BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57765) rcb->bge_maxlen_flags = (BGE_RCB_MAXLEN_FLAGS(512, 0) | (ETHER_MAX_DIX_LEN << 2)); else if (BGE_IS_5705_PLUS(sc)) @@ -1465,7 +1474,8 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_RBDI_STD_REPL_THRESH, 8); CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, 8); - if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717) { + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717 || + BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57765) { CSR_WRITE_4(sc, BGE_STD_REPL_LWM, 4); CSR_WRITE_4(sc, BGE_JUMBO_REPL_LWM, 4); } @@ -1844,6 +1854,14 @@ bge_attach(struct device *parent, struct device *self, void *aux) PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5724) sc->bge_chipid = pci_conf_read(pc, pa->pa_tag, BGE_PCI_GEN2_PRODID_ASICREV); + else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM57761 || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM57765 || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM57781 || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM57785 || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM57791 || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM57795) + sc->bge_chipid = pci_conf_read(pc, pa->pa_tag, + BGE_PCI_GEN15_PRODID_ASICREV); else sc->bge_chipid = pci_conf_read(pc, pa->pa_tag, BGE_PCI_PRODID_ASICREV); @@ -1904,6 +1922,7 @@ bge_attach(struct device *parent, struct device *self, void *aux) BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5784 || BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785 || BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787 || + BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57765 || BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57780) sc->bge_flags |= BGE_5755_PLUS; @@ -1981,6 +2000,7 @@ bge_attach(struct device *parent, struct device *self, void *aux) BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5906 && BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5717 && BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5785 && + BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM57765 && BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM57780) { if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5755 || BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5761 || @@ -2449,7 +2469,8 @@ bge_reset(struct bge_softc *sc) if (sc->bge_flags & BGE_PCIE && sc->bge_chipid != BGE_CHIPID_BCM5750_A0 && BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5717 && - BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5785) { + BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5785 && + BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM57765) { u_int32_t v; /* Enable PCI Express bug fix */ diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h index fde4f4bfb05..3c5b523b470 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.99 2009/10/11 10:36:31 sthen Exp $ */ +/* $OpenBSD: if_bgereg.h,v 1.100 2010/01/09 06:19:01 naddy Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -210,6 +210,7 @@ #define BGE_PCI_ISR_MBX_LO 0xB4 #define BGE_PCI_PRODID_ASICREV 0xBC #define BGE_PCI_GEN2_PRODID_ASICREV 0xF4 +#define BGE_PCI_GEN15_PRODID_ASICREV 0xFC /* XXX: * Used in PCI-Express code for 575x chips. @@ -326,6 +327,7 @@ #define BGE_ASICREV_BCM5785 0x5785 #define BGE_ASICREV_BCM57780 0x57780 #define BGE_ASICREV_BCM5717 0x5717 +#define BGE_ASICREV_BCM57765 0x57785 /* chip revisions */ #define BGE_CHIPREV(x) ((x) >> 8) |