blob: 8b1b23a041a83ffd7f362aa49249fc46fa5f2cc6 [file] [log] [blame]
Pankaj Gupta6b36c1b2020-12-09 14:02:38 +05301/*
2 * Copyright 2021 NXP
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef PLAT_CONSOLE_H
9#define PLAT_CONSOLE_H
10
11#include <stdint.h>
12#include <drivers/console.h>
13
14#if (NXP_CONSOLE == NS16550)
15/*
16 * NXP specific UART - 16550 configuration
17 *
18 * Initialize a NXP 16550 console instance and register it with the console
19 * framework. The |console| pointer must point to storage that will be valid
20 * for the lifetime of the console, such as a global or static local variable.
21 * Its contents will be reinitialized from scratch.
22 * When |clock| has a value of 0, the UART will *not* be initialised. This
23 * means the UART should already be enabled and the baudrate and clock setup
24 * should have been done already, either by platform specific code or by
25 * previous firmware stages. The |baud| parameter will be ignored in this
26 * case as well.
27 */
28int nxp_console_16550_register(uintptr_t baseaddr, uint32_t clock,
29 uint32_t baud, console_t *console);
30#endif
31/*
32 * Function to initialize platform's console
33 * and register with console framework
34 */
35void plat_console_init(uintptr_t nxp_console_addr, uint32_t uart_clk_div,
36 uint32_t baud);
37
38#endif