xref: /optee_os/core/include/console.h (revision 4dc31c52544a7241e97d0452d512330ee30ed664)
14de4bebcSJens Wiklander /*
24de4bebcSJens Wiklander  * Copyright (c) 2014, Linaro Limited
34de4bebcSJens Wiklander  * All rights reserved.
44de4bebcSJens Wiklander  *
54de4bebcSJens Wiklander  * Redistribution and use in source and binary forms, with or without
64de4bebcSJens Wiklander  * modification, are permitted provided that the following conditions are met:
74de4bebcSJens Wiklander  *
84de4bebcSJens Wiklander  * 1. Redistributions of source code must retain the above copyright notice,
94de4bebcSJens Wiklander  * this list of conditions and the following disclaimer.
104de4bebcSJens Wiklander  *
114de4bebcSJens Wiklander  * 2. Redistributions in binary form must reproduce the above copyright notice,
124de4bebcSJens Wiklander  * this list of conditions and the following disclaimer in the documentation
134de4bebcSJens Wiklander  * and/or other materials provided with the distribution.
144de4bebcSJens Wiklander  *
154de4bebcSJens Wiklander  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
164de4bebcSJens Wiklander  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
174de4bebcSJens Wiklander  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
184de4bebcSJens Wiklander  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
194de4bebcSJens Wiklander  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
204de4bebcSJens Wiklander  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
214de4bebcSJens Wiklander  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
224de4bebcSJens Wiklander  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
234de4bebcSJens Wiklander  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
244de4bebcSJens Wiklander  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
254de4bebcSJens Wiklander  * POSSIBILITY OF SUCH DAMAGE.
264de4bebcSJens Wiklander  */
274de4bebcSJens Wiklander 
284de4bebcSJens Wiklander #ifndef CONSOLE_H
294de4bebcSJens Wiklander #define CONSOLE_H
304de4bebcSJens Wiklander 
31*4dc31c52SJerome Forissier #include <compiler.h>
32*4dc31c52SJerome Forissier 
336ef34537SSY Chiu void console_init(void);
344de4bebcSJens Wiklander void console_putc(int ch);
35db886a7fSJerome Forissier void console_flush(void);
364de4bebcSJens Wiklander 
37756aea59SJerome Forissier struct serial_chip;
38756aea59SJerome Forissier void register_serial_console(struct serial_chip *chip);
39756aea59SJerome Forissier 
40*4dc31c52SJerome Forissier #ifdef CFG_DT
41*4dc31c52SJerome Forissier void configure_console_from_dt(unsigned long phys_fdt);
42*4dc31c52SJerome Forissier #else
43*4dc31c52SJerome Forissier static inline void configure_console_from_dt(unsigned long phys_fdt __unused)
44*4dc31c52SJerome Forissier {}
45*4dc31c52SJerome Forissier #endif /* !CFG_DT */
46*4dc31c52SJerome Forissier 
474de4bebcSJens Wiklander #endif /* CONSOLE_H */
484de4bebcSJens Wiklander 
49