Hi,

We've got an onboard bge that has got this annoying printf that
also shows up on every up and down (comes from bge_reset):

bge0 at pci4 dev 0 function 0 "Broadcom BCM5718" rev 0x10, BCM5717 B0 \
(0x5717100), APE firmware NCSI 1.1.19.0: msi, address fc:aa:14:16:14:26
brgphy0 at bge0 phy 1: BCM5717C 10/100/1000baseT PHY, rev. 0
bge1 at pci4 dev 0 function 1 "Broadcom BCM5718" rev 0x10, BCM5717 B0 \
(0x5717100), APE firmware NCSI 1.1.19.0bge1: firmware handshake timed out
: msi, address fc:aa:14:16:14:27
brgphy1 at bge1 phy 2: BCM5717C 10/100/1000baseT PHY, rev. 0

At first I thought that we should just silence it, but after
double checking against the BCM5718 Programmer's Guide it became
apparent that we're not waiting long enough for chips with SEEPROM:
we're delay()ing for 1000ms which is good enough for "Flash" devices,
but need to delay() for 10000ms when used with SEEPROM ones.  This
knowledge comes from Chapter 7 "Device Control", section "Device
Reset Procedure", point 13.

While the diff increases maximum timeout for "Flash" devices as
well as for SEEPROM ones, I don't think it would harm anything
as we're most likely to break out of the loop early.  Needless
to say that it works fine here.  OK?

diff --git sys/dev/pci/if_bge.c sys/dev/pci/if_bge.c
index b761ea9..7d8c970 100644
--- sys/dev/pci/if_bge.c
+++ sys/dev/pci/if_bge.c
@@ -3363,11 +3363,11 @@ bge_reset(struct bge_softc *sc)
                 */
                for (i = 0; i < BGE_TIMEOUT; i++) {
                        val = bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM);
                        if (val == ~BGE_MAGIC_NUMBER)
                                break;
-                       DELAY(10);
+                       DELAY(100);
                }
 
                if (i >= BGE_TIMEOUT && (!(sc->bge_flags & BGE_NO_EEPROM)))
                        printf("%s: firmware handshake timed out\n",
                           sc->bge_dev.dv_xname);

Reply via email to