svn commit: r281204 - head/sys/dev/uart

Andrew Turner andrew at FreeBSD.org
Tue Apr 7 15:12:05 UTC 2015


Author: andrew
Date: Tue Apr  7 15:12:03 2015
New Revision: 281204
URL: https://svnweb.freebsd.org/changeset/base/281204

Log:
  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

Modified:
  head/sys/dev/uart/uart_bus_fdt.c
  head/sys/dev/uart/uart_cpu_fdt.c

Modified: head/sys/dev/uart/uart_bus_fdt.c
==============================================================================
--- head/sys/dev/uart/uart_bus_fdt.c	Tue Apr  7 14:47:27 2015	(r281203)
+++ head/sys/dev/uart/uart_bus_fdt.c	Tue Apr  7 15:12:03 2015	(r281204)
@@ -83,10 +83,16 @@ uart_fdt_get_clock(phandle_t node, pcell
 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

Modified: head/sys/dev/uart/uart_cpu_fdt.c
==============================================================================
--- head/sys/dev/uart/uart_cpu_fdt.c	Tue Apr  7 14:47:27 2015	(r281203)
+++ head/sys/dev/uart/uart_cpu_fdt.c	Tue Apr  7 15:12:03 2015	(r281204)
@@ -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.
  */


More information about the svn-src-all mailing list