summaryrefslogtreecommitdiff
path: root/plat/qemu/qemu_console.c
diff options
context:
space:
mode:
authordavidcunado-arm <david.cunado@arm.com>2018-03-22 07:57:55 +0000
committerGitHub <noreply@github.com>2018-03-22 07:57:55 +0000
commitf13ef37a38cec17f72f08dc63bbbe546a54d78a7 (patch)
tree1b562a844f7c2fd22c3d4a434d62bd37519db81f /plat/qemu/qemu_console.c
parent0f66bbf2fdb028555c4c7bdb4ce1855e2a4ffe7a (diff)
parent6a55f6aae96deafce184766df8675888b818ccf4 (diff)
Merge pull request #1299 from michpappas/tf-issues#561_qemu_support_MULTI_CONSOLE
qemu: Support MULTI_CONSOLE_API
Diffstat (limited to 'plat/qemu/qemu_console.c')
-rw-r--r--plat/qemu/qemu_console.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/plat/qemu/qemu_console.c b/plat/qemu/qemu_console.c
new file mode 100644
index 00000000..9c02957e
--- /dev/null
+++ b/plat/qemu/qemu_console.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+#include <console.h>
+#include <pl011.h>
+#include <platform_def.h>
+
+static console_pl011_t console;
+static console_pl011_t crash_console;
+
+void qemu_console_init(void)
+{
+#if MULTI_CONSOLE_API
+ (void)console_pl011_register(PLAT_QEMU_BOOT_UART_BASE,
+ PLAT_QEMU_BOOT_UART_CLK_IN_HZ,
+ PLAT_QEMU_CONSOLE_BAUDRATE, &console);
+#else
+ console_init(PLAT_QEMU_BOOT_UART_BASE,
+ PLAT_QEMU_BOOT_UART_CLK_IN_HZ,
+ PLAT_QEMU_CONSOLE_BAUDRATE);
+#endif /* MULTI_CONSOLE_API */
+}
+
+void qemu_crash_console_init(void)
+{
+#if MULTI_CONSOLE_API
+ (void)console_pl011_register(PLAT_QEMU_CRASH_UART_BASE,
+ PLAT_QEMU_CRASH_UART_CLK_IN_HZ,
+ PLAT_QEMU_CONSOLE_BAUDRATE, &crash_console);
+#else
+ console_core_init(PLAT_QEMU_CRASH_UART_BASE,
+ PLAT_QEMU_CRASH_UART_CLK_IN_HZ,
+ PLAT_QEMU_CONSOLE_BAUDRATE);
+#endif /* MULTI_CONSOLE_API */
+}