diff options
author | John Rigby <jrigby@freescale.com> | 2008-11-19 13:57:34 -0700 |
---|---|---|
committer | John Rigby <jrigby@freescale.com> | 2009-02-03 09:25:51 -0700 |
commit | 4c154252c480b13f69ce1b71a9530b0515da76a6 (patch) | |
tree | 55861aff9036738ec9317c6f2dd4dad49289f85c /board/ads5121/ads5121_diu.c | |
parent | 92c20fbd3a7788c1a154f50a3f44f28a7763f99a (diff) | |
download | u-boot-imx-4c154252c480b13f69ce1b71a9530b0515da76a6.zip u-boot-imx-4c154252c480b13f69ce1b71a9530b0515da76a6.tar.gz u-boot-imx-4c154252c480b13f69ce1b71a9530b0515da76a6.tar.bz2 |
ADS5121 DIU Add diu_bmp_addr env
Add support for using a bmp other than
FSL_Logo_BMP for the DIU splash screen.
Can now set the env var "diu_bmp_addr" to
the address of a BMP in flash to use instead
of the default FSL_Logo_BMP.
Signed-off-by: Martha Marx <mmarx@silicontkx.com>
Signed-off-by: John Rigby <jrigby@freescale.com>
Diffstat (limited to 'board/ads5121/ads5121_diu.c')
-rw-r--r-- | board/ads5121/ads5121_diu.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/board/ads5121/ads5121_diu.c b/board/ads5121/ads5121_diu.c index 565b63d..41a1353 100644 --- a/board/ads5121/ads5121_diu.c +++ b/board/ads5121/ads5121_diu.c @@ -65,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, |