diff options
author | Peng Fan <peng.fan@nxp.com> | 2017-12-05 13:20:59 +0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-12-12 21:33:38 -0500 |
commit | a1be94b65410c7ebba5e7695478b6623579b410c (patch) | |
tree | 8d1c66635f112b8b170291e26ef1ad8621f83cc9 /common/spl/spl_fit.c | |
parent | 6032c029474cfba1ab2ff4a68e78905545c0c843 (diff) | |
download | u-boot-a1be94b65410c7ebba5e7695478b6623579b410c.zip u-boot-a1be94b65410c7ebba5e7695478b6623579b410c.tar.gz u-boot-a1be94b65410c7ebba5e7695478b6623579b410c.tar.bz2 |
SPL: Add FIT data-position property support
For external data, FIT has a optional property "data-position" which
can set the external data to a fixed offset to FIT beginning.
Add the support for this property in SPL FIT.
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: "Andrew F. Davis" <afd@ti.com>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: "tomas.melin@vaisala.com" <tomas.melin@vaisala.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: "Cooper Jr., Franklin" <fcooper@ti.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Rick Altherr <raltherr@google.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'common/spl/spl_fit.c')
-rw-r--r-- | common/spl/spl_fit.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 72ae8f4..cc07fbc 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -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; |