diff options
author | ian <ian@FreeBSD.org> | 2015-05-23 22:36:41 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2015-05-23 22:36:41 +0000 |
commit | 011666b0a8c74e747a5483f15fb01e9ac7dac93c (patch) | |
tree | adb6f1b04d7fdde4fd2c8ba9ed690bd314f62381 /sys/dev/ofw/ofwbus.c | |
parent | 132e8a35de4a2129b8843c01be9c949f9501e845 (diff) | |
download | FreeBSD-src-011666b0a8c74e747a5483f15fb01e9ac7dac93c.zip FreeBSD-src-011666b0a8c74e747a5483f15fb01e9ac7dac93c.tar.gz |
MFC r277098, r279235:
Introduce ofw_bus_reg_to_rl() to replace part of common bus code
Fix endianness on FDT read in ARM GIC
Diffstat (limited to 'sys/dev/ofw/ofwbus.c')
-rw-r--r-- | sys/dev/ofw/ofwbus.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c index e135513..6a6095a 100644 --- a/sys/dev/ofw/ofwbus.c +++ b/sys/dev/ofw/ofwbus.c @@ -442,10 +442,6 @@ ofwbus_setup_dinfo(device_t dev, phandle_t node) struct ofwbus_softc *sc; struct ofwbus_devinfo *ndi; const char *nodename; - uint32_t *reg; - uint64_t phys, size; - int i, j, rid; - int nreg; sc = device_get_softc(dev); @@ -462,33 +458,7 @@ ofwbus_setup_dinfo(device_t dev, phandle_t node) } resource_list_init(&ndi->ndi_rl); - nreg = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®); - if (nreg == -1) - nreg = 0; - if (nreg % (sc->acells + sc->scells) != 0) { - if (bootverbose) - device_printf(dev, "Malformed reg property on <%s>\n", - nodename); - nreg = 0; - } - - for (i = 0, rid = 0; i < nreg; i += sc->acells + sc->scells, rid++) { - phys = size = 0; - for (j = 0; j < sc->acells; j++) { - phys <<= 32; - phys |= reg[i + j]; - } - for (j = 0; j < sc->scells; j++) { - size <<= 32; - size |= reg[i + sc->acells + j]; - } - /* Skip the dummy reg property of glue devices like ssm(4). */ - if (size != 0) - resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, rid, - phys, phys + size - 1, size); - } - free(reg, M_OFWPROP); - + ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &ndi->ndi_rl); ofw_bus_intr_to_rl(dev, node, &ndi->ndi_rl); return (ndi); |