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