]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
vexpress64: config header: unify environment definition
authorAndre Przywara <andre.przywara@arm.com>
Fri, 4 Mar 2022 16:30:12 +0000 (16:30 +0000)
committerTom Rini <trini@konsulko.com>
Fri, 1 Apr 2022 18:56:26 +0000 (14:56 -0400)
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@arm.com>
include/configs/vexpress_aemv8.h

index b956bd9147800568d0ea96f615fbd8ae8fbe0584..f8731aad97dc50b3b658e4ac69dc041a84828226 100644 (file)
@@ -99,8 +99,6 @@
 #define CONFIG_PL011_CLOCK             24000000
 #endif
 
-/* Miscellaneous configurable options */
-
 /* Physical Memory Map */
 #define PHYS_SDRAM_1                   (V2M_BASE)      /* SDRAM Bank #1 */
 /* Top 16MB reserved for secure world use */
 #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} ;"\
                "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)             \
 
 #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 */