qemu: don't use C functions for the crash console callbacks
Use the console_pl011_core_* functions directly in the crash console
callbacks.
This bypasses the MULTI_CONSOLE_API for the crash console (UART1), but
allows using the crash console before the C runtime has been initialized
(eg to call ASM_ASSERT). This retains backwards compatibility with respect
to functionality when the old API is used.
Use the MULTI_CONSOLE_API to register UART0 as the boot and runtime
console.
Fixes ARM-software/tf-issues#572
Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
diff --git a/plat/qemu/qemu_console.c b/plat/qemu/qemu_console.c
index 1cf84aa..a90c9a1 100644
--- a/plat/qemu/qemu_console.c
+++ b/plat/qemu/qemu_console.c
@@ -9,7 +9,6 @@
#if MULTI_CONSOLE_API
static console_pl011_t console;
-static console_pl011_t crash_console;
#endif /* MULTI_CONSOLE_API */
void qemu_console_init(void)
@@ -18,6 +17,9 @@
(void)console_pl011_register(PLAT_QEMU_BOOT_UART_BASE,
PLAT_QEMU_BOOT_UART_CLK_IN_HZ,
PLAT_QEMU_CONSOLE_BAUDRATE, &console);
+
+ console_set_scope(&console.console, CONSOLE_FLAG_BOOT |
+ CONSOLE_FLAG_RUNTIME);
#else
console_init(PLAT_QEMU_BOOT_UART_BASE,
PLAT_QEMU_BOOT_UART_CLK_IN_HZ,
@@ -25,15 +27,3 @@
#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 */
-}