diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2009-04-04 00:22:44 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2009-04-04 00:22:44 +0000 |
commit | ef1e56b6d485dbe76218164db7b0414e30ab423c (patch) | |
tree | d2c385231a9dbcaffdd618abd8accd1c9a2a8559 /sys/dev/powermac_nvram/powermac_nvram.c | |
parent | 86b18dc38b6aaf20c8399264b992273cf312d727 (diff) | |
download | FreeBSD-src-ef1e56b6d485dbe76218164db7b0414e30ab423c.zip FreeBSD-src-ef1e56b6d485dbe76218164db7b0414e30ab423c.tar.gz |
Add support for 64-bit PowerPC CPUs operating in the 64-bit bridge mode
provided, for example, on the PowerPC 970 (G5), as well as on related CPUs
like the POWER3 and POWER4.
This also adds support for various built-in hardware found on Apple G5
hardware (e.g. the IBM CPC925 northbridge).
Reviewed by: grehan
Diffstat (limited to 'sys/dev/powermac_nvram/powermac_nvram.c')
-rw-r--r-- | sys/dev/powermac_nvram/powermac_nvram.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/powermac_nvram/powermac_nvram.c b/sys/dev/powermac_nvram/powermac_nvram.c index a55fcae..f6e930b 100644 --- a/sys/dev/powermac_nvram/powermac_nvram.c +++ b/sys/dev/powermac_nvram/powermac_nvram.c @@ -131,19 +131,25 @@ powermac_nvram_attach(device_t dev) { struct powermac_nvram_softc *sc; phandle_t node; - u_int32_t reg[2]; - int gen0, gen1; + u_int32_t reg[3]; + int gen0, gen1, i; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); - if (OF_getprop(node, "reg", reg, sizeof(reg)) < 8) + if ((i = OF_getprop(node, "reg", reg, sizeof(reg))) < 8) return ENXIO; sc->sc_dev = dev; sc->sc_node = node; - sc->sc_bank0 = (vm_offset_t)pmap_mapdev(reg[0], NVRAM_SIZE * 2); + /* + * Find which byte of reg corresponds to the 32-bit physical address. + * We should probably read #address-cells from /chosen instead. + */ + i = (i/4) - 2; + + sc->sc_bank0 = (vm_offset_t)pmap_mapdev(reg[i], NVRAM_SIZE * 2); sc->sc_bank1 = sc->sc_bank0 + NVRAM_SIZE; gen0 = powermac_nvram_check((void *)sc->sc_bank0); |