diff options
Diffstat (limited to 'common/spl/spl_fit.c')
| -rw-r--r-- | common/spl/spl_fit.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 746c3d2fa28..a588d13eb40 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -448,8 +448,8 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image, debug("%s: No additional FDT node\n", __func__); ret = 0; break; - } else if (ret < 0) { - continue; + } else if (ret) { + break; } ret = board_spl_fit_append_fdt_skip(str); @@ -550,6 +550,23 @@ static int spl_fit_image_is_fpga(const void *fit, int node) return !strcmp(type, "fpga"); } +static void spl_fit_image_record_arm32_optee(const void *fit, int node, + struct spl_image_info *spl_image, + struct spl_image_info *image_info) +{ +#if defined(CONFIG_BOOTM_OPTEE) && defined(CONFIG_ARM) && !defined(CONFIG_ARM64) + const char *type = fdt_getprop(fit, node, FIT_TYPE_PROP, NULL); + + if (!type) + return; + + if (strcmp(type, "tee")) + return; + + spl_image->optee_addr = image_info->load_addr; +#endif +} + static int spl_fit_image_get_os(const void *fit, int noffset, uint8_t *os) { if (!CONFIG_IS_ENABLED(FIT_IMAGE_TINY) || CONFIG_IS_ENABLED(OS_BOOT)) @@ -903,6 +920,9 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, image_info.entry_point != FDT_ERROR) spl_image->entry_point = image_info.entry_point; + spl_fit_image_record_arm32_optee(ctx.fit, node, spl_image, + &image_info); + /* Record our loadables into the FDT */ if (!CONFIG_IS_ENABLED(FIT_IMAGE_TINY) && xpl_get_fdt_update(info) && spl_image->fdt_addr) |
