summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2015-05-23 20:54:25 +0000
committerian <ian@FreeBSD.org>2015-05-23 20:54:25 +0000
commitf3f411e10b20906a8640a6316ddcc3c1f24725e3 (patch)
treeb8226cf0be8fe4cd6baeb7595bf89042db51e870 /sys/arm/at91
parentce1bf49e72ea9be2396679cd9569beeec685e9c6 (diff)
downloadFreeBSD-src-f3f411e10b20906a8640a6316ddcc3c1f24725e3.zip
FreeBSD-src-f3f411e10b20906a8640a6316ddcc3c1f24725e3.tar.gz
MFC r279723, r279724:
Define new linker set, UART_FDT_CLASS_AND_DEVICE, for registering full (class and device) FDT UART. Define second one, UART_FDT_CLASS, for UART class only. Move the uart_class definitions and fdt compat data into the individual uart implementations, and export them using the new linker-set mechanism.
Diffstat (limited to 'sys/arm/at91')
-rw-r--r--sys/arm/at91/uart_bus_at91usart.c1
-rw-r--r--sys/arm/at91/uart_cpu_at91usart.c1
-rw-r--r--sys/arm/at91/uart_dev_at91usart.c12
3 files changed, 14 insertions, 0 deletions
diff --git a/sys/arm/at91/uart_bus_at91usart.c b/sys/arm/at91/uart_bus_at91usart.c
index 65829df..28182fa 100644
--- a/sys/arm/at91/uart_bus_at91usart.c
+++ b/sys/arm/at91/uart_bus_at91usart.c
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include "uart_if.h"
+extern struct uart_class at91_usart_class;
static int usart_at91_probe(device_t dev);
static device_method_t usart_at91_methods[] = {
diff --git a/sys/arm/at91/uart_cpu_at91usart.c b/sys/arm/at91/uart_cpu_at91usart.c
index 67a0a05..57c4a5a 100644
--- a/sys/arm/at91/uart_cpu_at91usart.c
+++ b/sys/arm/at91/uart_cpu_at91usart.c
@@ -51,6 +51,7 @@ bus_space_tag_t uart_bus_space_io;
bus_space_tag_t uart_bus_space_mem;
extern struct bus_space at91_bs_tag;
+extern struct uart_class at91_usart_class;
int
uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)
diff --git a/sys/arm/at91/uart_dev_at91usart.c b/sys/arm/at91/uart_dev_at91usart.c
index 049fff5..ee5254c 100644
--- a/sys/arm/at91/uart_dev_at91usart.c
+++ b/sys/arm/at91/uart_dev_at91usart.c
@@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$");
#include <dev/uart/uart.h>
#include <dev/uart/uart_cpu.h>
+#ifdef FDT
+#include <dev/uart/uart_cpu_fdt.h>
+#endif
#include <dev/uart/uart_bus.h>
#include <arm/at91/at91_usartreg.h>
#include <arm/at91/at91_pdcreg.h>
@@ -866,3 +869,12 @@ struct uart_class at91_usart_class = {
.uc_ops = &at91_usart_ops,
.uc_range = 8
};
+
+#ifdef FDT
+static struct ofw_compat_data compat_data[] = {
+ {"atmel,at91rm9200-usart",(uintptr_t)&at91_usart_class},
+ {"atmel,at91sam9260-usart",(uintptr_t)&at91_usart_class},
+ {NULL, (uintptr_t)NULL},
+};
+UART_FDT_CLASS_AND_DEVICE(compat_data);
+#endif
OpenPOWER on IntegriCloud