From: Giulio Benetti Date: Fri, 10 Jan 2020 14:46:51 +0000 (+0100) Subject: spl: fix entry_point equal to load_addr X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=1054344fa42b1f6568d35eae7ceecc859ad42258;p=u-boot.git spl: fix entry_point equal to load_addr At the moment entry_point is set to image_get_load(header) that sets it to "load address" instead of "entry point", assuming entry_point is equal to load_addr, but it's not true. Then load_addr is set to "entry_point - header_size", but this is wrong too since load_addr is not an entry point. So use image_get_ep() for entry_point assignment and image_get_load() for load_addr assignment. Signed-off-by: Giulio Benetti --- diff --git a/common/spl/spl.c b/common/spl/spl.c index c1fce62b91..19085ad270 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -284,9 +284,9 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->entry_point = image_get_ep(header); spl_image->size = image_get_data_size(header); } else { - spl_image->entry_point = image_get_load(header); + spl_image->entry_point = image_get_ep(header); /* Load including the header */ - spl_image->load_addr = spl_image->entry_point - + spl_image->load_addr = image_get_load(header) - header_size; spl_image->size = image_get_data_size(header) + header_size;