]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/mcc200/lcd.c
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / board / mcc200 / lcd.c
index 726366ddf0dccd4086efc033017a1c7a90f2ce5e..24f0abddf3734089e391c802fdaeb1039ba02adb 100644 (file)
@@ -21,6 +21,7 @@
 #include <common.h>
 #include <lcd.h>
 #include <mpc5xxx.h>
+#include <malloc.h>
 
 #ifdef CONFIG_LCD
 
@@ -55,6 +56,9 @@
 #define PSOC_RETRIES   10      /* each of PSOC_WAIT_TIME */
 #define PSOC_WAIT_TIME 10      /* usec */
 
+#include <video_font.h>
+#define FONT_WIDTH     VIDEO_FONT_WIDTH
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -64,32 +68,12 @@ vidinfo_t panel_info = {
        LCD_WIDTH, LCD_HEIGHT, LCD_BPP
 };
 
-int lcd_line_length;
-
-int lcd_color_fg;
-int lcd_color_bg;
-
-/*
- * Frame buffer memory information
- */
-void *lcd_base;                        /* Start of framebuffer memory  */
-void *lcd_console_address;     /* Start of console buffer      */
-
-short console_col = 0;
-short console_row = 0;
 
 /*
  *  The device we use to communicate with PSoC
  */
 int serial_inited = 0;
 
-/*
- * Exported functions
- */
-void lcd_initcolregs (void);
-void lcd_ctrl_init (void *lcdbase);
-void lcd_enable (void);
-
 /*
  *  Imported functions to support the PSoC protocol
  */
@@ -152,12 +136,12 @@ void lcd_enable (void)
 
 #if !defined(SWAPPED_LCD)
        for (i=0; i<fb_size; i++) {
-               serial_putc_raw_dev (PSOC_PSC, ((char *)lcd_base)[i]);
+               serial_putc_raw_dev(PSOC_PSC, ((char *)gd->fb_base)[i]);
        }
 #else
     {
        int x, y, pwidth;
-       char *p = (char *)lcd_base;
+       char *p = (char *)gd->fb_base;
 
        pwidth = ((panel_info.vl_col+7) >> 3);
        for (y=0; y<panel_info.vl_row; y++) {
@@ -185,7 +169,6 @@ void lcd_enable (void)
 }
 #ifdef CONFIG_PROGRESSBAR
 
-#define FONT_WIDTH      8 /* the same as VIDEO_FONT_WIDTH in video_font.h */
 void show_progress (int size, int tot)
 {
        int cnt;
@@ -208,4 +191,23 @@ void show_progress (int size, int tot)
 }
 
 #endif
+
+int bmp_display(ulong addr, int x, int y)
+{
+       int ret;
+       bmp_image_t *bmp = (bmp_image_t *)addr;
+
+       if (!bmp) {
+               printf("There is no valid bmp file at the given address\n");
+               return 1;
+       }
+
+       ret = lcd_display_bitmap((ulong)bmp, x, y);
+
+       if ((unsigned long)bmp != addr)
+               free(bmp);
+
+       return ret;
+}
+
 #endif /* CONFIG_LCD */