summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_bge.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-09-17 17:20:43 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-09-17 17:20:43 +0000
commit2ce66d6d69e93edee0f3720e1cebc8674476175e (patch)
treefd35203e0cd7edfc9c3c5312e10eb3ab2384854c /sys/dev/pci/if_bge.c
parent10ec1deaf33dc7b3ab3488f54302f88f197eda34 (diff)
- correct the firmware synchronization in bge_reset(), this
eliminates firmware timeouts for the BCM5752 as the hw firmware was coming up too fast for the driver. - remove the redundant firmware check in bge_chipinit(). Tested by pedro la peu <pedro at am-gen dot org> on an IBM ThinksPpad Z61m with a BCM5752, as well as the 5700/5703/5704 and 5750. The initial diff for bge_reset() and other information from David Christensen <davidch at broadcom dot com>.
Diffstat (limited to 'sys/dev/pci/if_bge.c')
-rw-r--r--sys/dev/pci/if_bge.c40
1 files changed, 13 insertions, 27 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index b911dee36b0..acc0aba03a7 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.177 2006/09/17 16:45:22 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.178 2006/09/17 17:20:42 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -172,7 +172,7 @@ void bge_free_rx_ring_jumbo(struct bge_softc *);
void bge_free_tx_ring(struct bge_softc *);
int bge_init_tx_ring(struct bge_softc *);
-int bge_chipinit(struct bge_softc *);
+void bge_chipinit(struct bge_softc *);
int bge_blockinit(struct bge_softc *);
u_int32_t bge_readmem_ind(struct bge_softc *, int);
@@ -1071,7 +1071,7 @@ bge_setpromisc(struct bge_softc *sc)
* Do endian, PCI and DMA initialization. Also check the on-board ROM
* self-test results.
*/
-int
+void
bge_chipinit(struct bge_softc *sc)
{
struct pci_attach_args *pa = &(sc->bge_pa);
@@ -1082,18 +1082,6 @@ bge_chipinit(struct bge_softc *sc)
pci_conf_write(pa->pa_pc, pa->pa_tag, BGE_PCI_MISC_CTL,
BGE_INIT);
- /*
- * Check the 'ROM failed' bit on the RX CPU to see if
- * self-tests passed. Skip this check when there's no SEEPROM
- * fitted, since in that case it will always fail.
- */
- if (sc->bge_eeprom &&
- CSR_READ_4(sc, BGE_RXCPU_MODE) & BGE_RXCPUMODE_ROMFAIL) {
- printf("%s: RX CPU self-diagnostics failed!\n",
- sc->bge_dev.dv_xname);
- return (ENODEV);
- }
-
/* Clear the MAC control register */
CSR_WRITE_4(sc, BGE_MAC_MODE, 0);
@@ -1217,8 +1205,6 @@ bge_chipinit(struct bge_softc *sc)
/* Set the timer prescaler (always 66MHz) */
CSR_WRITE_4(sc, BGE_MISC_CFG, 65 << 1/*BGE_32BITTIME_66MHZ*/);
-
- return (0);
}
int
@@ -1765,10 +1751,7 @@ bge_attach(struct device *parent, struct device *self, void *aux)
DPRINTFN(5, ("bge_reset\n"));
bge_reset(sc);
- if (bge_chipinit(sc)) {
- printf(": chip initialization failed\n");
- goto fail_1;
- }
+ bge_chipinit(sc);
/*
* Get station address from the EEPROM.
@@ -2037,6 +2020,15 @@ bge_reset(struct bge_softc *sc)
}
}
+ if (BGE_IS_5705_OR_BEYOND(sc))
+ reset |= BGE_MISCCFG_KEEP_GPHY_POWER;
+
+ /*
+ * Write the magic number to the firmware mailbox at 0xb50
+ * so that the driver can synchronize with the firmware.
+ */
+ bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM, BGE_MAGIC_NUMBER);
+
/* Issue global reset */
bge_writereg_ind(sc, BGE_MISC_CFG, reset);
@@ -2073,12 +2065,6 @@ bge_reset(struct bge_softc *sc)
CSR_WRITE_4(sc, BGE_MARB_MODE, BGE_MARBMODE_ENABLE);
/*
- * Prevent PXE restart: write a magic number to the
- * general communications memory at 0xB50.
- */
- bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM, BGE_MAGIC_NUMBER);
-
- /*
* Poll the value location we just wrote until
* we see the 1's complement of the magic number.
* This indicates that the firmware initialization