xref: /rk3399_ARM-atf/include/drivers/st/stm32_console.h (revision d5dfdeb65ff5b7f24dded201d2945c7b74565ce8)
16d264afcSYann Gautier /*
26d264afcSYann Gautier  * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
36d264afcSYann Gautier  *
46d264afcSYann Gautier  * SPDX-License-Identifier: BSD-3-Clause
56d264afcSYann Gautier  */
66d264afcSYann Gautier 
76d264afcSYann Gautier #ifndef STM32_CONSOLE_H
86d264afcSYann Gautier #define STM32_CONSOLE_H
96d264afcSYann Gautier 
1009d40e0eSAntonio Nino Diaz #include <drivers/console.h>
116d264afcSYann Gautier 
126d264afcSYann Gautier #define CONSOLE_T_STM32_BASE	CONSOLE_T_DRVDATA
136d264afcSYann Gautier 
14*d5dfdeb6SJulius Werner #ifndef __ASSEMBLER__
156d264afcSYann Gautier 
166d264afcSYann Gautier #include <stdint.h>
176d264afcSYann Gautier 
186d264afcSYann Gautier struct console_stm32 {
196d264afcSYann Gautier 	console_t console;
206d264afcSYann Gautier 	uintptr_t base;
216d264afcSYann Gautier };
226d264afcSYann Gautier 
236d264afcSYann Gautier /*
246d264afcSYann Gautier  * Initialize a new STM32 console instance and register it with the console
256d264afcSYann Gautier  * framework. The |console| pointer must point to storage that will be valid
266d264afcSYann Gautier  * for the lifetime of the console, such as a global or static local variable.
276d264afcSYann Gautier  * Its contents will be reinitialized from scratch.
286d264afcSYann Gautier  */
296d264afcSYann Gautier int console_stm32_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
306d264afcSYann Gautier 			   struct console_stm32 *console);
316d264afcSYann Gautier 
32*d5dfdeb6SJulius Werner #endif /*__ASSEMBLER__*/
336d264afcSYann Gautier 
346d264afcSYann Gautier #endif /* STM32_CONSOLE_H */
35