diff options
author | andrew <andrew@FreeBSD.org> | 2016-02-16 15:18:12 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2016-02-16 15:18:12 +0000 |
commit | 05274f8a8b8da8cd3adf7aa6d8a877992dbc44d2 (patch) | |
tree | ef2970757da3567fedb2a64ae083c1be0e25f35d /sys/powerpc | |
parent | 284f6cde63476cc099b272baa04262937e75e289 (diff) | |
download | FreeBSD-src-05274f8a8b8da8cd3adf7aa6d8a877992dbc44d2.zip FreeBSD-src-05274f8a8b8da8cd3adf7aa6d8a877992dbc44d2.tar.gz |
Allow callers of OF_decode_addr to get the size of the found mapping. This
will allow for code that uses the old fdt_get_range and fdt_regsize
functions to find a range, map it, access, then unmap to replace this, up
to and including the map, with a call to OF_decode_addr.
As this function should only be used in the early boot code the unmap is
mostly do document we no longer need the mapping as it's a no-op, at least
on arm.
Reviewed by: jhibbits
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D5258
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/ofw/ofw_machdep.c | 5 | ||||
-rw-r--r-- | sys/powerpc/ofw/ofw_syscons.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/powerpc/ofw/ofw_machdep.c b/sys/powerpc/ofw/ofw_machdep.c index d2bb77b..3051eb3 100644 --- a/sys/powerpc/ofw/ofw_machdep.c +++ b/sys/powerpc/ofw/ofw_machdep.c @@ -565,7 +565,7 @@ OF_getetheraddr(device_t dev, u_char *addr) */ int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, - bus_space_handle_t *handle) + bus_space_handle_t *handle, bus_size_t *sz) { bus_addr_t addr; bus_size_t size; @@ -585,6 +585,9 @@ OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, BUS_SPACE_MAP_PREFETCHABLE: 0; } + if (sz != NULL) + *sz = size; + return (bus_space_map(*tag, addr, size, flags, handle)); } diff --git a/sys/powerpc/ofw/ofw_syscons.c b/sys/powerpc/ofw/ofw_syscons.c index 7dc51f9..b766485 100644 --- a/sys/powerpc/ofw/ofw_syscons.c +++ b/sys/powerpc/ofw/ofw_syscons.c @@ -342,7 +342,7 @@ ofwfb_configure(int flags) if (fb_phys == sc->sc_num_pciaddrs) return (0); - OF_decode_addr(node, fb_phys, &sc->sc_tag, &sc->sc_addr); + OF_decode_addr(node, fb_phys, &sc->sc_tag, &sc->sc_addr, NULL); } ofwfb_init(0, &sc->sc_va, 0); |