diff options
author | andrew <andrew@FreeBSD.org> | 2015-04-07 15:12:03 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2015-04-07 15:12:03 +0000 |
commit | 48fff99b5bdcbf6b377070bfb321f60466e5f13c (patch) | |
tree | f8d0263f5b0c2e5a134fc8d0c8eb87f3a0dfd7ab /sys/dev/uart | |
parent | ae235f94bd8e004d0501d67e87e1486b2df2c971 (diff) | |
download | FreeBSD-src-48fff99b5bdcbf6b377070bfb321f60466e5f13c.zip FreeBSD-src-48fff99b5bdcbf6b377070bfb321f60466e5f13c.tar.gz |
Get the fdt uart driver working on arm64, there is no machine/fdt.h, and
the default shift should be 2 for the SoCs we support.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/dev/uart')
-rw-r--r-- | sys/dev/uart/uart_bus_fdt.c | 8 | ||||
-rw-r--r-- | sys/dev/uart/uart_cpu_fdt.c | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/uart/uart_bus_fdt.c b/sys/dev/uart/uart_bus_fdt.c index 918c892..5f0bb24 100644 --- a/sys/dev/uart/uart_bus_fdt.c +++ b/sys/dev/uart/uart_bus_fdt.c @@ -83,10 +83,16 @@ uart_fdt_get_clock(phandle_t node, pcell_t *cell) int uart_fdt_get_shift(phandle_t node, pcell_t *cell) { +#ifdef __aarch64__ +#define DEFAULT_SHIFT 2 +#else +#define DEFAULT_SHIFT 0 +#endif if ((OF_getencprop(node, "reg-shift", cell, sizeof(*cell))) <= 0) - *cell = 0; + *cell = DEFAULT_SHIFT; return (0); +#undef DEFAULT_SHIFT } static uintptr_t diff --git a/sys/dev/uart/uart_cpu_fdt.c b/sys/dev/uart/uart_cpu_fdt.c index 6f6ebda..dc00fe8 100644 --- a/sys/dev/uart/uart_cpu_fdt.c +++ b/sys/dev/uart/uart_cpu_fdt.c @@ -42,7 +42,9 @@ __FBSDID("$FreeBSD$"); #include <vm/pmap.h> #include <machine/bus.h> +#ifndef __aarch64__ #include <machine/fdt.h> +#endif #include <dev/fdt/fdt_common.h> #include <dev/ofw/ofw_bus.h> @@ -52,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include <dev/uart/uart_cpu.h> #include <dev/uart/uart_cpu_fdt.h> +#ifdef __aarch64__ +extern bus_space_tag_t fdtbus_bs_tag; +#endif + /* * UART console routines. */ |