diff --git a/common/image-fit.c b/common/image-fit.c index 7f2c3089e7..78d354f03d 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -711,6 +711,23 @@ int fit_image_get_comp(const void *fit, int noffset, uint8_t *comp) return 0; } +bool fit_image_is_preload(const void *fit, int noffset) +{ + int len; + int *data; + + data = (int *)fdt_getprop(fit, noffset, FIT_PRE_LOAD_PROP, &len); + if (data == NULL || len != sizeof(int)) { + fit_get_debug(fit, noffset, FIT_PRE_LOAD_PROP, len); + return false; + } + + if (*data != 1) + return false; + + return true; +} + static int fit_image_get_address(const void *fit, int noffset, char *name, ulong *load) { diff --git a/include/image.h b/include/image.h index 24d9c977e0..295d160380 100644 --- a/include/image.h +++ b/include/image.h @@ -930,6 +930,7 @@ int bootz_setup(ulong image, ulong *start, ulong *end); #define FIT_COMP_ADDR_PROP "comp" #define FIT_ENTRY_PROP "entry" #define FIT_LOAD_PROP "load" +#define FIT_PRE_LOAD_PROP "preload" #define FIT_ROLLBACK_PROP "rollback-index" /* configuration node */ @@ -1011,6 +1012,7 @@ int fit_image_get_os(const void *fit, int noffset, uint8_t *os); int fit_image_get_arch(const void *fit, int noffset, uint8_t *arch); int fit_image_get_type(const void *fit, int noffset, uint8_t *type); int fit_image_get_comp(const void *fit, int noffset, uint8_t *comp); +bool fit_image_is_preload(const void *fit, int noffset); int fit_image_get_load(const void *fit, int noffset, ulong *load); int fit_image_get_entry(const void *fit, int noffset, ulong *entry); int fit_image_get_comp_addr(const void *fit, int noffset, ulong *comp);