Date: Mon, 18 Jan 2016 17:03:12 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294280 - head/sys/dev/uart Message-ID: <201601181703.u0IH3Cxa031629@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Mon Jan 18 17:03:12 2016 New Revision: 294280 URL: https://svnweb.freebsd.org/changeset/base/294280 Log: 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 Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Mon Jan 18 16:54:26 2016 (r294279) +++ head/sys/dev/uart/uart_cpu_fdt.c Mon Jan 18 17:03:12 2016 (r294280) @@ -133,7 +133,6 @@ uart_cpu_getdev(int devtype, struct uart 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 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)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601181703.u0IH3Cxa031629>