summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_bus_fdt.c
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2012-08-15 03:49:10 +0000
committergonzo <gonzo@FreeBSD.org>2012-08-15 03:49:10 +0000
commita86619e32d43f67acebfca6f18e523a14bce37c8 (patch)
treed91a083208aa6a56ef7a654eca6f01ee88016949 /sys/dev/uart/uart_bus_fdt.c
parent7dcf863fe4ae5e10c9c55e6c27387d8d389687d9 (diff)
downloadFreeBSD-src-a86619e32d43f67acebfca6f18e523a14bce37c8.zip
FreeBSD-src-a86619e32d43f67acebfca6f18e523a14bce37c8.tar.gz
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
Diffstat (limited to 'sys/dev/uart/uart_bus_fdt.c')
-rw-r--r--sys/dev/uart/uart_bus_fdt.c6
1 files changed, 4 insertions, 2 deletions
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));
}
OpenPOWER on IntegriCloud