From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH v2] bootm: update os_entry from uimage
Date: Sat, 21 Sep 2013 17:20:29 +0200 [thread overview]
Message-ID: <1379776829-30964-1-git-send-email-plagnioj@jcrosoft.com> (raw)
if not uimage set 0 by default
today we do not see the issue as the kernel entry point is the same as the
load_addr but on other binary its not necessary the case
as today we ignore the entry point set in the uimage and just assume it's the
same as the load_addr
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
commands/bootm.c | 1 +
common/bootm.c | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/commands/bootm.c b/commands/bootm.c
index a4004df..7acf341 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -104,6 +104,7 @@ static int do_bootm(int argc, char *argv[])
data.initrd_address = UIMAGE_INVALID_ADDRESS;
data.os_address = UIMAGE_SOME_ADDRESS;
+ data.os_entry = UIMAGE_SOME_ADDRESS;
data.verify = 0;
data.verbose = 0;
diff --git a/common/bootm.c b/common/bootm.c
index 1987a09..17c8082 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -46,6 +46,7 @@ static struct image_handler *bootm_find_handler(enum filetype filetype,
static int bootm_open_os_uimage(struct image_data *data)
{
int ret;
+ int update_ep = 0;
data->os = uimage_open(data->os_file);
if (!data->os)
@@ -70,8 +71,10 @@ static int bootm_open_os_uimage(struct image_data *data)
return -EINVAL;
}
- if (data->os_address == UIMAGE_SOME_ADDRESS)
+ if (data->os_address == UIMAGE_SOME_ADDRESS) {
data->os_address = data->os->header.ih_load;
+ update_ep = 1;
+ }
if (data->os_address != UIMAGE_INVALID_ADDRESS) {
data->os_res = uimage_load_to_sdram(data->os, 0,
@@ -80,6 +83,13 @@ static int bootm_open_os_uimage(struct image_data *data)
uimage_close(data->os);
return -ENOMEM;
}
+
+ }
+
+ if (update_ep && data->os_entry == UIMAGE_SOME_ADDRESS) {
+ data->os_entry = data->os->header.ih_ep;
+ if (data->os_address != UIMAGE_INVALID_ADDRESS)
+ data->os_entry -= data->os_address;
}
return 0;
@@ -232,6 +242,9 @@ int bootm_boot(struct image_data *data)
}
}
+ if (data->os_entry == UIMAGE_SOME_ADDRESS)
+ data->os_entry = 0;
+
if (IS_ENABLED(CONFIG_CMD_BOOTM_INITRD) && data->initrd_file) {
initrd_type = file_name_detect_type(data->initrd_file);
--
1.8.4.rc3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2013-09-21 15:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-21 15:20 Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-09-22 18:17 ` Sascha Hauer
2013-09-23 4:40 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-23 6:33 ` Sascha Hauer
2013-09-23 8:07 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-23 8:12 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-23 9:11 ` Sascha Hauer
2013-09-23 8:16 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-23 9:13 ` Sascha Hauer
2013-09-23 14:32 ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-23 14:54 ` Sascha Hauer
2013-09-24 9:26 ` Jean-Christophe PLAGNIOL-VILLARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1379776829-30964-1-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox