aboutsummaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/Kconfig30
-rw-r--r--boot/Makefile6
-rw-r--r--boot/bootretry.c4
3 files changed, 31 insertions, 9 deletions
diff --git a/boot/Kconfig b/boot/Kconfig
index b83a4e8..a395529 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -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
diff --git a/boot/Makefile b/boot/Makefile
index 2938c3f..75366c8 100644
--- a/boot/Makefile
+++ b/boot/Makefile
@@ -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
diff --git a/boot/bootretry.c b/boot/bootretry.c
index dac891f..2bc9c68 100644
--- a/boot/bootretry.c
+++ b/boot/bootretry.c
@@ -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 */