Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2002 |
wdenk | b37c7e5 | 2003-06-30 16:24:52 +0000 | [diff] [blame] | 4 | * Detlev Zundel, DENX Software Engineering, dzu@denx.de. |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | /* |
| 8 | * BMP handling routines |
| 9 | */ |
| 10 | |
| 11 | #include <common.h> |
Simon Glass | b01c792 | 2016-01-18 19:52:22 -0700 | [diff] [blame] | 12 | #include <dm.h> |
Alessandro Rubini | 6111722 | 2009-07-19 17:52:27 +0200 | [diff] [blame] | 13 | #include <lcd.h> |
Simon Glass | b01c792 | 2016-01-18 19:52:22 -0700 | [diff] [blame] | 14 | #include <mapmem.h> |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 15 | #include <bmp_layout.h> |
| 16 | #include <command.h> |
wdenk | 8655b6f | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 17 | #include <asm/byteorder.h> |
Stefan Roese | c29ab9d | 2005-10-08 10:19:07 +0200 | [diff] [blame] | 18 | #include <malloc.h> |
Simon Glass | 72b335e | 2016-01-05 09:30:58 -0700 | [diff] [blame] | 19 | #include <mapmem.h> |
Anatolij Gustschin | ff8fb56 | 2013-07-02 00:04:05 +0200 | [diff] [blame] | 20 | #include <splash.h> |
Stefan Reinauer | f674f7c | 2012-09-28 15:11:11 +0000 | [diff] [blame] | 21 | #include <video.h> |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 22 | |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 23 | static int bmp_info (ulong addr); |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 24 | |
| 25 | /* |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 26 | * Allocate and decompress a BMP image using gunzip(). |
| 27 | * |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 28 | * Returns a pointer to the decompressed image data. This pointer is |
| 29 | * aligned to 32-bit-aligned-address + 2. |
| 30 | * See doc/README.displaying-bmps for explanation. |
| 31 | * |
| 32 | * The allocation address is passed to 'alloc_addr' and must be freed |
| 33 | * by the caller after use. |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 34 | * |
| 35 | * Returns NULL if decompression failed, or if the decompressed data |
| 36 | * didn't contain a valid BMP signature. |
| 37 | */ |
| 38 | #ifdef CONFIG_VIDEO_BMP_GZIP |
Simon Glass | 1c3dbe5 | 2015-05-13 07:02:27 -0600 | [diff] [blame] | 39 | struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp, |
| 40 | void **alloc_addr) |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 41 | { |
| 42 | void *dst; |
| 43 | unsigned long len; |
Simon Glass | 1c3dbe5 | 2015-05-13 07:02:27 -0600 | [diff] [blame] | 44 | struct bmp_image *bmp; |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 45 | |
| 46 | /* |
| 47 | * Decompress bmp image |
| 48 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 49 | len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE; |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 50 | /* allocate extra 3 bytes for 32-bit-aligned-address + 2 alignment */ |
| 51 | dst = malloc(CONFIG_SYS_VIDEO_LOGO_MAX_SIZE + 3); |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 52 | if (dst == NULL) { |
| 53 | puts("Error: malloc in gunzip failed!\n"); |
| 54 | return NULL; |
| 55 | } |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 56 | |
| 57 | bmp = dst; |
| 58 | |
| 59 | /* align to 32-bit-aligned-address + 2 */ |
Simon Glass | 1c3dbe5 | 2015-05-13 07:02:27 -0600 | [diff] [blame] | 60 | bmp = (struct bmp_image *)((((unsigned int)dst + 1) & ~3) + 2); |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 61 | |
Simon Glass | 72b335e | 2016-01-05 09:30:58 -0700 | [diff] [blame] | 62 | if (gunzip(bmp, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0), |
| 63 | &len) != 0) { |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 64 | free(dst); |
| 65 | return NULL; |
| 66 | } |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 67 | if (len == CONFIG_SYS_VIDEO_LOGO_MAX_SIZE) |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 68 | puts("Image could be truncated" |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 69 | " (increase CONFIG_SYS_VIDEO_LOGO_MAX_SIZE)!\n"); |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 70 | |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 71 | /* |
| 72 | * Check for bmp mark 'BM' |
| 73 | */ |
| 74 | if (!((bmp->header.signature[0] == 'B') && |
| 75 | (bmp->header.signature[1] == 'M'))) { |
| 76 | free(dst); |
| 77 | return NULL; |
| 78 | } |
| 79 | |
Wolfgang Denk | 17f79e4 | 2011-02-09 15:11:10 +0100 | [diff] [blame] | 80 | debug("Gzipped BMP image detected!\n"); |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 81 | |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 82 | *alloc_addr = dst; |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 83 | return bmp; |
| 84 | } |
| 85 | #else |
Simon Glass | 1c3dbe5 | 2015-05-13 07:02:27 -0600 | [diff] [blame] | 86 | struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp, |
| 87 | void **alloc_addr) |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 88 | { |
| 89 | return NULL; |
| 90 | } |
| 91 | #endif |
| 92 | |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 93 | static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
Frans Meulenbroeks | 9acd4f0 | 2010-03-27 11:16:10 +0100 | [diff] [blame] | 94 | { |
| 95 | ulong addr; |
| 96 | |
| 97 | switch (argc) { |
| 98 | case 1: /* use load_addr as default address */ |
| 99 | addr = load_addr; |
| 100 | break; |
| 101 | case 2: /* use argument */ |
| 102 | addr = simple_strtoul(argv[1], NULL, 16); |
| 103 | break; |
| 104 | default: |
Simon Glass | 4c12eeb | 2011-12-10 08:44:01 +0000 | [diff] [blame] | 105 | return CMD_RET_USAGE; |
Frans Meulenbroeks | 9acd4f0 | 2010-03-27 11:16:10 +0100 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | return (bmp_info(addr)); |
| 109 | } |
| 110 | |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 111 | static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
Frans Meulenbroeks | 9acd4f0 | 2010-03-27 11:16:10 +0100 | [diff] [blame] | 112 | { |
| 113 | ulong addr; |
| 114 | int x = 0, y = 0; |
| 115 | |
Anatolij Gustschin | ff8fb56 | 2013-07-02 00:04:05 +0200 | [diff] [blame] | 116 | splash_get_pos(&x, &y); |
| 117 | |
Frans Meulenbroeks | 9acd4f0 | 2010-03-27 11:16:10 +0100 | [diff] [blame] | 118 | switch (argc) { |
| 119 | case 1: /* use load_addr as default address */ |
| 120 | addr = load_addr; |
| 121 | break; |
| 122 | case 2: /* use argument */ |
| 123 | addr = simple_strtoul(argv[1], NULL, 16); |
| 124 | break; |
| 125 | case 4: |
| 126 | addr = simple_strtoul(argv[1], NULL, 16); |
Patrick Delaunay | b0fcedb | 2018-12-01 14:41:07 +0100 | [diff] [blame] | 127 | if (!strcmp(argv[2], "m")) |
| 128 | x = BMP_ALIGN_CENTER; |
| 129 | else |
| 130 | x = simple_strtoul(argv[2], NULL, 10); |
| 131 | if (!strcmp(argv[3], "m")) |
| 132 | y = BMP_ALIGN_CENTER; |
| 133 | else |
| 134 | y = simple_strtoul(argv[3], NULL, 10); |
Wolfgang Denk | 93e1459 | 2013-10-04 17:43:24 +0200 | [diff] [blame] | 135 | break; |
Frans Meulenbroeks | 9acd4f0 | 2010-03-27 11:16:10 +0100 | [diff] [blame] | 136 | default: |
Simon Glass | 4c12eeb | 2011-12-10 08:44:01 +0000 | [diff] [blame] | 137 | return CMD_RET_USAGE; |
Frans Meulenbroeks | 9acd4f0 | 2010-03-27 11:16:10 +0100 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | return (bmp_display(addr, x, y)); |
| 141 | } |
| 142 | |
| 143 | static cmd_tbl_t cmd_bmp_sub[] = { |
| 144 | U_BOOT_CMD_MKENT(info, 3, 0, do_bmp_info, "", ""), |
| 145 | U_BOOT_CMD_MKENT(display, 5, 0, do_bmp_display, "", ""), |
| 146 | }; |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 147 | |
Wolfgang Denk | 2e5167c | 2010-10-28 20:00:11 +0200 | [diff] [blame] | 148 | #ifdef CONFIG_NEEDS_MANUAL_RELOC |
Heiko Schocher | f1d2b31 | 2010-09-17 13:10:39 +0200 | [diff] [blame] | 149 | void bmp_reloc(void) { |
| 150 | fixup_cmdtable(cmd_bmp_sub, ARRAY_SIZE(cmd_bmp_sub)); |
| 151 | } |
| 152 | #endif |
| 153 | |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 154 | /* |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 155 | * Subroutine: do_bmp |
| 156 | * |
| 157 | * Description: Handler for 'bmp' command.. |
| 158 | * |
| 159 | * Inputs: argv[1] contains the subcommand |
| 160 | * |
| 161 | * Return: None |
| 162 | * |
| 163 | */ |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 164 | static int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 165 | { |
Frans Meulenbroeks | 9acd4f0 | 2010-03-27 11:16:10 +0100 | [diff] [blame] | 166 | cmd_tbl_t *c; |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 167 | |
Frans Meulenbroeks | 9acd4f0 | 2010-03-27 11:16:10 +0100 | [diff] [blame] | 168 | /* Strip off leading 'bmp' command argument */ |
| 169 | argc--; |
| 170 | argv++; |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 171 | |
Frans Meulenbroeks | 9acd4f0 | 2010-03-27 11:16:10 +0100 | [diff] [blame] | 172 | c = find_cmd_tbl(argv[0], &cmd_bmp_sub[0], ARRAY_SIZE(cmd_bmp_sub)); |
| 173 | |
Wolfgang Denk | 47e26b1 | 2010-07-17 01:06:04 +0200 | [diff] [blame] | 174 | if (c) |
Frans Meulenbroeks | 9acd4f0 | 2010-03-27 11:16:10 +0100 | [diff] [blame] | 175 | return c->cmd(cmdtp, flag, argc, argv); |
Wolfgang Denk | 47e26b1 | 2010-07-17 01:06:04 +0200 | [diff] [blame] | 176 | else |
Simon Glass | 4c12eeb | 2011-12-10 08:44:01 +0000 | [diff] [blame] | 177 | return CMD_RET_USAGE; |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 178 | } |
| 179 | |
wdenk | 0d49839 | 2003-07-01 21:06:45 +0000 | [diff] [blame] | 180 | U_BOOT_CMD( |
wdenk | 4b248f3 | 2004-03-14 16:51:43 +0000 | [diff] [blame] | 181 | bmp, 5, 1, do_bmp, |
Peter Tyser | 2fb2604 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 182 | "manipulate BMP image data", |
wdenk | 4b248f3 | 2004-03-14 16:51:43 +0000 | [diff] [blame] | 183 | "info <imageAddr> - display image info\n" |
Wolfgang Denk | a89c33d | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 184 | "bmp display <imageAddr> [x y] - display image at x,y" |
wdenk | b0fce99 | 2003-06-29 21:03:46 +0000 | [diff] [blame] | 185 | ); |
| 186 | |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 187 | /* |
| 188 | * Subroutine: bmp_info |
| 189 | * |
| 190 | * Description: Show information about bmp file in memory |
| 191 | * |
| 192 | * Inputs: addr address of the bmp file |
| 193 | * |
| 194 | * Return: None |
| 195 | * |
| 196 | */ |
| 197 | static int bmp_info(ulong addr) |
| 198 | { |
Simon Glass | 72b335e | 2016-01-05 09:30:58 -0700 | [diff] [blame] | 199 | struct bmp_image *bmp = (struct bmp_image *)map_sysmem(addr, 0); |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 200 | void *bmp_alloc_addr = NULL; |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 201 | unsigned long len; |
Stefan Roese | c29ab9d | 2005-10-08 10:19:07 +0200 | [diff] [blame] | 202 | |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 203 | if (!((bmp->header.signature[0]=='B') && |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 204 | (bmp->header.signature[1]=='M'))) |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 205 | bmp = gunzip_bmp(addr, &len, &bmp_alloc_addr); |
Stefan Roese | c29ab9d | 2005-10-08 10:19:07 +0200 | [diff] [blame] | 206 | |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 207 | if (bmp == NULL) { |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 208 | printf("There is no valid bmp file at the given address\n"); |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 209 | return 1; |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 210 | } |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 211 | |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 212 | printf("Image size : %d x %d\n", le32_to_cpu(bmp->header.width), |
| 213 | le32_to_cpu(bmp->header.height)); |
| 214 | printf("Bits per pixel: %d\n", le16_to_cpu(bmp->header.bit_count)); |
| 215 | printf("Compression : %d\n", le32_to_cpu(bmp->header.compression)); |
Stefan Roese | c29ab9d | 2005-10-08 10:19:07 +0200 | [diff] [blame] | 216 | |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 217 | if (bmp_alloc_addr) |
| 218 | free(bmp_alloc_addr); |
Stefan Roese | c29ab9d | 2005-10-08 10:19:07 +0200 | [diff] [blame] | 219 | |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 220 | return(0); |
| 221 | } |
| 222 | |
| 223 | /* |
| 224 | * Subroutine: bmp_display |
| 225 | * |
| 226 | * Description: Display bmp file located in memory |
| 227 | * |
| 228 | * Inputs: addr address of the bmp file |
| 229 | * |
| 230 | * Return: None |
| 231 | * |
| 232 | */ |
Anatolij Gustschin | de3b49c | 2012-04-27 04:38:06 +0000 | [diff] [blame] | 233 | int bmp_display(ulong addr, int x, int y) |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 234 | { |
Simon Glass | b01c792 | 2016-01-18 19:52:22 -0700 | [diff] [blame] | 235 | #ifdef CONFIG_DM_VIDEO |
| 236 | struct udevice *dev; |
| 237 | #endif |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 238 | int ret; |
Simon Glass | 72b335e | 2016-01-05 09:30:58 -0700 | [diff] [blame] | 239 | struct bmp_image *bmp = map_sysmem(addr, 0); |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 240 | void *bmp_alloc_addr = NULL; |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 241 | unsigned long len; |
| 242 | |
| 243 | if (!((bmp->header.signature[0]=='B') && |
| 244 | (bmp->header.signature[1]=='M'))) |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 245 | bmp = gunzip_bmp(addr, &len, &bmp_alloc_addr); |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 246 | |
| 247 | if (!bmp) { |
| 248 | printf("There is no valid bmp file at the given address\n"); |
| 249 | return 1; |
| 250 | } |
Simon Glass | 72b335e | 2016-01-05 09:30:58 -0700 | [diff] [blame] | 251 | addr = map_to_sysmem(bmp); |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 252 | |
Simon Glass | b01c792 | 2016-01-18 19:52:22 -0700 | [diff] [blame] | 253 | #ifdef CONFIG_DM_VIDEO |
Simon Glass | 3f603cb | 2016-02-11 13:23:26 -0700 | [diff] [blame] | 254 | ret = uclass_first_device_err(UCLASS_VIDEO, &dev); |
Simon Glass | b01c792 | 2016-01-18 19:52:22 -0700 | [diff] [blame] | 255 | if (!ret) { |
Simon Glass | 3f603cb | 2016-02-11 13:23:26 -0700 | [diff] [blame] | 256 | bool align = false; |
Simon Glass | b01c792 | 2016-01-18 19:52:22 -0700 | [diff] [blame] | 257 | |
Patrick Delaunay | b0fcedb | 2018-12-01 14:41:07 +0100 | [diff] [blame] | 258 | if (CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN) || |
| 259 | x == BMP_ALIGN_CENTER || |
| 260 | y == BMP_ALIGN_CENTER) |
| 261 | align = true; |
| 262 | |
Simon Glass | 3f603cb | 2016-02-11 13:23:26 -0700 | [diff] [blame] | 263 | ret = video_bmp_display(dev, addr, x, y, align); |
Simon Glass | b01c792 | 2016-01-18 19:52:22 -0700 | [diff] [blame] | 264 | } |
Simon Glass | b01c792 | 2016-01-18 19:52:22 -0700 | [diff] [blame] | 265 | #elif defined(CONFIG_LCD) |
Simon Glass | 72b335e | 2016-01-05 09:30:58 -0700 | [diff] [blame] | 266 | ret = lcd_display_bitmap(addr, x, y); |
wdenk | 281e00a | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 267 | #elif defined(CONFIG_VIDEO) |
Simon Glass | 72b335e | 2016-01-05 09:30:58 -0700 | [diff] [blame] | 268 | ret = video_display_bitmap(addr, x, y); |
wdenk | 281e00a | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 269 | #else |
| 270 | # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO |
wdenk | 4b248f3 | 2004-03-14 16:51:43 +0000 | [diff] [blame] | 271 | #endif |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 272 | |
Piotr Wilczek | f7ef9d6 | 2013-06-05 08:14:30 +0200 | [diff] [blame] | 273 | if (bmp_alloc_addr) |
| 274 | free(bmp_alloc_addr); |
Hans-Christian Egtvedt | 43ef1c3 | 2007-11-30 17:29:59 +0100 | [diff] [blame] | 275 | |
Simon Glass | e517db7 | 2016-01-30 15:45:15 -0700 | [diff] [blame] | 276 | return ret ? CMD_RET_FAILURE : 0; |
wdenk | 059ae17 | 2003-04-20 16:52:09 +0000 | [diff] [blame] | 277 | } |