All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] spl: fix entry_point equal to load_addr
@ 2019-11-25 16:18 Giulio Benetti
  2019-12-05 22:09 ` Tom Rini
  2020-01-16 14:40 ` Tom Rini
  0 siblings, 2 replies; 18+ messages in thread
From: Giulio Benetti @ 2019-11-25 16:18 UTC (permalink / raw)
  To: u-boot

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 <giulio.benetti@benettiengineering.com>
---
 common/spl/spl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index f1ad8dc9da..cdae346753 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -261,9 +261,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;
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-01-16 14:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 16:18 [U-Boot] [PATCH] spl: fix entry_point equal to load_addr Giulio Benetti
2019-12-05 22:09 ` Tom Rini
2019-12-06 12:46   ` Patrice CHOTARD
2019-12-06 12:58     ` Simon Goldschmidt
2019-12-06 13:34       ` Tom Rini
2019-12-06 13:37         ` Simon Goldschmidt
2019-12-06 13:44           ` Tom Rini
2019-12-06 13:48         ` Giulio Benetti
2019-12-06 14:04           ` Patrice CHOTARD
2019-12-06 17:23             ` Giulio Benetti
2019-12-06 14:05           ` Simon Goldschmidt
2019-12-06 14:55             ` Tom Rini
2019-12-07 21:28               ` Simon Goldschmidt
2020-01-10 14:57                 ` Giulio Benetti
2020-01-10 21:51                   ` Tom Rini
2020-01-16 14:40 ` Tom Rini
2020-01-16 14:46   ` Giulio Benetti
2020-01-16 14:49     ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.