Merge branch 'next' of git://git.denx.de/u-boot-avr32
[platform/kernel/u-boot.git] / common / lcd.c
index 2178f12..25f8664 100644 (file)
 #if defined(CONFIG_ATMEL_LCD)
 #include <atmel_lcdc.h>
 #include <nand.h>
-extern nand_info_t nand_info[];
 #endif
 
-#ifdef CONFIG_LCD
-
 /************************************************************************/
 /* ** FONT DATA                                                                */
 /************************************************************************/
@@ -540,7 +537,7 @@ void bitmap_plot (int x, int y)
 
        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);
@@ -679,6 +676,7 @@ 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) |
@@ -693,6 +691,9 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 #elif defined(CONFIG_MPC823)
                        cmap--;
 #endif
+#else /* CONFIG_ATMEL_LCD */
+                       lcd_setcolreg(i, cte.red, cte.green, cte.blue);
+#endif
                }
        }
 #endif
@@ -728,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
@@ -741,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)
 {
@@ -762,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);
                }
@@ -777,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));
 
@@ -851,5 +865,3 @@ static void *lcd_logo (void)
 
 /************************************************************************/
 /************************************************************************/
-
-#endif /* CONFIG_LCD */