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 | */ |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 6 | |
Michalis Pappas | cca6cb7 | 2018-03-04 15:43:38 +0800 | [diff] [blame] | 7 | #include <platform_def.h> |
| 8 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 9 | #include <drivers/console.h> |
| 10 | #include <drivers/arm/pl011.h> |
| 11 | |
Michalis Pappas | a0bb5ac | 2018-03-24 12:38:31 +0800 | [diff] [blame] | 12 | #if MULTI_CONSOLE_API |
Michalis Pappas | cca6cb7 | 2018-03-04 15:43:38 +0800 | [diff] [blame] | 13 | static console_pl011_t console; |
Michalis Pappas | a0bb5ac | 2018-03-24 12:38:31 +0800 | [diff] [blame] | 14 | #endif /* MULTI_CONSOLE_API */ |
Michalis Pappas | cca6cb7 | 2018-03-04 15:43:38 +0800 | [diff] [blame] | 15 | |
| 16 | void qemu_console_init(void) |
| 17 | { |
| 18 | #if MULTI_CONSOLE_API |
| 19 | (void)console_pl011_register(PLAT_QEMU_BOOT_UART_BASE, |
| 20 | PLAT_QEMU_BOOT_UART_CLK_IN_HZ, |
| 21 | PLAT_QEMU_CONSOLE_BAUDRATE, &console); |
Michalis Pappas | abd0836 | 2018-03-27 12:32:31 +0800 | [diff] [blame] | 22 | |
| 23 | console_set_scope(&console.console, CONSOLE_FLAG_BOOT | |
| 24 | CONSOLE_FLAG_RUNTIME); |
Michalis Pappas | cca6cb7 | 2018-03-04 15:43:38 +0800 | [diff] [blame] | 25 | #else |
| 26 | console_init(PLAT_QEMU_BOOT_UART_BASE, |
| 27 | PLAT_QEMU_BOOT_UART_CLK_IN_HZ, |
| 28 | PLAT_QEMU_CONSOLE_BAUDRATE); |
| 29 | #endif /* MULTI_CONSOLE_API */ |
| 30 | } |
| 31 | |