xref: /rk3399_ARM-atf/include/drivers/st/stm32_console.h (revision 6d264afc9e0e3515f861c42b10ad9cebc3367b15)
1*6d264afcSYann Gautier /*
2*6d264afcSYann Gautier  * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3*6d264afcSYann Gautier  *
4*6d264afcSYann Gautier  * SPDX-License-Identifier: BSD-3-Clause
5*6d264afcSYann Gautier  */
6*6d264afcSYann Gautier 
7*6d264afcSYann Gautier #ifndef STM32_CONSOLE_H
8*6d264afcSYann Gautier #define STM32_CONSOLE_H
9*6d264afcSYann Gautier 
10*6d264afcSYann Gautier #include <console.h>
11*6d264afcSYann Gautier 
12*6d264afcSYann Gautier #define CONSOLE_T_STM32_BASE	CONSOLE_T_DRVDATA
13*6d264afcSYann Gautier 
14*6d264afcSYann Gautier #ifndef __ASSEMBLY__
15*6d264afcSYann Gautier 
16*6d264afcSYann Gautier #include <stdint.h>
17*6d264afcSYann Gautier 
18*6d264afcSYann Gautier struct console_stm32 {
19*6d264afcSYann Gautier 	console_t console;
20*6d264afcSYann Gautier 	uintptr_t base;
21*6d264afcSYann Gautier };
22*6d264afcSYann Gautier 
23*6d264afcSYann Gautier /*
24*6d264afcSYann Gautier  * Initialize a new STM32 console instance and register it with the console
25*6d264afcSYann Gautier  * framework. The |console| pointer must point to storage that will be valid
26*6d264afcSYann Gautier  * for the lifetime of the console, such as a global or static local variable.
27*6d264afcSYann Gautier  * Its contents will be reinitialized from scratch.
28*6d264afcSYann Gautier  */
29*6d264afcSYann Gautier int console_stm32_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
30*6d264afcSYann Gautier 			   struct console_stm32 *console);
31*6d264afcSYann Gautier 
32*6d264afcSYann Gautier #endif /*__ASSEMBLY__*/
33*6d264afcSYann Gautier 
34*6d264afcSYann Gautier #endif /* STM32_CONSOLE_H */
35