diff options
author | ian <ian@FreeBSD.org> | 2016-01-18 17:03:12 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2016-01-18 17:03:12 +0000 |
commit | 2ca2e85e35e5300fd25386a5f6f9539eb1b83d12 (patch) | |
tree | a02c9e6a59a6aea7d88fc4fe591f5884770b6884 /sys/dev/uart | |
parent | 87558a38ae8607a42764a8e706e9128e4bba6b99 (diff) | |
download | FreeBSD-src-2ca2e85e35e5300fd25386a5f6f9539eb1b83d12.zip FreeBSD-src-2ca2e85e35e5300fd25386a5f6f9539eb1b83d12.tar.gz |
Use OF_decode_addr() to create a bus_space tag and handle for the console
on FDT/OFW platforms.
After the refactoring of the powerpc code so that OF_decode_addr() is usable
on all FDT/OFW platforms, this switches uart(4) to using it.
Differential Revision: https://reviews.freebsd.org/D4675
Diffstat (limited to 'sys/dev/uart')
-rw-r--r-- | sys/dev/uart/uart_cpu_fdt.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/sys/dev/uart/uart_cpu_fdt.c b/sys/dev/uart/uart_cpu_fdt.c index c70b4ca..1a4af9d 100644 --- a/sys/dev/uart/uart_cpu_fdt.c +++ b/sys/dev/uart/uart_cpu_fdt.c @@ -133,7 +133,6 @@ 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, pbase, psize; char *cp; int err; @@ -212,16 +211,6 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - di->bas.bst = uart_bus_space_mem; - err = fdt_regsize(node, &start, &size); - if (err) - return (ENXIO); - err = fdt_get_range(OF_parent(node), 0, &pbase, &psize); - if (err) - pbase = 0; - - start += pbase; - - return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh)); + return (OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh)); } |