From 14b9c852f21e3a11e6988e86a9e346a4068cd555 Mon Sep 17 00:00:00 2001 From: Ryan Harkin Date: Thu, 2 Mar 2017 15:26:01 +0000 Subject: vexpress64: fvp: boot from DRAM if semihosting fails If devtree.dtb, ramdisk.img and Image exist, boot via semihosting. If we partially load from semihosting, then fail, stop loading. If nothing loads from semihosting, boot from whatever is in DRAM. note: semihosting expects to load an initrd without a u-boot header and sets the chosen node with the initrd address and length. We don't know the length of the initrd in the DRAM method, so it will need a u-boot header so booti can load it. Signed-off-by: Ryan Harkin --- include/configs/vexpress_aemv8a.h | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h index de31313998..977d2f0d49 100644 --- a/include/configs/vexpress_aemv8a.h +++ b/include/configs/vexpress_aemv8a.h @@ -224,13 +224,25 @@ "systemd.log_target=null "\ "loglevel=9" -#define CONFIG_BOOTCOMMAND "smhload ${kernel_name} ${kernel_addr}; " \ - "smhload ${fdt_name} ${fdt_addr}; " \ - "smhload ${initrd_name} ${initrd_addr} "\ - "initrd_end; " \ - "fdt addr ${fdt_addr}; fdt resize; " \ - "fdt chosen ${initrd_addr} ${initrd_end}; " \ - "booti $kernel_addr - $fdt_addr" +#define CONFIG_BOOTCOMMAND "if smhload ${fdt_name} ${fdt_addr}; then "\ + " if smhload ${initrd_name} ${initrd_addr} "\ + " initrd_end; then " \ + " if smhload ${kernel_name} "\ + " ${kernel_addr}; then " \ + " fdt addr ${fdt_addr}; fdt resize; "\ + " fdt chosen ${initrd_addr} "\ + " ${initrd_end}; "\ + " booti ${kernel_addr} - ${fdt_addr}; "\ + " else; " \ + " exit; " \ + " fi; " \ + " else; " \ + " exit; " \ + " fi; " \ + "fi; " \ + "echo semihosting load failed, try booting "\ + "with contents of DRAM; " \ + "booti $kernel_addr $initrd_addr $fdt_addr" #elif CONFIG_TARGET_VEXPRESS64_BASE_FVP_DRAM -- cgit v1.2.3