svn commit: r295909 - head/sys/dev/uart
Ian Lepore
ian at FreeBSD.org
Tue Feb 23 02:57:47 UTC 2016
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);
}
More information about the svn-src-all
mailing list