From c3f4d17e05de2a448320e622e72153706aa0b59e Mon Sep 17 00:00:00 2001 From: wdenk Date: Fri, 25 Jun 2004 23:35:58 +0000 Subject: [PATCH] Add "cls" function to MPC823 LCD driver so we can reinitialize the display even after showing a bitmap --- CHANGELOG | 3 +++ cpu/mpc8xx/lcd.c | 37 +++++++++++++++++++++++--------- include/configs/HMI10.h | 47 ++++------------------------------------- include/lcd.h | 2 +- 4 files changed, 35 insertions(+), 54 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index de109410cd..aaaf9a454f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,9 @@ Changes since U-Boot 1.1.1: ====================================================================== +* Add "cls" function to MPC823 LCD driver so we can reinitialize the + display even after showing a bitmap + * Patch by Josef Wagner, 04 Jun 2004: - DDR Ram support for PM520 (MPC5200) - support for different flash types (PM520) 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 diff --git a/include/configs/HMI10.h b/include/configs/HMI10.h index 8acea1c08c..62ca616dee 100644 --- a/include/configs/HMI10.h +++ b/include/configs/HMI10.h @@ -297,12 +297,7 @@ * * If this is a 80 MHz CPU, set PLL multiplication factor to 5 (5*16=80)! */ -#ifdef CONFIG_80MHz /* for 80 MHz, we use a 16 MHz clock * 5 */ -#define CFG_PLPRCR \ - ( (5-1)< 66.000.000 / Divider = 129 * 80 Mhz => 80.000.000 / Divider = 156 */ -#if defined(CONFIG_80MHz) -#define CFG_MAMR_PTA 156 -#elif defined(CONFIG_66MHz) -#define CFG_MAMR_PTA 129 -#else /* 50 MHz */ -#define CFG_MAMR_PTA 98 -#endif /*CONFIG_??MHz */ + +#define CFG_PTA_PER_CLK ((4096 * 32 * 1000) / (4 * 64)) +#define CFG_MAMR_PTA 98 /* * For 16 MBit, refresh rates could be 31.3 us diff --git a/include/lcd.h b/include/lcd.h index e52a625470..e0e21840a0 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -37,7 +37,7 @@ extern char lcd_is_enabled; /* Video functions */ -int lcd_init (void *lcdbase); +/* int lcd_init (void *lcdbase); */ void lcd_putc (const char c); void lcd_puts (const char *s); void lcd_printf (const char *fmt, ...); -- 2.39.5