[U-Boot] [PATCH 09/11] vexpress64: juno: add optional initrd

Ryan Harkin ryan.harkin at linaro.org
Wed Sep 23 19:25:41 CEST 2015


Some OS images require an initrd on Juno.

If the file ramdisk.img exists in NOR flash, then we load it and pass
the address to the kernel.  Otherwise, we pass the "-" parameter as
before.

Signed-off-by: Ryan Harkin <ryan.harkin at linaro.org>
Reviewed-by: Linus Walleij <linus.walleij at linaro.org>
CC: David Feng <fenghua at phytium.com.cn>
CC: Bhupesh Sharma <bhupesh.sharma at freescale.com>
CC: Linus Walleij <linus.walleij at linaro.org>
---
 include/configs/vexpress_aemv8a.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
index 5198b32..c62c3ac 100644
--- a/include/configs/vexpress_aemv8a.h
+++ b/include/configs/vexpress_aemv8a.h
@@ -187,6 +187,8 @@
 #define CONFIG_EXTRA_ENV_SETTINGS	\
 				"kernel_name=Image\0"	\
 				"kernel_addr=0x80000000\0" \
+				"initrd_name=ramdisk.img\0"	\
+				"initrd_addr=0x84000000\0"	\
 				"fdt_name=juno\0" \
 				"fdt_addr=0x83000000\0" \
 				"fdt_high=0xffffffffffffffff\0" \
@@ -205,7 +207,12 @@
 #define CONFIG_BOOTCOMMAND	"afs load ${kernel_name} ${kernel_addr} ; " \
 				"afs load  ${fdt_name} ${fdt_addr} ; " \
 				"fdt addr ${fdt_addr}; fdt resize; " \
-				"booti ${kernel_addr} - ${fdt_addr}"
+				"if afs load  ${initrd_name} ${initrd_addr} ; "\
+				"then "\
+				"  setenv initrd_param ${initrd_addr}; "\
+				"  else setenv initrd_param -; "\
+				"fi ; " \
+				"booti ${kernel_addr} ${initrd_param} ${fdt_addr}"
 
 #define CONFIG_BOOTDELAY		1
 
-- 
1.9.1



More information about the U-Boot mailing list