From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] ARM: boot barebox with kernel calling convention
Date: Fri, 6 Dec 2013 10:43:01 +0100 [thread overview]
Message-ID: <1386322981-30721-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1386322981-30721-1-git-send-email-s.hauer@pengutronix.de>
Start a 2nd stage barebox with the Linux Kernel calling convention.
Right now barebox does not interpret ATAGs or devicetree passed
to it, but it doesn't hurt to pass parameters so that future bareboxes
can use them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/lib/armlinux.c | 2 +-
arch/arm/lib/bootm.c | 19 ++++++++++++++++---
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index d83c6a2..bc28620 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -261,7 +261,7 @@ void start_linux(void *adr, int swap, unsigned long initrd_address,
int architecture;
if (oftree) {
- printf("booting Linux kernel with devicetree\n");
+ printf("booting kernel with devicetree\n");
params = oftree;
} else {
setup_tags(initrd_address, initrd_size, swap);
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 599b09a..c0e4e15 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -296,15 +296,28 @@ static struct image_handler zimage_handler = {
static int do_bootm_barebox(struct image_data *data)
{
- void (*barebox)(void);
+ void *barebox;
barebox = read_file(data->os_file, NULL);
if (!barebox)
return -EINVAL;
- shutdown_barebox();
+ if (IS_ENABLED(CONFIG_OFTREE) && data->of_root_node) {
+ data->oftree = of_get_fixed_tree(data->of_root_node);
+ fdt_add_reserve_map(data->oftree);
+ of_print_cmdline(data->of_root_node);
+ if (bootm_verbose(data) > 1)
+ of_print_nodes(data->of_root_node, 0);
+ }
+
+ if (bootm_verbose(data)) {
+ printf("\nStarting barebox at 0x%p", barebox);
+ if (data->oftree)
+ printf(", oftree at 0x%p", data->oftree);
+ printf("...\n");
+ }
- barebox();
+ start_linux(barebox, 0, 0, 0, data->oftree);
reset_cpu(0);
}
--
1.8.4.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2013-12-06 9:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 9:42 Find ATAG base automatically and call barebox like the kernel Sascha Hauer
2013-12-06 9:42 ` [PATCH 1/3] ARM: start kernel: find a valid address for the atags list automatically Sascha Hauer
2013-12-06 14:38 ` Alexander Aring
2013-12-06 9:43 ` [PATCH 2/3] ARM: remove armlinux_set_bootparams() calls from boards Sascha Hauer
2013-12-06 9:43 ` Sascha Hauer [this message]
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=1386322981-30721-4-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--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