summaryrefslogtreecommitdiff
path: root/board/ads5121/ads5121_diu.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-02-07 23:51:52 +0100
committerWolfgang Denk <wd@denx.de>2009-02-07 23:51:52 +0100
commitf8306cb94f59ae2ace5bfede189944d329e5abb3 (patch)
treec26c402b9d1c3d28f5a54ffd4fcd2f3a393772de /board/ads5121/ads5121_diu.c
parent657f2062d8e17ebf4a55f52c9e71c07c0c94c779 (diff)
parent2d43e873a29ca4959ba6a30fc7fb396d3fd0dccf (diff)
downloadu-boot-imx-f8306cb94f59ae2ace5bfede189944d329e5abb3.zip
u-boot-imx-f8306cb94f59ae2ace5bfede189944d329e5abb3.tar.gz
u-boot-imx-f8306cb94f59ae2ace5bfede189944d329e5abb3.tar.bz2
Merge branch 'master' of ssh://gemini/home/wd/git/u-boot/master
Diffstat (limited to 'board/ads5121/ads5121_diu.c')
-rw-r--r--board/ads5121/ads5121_diu.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/board/ads5121/ads5121_diu.c b/board/ads5121/ads5121_diu.c
index 4f7dda0..41a1353 100644
--- a/board/ads5121/ads5121_diu.c
+++ b/board/ads5121/ads5121_diu.c
@@ -37,7 +37,11 @@
#include <video_fb.h>
#endif
+#ifdef CONFIG_FSL_DIU_LOGO_BMP
extern unsigned int FSL_Logo_BMP[];
+#else
+#define FSL_Logo_BMP NULL
+#endif
static int xres, yres;
@@ -61,16 +65,40 @@ void diu_set_pixel_clock(unsigned int pixclock)
debug("DIU: Modified value of CLKDVDR = 0x%08x\n", *clkdvdr);
}
+char *valid_bmp(char *addr)
+{
+ unsigned long h_addr;
+
+ h_addr = simple_strtoul(addr, NULL, 16);
+ if (h_addr < CONFIG_SYS_FLASH_BASE ||
+ h_addr >= (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE - 1)) {
+ printf("bmp addr %lx is not a valid flash address\n", h_addr);
+ return 0;
+ } else if ((*(char *)(h_addr) != 'B') || (*(char *)(h_addr+1) != 'M')) {
+ printf("bmp addr is not a bmp\n");
+ return 0;
+ } else
+ return (char *)h_addr;
+}
+
int ads5121_diu_init(void)
{
unsigned int pixel_format;
+ char *bmp = NULL;
+ char *bmp_env;
xres = 1024;
yres = 768;
pixel_format = 0x88883316;
- return fsl_diu_init(xres, pixel_format, 0,
- (unsigned char *)FSL_Logo_BMP);
+ debug("ads5121_diu_init\n");
+ bmp_env = getenv("diu_bmp_addr");
+ if (bmp_env) {
+ bmp = valid_bmp(bmp_env);
+ }
+ if (!bmp)
+ bmp = FSL_Logo_BMP;
+ return fsl_diu_init(xres, pixel_format, 0, (unsigned char *)bmp);
}
int ads5121diu_init_show_bmp(cmd_tbl_t *cmdtp,