image: Fix script execution from FIT images with external data
authorTobias Waldekranz <tobias@waldekranz.com>
Thu, 16 Feb 2023 15:33:47 +0000 (16:33 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 5 Apr 2023 14:54:47 +0000 (10:54 -0400)
Update the script loading code to recognize when script data is stored
externally from the FIT metadata (i.e., built with `mkimage -E`).

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
boot/image-board.c

index 7dd0c32..c602832 100644 (file)
@@ -1126,7 +1126,8 @@ fallback:
                        }
 
                        /* get script subimage data address and length */
-                       if (fit_image_get_data(fit_hdr, noffset, &fit_data, &fit_len)) {
+                       if (fit_image_get_data_and_size(fit_hdr, noffset,
+                                                       &fit_data, &fit_len)) {
                                puts("Could not find script subimage data\n");
                                return 1;
                        }