aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-20 20:51:21 -0600
committerTom Rini <trini@konsulko.com>2019-08-02 11:19:14 -0400
commit8fc31e23aa83dfe9a01bec5738ccbed7d4ad442e (patch)
tree50379cccc118437797e13565a9899591c726d687
parent2452bb7636beb5eeae29185518a899349289c609 (diff)
downloadu-boot-8fc31e23aa83dfe9a01bec5738ccbed7d4ad442e.zip
u-boot-8fc31e23aa83dfe9a01bec5738ccbed7d4ad442e.tar.gz
u-boot-8fc31e23aa83dfe9a01bec5738ccbed7d4ad442e.tar.bz2
autoboot: Rename CONFIG_MENUKEY to CONFIG_AUTOBOOT_MENUKEY
Since this is part of the autoboot functionality, it makes sense to name it with an AUTOBOOT prefix. No mainline boards use it so this should be safe, and downstream boards will need to adjust. Since this option is just an integer value, it really needs another option to control whether the feature is enabled or not. Add a new CONFIG_USE_AUTOBOOT_MENUKEY for that. This fits better with how things are done with Kconfig, avoiding the need to use a specific value to disable the feature. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--cmd/Kconfig17
-rw-r--r--common/autoboot.c10
-rw-r--r--configs/socfpga_vining_fpga_defconfig2
-rw-r--r--doc/README.autoboot8
-rw-r--r--include/autoboot.h2
-rw-r--r--scripts/config_whitelist.txt1
6 files changed, 32 insertions, 8 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 2cbfc0f..8d2e0a9 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -153,6 +153,23 @@ config AUTOBOOT_STOP_STR_SHA256
string / password matches a values that is encypted via
a SHA256 hash and saved in the environment.
+config AUTOBOOT_USE_MENUKEY
+ bool "Allow a specify key to run a menu from the environment"
+ depends on !AUTOBOOT_KEYED
+ help
+ If a specific key is pressed to stop autoboot, then the commands in
+ the environment variable 'menucmd' are executed before boot starts.
+
+config AUTOBOOT_MENUKEY
+ int "ASCII value of boot key to show a menu"
+ default 0
+ depends on AUTOBOOT_USE_MENUKEY
+ help
+ If this key is pressed to stop autoboot, then the commands in the
+ environment variable 'menucmd' will be executed before boot starts.
+ For example, 33 means "!" in ASCII, so pressing ! at boot would take
+ this action.
+
endmenu
config BUILD_BIN2C
diff --git a/common/autoboot.c b/common/autoboot.c
index a6071ab..ad189a8 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -224,7 +224,7 @@ static int abortboot_key_sequence(int bootdelay)
return abort;
}
-#ifdef CONFIG_MENUKEY
+#ifdef CONFIG_USE_AUTOBOOT_MENUKEY
static int menukey;
#endif
@@ -252,7 +252,7 @@ static int abortboot_single_key(int bootdelay)
if (tstc()) { /* we got a key press */
abort = 1; /* don't auto boot */
bootdelay = 0; /* no more delay */
-# ifdef CONFIG_MENUKEY
+# ifdef CONFIG_USE_AUTOBOOT_MENUKEY
menukey = getc();
# else
(void) getc(); /* consume input */
@@ -358,11 +358,11 @@ void autoboot_command(const char *s)
#endif
}
-#ifdef CONFIG_MENUKEY
- if (menukey == CONFIG_MENUKEY) {
+#ifdef CONFIG_USE_AUTOBOOT_MENUKEY
+ if (menukey == CONFIG_AUTOBOOT_MENUKEY) {
s = env_get("menucmd");
if (s)
run_command_list(s, -1, 0);
}
-#endif /* CONFIG_MENUKEY */
+#endif /* CONFIG_USE_AUTOBOOT_MENUKEY */
}
diff --git a/configs/socfpga_vining_fpga_defconfig b/configs/socfpga_vining_fpga_defconfig
index 1a9323f..9e86a23 100644
--- a/configs/socfpga_vining_fpga_defconfig
+++ b/configs/socfpga_vining_fpga_defconfig
@@ -8,7 +8,7 @@ CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="console=ttyS0,115200"
# CONFIG_USE_BOOTCOMMAND is not set
CONFIG_USE_PREBOOT=y
-CONFIG_PREBOOT="setenv hostname vining-${unit_serial} ; setenv PS1 "${unit_ident} (${unit_serial}) => " ; if gpio input 78 ; then setenv bootdelay 10 ; setenv boottype rcvr ; else setenv bootdelay 5 ; setenv boottype norm ; fi"
+CONFIG_PREBOOT="setenv hostname vining-${unit_serial} ; setenv PS1 \"${unit_ident} (${unit_serial}) => \" ; if gpio input 78 ; then setenv bootdelay 10 ; setenv boottype rcvr ; else setenv bootdelay 5 ; setenv boottype norm ; fi"
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
diff --git a/doc/README.autoboot b/doc/README.autoboot
index de35f30..5e9a5e1 100644
--- a/doc/README.autoboot
+++ b/doc/README.autoboot
@@ -152,3 +152,11 @@ What they do
(Only effective when CONFIG_BOOT_RETRY_TIME is also set)
After the countdown timed out, the board will be reset to restart
again.
+
+ CONFIG_AUTOBOOT_USE_MENUKEY
+ CONFIG_AUTOBOOT_MENUKEY
+
+ If this key is pressed to stop autoboot, then the commands in the
+ environment variable 'menucmd' will be executed before boot starts.
+ For example, 33 means "!" in ASCII, so pressing ! at boot would take
+ this action.
diff --git a/include/autoboot.h b/include/autoboot.h
index 3ebd6f9..ac8157e 100644
--- a/include/autoboot.h
+++ b/include/autoboot.h
@@ -27,7 +27,7 @@ const char *bootdelay_process(void);
* autoboot_command() - run the autoboot command
*
* If enabled, run the autoboot command returned from bootdelay_process().
- * Also do the CONFIG_MENUKEY processing if enabled.
+ * Also do the CONFIG_AUTOBOOT_MENUKEY processing if enabled.
*
* @cmd: Command to run
*/
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 2849441..3de5021 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1140,7 +1140,6 @@ CONFIG_MEMSIZE_MASK
CONFIG_MEM_HOLE_16M
CONFIG_MEM_INIT_VALUE
CONFIG_MEM_REMAP
-CONFIG_MENUKEY
CONFIG_MENU_SHOW
CONFIG_MFG_ENV_SETTINGS
CONFIG_MIIM_ADDRESS