]> git.sur5r.net Git - u-boot/blobdiff - common/lcd.c
ppc4xx: Add AMCC Arches board support (dual 460GT)
[u-boot] / common / lcd.c
index ebf377aa89d4e3202917268728629925ab44f051..d104b2604943df7251b3bbdab7e50e78d79f9eda 100644 (file)
@@ -55,8 +55,6 @@
 #include <nand.h>
 #endif
 
-#ifdef CONFIG_LCD
-
 /************************************************************************/
 /* ** FONT DATA                                                                */
 /************************************************************************/
@@ -388,13 +386,13 @@ static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        lcd_setcolreg  (CONSOLE_COLOR_WHITE,    0xFF, 0xFF, 0xFF);
 #endif
 
-#ifndef CFG_WHITE_ON_BLACK
+#ifndef CONFIG_SYS_WHITE_ON_BLACK
        lcd_setfgcolor (CONSOLE_COLOR_BLACK);
        lcd_setbgcolor (CONSOLE_COLOR_WHITE);
 #else
        lcd_setfgcolor (CONSOLE_COLOR_WHITE);
        lcd_setbgcolor (CONSOLE_COLOR_BLACK);
-#endif /* CFG_WHITE_ON_BLACK */
+#endif /* CONFIG_SYS_WHITE_ON_BLACK */
 
 #ifdef LCD_TEST_PATTERN
        test_pattern();
@@ -533,13 +531,13 @@ void bitmap_plot (int x, int y)
 #if defined(CONFIG_PXA250)
        struct pxafb_info *fbi = &panel_info.pxa;
 #elif defined(CONFIG_MPC823)
-       volatile immap_t *immr = (immap_t *) CFG_IMMR;
+       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
        volatile cpm8xx_t *cp = &(immr->im_cpm);
 #endif
 
        debug ("Logo: width %d  height %d  colors %d  cmap %d\n",
                BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS,
-               sizeof(bmp_logo_palette)/(sizeof(ushort)));
+               (int)(sizeof(bmp_logo_palette)/(sizeof(ushort))));
 
        bmap = &bmp_logo_bitmap[0];
        fb   = (uchar *)(lcd_base + y * lcd_line_length + x);
@@ -573,7 +571,7 @@ void bitmap_plot (int x, int y)
                        *(cmap + BMP_LOGO_OFFSET) = lut_entry;
                        cmap++;
 #else /* !CONFIG_ATMEL_LCD */
-#ifdef  CFG_INVERT_COLORS
+#ifdef  CONFIG_SYS_INVERT_COLORS
                        *cmap++ = 0xffff - colreg;
 #else
                        *cmap++ = colreg;
@@ -629,7 +627,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 #if defined(CONFIG_PXA250)
        struct pxafb_info *fbi = &panel_info.pxa;
 #elif defined(CONFIG_MPC823)
-       volatile immap_t *immr = (immap_t *) CFG_IMMR;
+       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
        volatile cpm8xx_t *cp = &(immr->im_cpm);
 #endif
 
@@ -678,11 +676,12 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                /* Set color map */
                for (i=0; i<colors; ++i) {
                        bmp_color_table_entry_t cte = bmp->color_table[i];
+#if !defined(CONFIG_ATMEL_LCD)
                        ushort colreg =
                                ( ((cte.red)   << 8) & 0xf800) |
                                ( ((cte.green) << 3) & 0x07e0) |
                                ( ((cte.blue)  >> 3) & 0x001f) ;
-#ifdef CFG_INVERT_COLORS
+#ifdef CONFIG_SYS_INVERT_COLORS
                        *cmap = 0xffff - colreg;
 #else
                        *cmap = colreg;
@@ -691,6 +690,9 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                        cmap++;
 #elif defined(CONFIG_MPC823)
                        cmap--;
+#endif
+#else /* CONFIG_ATMEL_LCD */
+                       lcd_setcolreg(i, cte.red, cte.green, cte.blue);
 #endif
                }
        }
@@ -727,8 +729,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
        for (i = 0; i < height; ++i) {
                WATCHDOG_RESET();
                for (j = 0; j < width ; j++)
-#if defined(CONFIG_PXA250)
-                       *(fb++)=*(bmap++);
+#if defined(CONFIG_PXA250) || defined(CONFIG_ATMEL_LCD)
+                       *(fb++) = *(bmap++);
 #elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
                        *(fb++)=255-*(bmap++);
 #endif
@@ -740,6 +742,9 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 }
 #endif
 
+#ifdef CONFIG_VIDEO_BMP_GZIP
+extern bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp);
+#endif
 
 static void *lcd_logo (void)
 {
@@ -761,6 +766,16 @@ static void *lcd_logo (void)
                addr = simple_strtoul(s, NULL, 16);
                do_splash = 0;
 
+#ifdef CONFIG_VIDEO_BMP_GZIP
+               bmp_image_t *bmp = (bmp_image_t *)addr;
+               unsigned long len;
+
+               if (!((bmp->header.signature[0]=='B') &&
+                     (bmp->header.signature[1]=='M'))) {
+                       addr = (ulong)gunzip_bmp(addr, &len);
+               }
+#endif
+
                if (lcd_display_bitmap (addr, 0, 0) == 0) {
                        return ((void *)lcd_base);
                }
@@ -776,7 +791,7 @@ static void *lcd_logo (void)
        sprintf (info, "%s (%s - %s) ", U_BOOT_VERSION, __DATE__, __TIME__);
        lcd_drawchars (LCD_INFO_X, LCD_INFO_Y, (uchar *)info, strlen(info));
 
-       sprintf (info, "(C) 2004 DENX Software Engineering");
+       sprintf (info, "(C) 2008 DENX Software Engineering GmbH");
        lcd_drawchars (LCD_INFO_X, LCD_INFO_Y + VIDEO_FONT_HEIGHT,
                                        (uchar *)info, strlen(info));
 
@@ -830,7 +845,7 @@ static void *lcd_logo (void)
        for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
                dram_size += gd->bd->bi_dram[i].size;
        nand_size = 0;
-       for (i = 0; i < CFG_MAX_NAND_DEVICE; i++)
+       for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
                nand_size += nand_info[i].size;
        sprintf (info, "  %ld MB SDRAM, %ld MB NAND",
                dram_size >> 20,
@@ -850,5 +865,3 @@ static void *lcd_logo (void)
 
 /************************************************************************/
 /************************************************************************/
-
-#endif /* CONFIG_LCD */