From c3f4d17e05de2a448320e622e72153706aa0b59e Mon Sep 17 00:00:00 2001 From: wdenk Date: Fri, 25 Jun 2004 23:35:58 +0000 Subject: Add "cls" function to MPC823 LCD driver so we can reinitialize the display even after showing a bitmap --- cpu/mpc8xx/lcd.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'cpu') diff --git a/cpu/mpc8xx/lcd.c b/cpu/mpc8xx/lcd.c index 1dc5f4e4b3..794ca02509 100644 --- a/cpu/mpc8xx/lcd.c +++ b/cpu/mpc8xx/lcd.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -434,8 +435,9 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count); static inline void lcd_puts_xy (ushort x, ushort y, uchar *s); static inline void lcd_putc_xy (ushort x, ushort y, uchar c); -int lcd_init (void *lcdbase); +static int lcd_init (void *lcdbase); +static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]); static void lcd_ctrl_init (void *lcdbase); static void lcd_enable (void); static void *lcd_logo (void); @@ -718,13 +720,8 @@ int drv_lcd_init (void) /*----------------------------------------------------------------------*/ -int lcd_init (void *lcdbase) +static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { - /* Initialize the lcd controller */ - debug ("[LCD] Initializing LCD frambuffer at %p\n", lcdbase); - - lcd_ctrl_init (lcdbase); - #if LCD_BPP == LCD_MONOCHROME /* Setting the palette */ lcd_initcolregs(); @@ -758,13 +755,33 @@ int lcd_init (void *lcdbase) COLOR_MASK(lcd_getbgcolor()), lcd_line_length*panel_info.vl_row); #endif - - lcd_enable (); - /* Paint the logo and retrieve LCD base address */ debug ("[LCD] Drawing the logo...\n"); lcd_console_address = lcd_logo (); + console_col = 0; + console_row = 0; + + return (0); +} + +U_BOOT_CMD( + cls, 1, 1, lcd_clear, + "cls - clear screen\n", + NULL +); + +/*----------------------------------------------------------------------*/ + +static int lcd_init (void *lcdbase) +{ + /* Initialize the lcd controller */ + debug ("[LCD] Initializing LCD frambuffer at %p\n", lcdbase); + + lcd_ctrl_init (lcdbase); + lcd_clear (NULL, 1, 1, NULL); /* dummy args */ + lcd_enable (); + /* Initialize the console */ console_col = 0; #ifdef LCD_INFO_BELOW_LOGO -- cgit v1.2.3