diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-02-03 20:44:54 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-02-03 20:44:54 -0500 |
commit | 42c6e9ad1b4bf5a8d071460a614c4d24e6877369 (patch) | |
tree | 94fe48028dfcf52719643d616cb19bfbb66c3343 /board/cm-bf548/video.c | |
parent | 66714b1a6df0a5a9f1656a6d4e6eea3c7ecdf7ae (diff) | |
download | u-boot-imx-42c6e9ad1b4bf5a8d071460a614c4d24e6877369.zip u-boot-imx-42c6e9ad1b4bf5a8d071460a614c4d24e6877369.tar.gz u-boot-imx-42c6e9ad1b4bf5a8d071460a614c4d24e6877369.tar.bz2 |
Blackfin: easylogo: add lzma logos
The bf527-ezkit boards are getting too big to fit into their reserved
flash space, so we need to use a lzma compressed logo.
Since the video driver code is very similar, add lzma compressed support
to all of the Blackfin video drivers.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'board/cm-bf548/video.c')
-rw-r--r-- | board/cm-bf548/video.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/board/cm-bf548/video.c b/board/cm-bf548/video.c index 4703098..a43413e 100644 --- a/board/cm-bf548/video.c +++ b/board/cm-bf548/video.c @@ -18,13 +18,15 @@ #include <linux/types.h> #include <stdio_dev.h> -#ifdef CONFIG_VIDEO +#include <lzma/LzmaTypes.h> +#include <lzma/LzmaDec.h> +#include <lzma/LzmaTools.h> #define DMA_SIZE16 2 #include <asm/mach-common/bits/eppi.h> -#include <asm/bfin_logo_230x230.h> +#include EASYLOGO_HEADER #define LCD_X_RES 480 /*Horizontal Resolution */ #define LCD_Y_RES 272 /* Vertical Resolution */ @@ -303,16 +305,27 @@ int drv_video_init(void) printf("Failed to alloc FB memory\n"); return -1; } + #ifdef EASYLOGO_ENABLE_GZIP unsigned char *data = EASYLOGO_DECOMP_BUFFER; unsigned long src_len = EASYLOGO_ENABLE_GZIP; - if (gunzip(data, bfin_logo.size, bfin_logo.data, &src_len)) { + error = gunzip(data, bfin_logo.size, bfin_logo.data, &src_len); + bfin_logo.data = data; +#elif defined(EASYLOGO_ENABLE_LZMA) + unsigned char *data = EASYLOGO_DECOMP_BUFFER; + SizeT lzma_len = bfin_logo.size; + error = lzmaBuffToBuffDecompress(data, &lzma_len, + bfin_logo.data, EASYLOGO_ENABLE_LZMA); + bfin_logo.data = data; +#else + error = 0; +#endif + + if (error) { puts("Failed to decompress logo\n"); free(dst); return -1; } - bfin_logo.data = data; -#endif memset(dst + ACTIVE_VIDEO_MEM_OFFSET, bfin_logo.data[0], fbmem_size - ACTIVE_VIDEO_MEM_OFFSET); @@ -335,5 +348,3 @@ int drv_video_init(void) return (error == 0) ? devices : error; } - -#endif |