]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: total_compute: move the boot command to an env file
authorBoyan Karatotev <boyan.karatotev@arm.com>
Fri, 25 Oct 2024 17:18:17 +0000 (18:18 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 4 Nov 2024 20:50:43 +0000 (14:50 -0600)
The boot command for Total Compute has many aspects and changes from time
to time. So move it to an .env file where it can be a proper script.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
board/armltd/total_compute/total_compute.env [new file with mode: 0644]
configs/total_compute_defconfig
include/configs/total_compute.h

diff --git a/board/armltd/total_compute/total_compute.env b/board/armltd/total_compute/total_compute.env
new file mode 100644 (file)
index 0000000..8975a86
--- /dev/null
@@ -0,0 +1,28 @@
+/* DRAM1 + 0x2000_0000 */
+load_addr=0xa0000000
+/* DRAM1 + 0x0800_0000 */
+initrd_addr_r=0x88000000
+
+bootcmd=
+    if part number mmc 0 vbmeta is_avb; then
+        echo 'MMC with vbmeta partition detected.';
+        echo 'Starting Android Verified boot...';
+        avb init 0;
+        if avb verify; then
+            set bootargs $bootargs $avb_bootargs;
+            part start mmc 0 boot boot_start;
+            part size mmc 0 boot boot_size;
+            mmc read ${load_addr} ${boot_start} ${boot_size};
+            bootm ${load_addr} ${load_addr} ${fdt_addr_r};
+        else;
+            echo 'AVB verification failed.';
+            exit;
+        fi;
+    elif part number mmc 0 system is_non_avb_android; then
+        echo 'Booting Android non-AVB...';
+        booti ${kernel_addr_r} ${initrd_addr_r} ${fdt_addr_r};
+    elif iminfo ${load_addr}; then
+        echo 'Booting FIT image...';
+        bootm ${load_addr} ${load_addr} ${fdt_addr_r};
+    fi;
+    echo 'ERROR: No valid image to boot the system. Aborting boot sequence.';
index 5f21d2e367ac61ea5660f5ed9a39c2768cf30889..291083d8b6641123109579b12f3c3ca43928201c 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_FIT_SIGNATURE=y
 CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=5
-CONFIG_BOOTCOMMAND="if part number mmc 0 vbmeta is_avb; then  echo MMC with vbmeta partition detected.;  echo starting Android Verified boot.;  avb init 0;   if avb verify; then     set bootargs $bootargs $avb_bootargs;     part start mmc 0 boot boot_start;     part size mmc 0 boot boot_size;     mmc read ${load_addr} ${boot_start} ${boot_size};     bootm ${load_addr} ${load_addr} ${fdt_addr_r};   else;     echo AVB verification failed.;     exit;   fi; elif part number mmc 0 system is_non_avb_android; then   booti ${kernel_addr_r} ${initrd_addr_r} ${fdt_addr_r};else;  echo Booting FIT image.;  bootm ${load_addr} ${load_addr} ${fdt_addr_r}; fi;"
 CONFIG_SYS_CBSIZE=512
 CONFIG_SYS_PBSIZE=544
 # CONFIG_DISPLAY_CPUINFO is not set
@@ -60,3 +59,4 @@ CONFIG_SYS_FLASH_CFI=y
 CONFIG_SYS_MAX_FLASH_SECT=256
 # CONFIG_RANDOM_UUID is not set
 CONFIG_LIBAVB=y
+CONFIG_ENV_SOURCE_FILE=total_compute
index 4c966ce4bf64ffae5c9e88e4aabcb6da42bf3d06..5cc0166f19e5e8d046301e61a676e09a9d72cdcc 100644 (file)
 
 /* Link Definitions */
 
-#define CFG_EXTRA_ENV_SETTINGS \
-                               "load_addr=0xa0000000\0"        \
-                               "initrd_addr_r=0x88000000\0"
-/*
- * If vbmeta partition is present, boot Android with verification using AVB.
- * Else if system partition is present (no vbmeta partition), boot Android
- * without verification (for development purposes).
- * Else boot FIT image.
- */
-
 #define CFG_SYS_FLASH_BASE             0x0C000000
 
 #endif /* __TOTAL_COMPUTE_H */