]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/lcd.c
Kconfig: change CONFIG_MX* to CONFIG_SOC_MX*
[karo-tx-uboot.git] / common / lcd.c
index 48eadac8465f861f2f553f456b5383e5ff82b571..0c28f48e1465b053efb2ade407569e5b4ef48430 100644 (file)
 #include <splash.h>
 #include <asm/io.h>
 #include <asm/unaligned.h>
-#include <fdt_support.h>
 #include <video_font.h>
 
-#if defined(CONFIG_LCD_DT_SIMPLEFB)
-#include <libfdt.h>
-#endif
-
 #ifdef CONFIG_LCD_LOGO
 #include <bmp_logo.h>
 #include <bmp_logo_data.h>
@@ -51,7 +46,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 static int lcd_init(void *lcdbase);
-static void *lcd_logo(void);
+static void lcd_logo(void);
 static void lcd_setfgcolor(int color);
 static void lcd_setbgcolor(int color);
 
@@ -184,6 +179,9 @@ void lcd_clear(void)
 {
        short console_rows, console_cols;
        int bg_color;
+       char *s;
+       ulong addr;
+       static int do_splash = 1;
 #if LCD_BPP == LCD_COLOR8
        /* Setting the palette */
        lcd_setcolreg(CONSOLE_COLOR_BLACK, 0, 0, 0);
@@ -233,7 +231,23 @@ void lcd_clear(void)
 #endif
        console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
        lcd_init_console(lcd_base, console_rows, console_cols);
-       lcd_init_console(lcd_logo(), console_rows, console_cols);
+       if (do_splash) {
+               s = getenv("splashimage");
+               if (s) {
+                       do_splash = 0;
+                       addr = simple_strtoul(s, NULL, 16);
+                       if (lcd_splash(addr) == 0) {
+                               lcd_sync();
+                               return;
+                       }
+               }
+       }
+
+       lcd_logo();
+#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
+       addr = (ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length;
+       lcd_init_console((void *)addr, console_rows, console_cols);
+#endif
        lcd_sync();
 }
 
@@ -340,7 +354,7 @@ __weak void lcd_logo_set_cmap(void)
                *cmap++ = bmp_logo_palette[i];
 }
 
-void bitmap_plot(int x, int y)
+void lcd_logo_plot(int x, int y)
 {
        ushort i, j;
        uchar *bmap = &bmp_logo_bitmap[0];
@@ -396,7 +410,7 @@ void bitmap_plot(int x, int y)
        lcd_sync();
 }
 #else
-static inline void bitmap_plot(int x, int y) {}
+static inline void lcd_logo_plot(int x, int y) {}
 #endif /* CONFIG_LCD_LOGO */
 
 #if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
@@ -745,46 +759,15 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 }
 #endif
 
-static void *lcd_logo(void)
+static void lcd_logo(void)
 {
-#ifdef CONFIG_SPLASH_SCREEN
-       char *s;
-       ulong addr;
-       static int do_splash = 1;
-
-       if (do_splash && (s = getenv("splashimage")) != NULL) {
-               int x = 0, y = 0;
-               char *end;
-
-               do_splash = 0;
-
-               if (splash_screen_prepare())
-                       return (void *)lcd_base;
-
-               addr = simple_strtoul (s, &end, 16);
-               if (addr == 0 || *end != '\0')
-                       return lcd_base;
-
-               splash_get_pos(&x, &y);
-
-               if (bmp_display(addr, x, y) == 0)
-                       return (void *)lcd_base;
-       }
-#endif /* CONFIG_SPLASH_SCREEN */
-
-       bitmap_plot(0, 0);
+       lcd_logo_plot(0, 0);
 
 #ifdef CONFIG_LCD_INFO
        lcd_set_col(LCD_INFO_X / VIDEO_FONT_WIDTH);
        lcd_set_row(LCD_INFO_Y / VIDEO_FONT_HEIGHT);
        lcd_show_board_info();
 #endif /* CONFIG_LCD_INFO */
-
-#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-       return lcd_base + BMP_LOGO_HEIGHT * lcd_line_length;
-#else
-       return lcd_base;
-#endif /* CONFIG_LCD_LOGO && !CONFIG_LCD_INFO_BELOW_LOGO */
 }
 
 #ifdef CONFIG_SPLASHIMAGE_GUARD
@@ -820,48 +803,3 @@ int lcd_get_pixel_height(void)
 {
        return panel_info.vl_row;
 }
-
-#if defined(CONFIG_LCD_DT_SIMPLEFB)
-static int lcd_dt_simplefb_configure_node(void *blob, int off)
-{
-#if LCD_BPP == LCD_COLOR16
-       return fdt_setup_simplefb_node(blob, off, gd->fb_base,
-                                      panel_info.vl_col, panel_info.vl_row,
-                                      panel_info.vl_col * 2, "r5g6b5");
-#else
-       return -1;
-#endif
-}
-
-int lcd_dt_simplefb_add_node(void *blob)
-{
-       static const char compat[] = "simple-framebuffer";
-       static const char disabled[] = "disabled";
-       int off, ret;
-
-       off = fdt_add_subnode(blob, 0, "framebuffer");
-       if (off < 0)
-               return -1;
-
-       ret = fdt_setprop(blob, off, "status", disabled, sizeof(disabled));
-       if (ret < 0)
-               return -1;
-
-       ret = fdt_setprop(blob, off, "compatible", compat, sizeof(compat));
-       if (ret < 0)
-               return -1;
-
-       return lcd_dt_simplefb_configure_node(blob, off);
-}
-
-int lcd_dt_simplefb_enable_existing_node(void *blob)
-{
-       int off;
-
-       off = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
-       if (off < 0)
-               return -1;
-
-       return lcd_dt_simplefb_configure_node(blob, off);
-}
-#endif