]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/mcc200/lcd.c
kbuild: use shorten log for linking u-boot
[karo-tx-uboot.git] / board / mcc200 / lcd.c
index 98b86d1834f6e3b8dea06febf124ae207a8ac757..c911445d97c3cb0216b0e5bb7f96ddfbf2ae0262 100644 (file)
@@ -2,25 +2,13 @@
  * (C) Copyright 2006
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <lcd.h>
 #include <mpc5xxx.h>
+#include <malloc.h>
 
 #ifdef CONFIG_LCD
 
@@ -55,6 +43,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 +55,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 +123,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++) {
@@ -180,16 +151,11 @@ void lcd_enable (void)
                        break;
                udelay (PSOC_WAIT_TIME);
        }
-       if (!retries) {
-               printf ("%s Warning: PSoC doesn't respond on "
-                       "RTS NEGATE\n", __FUNCTION__);
-       }
 
        return;
 }
 #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;
@@ -212,4 +178,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 */