- if (verify) {
- printf(" Verifying Checksum ... ");
- if (crc32(0, (char *) data, len) != ntohl(header.ih_dcrc)) {
- printf("Bad Data CRC\n");
+ count = image_multi_count (hdr);
+ if (part >= count) {
+ printf("Bad Image Part\n");
+ return 1;
+ }
+
+ image_multi_getimg (hdr, part, &data, &len);
+ break;
+#if defined(CONFIG_FIT)
+ case IMAGE_FORMAT_FIT:
+ if (uname == NULL) {
+ puts ("No FIT subimage unit name\n");
+ return 1;
+ }
+
+ printf("## Copying '%s' subimage from FIT image "
+ "at %08lx ...\n", uname, addr);
+
+ fit_hdr = (const void *)addr;
+ if (!fit_check_format (fit_hdr)) {
+ puts ("Bad FIT image format\n");
+ return 1;
+ }
+
+ /* get subimage node offset */
+ noffset = fit_image_get_node (fit_hdr, uname);
+ if (noffset < 0) {
+ printf ("Can't find '%s' FIT subimage\n", uname);