1 // SPDX-License-Identifier: GPL-2.0+
2 #ifdef CONFIG_SYS_BOOT_LOCKED
3 #define SETUP_BOOT_MENU setup_boot_menu=setenv bootmenu_0 eMMC=run bootcmd
5 #define SETUP_BOOT_MENU setup_boot_menu= \
6 if test "${mmcdev}" = 1; then \
7 setenv emmc_priority 0; \
8 setenv sd_priority 1; \
9 else setenv emmc_priority 1; \
10 setenv sd_priority 0; \
12 setenv bootmenu_${emmc_priority} eMMC=run boot_emmc; \
13 setenv bootmenu_${sd_priority} SD=run boot_sd;
17 echo Performing rollback...;
18 if test "${mmcpart_committed}" = 1; then
20 setenv mmcpart_committed 2;
23 setenv mmcpart_committed 1;
26 setenv upgrade_available;
30 boot_emmc=setenv mmcdev_wanted 1; run persist_mmcdev; run bootcmd;
31 boot_sd=setenv mmcdev_wanted 0; run persist_mmcdev; run bootcmd;
33 if test "${bootcount}" -gt "${bootlimit}"; then
36 if test "${ustate}" = 1; then
37 setenv upgrade_available 1;
46 if test "${ustate}" = 1 -a "${mmcpart}" != "${mmcpart_committed}"; then
47 setenv mmcpart_committed ${mmcpart};
51 loadbootpart=mmc partconf 1 boot_part
52 loadimage=load mmc ${mmcdev}:${gpt_partition_entry}
53 loadpart=gpt setenv mmc ${mmcdev} rootfs-${mmcpart_committed}
55 setenv bootargs console=${console},${baudrate} root=/dev/mmcblk${mmcdev}p${gpt_partition_entry} rootwait rw SM_ROOT_DEV=${mmcdev} SM_ROOT_PART=${gpt_partition_entry} SM_BOOT_PART=${boot_part}
58 echo mmcdev: ${mmcdev};
60 echo mmcpart: ${mmcpart_committed};
62 echo gptpart: ${gpt_partition_entry};
64 if run loadimage; then
69 #ifdef CONFIG_SYS_BOOT_LOCKED
70 hab_auth_img_or_fail ${fileaddr} ${filesize};
72 hab_auth_img ${fileaddr} ${filesize};
84 if test "${mmcdev}" != "${mmcdev_wanted}"; then
85 setenv mmcdev "${mmcdev_wanted}";
89 if test "${mmcdev}" = 1; then
90 setenv emmc_priority 0;
93 setenv emmc_priority 1;
96 setenv bootmenu_${emmc_priority} eMMC=run boot_emmc;
97 setenv bootmenu_${sd_priority} SD=run boot_sd;