Date: Tue, 23 Feb 2016 02:57:45 +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: r295909 - head/sys/dev/uart Message-ID: <201602230257.u1N2vjgF009461@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Tue Feb 23 02:57:45 2016 New Revision: 295909 URL: https://svnweb.freebsd.org/changeset/base/295909 Log: Now that we have OF_decode_addr(), with proper MD implementations, to obtain the bus space tag and handle for a uart console, use the values returned by that routine to set the global uart_bus_space_mem, instead of assuming that there will be a global variable named fdtbus_bs_tag to set it from. Also, use OF_getencprop() instead calling fdt32_to_cpu() separately. 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 Tue Feb 23 02:28:19 2016 (r295908) +++ head/sys/dev/uart/uart_cpu_fdt.c Tue Feb 23 02:57:45 2016 (r295909) @@ -136,9 +136,6 @@ uart_cpu_getdev(int devtype, struct uart char *cp; int err; - uart_bus_space_mem = fdtbus_bs_tag; - uart_bus_space_io = NULL; - /* Allow overriding the FDT using the environment. */ class = &uart_ns8250_class; err = uart_getenv(devtype, di, class); @@ -195,10 +192,8 @@ uart_cpu_getdev(int devtype, struct uart if (uart_fdt_get_shift(node, &shift) != 0) shift = uart_getregshift(class); - if (OF_getprop(node, "current-speed", &br, sizeof(br)) <= 0) + if (OF_getencprop(node, "current-speed", &br, sizeof(br)) <= 0) br = 0; - else - br = fdt32_to_cpu(br); /* * Finalize configuration. @@ -212,5 +207,9 @@ uart_cpu_getdev(int devtype, struct uart di->stopbits = 1; di->parity = UART_PARITY_NONE; - return (OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh, NULL)); + err = OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh, NULL); + uart_bus_space_mem = di->bas.bst; + uart_bus_space_io = NULL; + + return (err); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602230257.u1N2vjgF009461>