From 87b9739e9881148ee2fc1a9a852f09b18aaef11d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 22 Sep 2008 21:50:15 +0000 Subject: 2008-09-22 Joel Sherrill * Makefile.am, configure.ac, console/console.c, include/bsp.h, startup/bspstart.c: Use standardized bsp_cleanup() which can optionally print a message, poll for user to press key, and call bsp_reset(). Using this eliminates the various bsp_cleanup() implementations which had their own implementation and variety of string constants. * startup/bspreset.c: New file. * startup/bspclean.c: Removed. --- c/src/lib/libbsp/powerpc/gen5200/console/console.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'c/src/lib/libbsp/powerpc/gen5200/console/console.c') diff --git a/c/src/lib/libbsp/powerpc/gen5200/console/console.c b/c/src/lib/libbsp/powerpc/gen5200/console/console.c index 0a33b2fdff..34e38886e4 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/console/console.c +++ b/c/src/lib/libbsp/powerpc/gen5200/console/console.c @@ -142,8 +142,11 @@ uint32_t mpc5200_uart_avail_mask = GEN5200_UART_AVAIL_MASK; #endif static void A_BSP_output_char(char c); +static int A_BSP_get_char(void); BSP_output_char_function_type BSP_output_char = A_BSP_output_char; +BSP_polling_getchar_function_type BSP_poll_char = A_BSP_get_char; + /* Used to handle premature outputs of printk */ uint32_t console_initialized = FALSE; @@ -625,7 +628,7 @@ static void A_BSP_output_char( * and we can just poll bytes out at any time. */ #if !defined(HAS_UBOOT) - if (console_initialized == FALSE ) + if (console_initialized == FALSE) return; #endif @@ -637,6 +640,20 @@ static void A_BSP_output_char( PRINTK_WRITE( PRINTK_MINOR, &cr, 1 ); } +static int A_BSP_get_char(void) +{ + /* + * If we are using U-Boot, then the console is already initialized + * and we can just poll bytes in at any time. + */ + #if !defined(HAS_UBOOT) + if (console_initialized == FALSE) + return; + #endif + + return mpc5200_uart_pollRead(0); +} + /* *************** * BOILERPLATE * -- cgit v1.2.3