From a86619e32d43f67acebfca6f18e523a14bce37c8 Mon Sep 17 00:00:00 2001 From: gonzo Date: Wed, 15 Aug 2012 03:49:10 +0000 Subject: Merging of projects/armv6, part 4 r233822: Remove useless and wrong piece of code in fdt_get_range() which i overwrites passed phandle_t node. Modify debug printf in fdt_reg_to_rl() to be consistent (that is, print start and end *virtual* addresses). r230560: Handle "ranges;" Make fdt_reg_to_rl() responsible for mapping the device memory, instead on just hoping that there's only one simplebus, and using fdt_immr_va as the base VA. r230315 Add a function to get the PA from range, instead of (ab)using fdt_immr_pa, and use it for the UART driver --- sys/dev/uart/uart_bus_fdt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/dev/uart/uart_bus_fdt.c') diff --git a/sys/dev/uart/uart_bus_fdt.c b/sys/dev/uart/uart_bus_fdt.c index 8bb62ea..88523b5 100644 --- a/sys/dev/uart/uart_bus_fdt.c +++ b/sys/dev/uart/uart_bus_fdt.c @@ -137,7 +137,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) struct uart_class *class; phandle_t node, chosen; pcell_t shift, br, rclk; - u_long start, size; + u_long start, size, pbase, psize; int err; uart_bus_space_mem = fdtbus_bs_tag; @@ -197,7 +197,9 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) err = fdt_regsize(node, &start, &size); if (err) return (ENXIO); - start += fdt_immr_va; + + fdt_get_range(OF_parent(node), 0, &pbase, &psize); + start += pbase; return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh)); } -- cgit v1.1