qemu_console.c 1.02 KB
Newer Older
1
2
3
4
5
6
7
8
9
/*
 * 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>

10
#if MULTI_CONSOLE_API
11
12
static console_pl011_t console;
static console_pl011_t crash_console;
13
#endif /* MULTI_CONSOLE_API */
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

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 */
}