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