.globl platform_mem_init
.globl plat_qemu_calc_core_pos
.globl plat_crash_console_init
+#if MULTI_CONSOLE_API
.globl plat_crash_console_putc
+#endif /* MULTI_CONSOLE_API */
.globl plat_secondary_cold_boot_setup
.globl plat_get_my_entrypoint
.globl plat_is_my_cpu_primary
-
func plat_my_core_pos
mrs x0, mpidr_el1
b plat_qemu_calc_core_pos
* ---------------------------------------------
*/
func plat_crash_console_init
- mov_imm x0, PLAT_QEMU_CRASH_UART_BASE
- mov_imm x1, PLAT_QEMU_CRASH_UART_CLK_IN_HZ
- mov_imm x2, PLAT_QEMU_CONSOLE_BAUDRATE
- b console_core_init
+ b qemu_crash_console_init
endfunc plat_crash_console_init
/* ---------------------------------------------
* Clobber list : x1, x2
* ---------------------------------------------
*/
+#if !MULTI_CONSOLE_API
func plat_crash_console_putc
mov_imm x1, PLAT_QEMU_CRASH_UART_BASE
b console_core_putc
endfunc plat_crash_console_putc
-
+#endif /* MULTI_CONSOLE_API */
$(eval $(call add_define,ARM_XLAT_TABLES_LIB_V1))
-PLAT_BL_COMMON_SOURCES := plat/qemu/qemu_common.c \
- drivers/arm/pl011/${ARCH}/pl011_console.S
+PLAT_BL_COMMON_SOURCES := plat/qemu/qemu_common.c \
+ plat/qemu/qemu_console.c \
+ drivers/arm/pl011/${ARCH}/pl011_console.S \
ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1)
PLAT_BL_COMMON_SOURCES += lib/xlat_tables/xlat_tables_common.c \
endif
SEPARATE_CODE_AND_RODATA := 1
+MULTI_CONSOLE_API := 1
# Disable the PSCI platform compatibility layer
ENABLE_PLAT_COMPAT := 0
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
-#include <console.h>
#include <platform_def.h>
#include "qemu_private.h"
void bl1_early_platform_setup(void)
{
/* Initialize the console to provide early debug support */
- console_init(PLAT_QEMU_BOOT_UART_BASE, PLAT_QEMU_BOOT_UART_CLK_IN_HZ,
- PLAT_QEMU_CONSOLE_BAUDRATE);
+ qemu_console_init();
/* Allow BL1 to see the whole Trusted RAM */
bl1_tzram_layout.total_base = BL_RAM_BASE;
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
-#include <console.h>
#include <debug.h>
#include <desc_image_load.h>
#include <optee_utils.h>
void bl2_early_platform_setup(meminfo_t *mem_layout)
{
/* Initialize the console to provide early debug support */
- console_init(PLAT_QEMU_BOOT_UART_BASE, PLAT_QEMU_BOOT_UART_CLK_IN_HZ,
- PLAT_QEMU_CONSOLE_BAUDRATE);
+ qemu_console_init();
/* Setup the BL2 memory layout */
bl2_tzram_layout = *mem_layout;
#include <assert.h>
#include <bl_common.h>
-#include <console.h>
#include <gic_common.h>
#include <gicv2.h>
#include <platform_def.h>
#endif
{
/* Initialize the console to provide early debug support */
- console_init(PLAT_QEMU_BOOT_UART_BASE, PLAT_QEMU_BOOT_UART_CLK_IN_HZ,
- PLAT_QEMU_CONSOLE_BAUDRATE);
+ qemu_console_init();
#if LOAD_IMAGE_V2
/*
--- /dev/null
+/*
+ * 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 */
+}
int dt_add_psci_node(void *fdt);
int dt_add_psci_cpu_enable_methods(void *fdt);
+void qemu_console_init(void);
+void qemu_crash_console_init(void);
+
#endif /*__QEMU_PRIVATE_H*/