public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] fvp: Add support for loading Android boot images via semihosting
@ 2020-04-04  2:58 Peter Collingbourne
       [not found] ` <CAD0U-hK1uPsCzkJJ5SybxYNGjStFon1ybHfZ490p8OrHinUz0w@mail.gmail.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peter Collingbourne @ 2020-04-04  2:58 UTC (permalink / raw)
  To: u-boot

FVP now loads an Android boot image named boot.img if available,
otherwise it falls back to the existing code path.

Signed-off-by: Peter Collingbourne <pcc@google.com>
---
 configs/vexpress_aemv8a_semi_defconfig |  2 ++
 include/configs/vexpress_aemv8a.h      | 30 +++++++++++++++++---------
 2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/configs/vexpress_aemv8a_semi_defconfig b/configs/vexpress_aemv8a_semi_defconfig
index f31baab197..b52c761dee 100644
--- a/configs/vexpress_aemv8a_semi_defconfig
+++ b/configs/vexpress_aemv8a_semi_defconfig
@@ -14,6 +14,8 @@ CONFIG_BOOTARGS="console=ttyAMA0 earlycon=pl011,0x1c090000 debug user_debug=31 l
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="VExpress64# "
+CONFIG_ANDROID_BOOT_IMAGE=y
+CONFIG_CMD_ABOOTIMG=y
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
index 9a9cec414c..4f3a792f49 100644
--- a/include/configs/vexpress_aemv8a.h
+++ b/include/configs/vexpress_aemv8a.h
@@ -177,16 +177,26 @@
 				"initrd_addr=0x88000000\0"	\
 				"fdtfile=devtree.dtb\0"		\
 				"fdt_addr=0x83000000\0"		\
-				"fdt_high=0xffffffffffffffff\0"	\
-				"initrd_high=0xffffffffffffffff\0"
-
-#define CONFIG_BOOTCOMMAND	"smhload ${kernel_name} ${kernel_addr}; " \
-				"smhload ${fdtfile} ${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"
+				"boot_name=boot.img\0"		\
+				"boot_addr=0x8007f800\0"
+
+#define CONFIG_BOOTCOMMAND	"if smhload ${boot_name} ${boot_addr}; then " \
+				"  set bootargs; " \
+				"  abootimg addr ${boot_addr}; " \
+				"  abootimg get dtb --index=0 fdt_addr; " \
+				"  bootm ${boot_addr} ${boot_addr} " \
+				"  ${fdt_addr}; " \
+				"else; " \
+				"  set fdt_high 0xffffffffffffffff; " \
+				"  set initrd_high 0xffffffffffffffff; " \
+				"  smhload ${kernel_name} ${kernel_addr}; " \
+				"  smhload ${fdtfile} ${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; " \
+				"fi"
 
 
 #endif
-- 
2.26.0.292.g33ef6b2f38-goog

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-24 17:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-04  2:58 [PATCH] fvp: Add support for loading Android boot images via semihosting Peter Collingbourne
     [not found] ` <CAD0U-hK1uPsCzkJJ5SybxYNGjStFon1ybHfZ490p8OrHinUz0w@mail.gmail.com>
2020-04-06 18:24   ` Peter Collingbourne
2020-04-06 18:30     ` Ryan Harkin
2020-04-14 17:11       ` Peter Collingbourne
2020-04-15  1:19         ` Tom Rini
2020-04-16  9:37 ` Linus Walleij
2020-04-24 17:11 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox