Carlo Caione | 613bdb7 | 2019-09-05 12:27:39 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2019, Carlo Caione <ccaione@baylibre.com> |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <common/debug.h> |
| 8 | #include <meson_console.h> |
| 9 | #include <platform_def.h> |
| 10 | |
| 11 | /******************************************************************************* |
| 12 | * Function that sets up the console |
| 13 | ******************************************************************************/ |
| 14 | static console_meson_t aml_console; |
| 15 | |
| 16 | void aml_console_init(void) |
| 17 | { |
| 18 | int rc = console_meson_register(AML_UART0_AO_BASE, |
| 19 | AML_UART0_AO_CLK_IN_HZ, |
| 20 | AML_UART_BAUDRATE, |
| 21 | &aml_console); |
| 22 | if (rc == 0) { |
| 23 | /* |
| 24 | * The crash console doesn't use the multi console API, it uses |
| 25 | * the core console functions directly. It is safe to call panic |
| 26 | * and let it print debug information. |
| 27 | */ |
| 28 | panic(); |
| 29 | } |
| 30 | |
| 31 | console_set_scope(&aml_console.console, |
| 32 | CONSOLE_FLAG_BOOT | CONSOLE_FLAG_RUNTIME); |
| 33 | } |