Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2000-2004 |
| 4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 5 | * |
| 6 | * (C) Copyright 2003 |
| 7 | * Kai-Uwe Bloem, Auerswald GmbH & Co KG, <linux-development@auerswald.de> |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 10 | |
| 11 | /* |
| 12 | * Multi Image extract |
| 13 | */ |
| 14 | #include <common.h> |
| 15 | #include <command.h> |
Simon Glass | 6333448 | 2019-11-14 12:57:39 -0700 | [diff] [blame] | 16 | #include <cpu_func.h> |
Simon Glass | 313112a | 2019-08-01 09:46:46 -0600 | [diff] [blame] | 17 | #include <env.h> |
Simon Glass | 1a974af | 2019-08-01 09:46:36 -0600 | [diff] [blame] | 18 | #include <gzip.h> |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 19 | #include <image.h> |
Simon Glass | 9bc1564 | 2020-02-03 07:36:16 -0700 | [diff] [blame] | 20 | #include <malloc.h> |
Joe Hershberger | 65b905b | 2015-03-22 17:08:59 -0500 | [diff] [blame] | 21 | #include <mapmem.h> |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 22 | #include <watchdog.h> |
| 23 | #if defined(CONFIG_BZIP2) |
| 24 | #include <bzlib.h> |
| 25 | #endif |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 26 | #include <asm/byteorder.h> |
Simon Glass | 208d8e8 | 2013-08-30 11:00:09 -0600 | [diff] [blame] | 27 | #include <asm/io.h> |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 28 | |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 29 | #ifndef CONFIG_SYS_XIMG_LEN |
| 30 | /* use 8MByte as default max gunzip size */ |
| 31 | #define CONFIG_SYS_XIMG_LEN 0x800000 |
| 32 | #endif |
| 33 | |
Kim Phillips | dc00a68 | 2012-10-29 13:34:31 +0000 | [diff] [blame] | 34 | static int |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 35 | do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 36 | { |
Simon Glass | 892265d | 2019-12-28 10:45:02 -0700 | [diff] [blame] | 37 | ulong addr = image_load_addr; |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 38 | ulong dest = 0; |
Heiko Schocher | 515eb12 | 2014-05-28 11:33:33 +0200 | [diff] [blame] | 39 | ulong data, len; |
Bartlomiej Sieka | 3b8cc71 | 2008-03-20 19:38:45 +0100 | [diff] [blame] | 40 | int verify; |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 41 | int part = 0; |
Tom Rini | c220bd9 | 2019-05-23 07:14:07 -0400 | [diff] [blame] | 42 | #if defined(CONFIG_LEGACY_IMAGE_FORMAT) |
Heiko Schocher | 515eb12 | 2014-05-28 11:33:33 +0200 | [diff] [blame] | 43 | ulong count; |
Simon Glass | 208d8e8 | 2013-08-30 11:00:09 -0600 | [diff] [blame] | 44 | image_header_t *hdr = NULL; |
Heiko Schocher | 515eb12 | 2014-05-28 11:33:33 +0200 | [diff] [blame] | 45 | #endif |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 46 | #if defined(CONFIG_FIT) |
Bartlomiej Sieka | 3b8cc71 | 2008-03-20 19:38:45 +0100 | [diff] [blame] | 47 | const char *uname = NULL; |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 48 | const void* fit_hdr; |
| 49 | int noffset; |
| 50 | const void *fit_data; |
| 51 | size_t fit_len; |
| 52 | #endif |
Simon Glass | a039527 | 2013-04-17 16:13:45 +0000 | [diff] [blame] | 53 | #ifdef CONFIG_GZIP |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 54 | uint unc_len = CONFIG_SYS_XIMG_LEN; |
Simon Glass | a039527 | 2013-04-17 16:13:45 +0000 | [diff] [blame] | 55 | #endif |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 56 | uint8_t comp; |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 57 | |
Simon Glass | 22c34c2 | 2017-08-03 12:22:13 -0600 | [diff] [blame] | 58 | verify = env_get_yesno("verify"); |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 59 | |
| 60 | if (argc > 1) { |
| 61 | addr = simple_strtoul(argv[1], NULL, 16); |
| 62 | } |
| 63 | if (argc > 2) { |
| 64 | part = simple_strtoul(argv[2], NULL, 16); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 65 | #if defined(CONFIG_FIT) |
| 66 | uname = argv[2]; |
| 67 | #endif |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 68 | } |
| 69 | if (argc > 3) { |
| 70 | dest = simple_strtoul(argv[3], NULL, 16); |
| 71 | } |
| 72 | |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 73 | switch (genimg_get_format((void *)addr)) { |
Tom Rini | c220bd9 | 2019-05-23 07:14:07 -0400 | [diff] [blame] | 74 | #if defined(CONFIG_LEGACY_IMAGE_FORMAT) |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 75 | case IMAGE_FORMAT_LEGACY: |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 76 | |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 77 | printf("## Copying part %d from legacy image " |
| 78 | "at %08lx ...\n", part, addr); |
| 79 | |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 80 | hdr = (image_header_t *)addr; |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 81 | if (!image_check_magic(hdr)) { |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 82 | printf("Bad Magic Number\n"); |
| 83 | return 1; |
| 84 | } |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 85 | |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 86 | if (!image_check_hcrc(hdr)) { |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 87 | printf("Bad Header Checksum\n"); |
| 88 | return 1; |
| 89 | } |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 90 | #ifdef DEBUG |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 91 | image_print_contents(hdr); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 92 | #endif |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 93 | |
Pierre Aubert | de4e949 | 2015-09-16 08:29:11 +0200 | [diff] [blame] | 94 | if (!image_check_type(hdr, IH_TYPE_MULTI) && |
| 95 | !image_check_type(hdr, IH_TYPE_SCRIPT)) { |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 96 | printf("Wrong Image Type for %s command\n", |
| 97 | cmdtp->name); |
| 98 | return 1; |
| 99 | } |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 100 | |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 101 | comp = image_get_comp(hdr); |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 102 | if ((comp != IH_COMP_NONE) && (argc < 4)) { |
| 103 | printf("Must specify load address for %s command " |
| 104 | "with compressed image\n", |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 105 | cmdtp->name); |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 106 | return 1; |
| 107 | } |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 108 | |
| 109 | if (verify) { |
| 110 | printf(" Verifying Checksum ... "); |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 111 | if (!image_check_dcrc(hdr)) { |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 112 | printf("Bad Data CRC\n"); |
| 113 | return 1; |
| 114 | } |
| 115 | printf("OK\n"); |
| 116 | } |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 117 | |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 118 | count = image_multi_count(hdr); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 119 | if (part >= count) { |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 120 | printf("Bad Image Part\n"); |
| 121 | return 1; |
| 122 | } |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 123 | |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 124 | image_multi_getimg(hdr, part, &data, &len); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 125 | break; |
Heiko Schocher | 515eb12 | 2014-05-28 11:33:33 +0200 | [diff] [blame] | 126 | #endif |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 127 | #if defined(CONFIG_FIT) |
| 128 | case IMAGE_FORMAT_FIT: |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 129 | if (uname == NULL) { |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 130 | puts("No FIT subimage unit name\n"); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 131 | return 1; |
| 132 | } |
| 133 | |
| 134 | printf("## Copying '%s' subimage from FIT image " |
| 135 | "at %08lx ...\n", uname, addr); |
| 136 | |
| 137 | fit_hdr = (const void *)addr; |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 138 | if (!fit_check_format(fit_hdr)) { |
| 139 | puts("Bad FIT image format\n"); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 140 | return 1; |
| 141 | } |
| 142 | |
| 143 | /* get subimage node offset */ |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 144 | noffset = fit_image_get_node(fit_hdr, uname); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 145 | if (noffset < 0) { |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 146 | printf("Can't find '%s' FIT subimage\n", uname); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 147 | return 1; |
| 148 | } |
| 149 | |
Stefan Theil | 69b0ef5 | 2019-01-07 10:25:52 +0100 | [diff] [blame] | 150 | if (!fit_image_check_comp(fit_hdr, noffset, IH_COMP_NONE) |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 151 | && (argc < 4)) { |
| 152 | printf("Must specify load address for %s command " |
| 153 | "with compressed image\n", |
| 154 | cmdtp->name); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 155 | return 1; |
| 156 | } |
| 157 | |
| 158 | /* verify integrity */ |
| 159 | if (verify) { |
Simon Glass | 7428ad1 | 2013-05-07 06:11:57 +0000 | [diff] [blame] | 160 | if (!fit_image_verify(fit_hdr, noffset)) { |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 161 | puts("Bad Data Hash\n"); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 162 | return 1; |
| 163 | } |
| 164 | } |
| 165 | |
Tien Fong Chee | 8a86958 | 2019-02-12 20:49:30 +0800 | [diff] [blame] | 166 | /* get subimage/external data address and length */ |
| 167 | if (fit_image_get_data_and_size(fit_hdr, noffset, |
| 168 | &fit_data, &fit_len)) { |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 169 | puts("Could not find script subimage data\n"); |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 170 | return 1; |
| 171 | } |
| 172 | |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 173 | if (fit_image_get_comp(fit_hdr, noffset, &comp)) { |
| 174 | puts("Could not find script subimage " |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 175 | "compression type\n"); |
| 176 | return 1; |
| 177 | } |
| 178 | |
Bartlomiej Sieka | 3b8cc71 | 2008-03-20 19:38:45 +0100 | [diff] [blame] | 179 | data = (ulong)fit_data; |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 180 | len = (ulong)fit_len; |
| 181 | break; |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 182 | #endif |
| 183 | default: |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 184 | puts("Invalid image type for imxtract\n"); |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 185 | return 1; |
| 186 | } |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 187 | |
| 188 | if (argc > 3) { |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 189 | switch (comp) { |
| 190 | case IH_COMP_NONE: |
| 191 | #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) |
| 192 | { |
| 193 | size_t l = len; |
| 194 | size_t tail; |
| 195 | void *to = (void *) dest; |
| 196 | void *from = (void *)data; |
| 197 | |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 198 | printf(" Loading part %d ... ", part); |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 199 | |
| 200 | while (l > 0) { |
| 201 | tail = (l > CHUNKSZ) ? CHUNKSZ : l; |
| 202 | WATCHDOG_RESET(); |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 203 | memmove(to, from, tail); |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 204 | to += tail; |
| 205 | from += tail; |
| 206 | l -= tail; |
| 207 | } |
| 208 | } |
| 209 | #else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */ |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 210 | printf(" Loading part %d ... ", part); |
| 211 | memmove((char *) dest, (char *)data, len); |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 212 | #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */ |
| 213 | break; |
Matthew McClintock | c93a754 | 2011-05-24 05:48:26 +0000 | [diff] [blame] | 214 | #ifdef CONFIG_GZIP |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 215 | case IH_COMP_GZIP: |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 216 | printf(" Uncompressing part %d ... ", part); |
| 217 | if (gunzip((void *) dest, unc_len, |
| 218 | (uchar *) data, &len) != 0) { |
| 219 | puts("GUNZIP ERROR - image not loaded\n"); |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 220 | return 1; |
| 221 | } |
| 222 | break; |
Matthew McClintock | c93a754 | 2011-05-24 05:48:26 +0000 | [diff] [blame] | 223 | #endif |
Tom Rini | c220bd9 | 2019-05-23 07:14:07 -0400 | [diff] [blame] | 224 | #if defined(CONFIG_BZIP2) && defined(CONFIG_LEGACY_IMAGE_FORMAT) |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 225 | case IH_COMP_BZIP2: |
Wolfgang Denk | 3207afd | 2010-01-31 21:51:43 +0100 | [diff] [blame] | 226 | { |
| 227 | int i; |
| 228 | |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 229 | printf(" Uncompressing part %d ... ", part); |
Wolfgang Denk | 3207afd | 2010-01-31 21:51:43 +0100 | [diff] [blame] | 230 | /* |
Wolfgang Denk | a2cfb24 | 2010-03-12 23:06:04 +0100 | [diff] [blame] | 231 | * If we've got less than 4 MB of malloc() |
Wolfgang Denk | 3207afd | 2010-01-31 21:51:43 +0100 | [diff] [blame] | 232 | * space, use slower decompression algorithm |
| 233 | * which requires at most 2300 KB of memory. |
| 234 | */ |
| 235 | i = BZ2_bzBuffToBuffDecompress( |
Simon Glass | 208d8e8 | 2013-08-30 11:00:09 -0600 | [diff] [blame] | 236 | map_sysmem(ntohl(hdr->ih_load), 0), |
Wolfgang Denk | 3207afd | 2010-01-31 21:51:43 +0100 | [diff] [blame] | 237 | &unc_len, (char *)data, len, |
| 238 | CONFIG_SYS_MALLOC_LEN < (4096 * 1024), |
| 239 | 0); |
| 240 | if (i != BZ_OK) { |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 241 | printf("BUNZIP2 ERROR %d - " |
Wolfgang Denk | 3207afd | 2010-01-31 21:51:43 +0100 | [diff] [blame] | 242 | "image not loaded\n", i); |
| 243 | return 1; |
| 244 | } |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 245 | } |
| 246 | break; |
| 247 | #endif /* CONFIG_BZIP2 */ |
| 248 | default: |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 249 | printf("Unimplemented compression type %d\n", comp); |
Wolfgang Wegner | 781afa9 | 2009-12-10 10:11:21 +0100 | [diff] [blame] | 250 | return 1; |
| 251 | } |
Stephen Warren | 6904b6e | 2011-10-18 11:11:49 +0000 | [diff] [blame] | 252 | puts("OK\n"); |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 253 | } |
| 254 | |
Mario Six | 7feefe4 | 2018-03-28 14:39:10 +0200 | [diff] [blame] | 255 | flush_cache(dest, ALIGN(len, ARCH_DMA_MINALIGN)); |
Pieter Voorthuijsen | f52d281 | 2015-01-12 16:23:18 +0100 | [diff] [blame] | 256 | |
Simon Glass | 4d949a2 | 2017-08-03 12:22:10 -0600 | [diff] [blame] | 257 | env_set_hex("fileaddr", data); |
| 258 | env_set_hex("filesize", len); |
wdenk | 0359dde | 2004-06-09 10:15:00 +0000 | [diff] [blame] | 259 | |
| 260 | return 0; |
| 261 | } |
| 262 | |
Kim Phillips | dc00a68 | 2012-10-29 13:34:31 +0000 | [diff] [blame] | 263 | #ifdef CONFIG_SYS_LONGHELP |
| 264 | static char imgextract_help_text[] = |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 265 | "addr part [dest]\n" |
| 266 | " - extract <part> from legacy image at <addr> and copy to <dest>" |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 267 | #if defined(CONFIG_FIT) |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 268 | "\n" |
| 269 | "addr uname [dest]\n" |
| 270 | " - extract <uname> subimage from FIT image at <addr> and copy to <dest>" |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 271 | #endif |
Kim Phillips | dc00a68 | 2012-10-29 13:34:31 +0000 | [diff] [blame] | 272 | ""; |
| 273 | #endif |
| 274 | |
| 275 | U_BOOT_CMD( |
| 276 | imxtract, 4, 1, do_imgextract, |
| 277 | "extract a part of a multi-image", imgextract_help_text |
Marian Balakowicz | 2321ed0 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 278 | ); |