summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib64
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-12-18 07:08:41 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2019-12-20 16:08:21 +0100
commitd92e4b7e61215a0b7c609878bc294cb2b4b33f20 (patch)
treedeab8f0720418abf07a24a618e7e042b84ec097a /arch/arm/lib64
parent86d711f394f0449f4420819d7df000fd5f2f769b (diff)
downloadbarebox-d92e4b7e61215a0b7c609878bc294cb2b4b33f20.tar.gz
barebox-d92e4b7e61215a0b7c609878bc294cb2b4b33f20.tar.xz
ARM: aarch64: Add support for passing initrd to Linux
This adds basic support for passing intird to Linux Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/lib64')
-rw-r--r--arch/arm/lib64/armlinux.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/lib64/armlinux.c b/arch/arm/lib64/armlinux.c
index afa56792fb..31bd987f10 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)) {