a90c9a18ccccd76371d62cd64d4bc19668892edf
[project/bcm63xx/atf.git] / plat / qemu / qemu_console.c
1 /*
2 * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6 #include <console.h>
7 #include <pl011.h>
8 #include <platform_def.h>
9
10 #if MULTI_CONSOLE_API
11 static console_pl011_t console;
12 #endif /* MULTI_CONSOLE_API */
13
14 void qemu_console_init(void)
15 {
16 #if MULTI_CONSOLE_API
17 (void)console_pl011_register(PLAT_QEMU_BOOT_UART_BASE,
18 PLAT_QEMU_BOOT_UART_CLK_IN_HZ,
19 PLAT_QEMU_CONSOLE_BAUDRATE, &console);
20
21 console_set_scope(&console.console, CONSOLE_FLAG_BOOT |
22 CONSOLE_FLAG_RUNTIME);
23 #else
24 console_init(PLAT_QEMU_BOOT_UART_BASE,
25 PLAT_QEMU_BOOT_UART_CLK_IN_HZ,
26 PLAT_QEMU_CONSOLE_BAUDRATE);
27 #endif /* MULTI_CONSOLE_API */
28 }
29