dm: x86: video: Add a driver-model driver for ivybridge graphics
[oweals/u-boot.git] / drivers / video / mpc8xx_lcd.c
index ac74fc8ace32d5513001bfcdb008baddbe4cb5f0..b08576eab203f3ef6a6f6ab4ab348128fdff38da 100644 (file)
@@ -15,7 +15,6 @@
 #include <common.h>
 #include <command.h>
 #include <watchdog.h>
-#include <version.h>
 #include <stdarg.h>
 #include <lcdvideo.h>
 #include <linux/types.h>
@@ -357,22 +356,34 @@ lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue)
 
 /*----------------------------------------------------------------------*/
 
-#if LCD_BPP == LCD_MONOCHROME
-static
-void lcd_initcolregs (void)
+ushort *configuration_get_cmap(void)
 {
-       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-       volatile cpm8xx_t *cp = &(immr->im_cpm);
-       ushort regno;
+       immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+       cpm8xx_t *cp = &(immr->im_cpm);
+       return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
+}
 
-       for (regno = 0; regno < 16; regno++) {
-               cp->lcd_cmap[regno * 2] = 0;
-               cp->lcd_cmap[(regno * 2) + 1] = regno & 0x0f;
-       }
+#if defined(CONFIG_MPC823)
+void fb_put_byte(uchar **fb, uchar **from)
+{
+       *(*fb)++ = (255 - *(*from)++);
 }
 #endif
 
-/*----------------------------------------------------------------------*/
+#ifdef CONFIG_LCD_LOGO
+#include <bmp_logo.h>
+void lcd_logo_set_cmap(void)
+{
+       int i;
+       ushort *cmap;
+       immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+       cpm8xx_t *cp = &(immr->im_cpm);
+       cmap = (ushort *)&(cp->lcd_cmap[BMP_LOGO_OFFSET * sizeof(ushort)]);
+
+       for (i = 0; i < BMP_LOGO_COLORS; ++i)
+               *cmap++ = bmp_logo_palette[i];
+}
+#endif
 
 void lcd_enable (void)
 {