mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Barebox List <barebox@lists.infradead.org>
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH] ARM: aarch64: Add support for passing initrd to Linux
Date: Wed, 18 Dec 2019 07:08:41 -0800	[thread overview]
Message-ID: <20191218150841.30840-1-andrew.smirnov@gmail.com> (raw)

This adds basic support for passing intird to Linux

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/lib64/armlinux.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/arm/lib64/armlinux.c b/arch/arm/lib64/armlinux.c
index afa56792f..31bd987f1 100644
--- a/arch/arm/lib64/armlinux.c
+++ b/arch/arm/lib64/armlinux.c
@@ -37,6 +37,7 @@ static int do_bootm_linux(struct image_data *data)
 		       unsigned long x3);
 	resource_size_t start, end;
 	unsigned long text_offset, image_size, devicetree, kernel;
+	unsigned long image_end;
 	int ret;
 	void *fdt;
 
@@ -53,7 +54,18 @@ static int do_bootm_linux(struct image_data *data)
 	if (ret)
 		goto out;
 
-	devicetree = ALIGN(kernel + image_size, PAGE_SIZE);
+	image_end = PAGE_ALIGN(kernel + image_size);
+
+	if (bootm_has_initrd(data)) {
+		ret = bootm_load_initrd(data, image_end);
+		if (ret)
+			return ret;
+
+		image_end += resource_size(data->initrd_res);
+		image_end = PAGE_ALIGN(image_end);
+	}
+
+	devicetree = image_end;
 
 	fdt = bootm_get_devicetree(data);
 	if (IS_ERR(fdt)) {
-- 
2.21.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2019-12-18 15:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 15:08 Andrey Smirnov [this message]
2019-12-20 15:08 ` Sascha Hauer

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=20191218150841.30840-1-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.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