aml_console.c 875 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
/*
 * Copyright (c) 2019, Carlo Caione <ccaione@baylibre.com>
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <common/debug.h>
#include <meson_console.h>
#include <platform_def.h>

/*******************************************************************************
 * Function that sets up the console
 ******************************************************************************/
14
static console_t aml_console;
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

void aml_console_init(void)
{
	int rc = console_meson_register(AML_UART0_AO_BASE,
					AML_UART0_AO_CLK_IN_HZ,
					AML_UART_BAUDRATE,
					&aml_console);
	if (rc == 0) {
		/*
		 * The crash console doesn't use the multi console API, it uses
		 * the core console functions directly. It is safe to call panic
		 * and let it print debug information.
		 */
		panic();
	}

31
	console_set_scope(&aml_console,
32
33
			  CONSOLE_FLAG_BOOT | CONSOLE_FLAG_RUNTIME);
}