summaryrefslogtreecommitdiffstats
path: root/sys/dev/bm
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2008-10-13 17:33:55 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2008-10-13 17:33:55 +0000
commit2077c8c84518d3de09d60a724f2b27cf0b846fa8 (patch)
tree07f0ac1efff79a8b06d91d99b0fc9d999bef4a70 /sys/dev/bm
parent8797ac3e6ff25dbab60b6f9000d329df2fc048bc (diff)
downloadFreeBSD-src-2077c8c84518d3de09d60a724f2b27cf0b846fa8.zip
FreeBSD-src-2077c8c84518d3de09d60a724f2b27cf0b846fa8.tar.gz
Change the way we enable the BMAC cell in macio. Instead of calling the
macio's enable-enet word, which apparently does nothing on some machines, open an OF instance of the ethernet controller. This fixes cold booting from disk on my Blue & White G3. MFC after: 3 days
Diffstat (limited to 'sys/dev/bm')
-rw-r--r--sys/dev/bm/if_bm.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/dev/bm/if_bm.c b/sys/dev/bm/if_bm.c
index 6c3789c..b9bddb5 100644
--- a/sys/dev/bm/if_bm.c
+++ b/sys/dev/bm/if_bm.c
@@ -1119,21 +1119,25 @@ bm_chip_setup(struct bm_softc *sc)
{
uint16_t reg;
uint16_t *eaddr_sect;
- char hrow_path[128];
- ihandle_t hrow_ih;
+ char path[128];
+ ihandle_t bmac_ih;
eaddr_sect = (uint16_t *)(sc->sc_enaddr);
- /* Enable BMAC cell */
- OF_package_to_path(OF_parent(ofw_bus_get_node(sc->sc_dev)),
- hrow_path, sizeof(hrow_path));
- hrow_ih = OF_open(hrow_path);
- if (hrow_ih == -1) {
+ /*
+ * Enable BMAC cell by opening and closing its OF node. This enables
+ * the cell in macio as a side effect. We should probably directly
+ * twiddle the FCR bits, but we lack a good interface for this at the
+ * present time.
+ */
+
+ OF_package_to_path(ofw_bus_get_node(sc->sc_dev), path, sizeof(path));
+ bmac_ih = OF_open(path);
+ if (bmac_ih == -1) {
device_printf(sc->sc_dev,
"Enabling BMAC cell failed! Hoping it's already active.\n");
} else {
- OF_call_method("enable-enet", hrow_ih, 0, 0);
- OF_close(hrow_ih);
+ OF_close(bmac_ih);
}
/* Reset chip */
OpenPOWER on IntegriCloud