Convert CONFIG_BOOT_RETRY_TIME et al to Kconfig

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>
This commit is contained in:
Tom Rini 2022-03-11 09:12:04 -05:00
parent 0b5870c3f5
commit 69c8a817cf
30 changed files with 90 additions and 52 deletions

View 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

View 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

View File

@ -12,10 +12,6 @@
#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 */

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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;"

View 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

View File

@ -24,16 +24,6 @@
#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" \

View File

@ -22,9 +22,6 @@
* Options *
*----------------------------------------------------------------------*/
#define CONFIG_BOOT_RETRY_TIME -1
#define CONFIG_RESET_TO_RETRY
#define STATUS_LED_ACTIVE 0
/*----------------------------------------------------------------------*

View 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
*/

View 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)

View File

@ -16,11 +16,6 @@
/** 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" \

View File

@ -45,11 +45,6 @@
/** 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 */

View File

@ -412,8 +412,4 @@
#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 */

View 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

View File

@ -28,15 +28,6 @@
/* 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
*