blob: e21d707a0f068417ab07b7c5e297da4023deaeb4 [file] [log] [blame]
Carlo Caione613bdb72019-09-05 12:27:39 +01001/*
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 ******************************************************************************/
Andre Przywara0cd53442020-01-25 00:58:35 +000014static console_t aml_console;
Carlo Caione613bdb72019-09-05 12:27:39 +010015
16void 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
Andre Przywara0cd53442020-01-25 00:58:35 +000031 console_set_scope(&aml_console,
Carlo Caione613bdb72019-09-05 12:27:39 +010032 CONSOLE_FLAG_BOOT | CONSOLE_FLAG_RUNTIME);
33}