Date: Wed, 15 Oct 2008 01:28:03 GMT From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 151403 for review Message-ID: <200810150128.m9F1S3KM027076@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=151403 Change 151403 by nwhitehorn@nwhitehorn_trantor on 2008/10/15 01:28:02 Make powermac_nvram work on G5 systems by allowing for the #address-cells != 1 case. Affected files ... .. //depot/projects/ppc-g5/sys/dev/powermac_nvram/powermac_nvram.c#5 edit Differences ... ==== //depot/projects/ppc-g5/sys/dev/powermac_nvram/powermac_nvram.c#5 (text+ko) ==== @@ -131,19 +131,25 @@ { 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810150128.m9F1S3KM027076>