diff options
-rw-r--r-- | sys/arm/arm/ofw_machdep.c | 6 | ||||
-rw-r--r-- | sys/arm64/arm64/ofw_machdep.c | 6 | ||||
-rw-r--r-- | sys/dev/ofw/openfirm.h | 2 | ||||
-rw-r--r-- | sys/dev/tsec/if_tsec_fdt.c | 2 | ||||
-rw-r--r-- | sys/dev/uart/uart_cpu_fdt.c | 2 | ||||
-rw-r--r-- | sys/dev/uart/uart_cpu_powerpc.c | 2 | ||||
-rw-r--r-- | sys/dev/vt/hw/ofwfb/ofwfb.c | 3 | ||||
-rw-r--r-- | sys/mips/mips/ofw_machdep.c | 6 | ||||
-rw-r--r-- | sys/powerpc/ofw/ofw_machdep.c | 5 | ||||
-rw-r--r-- | sys/powerpc/ofw/ofw_syscons.c | 2 |
10 files changed, 26 insertions, 10 deletions
diff --git a/sys/arm/arm/ofw_machdep.c b/sys/arm/arm/ofw_machdep.c index 59b85c6..9c60775 100644 --- a/sys/arm/arm/ofw_machdep.c +++ b/sys/arm/arm/ofw_machdep.c @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); 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; @@ -66,6 +66,10 @@ OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, *tag = fdtbus_bs_tag; flags = 0; #endif + + if (sz != NULL) + *sz = size; + return (bus_space_map(*tag, addr, size, flags, handle)); } diff --git a/sys/arm64/arm64/ofw_machdep.c b/sys/arm64/arm64/ofw_machdep.c index 6a0b714..3941c1d 100644 --- a/sys/arm64/arm64/ofw_machdep.c +++ b/sys/arm64/arm64/ofw_machdep.c @@ -39,7 +39,7 @@ extern struct bus_space memmap_bus; 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; @@ -50,5 +50,9 @@ OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, return (err); *tag = &memmap_bus; + + if (sz != NULL) + *sz = size; + return (bus_space_map(*tag, addr, size, 0, handle)); } 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 */ diff --git a/sys/mips/mips/ofw_machdep.c b/sys/mips/mips/ofw_machdep.c index 82e2959..26bc260 100644 --- a/sys/mips/mips/ofw_machdep.c +++ b/sys/mips/mips/ofw_machdep.c @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); 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; @@ -66,5 +66,9 @@ OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, *tag = fdtbus_bs_tag; flags = 0; #endif + + if (sz != NULL) + *sz = size; + return (bus_space_map(*tag, addr, size, flags, handle)); } 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); |