xref: /openbmc/u-boot/include/console.h (revision e8f80a5a)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
224b852a7SSimon Glass /*
324b852a7SSimon Glass  * (C) Copyright 2000-2009
424b852a7SSimon Glass  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
524b852a7SSimon Glass  */
624b852a7SSimon Glass 
724b852a7SSimon Glass #ifndef __CONSOLE_H
824b852a7SSimon Glass #define __CONSOLE_H
924b852a7SSimon Glass 
1024b852a7SSimon Glass extern char console_buffer[];
1124b852a7SSimon Glass 
1224b852a7SSimon Glass /* common/console.c */
1324b852a7SSimon Glass int console_init_f(void);	/* Before relocation; uses the serial  stuff */
1424b852a7SSimon Glass int console_init_r(void);	/* After  relocation; uses the console stuff */
1524b852a7SSimon Glass int console_assign(int file, const char *devname);	/* Assign the console */
1624b852a7SSimon Glass int ctrlc(void);
1724b852a7SSimon Glass int had_ctrlc(void);	/* have we had a Control-C since last clear? */
1824b852a7SSimon Glass void clear_ctrlc(void);	/* clear the Control-C condition */
1924b852a7SSimon Glass int disable_ctrlc(int);	/* 1 to disable, 0 to enable Control-C detect */
2024b852a7SSimon Glass int confirm_yesno(void);        /*  1 if input is "y", "Y", "yes" or "YES" */
2124b852a7SSimon Glass 
229854a874SSimon Glass /**
239854a874SSimon Glass  * console_record_init() - set up the console recording buffers
249854a874SSimon Glass  *
259854a874SSimon Glass  * This should be called as soon as malloc() is available so that the maximum
269854a874SSimon Glass  * amount of console output can be recorded.
279854a874SSimon Glass  */
289854a874SSimon Glass int console_record_init(void);
299854a874SSimon Glass 
309854a874SSimon Glass /**
319854a874SSimon Glass  * console_record_reset() - reset the console recording buffers
329854a874SSimon Glass  *
339854a874SSimon Glass  * Removes any data in the buffers
349854a874SSimon Glass  */
359854a874SSimon Glass void console_record_reset(void);
369854a874SSimon Glass 
379854a874SSimon Glass /**
389854a874SSimon Glass  * console_record_reset_enable() - reset and enable the console buffers
399854a874SSimon Glass  *
409854a874SSimon Glass  * This should be called to enable the console buffer.
419854a874SSimon Glass  */
429854a874SSimon Glass void console_record_reset_enable(void);
439854a874SSimon Glass 
44b0895384SSimon Glass /**
45b0895384SSimon Glass  * console_announce_r() - print a U-Boot console on non-serial consoles
46b0895384SSimon Glass  *
47b0895384SSimon Glass  * When U-Boot starts up with a display it generally does not announce itself
48b0895384SSimon Glass  * on the display. The banner is instead emitted on the UART before relocation.
49b0895384SSimon Glass  * This function prints a banner on devices which (we assume) did not receive
50b0895384SSimon Glass  * it before relocation.
51b0895384SSimon Glass  *
52b0895384SSimon Glass  * @return 0 (meaning no errors)
53b0895384SSimon Glass  */
54b0895384SSimon Glass int console_announce_r(void);
55b0895384SSimon Glass 
5624b852a7SSimon Glass /*
5724b852a7SSimon Glass  * CONSOLE multiplexing.
5824b852a7SSimon Glass  */
5924b852a7SSimon Glass #ifdef CONFIG_CONSOLE_MUX
6024b852a7SSimon Glass #include <iomux.h>
6124b852a7SSimon Glass #endif
6224b852a7SSimon Glass 
6324b852a7SSimon Glass #endif
64