Convert CONFIG_BOOT_RETRY_TIME et al to Kconfig
authorTom Rini <trini@konsulko.com>
Fri, 11 Mar 2022 14:12:04 +0000 (09:12 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 18 Mar 2022 16:48:17 +0000 (12:48 -0400)
This converts the following to Kconfig:
   CONFIG_BOOT_RETRY_TIME
   CONFIG_BOOT_RETRY_MIN
   CONFIG_RESET_TO_RETRY

We also introduce CONFIG_BOOT_RETRY to gate these options, and clean up
the associated Makefile entry and C code for picking default values of
CONFIG_BOOT_RETRY_MIN.

Signed-off-by: Tom Rini <trini@konsulko.com>
30 files changed:
boot/Kconfig
boot/Makefile
boot/bootretry.c
configs/am335x_shc_defconfig
configs/am335x_shc_netboot_defconfig
configs/am335x_shc_sdboot_defconfig
configs/draco_defconfig
configs/eb_cpu5282_defconfig
configs/eb_cpu5282_internal_defconfig
configs/etamin_defconfig
configs/highbank_defconfig
configs/ids8313_defconfig
configs/octeontx2_95xx_defconfig
configs/octeontx2_96xx_defconfig
configs/octeontx_81xx_defconfig
configs/octeontx_83xx_defconfig
configs/pxm2_defconfig
configs/rastaban_defconfig
configs/rut_defconfig
configs/socfpga_secu1_defconfig
configs/thuban_defconfig
include/configs/am335x_shc.h
include/configs/eb_cpu5282.h
include/configs/highbank.h
include/configs/ids8313.h
include/configs/octeontx2_common.h
include/configs/octeontx_common.h
include/configs/siemens-am33x-common.h
include/configs/smartweb.h
include/configs/socfpga_arria5_secu1.h

index b83a4e8..a395529 100644 (file)
@@ -991,6 +991,36 @@ config AUTOBOOT_MENU_SHOW
          environmnent variable (if enabled) and before handling the boot delay.
          See README.bootmenu for more details.
 
+config BOOT_RETRY
+       bool "Boot retry feature"
+       help
+         Allow for having the U-Boot command prompt time out and attempt
+         to boot again.  If the environment variable "bootretry" is found then
+         its value is used, otherwise the retry timeout is
+         CONFIG_BOOT_RETRY_TIME.  CONFIG_BOOT_RETRY_MIN is optional and
+         defaults to CONFIG_BOOT_RETRY_TIME. All times are in seconds.
+
+config BOOT_RETRY_TIME
+       int "Timeout in seconds before attempting to boot again"
+       depends on BOOT_RETRY
+       help
+         Time in seconds before the U-Boot prompt will timeout and boot will
+         be attempted again.
+
+config BOOT_RETRY_MIN
+       int "Minimum timeout in seconds for 'bootretry'"
+       depends on BOOT_RETRY
+       default BOOT_RETRY_TIME
+       help
+         The minimum time in seconds that "bootretry" can be set to.
+
+config RESET_TO_RETRY
+       bool "Reset the board to retry autoboot"
+       depends on BOOT_RETRY
+       help
+         After the countdown timed out, the board will be reset to restart
+         again.
+
 endmenu
 
 config USE_BOOTARGS
index 2938c3f..75366c8 100644 (file)
@@ -5,11 +5,7 @@
 
 ifndef CONFIG_SPL_BUILD
 
-# This option is not just y/n - it can have a numeric value
-ifdef CONFIG_BOOT_RETRY_TIME
-obj-y += bootretry.o
-endif
-
+obj-$(CONFIG_BOOT_RETRY) += bootretry.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o bootm_os.o
 obj-$(CONFIG_CMD_BOOTZ) += bootm.o bootm_os.o
 obj-$(CONFIG_CMD_BOOTI) += bootm.o bootm_os.o
index dac891f..2bc9c68 100644 (file)
 #include <time.h>
 #include <watchdog.h>
 
-#ifndef CONFIG_BOOT_RETRY_MIN
-#define CONFIG_BOOT_RETRY_MIN CONFIG_BOOT_RETRY_TIME
-#endif
-
 static uint64_t endtime;  /* must be set, default is instant timeout */
 static int      retry_time = -1; /* -1 so can call readline before main_loop */
 
index 212c884..5953193 100644 (file)
@@ -23,6 +23,9 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter 'shc' to enter prompt (times out) %d \nEnter 'noautoboot' to enter prompt without timeout\n"
 CONFIG_AUTOBOOT_DELAY_STR="shc"
 CONFIG_AUTOBOOT_STOP_STR="noautoboot"
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=30
+CONFIG_RESET_TO_RETRY=y
 CONFIG_BOOTCOMMAND="if mmc dev 1; mmc rescan; then run emmc_setup; else echo ERROR: eMMC device not detected!; panic; fi; if run loaduimage; then run mmcboot; else echo ERROR Unable to load uImage from eMMC!; echo Performing Rollback!; setenv _active_ ${active_root}; setenv _inactive_ ${inactive_root}; setenv active_root ${_inactive_}; setenv inactive_root ${_active_}; saveenv; reset; fi; "
 CONFIG_DEFAULT_FDT_FILE="am335x-shc"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
index 2111495..37899df 100644 (file)
@@ -24,6 +24,9 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter 'shc' to enter prompt (times out) %d \nEnter 'noautoboot' to enter prompt without timeout\n"
 CONFIG_AUTOBOOT_DELAY_STR="shc"
 CONFIG_AUTOBOOT_STOP_STR="noautoboot"
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=30
+CONFIG_RESET_TO_RETRY=y
 CONFIG_BOOTCOMMAND="run fusecmd; if run netboot; then echo Booting from network; else echo ERROR: Cannot boot from network!; panic; fi; "
 CONFIG_DEFAULT_FDT_FILE="am335x-shc"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
index 771ff1b..c33c94f 100644 (file)
@@ -24,6 +24,9 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter 'shc' to enter prompt (times out) %d \nEnter 'noautoboot' to enter prompt without timeout\n"
 CONFIG_AUTOBOOT_DELAY_STR="shc"
 CONFIG_AUTOBOOT_STOP_STR="noautoboot"
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=30
+CONFIG_RESET_TO_RETRY=y
 CONFIG_BOOTCOMMAND="if mmc dev 0; mmc rescan; then run sd_setup; else echo ERROR: SD/MMC-Card not detected!; panic; fi; if run loaduimage; then echo Bootable SD/MMC-Card inserted, booting from it!; run mmcboot; else echo ERROR: Unable to load uImage from SD/MMC-Card!; panic; fi; "
 CONFIG_DEFAULT_FDT_FILE="am335x-shc"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
index d2186b0..096224f 100644 (file)
@@ -28,6 +28,9 @@ CONFIG_BOOTDELAY=3
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=60
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_PREBOOT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
index d93104e..8b725f8 100644 (file)
@@ -7,6 +7,9 @@ CONFIG_TARGET_EB_CPU5282=y
 CONFIG_SYS_LOAD_ADDR=0x20000
 CONFIG_SYS_EXTRA_OPTIONS="SYS_MONITOR_BASE=0xFF000400"
 CONFIG_BOOTDELAY=5
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=-1
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="printenv"
 # CONFIG_DISPLAY_BOARDINFO is not set
index f9a00b8..240bb00 100644 (file)
@@ -7,6 +7,9 @@ CONFIG_TARGET_EB_CPU5282=y
 CONFIG_SYS_LOAD_ADDR=0x20000
 CONFIG_SYS_EXTRA_OPTIONS="SYS_MONITOR_BASE=0xF0000418"
 CONFIG_BOOTDELAY=5
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=-1
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="printenv"
 # CONFIG_DISPLAY_BOARDINFO is not set
index 32800ec..8bb4ce0 100644 (file)
@@ -29,6 +29,9 @@ CONFIG_BOOTDELAY=3
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=60
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_PREBOOT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
index 61a25c2..f8cf18e 100644 (file)
@@ -17,6 +17,9 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds...\nPress <s> to stop or <d> to delay\n"
 CONFIG_AUTOBOOT_KEYED_CTRLC=y
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=-1
+CONFIG_RESET_TO_RETRY=y
 # CONFIG_USE_BOOTCOMMAND is not set
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
index 64e2a4c..ee7faf9 100644 (file)
@@ -127,6 +127,10 @@ CONFIG_BOOTDELAY=1
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter password - autoboot in %d seconds...\n"
 CONFIG_AUTOBOOT_DELAY_STR="ids"
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=900
+CONFIG_BOOT_RETRY_MIN=30
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run boot_cramfs"
 CONFIG_USE_PREBOOT=y
index 823e3e4..5860e73 100644 (file)
@@ -22,6 +22,10 @@ CONFIG_FIT_SIGNATURE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=5
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=-1
+CONFIG_BOOT_RETRY_MIN=30
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200n8 earlycon=pl011,0x87e028000000 maxcpus=6 rootwait rw root=/dev/mmcblk0p2 coherent_pool=16M"
 # CONFIG_DISPLAY_CPUINFO is not set
index 28c093e..0c91ce2 100644 (file)
@@ -22,6 +22,10 @@ CONFIG_FIT_SIGNATURE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=5
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=-1
+CONFIG_BOOT_RETRY_MIN=30
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200n8 earlycon=pl011,0x87e028000000 maxcpus=24 rootwait rw root=/dev/mmcblk0p2 coherent_pool=16M"
 # CONFIG_DISPLAY_CPUINFO is not set
index 5eab817..c421e2a 100644 (file)
@@ -23,6 +23,10 @@ CONFIG_FIT_SIGNATURE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=5
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=-1
+CONFIG_BOOT_RETRY_MIN=30
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200n8 earlycon=pl011,0x87e028000000 maxcpus=4 rootwait rw root=/dev/sda2 coherent_pool=16M"
 # CONFIG_DISPLAY_CPUINFO is not set
index 6ad0359..6069201 100644 (file)
@@ -21,6 +21,10 @@ CONFIG_FIT_SIGNATURE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=5
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=-1
+CONFIG_BOOT_RETRY_MIN=30
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200n8 earlycon=pl011,0x87e028000000 maxcpus=24 rootwait rw root=/dev/sda2 coherent_pool=16M"
 # CONFIG_DISPLAY_CPUINFO is not set
index e7ea416..5f71e26 100644 (file)
@@ -27,6 +27,9 @@ CONFIG_BOOTDELAY=3
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=60
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_PREBOOT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_CPUINFO is not set
index 9820088..240304e 100644 (file)
@@ -28,6 +28,9 @@ CONFIG_BOOTDELAY=3
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=60
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_PREBOOT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
index 1f110da..c3f8dd4 100644 (file)
@@ -27,6 +27,9 @@ CONFIG_BOOTDELAY=3
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=60
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_PREBOOT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_CPUINFO is not set
index e71b1e1..e5fc9ed 100644 (file)
@@ -17,6 +17,9 @@ CONFIG_BUILD_TARGET="u-boot-with-nand-spl.sfp"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_LOAD_ADDR=0x02000000
 CONFIG_FIT=y
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=45
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 ubi.fm_autoconvert=1 uio_pdrv_genirq.of_id=\"idq,regbank\""
 CONFIG_BOOTCOMMAND="setenv bootcmd 'bridge enable; if test ${bootnum} = 'b'; then run _fpga_loadsafe; else if test ${bootcount} -eq 4; then echo 'Switching copy...'; setexpr x $bootnum % 2 && setexpr bootnum $x + 1; saveenv; fi; run _fpga_loaduser; fi;echo 'Booting bank $bootnum' && run userload && run userboot;' && setenv altbootcmd 'setenv bootnum b && saveenv && boot;' && saveenv && saveenv && boot;"
index b48575d..4e22290 100644 (file)
@@ -28,6 +28,9 @@ CONFIG_BOOTDELAY=3
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
+CONFIG_BOOT_RETRY=y
+CONFIG_BOOT_RETRY_TIME=60
+CONFIG_RESET_TO_RETRY=y
 CONFIG_USE_PREBOOT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
index 7789c1c..62d64ff 100644 (file)
 
 #define CONFIG_HSMMC2_8BIT
 
-#ifndef CONFIG_SHC_ICT
-/*
- * In builds other than ICT, reset to retry after timeout
- * Define a timeout after which a stopped bootloader continues autoboot
- * (only works with CONFIG_RESET_TO_RETRY)
- */
-# define CONFIG_BOOT_RETRY_TIME 30
-# define CONFIG_RESET_TO_RETRY
-#endif
-
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "loadaddr=0x80200000\0" \
index d983cb7..57ae33e 100644 (file)
@@ -22,9 +22,6 @@
  * Options                                                             *
  *----------------------------------------------------------------------*/
 
-#define CONFIG_BOOT_RETRY_TIME -1
-#define CONFIG_RESET_TO_RETRY
-
 #define STATUS_LED_ACTIVE              0
 
 /*----------------------------------------------------------------------*
index 55c874b..0ff70fd 100644 (file)
@@ -16,9 +16,6 @@
 
 #define CONFIG_SYS_BOOTCOUNT_LE                /* Use little-endian accessors */
 
-#define CONFIG_BOOT_RETRY_TIME         -1
-#define CONFIG_RESET_TO_RETRY
-
 /*
  * Miscellaneous configurable options
  */
index 08b9ec7..48d2efb 100644 (file)
@@ -16,9 +16,6 @@
 /*
  * High Level Configuration Options
  */
-#define CONFIG_BOOT_RETRY_TIME         900
-#define CONFIG_BOOT_RETRY_MIN          30
-#define CONFIG_RESET_TO_RETRY
 
 #define CONFIG_SYS_SICRH       0x00000000
 #define CONFIG_SYS_SICRL       (SICRL_LBC | SICRL_SPI_D)
index 494f58b..6ec2d3e 100644 (file)
 /** Stack starting address */
 #define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_SDRAM_BASE + 0xffff0)
 
-/* Autoboot options */
-#define CONFIG_RESET_TO_RETRY
-#define CONFIG_BOOT_RETRY_TIME         -1
-#define CONFIG_BOOT_RETRY_MIN          30
-
 /** Extra environment settings */
 #define CONFIG_EXTRA_ENV_SETTINGS      \
                                        "loadaddr=20080000\0"   \
index 3ad6a59..bcf8b41 100644 (file)
 
 /** Heap size for U-Boot */
 
-/* Autoboot options */
-#define CONFIG_RESET_TO_RETRY
-#define CONFIG_BOOT_RETRY_TIME         -1
-#define CONFIG_BOOT_RETRY_MIN          30
-
 /* AHCI support Definitions */
 #ifdef CONFIG_DM_SCSI
 /** Enable 48-bit SATA addressing */
index 6235ad2..c3a04c2 100644 (file)
 #endif
 #endif
 
-/* Reboot after 60 sec if bootcmd fails */
-#define CONFIG_RESET_TO_RETRY
-#define CONFIG_BOOT_RETRY_TIME 60
-
 #endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */
index 7aa6c40..8fb29b0 100644 (file)
@@ -46,7 +46,6 @@
 
 /* setting board specific options */
 #define CONFIG_SYS_AUTOLOAD "yes"
-#define CONFIG_RESET_TO_RETRY
 
 /* The LED PINs */
 #define CONFIG_RED_LED                 AT91_PIN_PA9
index 5caffa6..88fd8ae 100644 (file)
 /* Environment settings */
 
 /*
- * Autoboot
- *
- * After 45s of inactivity in the prompt, the board will reset.
- * Set 'bootretry' in the environment to -1 to disable this behavior
- */
-#define CONFIG_BOOT_RETRY_TIME 45
-#define CONFIG_RESET_TO_RETRY
-
-/*
  * FPGA Remote Update related environment
  *
  * Note that since those commands access the FPGA, the HPS-to-FPGA