Michalis Pappas | cca6cb7 | 2018-03-04 15:43:38 +0800 | [diff] [blame] | 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 | |
Michalis Pappas | a0bb5ac | 2018-03-24 12:38:31 +0800 | [diff] [blame] | 10 | #if MULTI_CONSOLE_API |
Michalis Pappas | cca6cb7 | 2018-03-04 15:43:38 +0800 | [diff] [blame] | 11 | static console_pl011_t console; |
| 12 | static console_pl011_t crash_console; |
Michalis Pappas | a0bb5ac | 2018-03-24 12:38:31 +0800 | [diff] [blame] | 13 | #endif /* MULTI_CONSOLE_API */ |
Michalis Pappas | cca6cb7 | 2018-03-04 15:43:38 +0800 | [diff] [blame] | 14 | |
| 15 | void qemu_console_init(void) |
| 16 | { |
| 17 | #if MULTI_CONSOLE_API |
| 18 | (void)console_pl011_register(PLAT_QEMU_BOOT_UART_BASE, |
| 19 | PLAT_QEMU_BOOT_UART_CLK_IN_HZ, |
| 20 | PLAT_QEMU_CONSOLE_BAUDRATE, &console); |
| 21 | #else |
| 22 | console_init(PLAT_QEMU_BOOT_UART_BASE, |
| 23 | PLAT_QEMU_BOOT_UART_CLK_IN_HZ, |
| 24 | PLAT_QEMU_CONSOLE_BAUDRATE); |
| 25 | #endif /* MULTI_CONSOLE_API */ |
| 26 | } |
| 27 | |
| 28 | void qemu_crash_console_init(void) |
| 29 | { |
| 30 | #if MULTI_CONSOLE_API |
| 31 | (void)console_pl011_register(PLAT_QEMU_CRASH_UART_BASE, |
| 32 | PLAT_QEMU_CRASH_UART_CLK_IN_HZ, |
| 33 | PLAT_QEMU_CONSOLE_BAUDRATE, &crash_console); |
| 34 | #else |
| 35 | console_core_init(PLAT_QEMU_CRASH_UART_BASE, |
| 36 | PLAT_QEMU_CRASH_UART_CLK_IN_HZ, |
| 37 | PLAT_QEMU_CONSOLE_BAUDRATE); |
| 38 | #endif /* MULTI_CONSOLE_API */ |
| 39 | } |