aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2017-09-18 16:59:43 -0700
committerJulius Werner <jwerner@chromium.org>2018-01-19 15:21:12 -0800
commit4a0c45716df6b0e9c1142c768bb2578ad87ce8c7 (patch)
tree317cb8b29fcd39b4e53455b2eef492ffa2039149 /include
parent36c42ca111ea44e10d3589e93fa18a2b8162b6a3 (diff)
downloadplatform_external_arm-trusted-firmware-4a0c45716df6b0e9c1142c768bb2578ad87ce8c7.tar.gz
platform_external_arm-trusted-firmware-4a0c45716df6b0e9c1142c768bb2578ad87ce8c7.tar.bz2
platform_external_arm-trusted-firmware-4a0c45716df6b0e9c1142c768bb2578ad87ce8c7.zip
drivers: arm: pl011: Update PL011 driver to support MULTI_CONSOLE_API
This patch updates the ARM PL011 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: Ic34e4158addbb0c5fae500c9cff899c05a4f4206 Signed-off-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/drivers/arm/pl011.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/drivers/arm/pl011.h b/include/drivers/arm/pl011.h
index cd259c5e1..06d754353 100644
--- a/include/drivers/arm/pl011.h
+++ b/include/drivers/arm/pl011.h
@@ -7,6 +7,8 @@
#ifndef __PL011_H__
#define __PL011_H__
+#include <console.h>
+
/* PL011 Registers */
#define UARTDR 0x000
#define UARTRSR 0x004
@@ -79,4 +81,26 @@
#endif /* !PL011_GENERIC_UART */
+#define CONSOLE_T_PL011_BASE CONSOLE_T_DRVDATA
+
+#ifndef __ASSEMBLY__
+
+#include <types.h>
+
+typedef struct {
+ console_t console;
+ uintptr_t base;
+} console_pl011_t;
+
+/*
+ * Initialize a new PL011 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_pl011_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
+ console_pl011_t *console);
+
+#endif /*__ASSEMBLY__*/
+
#endif /* __PL011_H__ */