summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2017-09-18 16:57:51 -0700
committerJulius Werner <jwerner@chromium.org>2018-01-19 15:21:12 -0800
commit36c42ca111ea44e10d3589e93fa18a2b8162b6a3 (patch)
tree9ee631744c31482f7b6d127e092fcdd69f3ac5e4 /include
parent17cd67d2af885913427be5c0d8af47647d72896e (diff)
drivers: ti: uart: Update 16550 UART driver to support MULTI_CONSOLE_API
This patch updates the TI 16550 console driver to support the new console API. The driver will continue to support the old API as well by checking the MULTI_CONSOLE_API compile-time flag. Change-Id: I60a44b7ba3c35c74561824c04b8dbe3e3039324c Signed-off-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/drivers/ti/uart/uart_16550.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/drivers/ti/uart/uart_16550.h b/include/drivers/ti/uart/uart_16550.h
index f258d45b..9eba41aa 100644
--- a/include/drivers/ti/uart/uart_16550.h
+++ b/include/drivers/ti/uart/uart_16550.h
@@ -7,6 +7,8 @@
#ifndef __UART_16550_H__
#define __UART_16550_H__
+#include <console.h>
+
/* UART16550 Registers */
#define UARTTX 0x0
#define UARTRX 0x0
@@ -67,4 +69,26 @@
#define UARTLSR_RDR_BIT (0) /* Rx Data Ready Bit */
#define UARTLSR_RDR (1 << UARTLSR_RDR_BIT) /* Rx Data Ready */
+#define CONSOLE_T_16550_BASE CONSOLE_T_DRVDATA
+
+#ifndef __ASSEMBLY__
+
+#include <types.h>
+
+typedef struct {
+ console_t console;
+ uintptr_t base;
+} console_16550_t;
+
+/*
+ * Initialize a new 16550 console instance and register it with the console
+ * framework. The |console| pointer must point to storage that will be valid
+ * for the lifetime of the console, such as a global or static local variable.
+ * Its contents will be reinitialized from scratch.
+ */
+int console_16550_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
+ console_16550_t *console);
+
+#endif /*__ASSEMBLY__*/
+
#endif /* __UART_16550_H__ */