Commit ab2cf472 authored by Andreas Kemnade's avatar Andreas Kemnade

HACK: spl: copy image over to the desired load address

to be able to process fit images and ordinary images
and images with different loading address, the image
has to be copied, since the dfu layer loads the full
image at once, so it will be misplaced.

it expects CONFIG_SPL_LOAD_FIT_ADDRESS to set to a good
temporary space for every image.
Signed-off-by: default avatarAndreas Kemnade <andreas@kemnade.info>
parent 6ca500a6
......@@ -227,6 +227,18 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
* the flash. For now, it will temporary fixed to address
* pointed by U-Boot.
*/
#if defined(CONFIG_SPL_DFU_SUPPORT)
if (bootdev->boot_device == BOOT_DEVICE_DFU) {
int ret = spl_parse_image_header(spl_image, header);
if (ret)
return ret;
memcpy((void *)spl_image->load_addr,
(void *)(CONFIG_SPL_LOAD_FIT_ADDRESS),
spl_image->size);
return 0;
}
#endif
header = (struct image_header *)
(CONFIG_SYS_TEXT_BASE - sizeof(struct image_header));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment