blob: 70e3b0bd4e16bec1ea783b69eff77d6299031573 [file] [log] [blame]
Antonio Nino Diaz01193242018-08-15 22:07:35 +01001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef MESON_CONSOLE_H
8#define MESON_CONSOLE_H
9
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <drivers/console.h>
Antonio Nino Diaz01193242018-08-15 22:07:35 +010011
12#define CONSOLE_T_MESON_BASE CONSOLE_T_DRVDATA
13
Julius Werner53456fc2019-07-09 13:49:11 -070014#ifndef __ASSEMBLER__
Antonio Nino Diaz01193242018-08-15 22:07:35 +010015
16#include <stdint.h>
17
18typedef struct {
19 console_t console;
20 uintptr_t base;
21} console_meson_t;
22
23/*
24 * Initialize a new meson console instance and register it with the console
25 * framework. The |console| pointer must point to storage that will be valid
26 * for the lifetime of the console, such as a global or static local variable.
27 * Its contents will be reinitialized from scratch.
28 *
29 * NOTE: The clock is actually fixed to 24 MHz. The argument is only there in
30 * order to make this function future-proof.
31 */
32int console_meson_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
33 console_meson_t *console);
34
Julius Werner53456fc2019-07-09 13:49:11 -070035#endif /*__ASSEMBLER__*/
Antonio Nino Diaz01193242018-08-15 22:07:35 +010036
37#endif /* MESON_CONSOLE_H */