1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * (C) Copyright 2000-2009 3*4882a593Smuzhiyun * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * SPDX-License-Identifier: GPL-2.0+ 6*4882a593Smuzhiyun */ 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun #ifndef __CONSOLE_H 9*4882a593Smuzhiyun #define __CONSOLE_H 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun extern char console_buffer[]; 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun /* common/console.c */ 14*4882a593Smuzhiyun int console_init_f(void); /* Before relocation; uses the serial stuff */ 15*4882a593Smuzhiyun int console_init_r(void); /* After relocation; uses the console stuff */ 16*4882a593Smuzhiyun int console_assign(int file, const char *devname); /* Assign the console */ 17*4882a593Smuzhiyun int ctrlc(void); 18*4882a593Smuzhiyun int had_ctrlc(void); /* have we had a Control-C since last clear? */ 19*4882a593Smuzhiyun void clear_ctrlc(void); /* clear the Control-C condition */ 20*4882a593Smuzhiyun int disable_ctrlc(int); /* 1 to disable, 0 to enable Control-C detect */ 21*4882a593Smuzhiyun int confirm_yesno(void); /* 1 if input is "y", "Y", "yes" or "YES" */ 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun /** 24*4882a593Smuzhiyun * console_record_init() - set up the console recording buffers 25*4882a593Smuzhiyun * 26*4882a593Smuzhiyun * This should be called as soon as malloc() is available so that the maximum 27*4882a593Smuzhiyun * amount of console output can be recorded. 28*4882a593Smuzhiyun */ 29*4882a593Smuzhiyun int console_record_init(void); 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun /** 32*4882a593Smuzhiyun * console_record_reset() - reset the console recording buffers 33*4882a593Smuzhiyun * 34*4882a593Smuzhiyun * Removes any data in the buffers 35*4882a593Smuzhiyun */ 36*4882a593Smuzhiyun void console_record_reset(void); 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun /** 39*4882a593Smuzhiyun * console_record_reset_enable() - reset and enable the console buffers 40*4882a593Smuzhiyun * 41*4882a593Smuzhiyun * This should be called to enable the console buffer. 42*4882a593Smuzhiyun */ 43*4882a593Smuzhiyun void console_record_reset_enable(void); 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun /** 46*4882a593Smuzhiyun * console_record_print_purge() - print record data and remove data from buffers 47*4882a593Smuzhiyun */ 48*4882a593Smuzhiyun void console_record_print_purge(void); 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun /** 51*4882a593Smuzhiyun * console_announce_r() - print a U-Boot console on non-serial consoles 52*4882a593Smuzhiyun * 53*4882a593Smuzhiyun * When U-Boot starts up with a display it generally does not announce itself 54*4882a593Smuzhiyun * on the display. The banner is instead emitted on the UART before relocation. 55*4882a593Smuzhiyun * This function prints a banner on devices which (we assume) did not receive 56*4882a593Smuzhiyun * it before relocation. 57*4882a593Smuzhiyun * 58*4882a593Smuzhiyun * @return 0 (meaning no errors) 59*4882a593Smuzhiyun */ 60*4882a593Smuzhiyun int console_announce_r(void); 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun /* 63*4882a593Smuzhiyun * CONSOLE multiplexing. 64*4882a593Smuzhiyun */ 65*4882a593Smuzhiyun #ifdef CONFIG_CONSOLE_MUX 66*4882a593Smuzhiyun #include <iomux.h> 67*4882a593Smuzhiyun #endif 68*4882a593Smuzhiyun 69*4882a593Smuzhiyun #endif 70