summaryrefslogtreecommitdiff
path: root/include/configs/vexpress_aemv8.h
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2022-03-04 16:30:14 +0000
committerTom Rini <trini@konsulko.com>2022-04-01 14:58:16 -0400
commit8a0a8ff52c1681a3cde8568cb6e252b9a98fdf06 (patch)
tree96f599eedf388311ff0ed92894e06a8403b67949 /include/configs/vexpress_aemv8.h
parent5865038257d1a38dd71f8107e4510f3c0c0dd584 (diff)
vexpress64: fvp: add distro_boot support
So far the FVP model just supports booting through semihosting, so by loading files from the host the model is running on. This allows for quick booting of new kernels (or replacing DTBs), but prevents more featureful boots like using UEFI. Enable the distro_boot feature, and provide a list of possible boot sources that U-Boot should check: - For backwards compatibility we start with semihosting, which gets its commands migrated from CONFIG_BOOTCOMMAND into the distro_boot infrastructure. This is also slightly tweaked to fail graceful in case the required files could not be found. - Next we try to use a user provided script, that could be easily placed into memory using the model command line. - Since we gained virtio support with the enablement of OF_CONTROL, let's check virtio block devices next. This is where UEFI boot can be easily used, for instance by providing a distro installer .iso file through virtio-blk. - Networking is now provided by virtio as well, so enable the default PXE and DHCP boot flows, mostly because we can. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'include/configs/vexpress_aemv8.h')
-rw-r--r--include/configs/vexpress_aemv8.h57
1 files changed, 53 insertions, 4 deletions
diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
index f8731aad97..74060c6349 100644
--- a/include/configs/vexpress_aemv8.h
+++ b/include/configs/vexpress_aemv8.h
@@ -137,6 +137,50 @@
"booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}\0"
#define BOOTENV_DEV_NAME_AFS(devtypeu, devtypel, instance) "afs "
+/* Boot by executing a U-Boot script pre-loaded into DRAM. */
+#define BOOTENV_DEV_MEM(devtypeu, devtypel, instance) \
+ "bootcmd_mem= " \
+ "source ${scriptaddr}; " \
+ "if test $? -eq 1; then " \
+ " env import -t ${scriptaddr}; " \
+ " if test -n $uenvcmd; then " \
+ " echo Running uenvcmd ...; " \
+ " run uenvcmd; " \
+ " fi; " \
+ "fi\0"
+#define BOOTENV_DEV_NAME_MEM(devtypeu, devtypel, instance) "mem "
+
+#ifdef CONFIG_CMD_VIRTIO
+#define FUNC_VIRTIO(func) func(VIRTIO, virtio, 0)
+#else
+#define FUNC_VIRTIO(func)
+#endif
+
+/*
+ * Boot by loading an Android image, or kernel, initrd and FDT through
+ * semihosting into DRAM.
+ */
+#define BOOTENV_DEV_SMH(devtypeu, devtypel, instance) \
+ "bootcmd_smh= " \
+ "if smhload ${boot_name} ${boot_addr_r}; then" \
+ " setenv bootargs;" \
+ " abootimg addr ${boot_addr_r};" \
+ " abootimg get dtb --index=0 fdt_addr_r;" \
+ " bootm ${boot_addr_r} ${boot_addr_r} ${fdt_addr_r};" \
+ "else" \
+ " if smhload ${kernel_name} ${kernel_addr_r}; then" \
+ " setenv fdt_high 0xffffffffffffffff;" \
+ " setenv initrd_high 0xffffffffffffffff;" \
+ " smhload ${fdtfile} ${fdt_addr_r};" \
+ " smhload ${ramdisk_name} ${ramdisk_addr_r} ramdisk_end;" \
+ " fdt addr ${fdt_addr_r};" \
+ " fdt resize;" \
+ " fdt chosen ${ramdisk_addr_r} ${ramdisk_end};" \
+ " booti $kernel_addr_r - $fdt_addr_r;" \
+ " fi;" \
+ "fi\0"
+#define BOOTENV_DEV_NAME_SMH(devtypeu, devtypel, instance) "smh "
+
/* Boot sources for distro boot and load addresses, per board */
#ifdef CONFIG_TARGET_VEXPRESS64_JUNO /* Arm Juno board */
@@ -149,8 +193,6 @@
func(DHCP, dhcp, na) \
func(AFS, afs, na)
-#include <config_distro_bootcmd.h>
-
#define VEXPRESS_KERNEL_ADDR 0x80080000
#define VEXPRESS_PXEFILE_ADDR 0x8fb00000
#define VEXPRESS_FDT_ADDR 0x8fc00000
@@ -166,6 +208,13 @@
#elif CONFIG_TARGET_VEXPRESS64_BASE_FVP /* ARMv8-A base model */
+#define BOOT_TARGET_DEVICES(func) \
+ func(SMH, smh, na) \
+ func(MEM, mem, na) \
+ FUNC_VIRTIO(func) \
+ func(PXE, pxe, na) \
+ func(DHCP, dhcp, na)
+
#define VEXPRESS_KERNEL_ADDR 0x80080000
#define VEXPRESS_PXEFILE_ADDR 0x8fa00000
#define VEXPRESS_SCRIPT_ADDR 0x8fb00000
@@ -180,10 +229,10 @@
"boot_name=boot.img\0" \
"boot_addr_r=" __stringify(VEXPRESS_BOOT_ADDR) "\0"
-#define BOOTENV
-
#endif
+#include <config_distro_bootcmd.h>
+
/* Default load addresses and names for the different payloads. */
#define CONFIG_EXTRA_ENV_SETTINGS \
"kernel_addr_r=" __stringify(VEXPRESS_KERNEL_ADDR) "\0" \