vexpress64: juno: add optional initrd
authorRyan Harkin <ryan.harkin@linaro.org>
Fri, 9 Oct 2015 16:18:06 +0000 (17:18 +0100)
committerTom Rini <trini@konsulko.com>
Sun, 11 Oct 2015 21:12:05 +0000 (17:12 -0400)
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@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
include/configs/vexpress_aemv8a.h

index f9fa2cef12eeb401b1aa69ef0c77ff31039fce2c..99dd8b6b62495bb417a8963e6bdb87df080c2164 100644 (file)
 #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" \
 #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