Author: marcel Date: Mon Jan 17 23:34:36 2011 New Revision: 217520 URL: http://svn.freebsd.org/changeset/base/217520
Log: Check the environment for system devices before using the FDT. This allows overriding the FDT, and allows specifying a debug port. Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Mon Jan 17 23:06:47 2011 (r217519) +++ head/sys/dev/uart/uart_bus_fdt.c Mon Jan 17 23:34:36 2011 (r217520) @@ -140,6 +140,15 @@ uart_cpu_getdev(int devtype, struct uart u_long start, size; int err; + uart_bus_space_mem = fdtbus_bs_tag; + uart_bus_space_io = NULL; + + /* Allow overriding the FDT uning the environment. */ + class = &uart_ns8250_class; + err = uart_getenv(devtype, di, class); + if (!err) + return (0); + if (devtype != UART_DEV_CONSOLE) return (ENXIO); @@ -183,18 +192,12 @@ uart_cpu_getdev(int devtype, struct uart di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - di->bas.bst = fdtbus_bs_tag; + di->bas.bst = uart_bus_space_mem; err = fdt_regsize(node, &start, &size); if (err) return (ENXIO); start += fdt_immr_va; - uart_bus_space_mem = fdtbus_bs_tag; - uart_bus_space_io = NULL; - - if (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh) != 0) - return (ENXIO); - - return (0); + return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh)); } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"