summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2016-02-16 15:18:12 +0000
committerandrew <andrew@FreeBSD.org>2016-02-16 15:18:12 +0000
commit05274f8a8b8da8cd3adf7aa6d8a877992dbc44d2 (patch)
treeef2970757da3567fedb2a64ae083c1be0e25f35d /sys/dev
parent284f6cde63476cc099b272baa04262937e75e289 (diff)
downloadFreeBSD-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/dev')
-rw-r--r--sys/dev/ofw/openfirm.h2
-rw-r--r--sys/dev/tsec/if_tsec_fdt.c2
-rw-r--r--sys/dev/uart/uart_cpu_fdt.c2
-rw-r--r--sys/dev/uart/uart_cpu_powerpc.c2
-rw-r--r--sys/dev/vt/hw/ofwfb/ofwfb.c3
5 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/ofw/openfirm.h b/sys/dev/ofw/openfirm.h
index acfd2d2..e616efc 100644
--- a/sys/dev/ofw/openfirm.h
+++ b/sys/dev/ofw/openfirm.h
@@ -176,7 +176,7 @@ int OF_interpret(const char *cmd, int nreturns, ...);
*/
#ifndef __sparc64__
int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *ptag,
- bus_space_handle_t *phandle);
+ bus_space_handle_t *phandle, bus_size_t *sz);
#endif
#endif /* _KERNEL */
diff --git a/sys/dev/tsec/if_tsec_fdt.c b/sys/dev/tsec/if_tsec_fdt.c
index ccc7c94..ab4bffc 100644
--- a/sys/dev/tsec/if_tsec_fdt.c
+++ b/sys/dev/tsec/if_tsec_fdt.c
@@ -167,7 +167,7 @@ tsec_fdt_attach(device_t dev)
}
phy = OF_node_from_xref(phy);
- OF_decode_addr(OF_parent(phy), 0, &sc->phy_bst, &sc->phy_bsh);
+ OF_decode_addr(OF_parent(phy), 0, &sc->phy_bst, &sc->phy_bsh, NULL);
OF_getencprop(phy, "reg", &sc->phyaddr, sizeof(sc->phyaddr));
/* Init timer */
diff --git a/sys/dev/uart/uart_cpu_fdt.c b/sys/dev/uart/uart_cpu_fdt.c
index 1a4af9d..6eb40f0 100644
--- a/sys/dev/uart/uart_cpu_fdt.c
+++ b/sys/dev/uart/uart_cpu_fdt.c
@@ -212,5 +212,5 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
di->stopbits = 1;
di->parity = UART_PARITY_NONE;
- return (OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh));
+ return (OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh, NULL));
}
diff --git a/sys/dev/uart/uart_cpu_powerpc.c b/sys/dev/uart/uart_cpu_powerpc.c
index e41ceae..8d98405 100644
--- a/sys/dev/uart/uart_cpu_powerpc.c
+++ b/sys/dev/uart/uart_cpu_powerpc.c
@@ -180,7 +180,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
if (class == NULL)
return (ENXIO);
- error = OF_decode_addr(input, 0, &di->bas.bst, &di->bas.bsh);
+ error = OF_decode_addr(input, 0, &di->bas.bst, &di->bas.bsh, NULL);
if (error)
return (error);
diff --git a/sys/dev/vt/hw/ofwfb/ofwfb.c b/sys/dev/vt/hw/ofwfb/ofwfb.c
index c3ac185..0776a8e 100644
--- a/sys/dev/vt/hw/ofwfb/ofwfb.c
+++ b/sys/dev/vt/hw/ofwfb/ofwfb.c
@@ -480,7 +480,8 @@ ofwfb_init(struct vt_device *vd)
return (CN_DEAD);
#if defined(__powerpc__)
- OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase);
+ OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase,
+ NULL);
sc->fb.fb_pbase = sc->fb.fb_vbase; /* 1:1 mapped */
#ifdef __powerpc64__
/* Real mode under a hypervisor probably doesn't cover FB */
OpenPOWER on IntegriCloud