* [PATCH] ARM: aarch64: Add support for passing initrd to Linux
@ 2019-12-18 15:08 Andrey Smirnov
2019-12-20 15:08 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Smirnov @ 2019-12-18 15:08 UTC (permalink / raw)
To: Barebox List; +Cc: Andrey Smirnov
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-20 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 15:08 [PATCH] ARM: aarch64: Add support for passing initrd to Linux Andrey Smirnov
2019-12-20 15:08 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox