[PATCH 05/11] vexpress64: config header: unify environment definition
Andre Przywara
andre.przywara at arm.com
Fri Mar 4 17:30:12 CET 2022
The definition of the standard environment variables (kernel_addr_r and
friends) has been improved lately for the FVP model, but the Juno board
is still using some custom scheme.
Since we need to extend this to a third board soon, let's unify the
definition:
- Define the Juno addresses in the same generic way we do for the FVP
model, and move the actual variable setting out of the board #ifdef's.
- Add the missing addresses for a PXE file and a boot script.
- Cleanup some stale comments on the way.
As the FVP model doesn't have support for distro_boot quite yet, add
a dummy definition for now, to be replaced with the real thing later.
Signed-off-by: Andre Przywara <andre.przywara at arm.com>
---
include/configs/vexpress_aemv8.h | 83 +++++++++++++++++---------------
1 file changed, 45 insertions(+), 38 deletions(-)
diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
index f0c5ceb384..983d60211a 100644
--- a/include/configs/vexpress_aemv8.h
+++ b/include/configs/vexpress_aemv8.h
@@ -102,8 +102,6 @@
/* BOOTP options */
#define CONFIG_BOOTP_BOOTFILESIZE
-/* Miscellaneous configurable options */
-
/* Physical Memory Map */
#define PHYS_SDRAM_1 (V2M_BASE) /* SDRAM Bank #1 */
/* Top 16MB reserved for secure world use */
@@ -119,11 +117,7 @@
#define PHYS_SDRAM_2_SIZE 0x80000000
#endif
-/* Enable memtest */
-
-/* Initial environment variables */
-#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
-/* Copy the kernel and FDT to DRAM memory and boot */
+/* Copy the kernel, initrd and FDT from NOR flash to DRAM memory and boot. */
#define BOOTENV_DEV_AFS(devtypeu, devtypel, instance) \
"bootcmd_afs=" \
"afs load ${kernel_name} ${kernel_addr_r} ;"\
@@ -146,6 +140,10 @@
"booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}\0"
#define BOOTENV_DEV_NAME_AFS(devtypeu, devtypel, instance) "afs "
+/* Boot sources for distro boot and load addresses, per board */
+
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO /* Arm Juno board */
+
#define BOOT_TARGET_DEVICES(func) \
func(USB, usb, 0) \
func(SATA, sata, 0) \
@@ -156,40 +154,49 @@
#include <config_distro_bootcmd.h>
-/*
- * Defines where the kernel and FDT exist in NOR flash and where it will
- * be copied into DRAM
- */
-#define CONFIG_EXTRA_ENV_SETTINGS \
- "kernel_name=norkern\0" \
- "kernel_alt_name=Image\0" \
- "kernel_addr_r=0x80080000\0" \
- "ramdisk_name=ramdisk.img\0" \
- "ramdisk_addr_r=0x88000000\0" \
- "fdtfile=board.dtb\0" \
- "fdt_alt_name=juno\0" \
- "fdt_addr_r=0x80000000\0" \
- BOOTENV
-
-#elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
-
-#define VEXPRESS_KERNEL_ADDR 0x80080000
-#define VEXPRESS_FDT_ADDR 0x8fc00000
-#define VEXPRESS_BOOT_ADDR 0x8fd00000
-#define VEXPRESS_RAMDISK_ADDR 0x8fe00000
-
-#define CONFIG_EXTRA_ENV_SETTINGS \
- "kernel_name=Image\0" \
- "kernel_addr_r=" __stringify(VEXPRESS_KERNEL_ADDR) "\0" \
- "ramdisk_name=ramdisk.img\0" \
- "ramdisk_addr_r=" __stringify(VEXPRESS_RAMDISK_ADDR) "\0" \
- "fdtfile=devtree.dtb\0" \
- "fdt_addr_r=" __stringify(VEXPRESS_FDT_ADDR) "\0" \
- "boot_name=boot.img\0" \
- "boot_addr_r=" __stringify(VEXPRESS_BOOT_ADDR) "\0"
+#define VEXPRESS_KERNEL_ADDR 0x80080000
+#define VEXPRESS_PXEFILE_ADDR 0x8fb00000
+#define VEXPRESS_FDT_ADDR 0x8fc00000
+#define VEXPRESS_SCRIPT_ADDR 0x8fd00000
+#define VEXPRESS_RAMDISK_ADDR 0x8fe00000
+
+#define EXTRA_ENV_NAMES \
+ "kernel_name=norkern\0" \
+ "kernel_alt_name=Image\0" \
+ "ramdisk_name=ramdisk.img\0" \
+ "fdtfile=board.dtb\0" \
+ "fdt_alt_name=juno\0"
+
+#elif CONFIG_TARGET_VEXPRESS64_BASE_FVP /* ARMv8-A base model */
+
+#define VEXPRESS_KERNEL_ADDR 0x80080000
+#define VEXPRESS_PXEFILE_ADDR 0x8fa00000
+#define VEXPRESS_SCRIPT_ADDR 0x8fb00000
+#define VEXPRESS_FDT_ADDR 0x8fc00000
+#define VEXPRESS_BOOT_ADDR 0x8fd00000
+#define VEXPRESS_RAMDISK_ADDR 0x8fe00000
+
+#define EXTRA_ENV_NAMES \
+ "kernel_name=Image\0" \
+ "ramdisk_name=ramdisk.img\0" \
+ "fdtfile=devtree.dtb\0" \
+ "boot_name=boot.img\0" \
+ "boot_addr_r=" __stringify(VEXPRESS_BOOT_ADDR) "\0"
+
+#define BOOTENV
#endif
+/* Default load addresses and names for the different payloads. */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "kernel_addr_r=" __stringify(VEXPRESS_KERNEL_ADDR) "\0" \
+ "ramdisk_addr_r=" __stringify(VEXPRESS_RAMDISK_ADDR) "\0" \
+ "pxefile_addr_r=" __stringify(VEXPRESS_PXEFILE_ADDR) "\0" \
+ "fdt_addr_r=" __stringify(VEXPRESS_FDT_ADDR) "\0" \
+ "scriptaddr=" __stringify(VEXPRESS_SCRIPT_ADDR) "\0" \
+ EXTRA_ENV_NAMES \
+ BOOTENV
+
/* Monitor Command Prompt */
#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
#define CONFIG_SYS_MAXARGS 64 /* max command args */
--
2.25.1
More information about the U-Boot
mailing list