- Use a longer timeout value for firmware handshaking.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 30 Nov 2008 09:49:49 +0000 (17:49 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 30 Nov 2008 09:56:20 +0000 (17:56 +0800)
- Nuke the RX CPU self-diag, which prevents working cards from working.(*)

This commit intends to fix the firmware handshaking failure seen on PCI cards.
PCI-E cards do not seem to be affected.

(*) Linux tg3 does not have this diag neither does OpenBSD's bge(4)

sys/dev/netif/bge/if_bge.c
sys/dev/netif/bge/if_bgereg.h

index 39c4bae..e130a21 100644 (file)
@@ -1190,16 +1190,6 @@ bge_chipinit(struct bge_softc *sc)
        /* Set endian type before we access any non-PCI registers. */
        pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4);
 
-       /*
-        * Check the 'ROM failed' bit on the RX CPU to see if
-        * self-tests passed.
-        */
-       if (CSR_READ_4(sc, BGE_RXCPU_MODE) & BGE_RXCPUMODE_ROMFAIL) {
-               if_printf(&sc->arpcom.ac_if,
-                         "RX CPU self-diagnostics failed!\n");
-               return(ENODEV);
-       }
-
        /* Clear the MAC control register */
        CSR_WRITE_4(sc, BGE_MAC_MODE, 0);
 
@@ -2271,13 +2261,13 @@ bge_reset(struct bge_softc *sc)
                 * This indicates that the firmware initialization
                 * is complete.
                 */
-               for (i = 0; i < BGE_TIMEOUT; i++) {
+               for (i = 0; i < BGE_FIRMWARE_TIMEOUT; i++) {
                        val = bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM);
                        if (val == ~BGE_MAGIC_NUMBER)
                                break;
                        DELAY(10);
                }
-               if (i == BGE_TIMEOUT) {
+               if (i == BGE_FIRMWARE_TIMEOUT) {
                        if_printf(&sc->arpcom.ac_if, "firmware handshake "
                                  "timed out, found 0x%08x\n", val);
                        return;
index 55d0f28..b61b03e 100644 (file)
@@ -2396,6 +2396,7 @@ struct bge_type {
 #define BGE_HWREV_TIGON                0x01
 #define BGE_HWREV_TIGON_II     0x02
 #define BGE_TIMEOUT            5000
+#define BGE_FIRMWARE_TIMEOUT   20000
 #define BGE_TXCONS_UNSET       0xFFFF  /* impossible value */
 
 struct bge_bcom_hack {