]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/spl/spl_fit.c
SPL: Add FIT data-position property support
[people/ms/u-boot.git] / common / spl / spl_fit.c
index 72ae8f4c50310e26eb95b7c14eef62b99a6143ff..cc07fbc8a02adc332fd4a7b45b574aa0f74b17ad 100644 (file)
@@ -173,6 +173,7 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
        int align_len = ARCH_DMA_MINALIGN - 1;
        uint8_t image_comp = -1, type = -1;
        const void *data;
+       bool external_data = false;
 
        if (IS_ENABLED(CONFIG_SPL_OS_BOOT) && IS_ENABLED(CONFIG_SPL_GZIP)) {
                if (fit_image_get_comp(fit, node, &image_comp))
@@ -189,9 +190,15 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
        if (fit_image_get_load(fit, node, &load_addr))
                load_addr = image_info->load_addr;
 
-       if (!fit_image_get_data_offset(fit, node, &offset)) {
-               /* External data */
+       if (!fit_image_get_data_position(fit, node, &offset)) {
+               external_data = true;
+       } else if (!fit_image_get_data_offset(fit, node, &offset)) {
                offset += base_offset;
+               external_data = true;
+       }
+
+       if (external_data) {
+               /* External data */
                if (fit_image_get_data_size(fit, node, &len))
                        return -ENOENT;