if_bge: Support more chipsets
authorMichael Neumann <mneumann@ntecs.de>
Mon, 18 Jul 2011 23:00:14 +0000 (01:00 +0200)
committerMichael Neumann <mneumann@ntecs.de>
Mon, 18 Jul 2011 23:00:14 +0000 (01:00 +0200)
Add (limited) support for 5761, 5784, 57780 chipsets.

Tested with a Broadcom BCM5723. It works when media is set
before an IP is being assigned, otherwise it panics. Also panics
a lot on a SMP system.

Obtained from: FreeBSD rev 197832.

sys/bus/pci/pcidevs
sys/bus/pci/pcidevs.h
sys/bus/pci/pcidevs_data.h
sys/dev/netif/bge/if_bge.c
sys/dev/netif/bge/if_bgereg.h

index 9f385e5..cdbdee3 100644 (file)
@@ -1110,6 +1110,7 @@ product BROADCOM BCM5705K 0x1654  BCM5705K 10/100/1000 Ethetnet
 product BROADCOM BCM5720       0x1658  BCM5720
 product BROADCOM BCM5721       0x1659  BCM5721 10/100/1000 Ethernet
 product BROADCOM BCM5722       0x165a  BCM5722
+product BROADCOM BCM5723       0x165b  BCM5723
 product BROADCOM BCM5705M      0x165d  BCM5705M 10/100/1000 Ethernet
 product BROADCOM BCM5705M_ALT  0x165e  BCM5705M 10/100/1000 Ethernet
 product BROADCOM BCM5714       0x1668  BCM5714 1000baseT Ethernet
@@ -1129,11 +1130,20 @@ product BROADCOM BCM5755        0x167b  BCM5755
 product BROADCOM BCM5750M      0x167c  BCM5750M 10/100/1000 Ethernet
 product BROADCOM BCM5751M      0x167d  BCM5751M 10/100/1000 Ethernet
 product BROADCOM BCM5751F      0x167e  BCM5751F
+product BROADCOM BCM5761       0x1681  BCM5761
+product BROADCOM BCM5761E      0x1680  BCM5761E
+product BROADCOM BCM5761S      0x1688  BCM5761S
+product BROADCOM BCM5761SE     0x1689  BCM5761SE
+product BROADCOM BCM5764       0x1684  BCM5764
 product BROADCOM BCM5787F      0x167f  BCM5787F
 product BROADCOM BCM5787M      0x1693  BCM5787M
 product BROADCOM BCM5782       0x1696  BCM5782 10/100/1000 Ethernet
+product BROADCOM BCM5784       0x1698  BCM5784
+product BROADCOM BCM5785F      0x16a0  BCM5785F
+product BROADCOM BCM5785G      0x1699  BCM5785G
 product BROADCOM BCM5786       0x169a  BCM5786
 product BROADCOM BCM5787       0x169b  BCM5787
+product BROADCOM BCM5787F      0x167f  BCM5787F
 product BROADCOM BCM5788       0x169c  BCM5788 10/100/1000 Enternet
 product BROADCOM BCM5789       0x169d  BCM5789 10/100/1000 Enternet
 product BROADCOM BCM5702X      0x16a6  BCM5702X 10/100/1000 Ethernet
@@ -1153,6 +1163,10 @@ product BROADCOM BCM5901 0x170d  BCM5901 10/100 Ethernet
 product BROADCOM BCM5901A2     0x170e  BCM5901A 10/100 Ethernet
 product BROADCOM BCM5906       0x1712  BCM5906
 product BROADCOM BCM5906M      0x1713  BCM5906M
+product BROADCOM BCM57760      0x1690  BCM57760
+product BROADCOM BCM57780      0x1692  BCM57780
+product BROADCOM BCM57788      0x1691  BCM57788
+product BROADCOM BCM57790      0x1694  BCM57790
 product BROADCOM BCM4301       0x4301  BCM4301 802.11b Wireless Lan
 product BROADCOM BCM4307       0x4307  BCM4307 802.11b Wireless Lan
 product BROADCOM BCM4311       0x4311  BCM4311 802.11a/b/g Wireless Lan
index 35b12ef..e2be60a 100644 (file)
 #define        PCI_PRODUCT_BROADCOM_BCM5720    0x1658          /* BCM5720 */
 #define        PCI_PRODUCT_BROADCOM_BCM5721    0x1659          /* BCM5721 10/100/1000 Ethernet */
 #define        PCI_PRODUCT_BROADCOM_BCM5722    0x165a          /* BCM5722 */
+#define        PCI_PRODUCT_BROADCOM_BCM5723    0x165b          /* BCM5723 */
 #define        PCI_PRODUCT_BROADCOM_BCM5705M   0x165d          /* BCM5705M 10/100/1000 Ethernet */
 #define        PCI_PRODUCT_BROADCOM_BCM5705M_ALT       0x165e          /* BCM5705M 10/100/1000 Ethernet */
 #define        PCI_PRODUCT_BROADCOM_BCM5714    0x1668          /* BCM5714 1000baseT Ethernet */
 #define        PCI_PRODUCT_BROADCOM_BCM5750M   0x167c          /* BCM5750M 10/100/1000 Ethernet */
 #define        PCI_PRODUCT_BROADCOM_BCM5751M   0x167d          /* BCM5751M 10/100/1000 Ethernet */
 #define        PCI_PRODUCT_BROADCOM_BCM5751F   0x167e          /* BCM5751F */
+#define        PCI_PRODUCT_BROADCOM_BCM5761    0x1681          /* BCM5761 */
+#define        PCI_PRODUCT_BROADCOM_BCM5761E   0x1680          /* BCM5761E */
+#define        PCI_PRODUCT_BROADCOM_BCM5761S   0x1688          /* BCM5761S */
+#define        PCI_PRODUCT_BROADCOM_BCM5761SE  0x1689          /* BCM5761SE */
+#define        PCI_PRODUCT_BROADCOM_BCM5764    0x1684          /* BCM5764 */
 #define        PCI_PRODUCT_BROADCOM_BCM5787F   0x167f          /* BCM5787F */
 #define        PCI_PRODUCT_BROADCOM_BCM5787M   0x1693          /* BCM5787M */
 #define        PCI_PRODUCT_BROADCOM_BCM5782    0x1696          /* BCM5782 10/100/1000 Ethernet */
+#define        PCI_PRODUCT_BROADCOM_BCM5784    0x1698          /* BCM5784 */
+#define        PCI_PRODUCT_BROADCOM_BCM5785F   0x16a0          /* BCM5785F */
+#define        PCI_PRODUCT_BROADCOM_BCM5785G   0x1699          /* BCM5785G */
 #define        PCI_PRODUCT_BROADCOM_BCM5786    0x169a          /* BCM5786 */
 #define        PCI_PRODUCT_BROADCOM_BCM5787    0x169b          /* BCM5787 */
+#define        PCI_PRODUCT_BROADCOM_BCM5787F   0x167f          /* BCM5787F */
 #define        PCI_PRODUCT_BROADCOM_BCM5788    0x169c          /* BCM5788 10/100/1000 Enternet */
 #define        PCI_PRODUCT_BROADCOM_BCM5789    0x169d          /* BCM5789 10/100/1000 Enternet */
 #define        PCI_PRODUCT_BROADCOM_BCM5702X   0x16a6          /* BCM5702X 10/100/1000 Ethernet */
 #define        PCI_PRODUCT_BROADCOM_BCM5901A2  0x170e          /* BCM5901A 10/100 Ethernet */
 #define        PCI_PRODUCT_BROADCOM_BCM5906    0x1712          /* BCM5906 */
 #define        PCI_PRODUCT_BROADCOM_BCM5906M   0x1713          /* BCM5906M */
+#define        PCI_PRODUCT_BROADCOM_BCM57760   0x1690          /* BCM57760 */
+#define        PCI_PRODUCT_BROADCOM_BCM57780   0x1692          /* BCM57780 */
+#define        PCI_PRODUCT_BROADCOM_BCM57788   0x1691          /* BCM57788 */
+#define        PCI_PRODUCT_BROADCOM_BCM57790   0x1694          /* BCM57790 */
 #define        PCI_PRODUCT_BROADCOM_BCM4301    0x4301          /* BCM4301 802.11b Wireless Lan */
 #define        PCI_PRODUCT_BROADCOM_BCM4307    0x4307          /* BCM4307 802.11b Wireless Lan */
 #define        PCI_PRODUCT_BROADCOM_BCM4311    0x4311          /* BCM4311 802.11a/b/g Wireless Lan */
index e865c76..3b13944 100644 (file)
@@ -2484,6 +2484,12 @@ const struct pci_knowndev pci_knowndevs[] = {
            "BCM5722",
        },
        {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5723,
+           0,
+           "Broadcom Corporation",
+           "BCM5723",
+       },
+       {
            PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5705M,
            0,
            "Broadcom Corporation",
@@ -2598,6 +2604,36 @@ const struct pci_knowndev pci_knowndevs[] = {
            "BCM5751F",
        },
        {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5761,
+           0,
+           "Broadcom Corporation",
+           "BCM5761",
+       },
+       {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5761E,
+           0,
+           "Broadcom Corporation",
+           "BCM5761E",
+       },
+       {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5761S,
+           0,
+           "Broadcom Corporation",
+           "BCM5761S",
+       },
+       {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5761SE,
+           0,
+           "Broadcom Corporation",
+           "BCM5761SE",
+       },
+       {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5764,
+           0,
+           "Broadcom Corporation",
+           "BCM5764",
+       },
+       {
            PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5787F,
            0,
            "Broadcom Corporation",
@@ -2616,6 +2652,24 @@ const struct pci_knowndev pci_knowndevs[] = {
            "BCM5782 10/100/1000 Ethernet",
        },
        {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5784,
+           0,
+           "Broadcom Corporation",
+           "BCM5784",
+       },
+       {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5785F,
+           0,
+           "Broadcom Corporation",
+           "BCM5785F",
+       },
+       {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5785G,
+           0,
+           "Broadcom Corporation",
+           "BCM5785G",
+       },
+       {
            PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5786,
            0,
            "Broadcom Corporation",
@@ -2628,6 +2682,12 @@ const struct pci_knowndev pci_knowndevs[] = {
            "BCM5787",
        },
        {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5787F,
+           0,
+           "Broadcom Corporation",
+           "BCM5787F",
+       },
+       {
            PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5788,
            0,
            "Broadcom Corporation",
@@ -2742,6 +2802,30 @@ const struct pci_knowndev pci_knowndevs[] = {
            "BCM5906M",
        },
        {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57760,
+           0,
+           "Broadcom Corporation",
+           "BCM57760",
+       },
+       {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57780,
+           0,
+           "Broadcom Corporation",
+           "BCM57780",
+       },
+       {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57788,
+           0,
+           "Broadcom Corporation",
+           "BCM57788",
+       },
+       {
+           PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57790,
+           0,
+           "Broadcom Corporation",
+           "BCM57790",
+       },
+       {
            PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM4301,
            0,
            "Broadcom Corporation",
index 7250728..a76e5dc 100644 (file)
@@ -179,6 +179,8 @@ static const struct bge_type bge_devs[] = {
                "Broadcom BCM5721 Gigabit Ethernet" },
        { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5722,
                "Broadcom BCM5722 Gigabit Ethernet" },
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5723,
+               "Broadcom BCM5723 Gigabit Ethernet" },
        { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5750,
                "Broadcom BCM5750 Gigabit Ethernet" },
        { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5750M,
@@ -209,6 +211,16 @@ static const struct bge_type bge_devs[] = {
                "Broadcom BCM5755M Gigabit Ethernet" },
        { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5756,
                "Broadcom BCM5756 Gigabit Ethernet" },
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5761,
+               "Broadcom BCM5761 Gigabit Ethernet" },
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5761E,
+               "Broadcom BCM5761E Gigabit Ethernet" },
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5761S,
+               "Broadcom BCM5761S Gigabit Ethernet" },
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5761SE,
+               "Broadcom BCM5761SE Gigabit Ethernet" },
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5764,
+               "Broadcom BCM5764 Gigabit Ethernet" },
        { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5780,
                "Broadcom BCM5780 Gigabit Ethernet" },
        { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5780S,
@@ -217,6 +229,12 @@ static const struct bge_type bge_devs[] = {
                "Broadcom BCM5781 Gigabit Ethernet" },
        { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5782,
                "Broadcom BCM5782 Gigabit Ethernet" },
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5784,
+               "Broadcom BCM5784 Gigabit Ethernet" },
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5785F,
+               "Broadcom BCM5785F Gigabit Ethernet" },
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5785G,
+               "Broadcom BCM5785G Gigabit Ethernet" },
        { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5786,
                "Broadcom BCM5786 Gigabit Ethernet" },
        { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5787,
@@ -239,7 +257,14 @@ static const struct bge_type bge_devs[] = {
                "Broadcom BCM5906 Fast Ethernet"},
        { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5906M,
                "Broadcom BCM5906M Fast Ethernet"},
-
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57760,
+               "Broadcom BCM57760 Gigabit Ethernet"},
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57780,
+               "Broadcom BCM57780 Gigabit Ethernet"},
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57788,
+               "Broadcom BCM57788 Gigabit Ethernet"},
+       { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM57790,
+               "Broadcom BCM57790 Gigabit Ethernet"},
        { PCI_VENDOR_SCHNEIDERKOCH, PCI_PRODUCT_SCHNEIDERKOCH_SK_9DX1,
                "SysKonnect Gigabit Ethernet" },
 
@@ -251,6 +276,7 @@ static const struct bge_type bge_devs[] = {
 #define BGE_IS_5705_PLUS(sc)           ((sc)->bge_flags & BGE_FLAG_5705_PLUS)
 #define BGE_IS_5714_FAMILY(sc)         ((sc)->bge_flags & BGE_FLAG_5714_FAMILY)
 #define BGE_IS_575X_PLUS(sc)           ((sc)->bge_flags & BGE_FLAG_575X_PLUS)
+#define BGE_IS_5755_PLUS(sc)           ((sc)->bge_flags & BGE_FLAG_5755_PLUS)
 
 typedef int    (*bge_eaddr_fcn_t)(struct bge_softc *, uint8_t[]);
 
@@ -1612,14 +1638,19 @@ bge_blockinit(struct bge_softc *sc)
 
        /* Turn on write DMA state machine */
        val = BGE_WDMAMODE_ENABLE|BGE_WDMAMODE_ALL_ATTNS;
-       if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
-           sc->bge_asicrev == BGE_ASICREV_BCM5787)
+       if (BGE_IS_5755_PLUS(sc))
                val |= (1 << 29);       /* Enable host coalescing bug fix. */
        CSR_WRITE_4(sc, BGE_WDMA_MODE, val);
        DELAY(40);
 
        /* Turn on read DMA state machine */
        val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS;
+        if (sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
+            sc->bge_asicrev == BGE_ASICREV_BCM5785 ||
+            sc->bge_asicrev == BGE_ASICREV_BCM57780)
+               val |= BGE_RDMAMODE_BD_SBD_CRPT_ATTN |
+                  BGE_RDMAMODE_MBUF_RBD_CRPT_ATTN |
+                  BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN;
        if (sc->bge_flags & BGE_FLAG_PCIE)
                val |= BGE_RDMAMODE_FIFO_LONG_BURST;
        CSR_WRITE_4(sc, BGE_RDMA_MODE, val);
@@ -1642,7 +1673,10 @@ bge_blockinit(struct bge_softc *sc)
        CSR_WRITE_4(sc, BGE_SBDC_MODE, BGE_SBDCMODE_ENABLE);
 
        /* Turn on send data completion state machine */
-       CSR_WRITE_4(sc, BGE_SDC_MODE, BGE_SDCMODE_ENABLE);
+       val = BGE_SDCMODE_ENABLE;
+       if (sc->bge_asicrev == BGE_ASICREV_BCM5761)
+               val |= BGE_SDCMODE_CDELAY; 
+       CSR_WRITE_4(sc, BGE_SDC_MODE, val);
 
        /* Turn on send data initiator state machine */
        CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE);
@@ -1774,13 +1808,25 @@ bge_attach(device_t dev)
 
        /* Save various chip information */
        sc->bge_chipid =
-           pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
-           BGE_PCIMISCCTL_ASICREV;
+           pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >>
+           BGE_PCIMISCCTL_ASICREV_SHIFT;
+        if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG)
+               sc->bge_chipid = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, 4);
        sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid);
        sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid);
 
        /* Save chipset family. */
        switch (sc->bge_asicrev) {
+       case BGE_ASICREV_BCM5755:
+       case BGE_ASICREV_BCM5761:
+       case BGE_ASICREV_BCM5784:
+       case BGE_ASICREV_BCM5785:
+       case BGE_ASICREV_BCM5787:
+       case BGE_ASICREV_BCM57780:
+           sc->bge_flags |= BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS |
+               BGE_FLAG_5705_PLUS;
+           break;
+
        case BGE_ASICREV_BCM5700:
        case BGE_ASICREV_BCM5701:
        case BGE_ASICREV_BCM5703:
@@ -1796,8 +1842,6 @@ bge_attach(device_t dev)
 
        case BGE_ASICREV_BCM5750:
        case BGE_ASICREV_BCM5752:
-       case BGE_ASICREV_BCM5755:
-       case BGE_ASICREV_BCM5787:
        case BGE_ASICREV_BCM5906:
                sc->bge_flags |= BGE_FLAG_575X_PLUS;
                /* Fall through */
@@ -1833,16 +1877,14 @@ bge_attach(device_t dev)
        if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0)
                sc->bge_flags |= BGE_FLAG_5704_A0_BUG;
 
-       if (BGE_IS_5705_PLUS(sc)) {
+       if (BGE_IS_5705_PLUS(sc) &&
+               !(sc->bge_flags & BGE_FLAG_ADJUST_TRIM)) {
                if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
+                   sc->bge_asicrev == BGE_ASICREV_BCM5761 ||
+                   sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
                    sc->bge_asicrev == BGE_ASICREV_BCM5787) {
-                       uint32_t product = pci_get_device(dev);
-
-                       if (product != PCI_PRODUCT_BROADCOM_BCM5722 &&
-                           product != PCI_PRODUCT_BROADCOM_BCM5756)
-                               sc->bge_flags |= BGE_FLAG_JITTER_BUG;
-                       if (product == PCI_PRODUCT_BROADCOM_BCM5755M)
-                               sc->bge_flags |= BGE_FLAG_ADJUST_TRIM;
+                       if (sc->bge_chipid != BGE_CHIPID_BCM5722_A0)
+                           sc->bge_flags |= BGE_FLAG_JITTER_BUG;
                } else if (sc->bge_asicrev != BGE_ASICREV_BCM5906) {
                        sc->bge_flags |= BGE_FLAG_BER_BUG;
                }
index 44ec50e..d5083a4 100644 (file)
 #define BGE_PCI_UNDI_TX_BD_PRODIDX_LO  0xAC
 #define BGE_PCI_ISR_MBX_HI             0xB0
 #define BGE_PCI_ISR_MBX_LO             0xB4
+#define BGE_PCI_PRODID_ASICREV         0xBC
 
 /* PCI Misc. Host control register */
 #define BGE_PCIMISCCTL_CLEAR_INTA      0x00000001
 #define BGE_PCIMISCCTL_REG_WORDSWAP    0x00000040
 #define BGE_PCIMISCCTL_INDIRECT_ACCESS 0x00000080
 #define BGE_PCIMISCCTL_ASICREV         0xFFFF0000
+#define BGE_PCIMISCCTL_ASICREV_SHIFT   16
 
 #if BYTE_ORDER == LITTLE_ENDIAN
 #define BGE_DMA_SWAP_OPTIONS           (BGE_MODECTL_WORDSWAP_NONFRAME |\
                                         BGE_PCIMISCCTL_MASK_PCI_INTR | \
                                         BGE_PCIMISCCTL_INDIRECT_ACCESS)
 
-#define BGE_CHIPID_TIGON_I             0x40000000
-#define BGE_CHIPID_TIGON_II            0x60000000
-#define BGE_CHIPID_BCM5700_A0          0x70000000
-#define BGE_CHIPID_BCM5700_A1          0x70010000
-#define BGE_CHIPID_BCM5700_B0          0x71000000
-#define BGE_CHIPID_BCM5700_B1          0x71010000
-#define BGE_CHIPID_BCM5700_B2          0x71020000
-#define BGE_CHIPID_BCM5700_B3          0x71030000
-#define BGE_CHIPID_BCM5700_ALTIMA      0x71040000
-#define BGE_CHIPID_BCM5700_C0          0x72000000
-#define BGE_CHIPID_BCM5701_A0          0x00000000      /* grrrr */
-#define BGE_CHIPID_BCM5701_B0          0x01000000
-#define BGE_CHIPID_BCM5701_B2          0x01020000
-#define BGE_CHIPID_BCM5701_B5          0x01050000
-#define BGE_CHIPID_BCM5703_A0          0x10000000
-#define BGE_CHIPID_BCM5703_A1          0x10010000
-#define BGE_CHIPID_BCM5703_A2          0x10020000
-#define BGE_CHIPID_BCM5703_A3          0x10030000
-#define BGE_CHIPID_BCM5703_B0          0x11000000
-#define BGE_CHIPID_BCM5704_A0          0x20000000
-#define BGE_CHIPID_BCM5704_A1          0x20010000
-#define BGE_CHIPID_BCM5704_A2          0x20020000
-#define BGE_CHIPID_BCM5704_A3          0x20030000
-#define BGE_CHIPID_BCM5704_B0          0x21000000
-#define BGE_CHIPID_BCM5705_A0          0x30000000
-#define BGE_CHIPID_BCM5705_A1          0x30010000
-#define BGE_CHIPID_BCM5705_A2          0x30020000
-#define BGE_CHIPID_BCM5705_A3          0x30030000
-#define BGE_CHIPID_BCM5750_A0          0x40000000
-#define BGE_CHIPID_BCM5750_A1          0x40010000
-#define BGE_CHIPID_BCM5750_A3          0x40030000
-#define BGE_CHIPID_BCM5750_B0          0x41000000
-#define BGE_CHIPID_BCM5750_B1          0x41010000
-#define BGE_CHIPID_BCM5750_C0          0x42000000
-#define BGE_CHIPID_BCM5750_C1          0x42010000
-#define BGE_CHIPID_BCM5750_C2          0x42020000
-#define BGE_CHIPID_BCM5714_A0          0x50000000
-#define BGE_CHIPID_BCM5752_A0          0x60000000
-#define BGE_CHIPID_BCM5752_A1          0x60010000
-#define BGE_CHIPID_BCM5752_A2          0x60020000
-#define BGE_CHIPID_BCM5714_B0          0x80000000
-#define BGE_CHIPID_BCM5714_B3          0x80030000
-#define BGE_CHIPID_BCM5715_A0          0x90000000
-#define BGE_CHIPID_BCM5715_A1          0x90010000
-#define        BGE_CHIPID_BCM5715_A3           0x90030000
-#define BGE_CHIPID_BCM5755_A0          0xa0000000
-#define BGE_CHIPID_BCM5755_A1          0xa0010000
-#define BGE_CHIPID_BCM5755_A2          0xa0020000
-#define BGE_CHIPID_BCM5754_A0          0xb0000000
-#define BGE_CHIPID_BCM5754_A1          0xb0010000
-#define BGE_CHIPID_BCM5754_A2          0xb0020000
-#define BGE_CHIPID_BCM5787_A0          0xb0000000
-#define BGE_CHIPID_BCM5787_A1          0xb0010000
-#define BGE_CHIPID_BCM5787_A2          0xb0020000
-#define BGE_CHIPID_BCM5906_A1          0xc0010000
-#define BGE_CHIPID_BCM5906_A2          0xc0020000
+#define BGE_CHIPID_TIGON_I             0x4000
+#define BGE_CHIPID_TIGON_II            0x6000
+#define BGE_CHIPID_BCM5700_A0          0x7000
+#define BGE_CHIPID_BCM5700_A1          0x7001
+#define BGE_CHIPID_BCM5700_B0          0x7100
+#define BGE_CHIPID_BCM5700_B1          0x7101
+#define BGE_CHIPID_BCM5700_B2          0x7102
+#define BGE_CHIPID_BCM5700_B3          0x7103
+#define BGE_CHIPID_BCM5700_ALTIMA      0x7104
+#define BGE_CHIPID_BCM5700_C0          0x7200
+#define BGE_CHIPID_BCM5701_A0          0x0000  /* grrrr */
+#define BGE_CHIPID_BCM5701_B0          0x0100
+#define BGE_CHIPID_BCM5701_B2          0x0102
+#define BGE_CHIPID_BCM5701_B5          0x0105
+#define BGE_CHIPID_BCM5703_A0          0x1000
+#define BGE_CHIPID_BCM5703_A1          0x1001
+#define BGE_CHIPID_BCM5703_A2          0x1002
+#define BGE_CHIPID_BCM5703_A3          0x1003
+#define BGE_CHIPID_BCM5703_B0          0x1100
+#define BGE_CHIPID_BCM5704_A0          0x2000
+#define BGE_CHIPID_BCM5704_A1          0x2001
+#define BGE_CHIPID_BCM5704_A2          0x2002
+#define BGE_CHIPID_BCM5704_A3          0x2003
+#define BGE_CHIPID_BCM5704_B0          0x2100
+#define BGE_CHIPID_BCM5705_A0          0x3000
+#define BGE_CHIPID_BCM5705_A1          0x3001
+#define BGE_CHIPID_BCM5705_A2          0x3002
+#define BGE_CHIPID_BCM5705_A3          0x3003
+#define BGE_CHIPID_BCM5750_A0          0x4000
+#define BGE_CHIPID_BCM5750_A1          0x4001
+#define BGE_CHIPID_BCM5750_A3          0x4003
+#define BGE_CHIPID_BCM5750_B0          0x4100
+#define BGE_CHIPID_BCM5750_B1          0x4101
+#define BGE_CHIPID_BCM5750_C0          0x4200
+#define BGE_CHIPID_BCM5750_C1          0x4201
+#define BGE_CHIPID_BCM5750_C2          0x4202
+#define BGE_CHIPID_BCM5714_A0          0x5000
+#define BGE_CHIPID_BCM5752_A0          0x6000
+#define BGE_CHIPID_BCM5752_A1          0x6001
+#define BGE_CHIPID_BCM5752_A2          0x6002
+#define BGE_CHIPID_BCM5714_B0          0x8000
+#define BGE_CHIPID_BCM5714_B3          0x8003
+#define BGE_CHIPID_BCM5715_A0          0x9000
+#define BGE_CHIPID_BCM5715_A1          0x9001
+#define        BGE_CHIPID_BCM5715_A3           0x9003
+#define        BGE_CHIPID_BCM5722_A0           0xa200
+#define BGE_CHIPID_BCM5755_A0          0xa000
+#define BGE_CHIPID_BCM5755_A1          0xa001
+#define BGE_CHIPID_BCM5755_A2          0xa002
+#define BGE_CHIPID_BCM5754_A0          0xb000
+#define BGE_CHIPID_BCM5754_A1          0xb001
+#define BGE_CHIPID_BCM5754_A2          0xb002
+#define BGE_CHIPID_BCM5761_A0          0x5761000
+#define BGE_CHIPID_BCM5761_A1          0x5761100
+#define BGE_CHIPID_BCM5784_A0          0x5784000
+#define BGE_CHIPID_BCM5784_A1          0x5784100
+#define BGE_CHIPID_BCM5787_A0          0xb000
+#define BGE_CHIPID_BCM5787_A1          0xb001
+#define BGE_CHIPID_BCM5787_A2          0xb002
+#define BGE_CHIPID_BCM5906_A1          0xc001
+#define BGE_CHIPID_BCM5906_A2          0xc002
+#define BGE_CHIPID_BCM57780_A0         0x57780000
+#define BGE_CHIPID_BCM57780_A1         0x57780001
 
 /* shorthand one */
-#define BGE_ASICREV(x)                 ((x) >> 28)
+#define BGE_ASICREV(x)                 ((x) >> 12)
 #define BGE_ASICREV_BCM5701            0x00
 #define BGE_ASICREV_BCM5703            0x01
 #define BGE_ASICREV_BCM5704            0x02
 #define BGE_ASICREV_BCM5787            0x0b
 #define BGE_ASICREV_BCM5906            0x0c
 
+/* Should consult BGE_PCI_PRODID_ASICREV for ChipID */
+#define BGE_ASICREV_USE_PRODID_REG     0x0f
+/* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */ 
+#define BGE_ASICREV_BCM5761            0x5761
+#define BGE_ASICREV_BCM5784            0x5784
+#define BGE_ASICREV_BCM5785            0x5785
+#define BGE_ASICREV_BCM57780           0x57780
+
 /* chip revisions */
-#define BGE_CHIPREV(x)                 ((x) >> 24)
+#define BGE_CHIPREV(x)                 ((x) >> 8)
 #define BGE_CHIPREV_5700_AX            0x70
 #define BGE_CHIPREV_5700_BX            0x71
 #define BGE_CHIPREV_5700_CX            0x72
 #define BGE_CHIPREV_5703_AX            0x10
 #define BGE_CHIPREV_5704_AX            0x20
 #define BGE_CHIPREV_5704_BX            0x21
+#define BGE_CHIPREV_5750_AX            0x40
+#define BGE_CHIPREV_5750_BX            0x41
+/* BGE_PCI_PRODID_ASICREV chip rev. identifiers. */
+#define BGE_CHIPREV_5761_AX            0x57611
+#define BGE_CHIPREV_5784_AX            0x57841
 
 /* PCI DMA Read/Write Control register */
 #define BGE_PCIDMARWCTL_MINDMA         0x000000FF
 #define BGE_SDCMODE_RESET              0x00000001
 #define BGE_SDCMODE_ENABLE             0x00000002
 #define BGE_SDCMODE_ATTN               0x00000004
+#define BGE_SDCMODE_CDELAY             0x00000010
 
 /* Send Data completion status register */
 #define BGE_SDCSTAT_ATTN               0x00000004
 #define BGE_RDMAMODE_PCI_FIFOOREAD_ATTN        0x00000100
 #define BGE_RDMAMODE_LOCWRITE_TOOBIG   0x00000200
 #define BGE_RDMAMODE_ALL_ATTNS         0x000003FC
+#define BGE_RDMAMODE_BD_SBD_CRPT_ATTN  0x00000800
+#define BGE_RDMAMODE_MBUF_RBD_CRPT_ATTN        0x00001000
+#define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN        0x00002000
 #define BGE_RDMAMODE_FIFO_SIZE_128     0x00020000
 #define BGE_RDMAMODE_FIFO_LONG_BURST   0x00030000
 
@@ -2427,6 +2453,7 @@ struct bge_softc {
 #define BGE_FLAG_5705_PLUS     0x00002000
 #define BGE_FLAG_5714_FAMILY   0x00004000
 #define BGE_FLAG_575X_PLUS     0x00008000
+#define BGE_FLAG_5755_PLUS     0x00010000
 #define BGE_FLAG_RX_ALIGNBUG   0x00100000
 #define BGE_FLAG_NO_3LED       0x00200000
 #define BGE_FLAG_ADC_BUG       0x00400000
@@ -2437,8 +2464,8 @@ struct bge_softc {
 #define BGE_FLAG_CRC_BUG       0x08000000
 #define BGE_FLAG_NO_EEPROM     0x10000000
        uint32_t                bge_chipid;
-       uint8_t                 bge_asicrev;
-       uint8_t                 bge_chiprev;
+       uint32_t                bge_asicrev;
+       uint32_t                bge_chiprev;
        struct bge_ring_data    bge_ldata;      /* rings */
        struct bge_chain_data   bge_cdata;      /* mbufs */
        uint16_t                bge_tx_saved_considx;