From 9f53146f396d9def8013e29e105729c1f42ae037 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 20 Jul 2019 20:51:12 -0600 Subject: Convert CONFIG_SHOW_BOOT_PROGRESS to Kconfig This converts the following to Kconfig: CONFIG_SHOW_BOOT_PROGRESS Signed-off-by: Simon Glass --- scripts/config_whitelist.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 85f75a48bf5..d06e2d2c23c 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1620,7 +1620,6 @@ CONFIG_SHARP_LQ035Q7DH06 CONFIG_SHEEVA_88SV131 CONFIG_SHEEVA_88SV331xV5 CONFIG_SHOW_ACTIVITY -CONFIG_SHOW_BOOT_PROGRESS CONFIG_SH_CMT_CLK_FREQ CONFIG_SH_DSP CONFIG_SH_ETHER_ALIGNE_SIZE -- cgit v1.3.1 From 2452bb7636beb5eeae29185518a899349289c609 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 20 Jul 2019 20:51:20 -0600 Subject: autoboot: Drop unused CONFIG_MENUPROMPT This is not defined by any board. We could use CONFIG_AUTOBOOT_PROMPT instead perhaps, but this depends on CONFIG_AUTOBOOT_KEYED which is not used for the single-key case. So let's just remove CONFIG_MENUPROMPT. Signed-off-by: Simon Glass --- common/autoboot.c | 4 ---- scripts/config_whitelist.txt | 1 - 2 files changed, 5 deletions(-) (limited to 'scripts') diff --git a/common/autoboot.c b/common/autoboot.c index 012dd5797e1..a6071ab8391 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -233,11 +233,7 @@ static int abortboot_single_key(int bootdelay) int abort = 0; unsigned long ts; -#ifdef CONFIG_MENUPROMPT - printf(CONFIG_MENUPROMPT); -#else printf("Hit any key to stop autoboot: %2d ", bootdelay); -#endif /* * Check if key already pressed diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index d06e2d2c23c..28494411feb 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1141,7 +1141,6 @@ CONFIG_MEM_HOLE_16M CONFIG_MEM_INIT_VALUE CONFIG_MEM_REMAP CONFIG_MENUKEY -CONFIG_MENUPROMPT CONFIG_MENU_SHOW CONFIG_MFG_ENV_SETTINGS CONFIG_MIIM_ADDRESS -- cgit v1.3.1 From 8fc31e23aa83dfe9a01bec5738ccbed7d4ad442e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 20 Jul 2019 20:51:21 -0600 Subject: 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 --- cmd/Kconfig | 17 +++++++++++++++++ common/autoboot.c | 10 +++++----- configs/socfpga_vining_fpga_defconfig | 2 +- doc/README.autoboot | 8 ++++++++ include/autoboot.h | 2 +- scripts/config_whitelist.txt | 1 - 6 files changed, 32 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/cmd/Kconfig b/cmd/Kconfig index 2cbfc0f87ec..8d2e0a9e4ec 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 a6071ab8391..ad189a8ba28 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 1a9323f822e..9e86a237043 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 de35f3093df..5e9a5e1cf7f 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 3ebd6f90e3c..ac8157e5704 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 28494411feb..3de5021e8fe 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 -- cgit v1.3.1 From e231306e48870b7138d5ff161e16e0d53b325314 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 20 Jul 2019 20:51:24 -0600 Subject: autoboot: Rename CONFIG_MENU_SHOW to include AUTOBOOT Rename this option to CONFIG_AUTOBOOT_MENU_SHOW this it relates to the autoboot functionality. Signed-off-by: Simon Glass --- cmd/bootmenu.c | 2 +- common/autoboot.c | 2 +- doc/README.bootmenu | 2 +- doc/README.menu | 2 +- include/configs/nokia_rx51.h | 2 +- include/configs/vexpress_aemv8a.h | 2 +- include/menu.h | 2 +- scripts/config_whitelist.txt | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 7f88c1ed632..0ae9d5a6815 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -472,7 +472,7 @@ void menu_display_statusline(struct menu *m) puts(ANSI_CLEAR_LINE); } -#ifdef CONFIG_MENU_SHOW +#ifdef CONFIG_AUTOBOOT_MENU_SHOW int menu_show(int bootdelay) { bootmenu_show(bootdelay); diff --git a/common/autoboot.c b/common/autoboot.c index 9752470873c..a38527ff96f 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -324,7 +324,7 @@ const char *bootdelay_process(void) debug("### main_loop entered: bootdelay=%d\n\n", bootdelay); -#if defined(CONFIG_MENU_SHOW) +#if defined(CONFIG_AUTOBOOT_MENU_SHOW) bootdelay = menu_show(bootdelay); #endif bootretry_init_cmd_timeout(); diff --git a/doc/README.bootmenu b/doc/README.bootmenu index 34ff8d5ecc9..ca5099089e7 100644 --- a/doc/README.bootmenu +++ b/doc/README.bootmenu @@ -91,7 +91,7 @@ To run the bootmenu at startup add these additional definitions: #define CONFIG_AUTOBOOT_KEYED #define CONFIG_BOOTDELAY 30 - #define CONFIG_MENU_SHOW + #define CONFIG_AUTOBOOT_MENU_SHOW When you intend to use the bootmenu on color frame buffer console, make sure to additionally define CONFIG_CFB_CONSOLE_ANSI in the diff --git a/doc/README.menu b/doc/README.menu index 450c6a83a77..0f3d7416055 100644 --- a/doc/README.menu +++ b/doc/README.menu @@ -14,7 +14,7 @@ Menus are composed of items. Each item has a key used to identify it in the menu, and an opaque pointer to data controlled by the consumer. If you want to show a menu, instead starting the shell, define -CONFIG_MENU_SHOW. You have to code the int menu_show(int bootdelay) +CONFIG_AUTOBOOT_MENU_SHOW. You have to code the int menu_show(int bootdelay) function, which handle your menu. This function returns the remaining bootdelay. diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index f47d088303b..b251061e305 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -270,7 +270,7 @@ int rx51_kp_getc(struct stdio_dev *sdev); "run attachboot;" \ "echo" -#define CONFIG_MENU_SHOW +#define CONFIG_AUTOBOOT_MENU_SHOW /* * Miscellaneous configurable options diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h index 2354f4e958d..2b1269de837 100644 --- a/include/configs/vexpress_aemv8a.h +++ b/include/configs/vexpress_aemv8a.h @@ -110,7 +110,7 @@ #define CONFIG_PL011_CLOCK 24000000 #endif -/*#define CONFIG_MENU_SHOW*/ +/*#define CONFIG_AUTOBOOT_MENU_SHOW*/ /* BOOTP options */ #define CONFIG_BOOTP_BOOTFILESIZE diff --git a/include/menu.h b/include/menu.h index fbff429c895..8fd7b0a1f02 100644 --- a/include/menu.h +++ b/include/menu.h @@ -19,7 +19,7 @@ int menu_destroy(struct menu *m); void menu_display_statusline(struct menu *m); int menu_default_choice(struct menu *m, void **choice); -#if defined(CONFIG_MENU_SHOW) +#if defined(CONFIG_AUTOBOOT_MENU_SHOW) int menu_show(int bootdelay); #endif #endif /* __MENU_H__ */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 3de5021e8fe..53db749a65c 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -96,6 +96,7 @@ CONFIG_ATMEL_LEGACY CONFIG_ATMEL_MCI_8BIT CONFIG_ATMEL_SPI0 CONFIG_AT_TRANS +CONFIG_AUTOBOOT_MENU_SHOW CONFIG_AUTO_ZRELADDR CONFIG_BACKSIDE_L2_CACHE CONFIG_BAT_PAIR @@ -1140,7 +1141,6 @@ CONFIG_MEMSIZE_MASK CONFIG_MEM_HOLE_16M CONFIG_MEM_INIT_VALUE CONFIG_MEM_REMAP -CONFIG_MENU_SHOW CONFIG_MFG_ENV_SETTINGS CONFIG_MIIM_ADDRESS CONFIG_MII_DEFAULT_TSEC -- cgit v1.3.1