summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/Kconfig9
-rw-r--r--common/stdio.c6
-rw-r--r--common/usb_kbd.c2
-rw-r--r--configs/MPC8610HPCD_defconfig1
-rw-r--r--configs/MPC8641HPCN_36BIT_defconfig1
-rw-r--r--configs/MPC8641HPCN_defconfig1
-rw-r--r--configs/apalis_t30_defconfig1
-rw-r--r--configs/at91rm9200ek_defconfig1
-rw-r--r--configs/at91rm9200ek_ram_defconfig1
-rw-r--r--configs/beaver_defconfig1
-rw-r--r--configs/cardhu_defconfig1
-rw-r--r--configs/cei-tk1-som_defconfig1
-rw-r--r--configs/cgtqmx6eval_defconfig1
-rw-r--r--configs/colibri_t20_defconfig1
-rw-r--r--configs/colibri_t30_defconfig1
-rw-r--r--configs/dalmore_defconfig1
-rw-r--r--configs/dms-ba16-1g_defconfig1
-rw-r--r--configs/dms-ba16_defconfig1
-rw-r--r--configs/e2220-1170_defconfig1
-rw-r--r--configs/gwventana_defconfig1
-rw-r--r--configs/harmony_defconfig1
-rw-r--r--configs/jetson-tk1_defconfig1
-rw-r--r--configs/medcom-wide_defconfig1
-rw-r--r--configs/mx6cuboxi_defconfig1
-rw-r--r--configs/mx6qsabrelite_defconfig1
-rw-r--r--configs/nitrogen6dl2g_defconfig1
-rw-r--r--configs/nitrogen6dl_defconfig1
-rw-r--r--configs/nitrogen6q2g_defconfig1
-rw-r--r--configs/nitrogen6q_defconfig1
-rw-r--r--configs/nitrogen6s1g_defconfig1
-rw-r--r--configs/nitrogen6s_defconfig1
-rw-r--r--configs/nyan-big_defconfig1
-rw-r--r--configs/p2371-0000_defconfig1
-rw-r--r--configs/p2371-2180_defconfig1
-rw-r--r--configs/p2571_defconfig1
-rw-r--r--configs/p2771-0000-000_defconfig1
-rw-r--r--configs/p2771-0000-500_defconfig1
-rw-r--r--configs/paz00_defconfig1
-rw-r--r--configs/plutux_defconfig1
-rw-r--r--configs/smdk2410_defconfig1
-rw-r--r--configs/tec-ng_defconfig1
-rw-r--r--configs/tec_defconfig1
-rw-r--r--configs/trimslice_defconfig1
-rw-r--r--configs/venice2_defconfig1
-rw-r--r--configs/whistler_defconfig1
-rw-r--r--drivers/serial/serial-uclass.c2
-rw-r--r--include/configs/MIP405.h1
-rw-r--r--include/configs/MPC8610HPCD.h1
-rw-r--r--include/configs/MPC8641HPCN.h1
-rw-r--r--include/configs/PIP405.h1
-rw-r--r--include/configs/VCMA9.h1
-rw-r--r--include/configs/cm_fx6.h1
-rw-r--r--include/configs/cyrus.h1
-rw-r--r--include/configs/gr_ep2s60.h1
-rw-r--r--include/configs/novena.h1
-rw-r--r--include/configs/rpi.h1
-rw-r--r--include/configs/sandbox.h2
-rw-r--r--include/configs/sunxi-common.h1
-rw-r--r--include/configs/tbs2910.h1
-rw-r--r--include/configs/tegra-common.h4
-rw-r--r--include/configs/x86-common.h2
-rw-r--r--include/stdio_dev.h2
-rw-r--r--scripts/config_whitelist.txt1
63 files changed, 57 insertions, 27 deletions
diff --git a/common/Kconfig b/common/Kconfig
index ff2b1a400bd..dbe5bb619ba 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -335,6 +335,15 @@ config SYS_CONSOLE_INFO_QUIET
Enable this option to supress this output. It can be obtained by
calling stdio_print_current_devices() from board code.
+config SYS_STDIO_DEREGISTER
+ bool "Allow deregistering stdio devices"
+ default y if USB_KEYBOARD
+ help
+ Generally there is no need to deregister stdio devices since they
+ are never deactivated. But if a stdio device is used which can be
+ removed (for example a USB keyboard) then this option can be
+ enabled to ensure this is handled correctly.
+
endmenu
config SYS_NO_FLASH
diff --git a/common/stdio.c b/common/stdio.c
index ab9b05df48a..8e4a9beef45 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -37,7 +37,7 @@ char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
#define CONFIG_SYS_DEVICE_NULLDEV 1
#endif
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
#define CONFIG_SYS_DEVICE_NULLDEV 1
#endif
@@ -245,7 +245,7 @@ int stdio_register(struct stdio_dev *dev)
/* deregister the device "devname".
* returns 0 if success, -1 if device is assigned and 1 if devname not found
*/
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
int stdio_deregister_dev(struct stdio_dev *dev, int force)
{
int l;
@@ -292,7 +292,7 @@ int stdio_deregister(const char *devname, int force)
return stdio_deregister_dev(dev, force);
}
-#endif /* CONFIG_SYS_STDIO_DEREGISTER */
+#endif /* CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) */
int stdio_init_tables(void)
{
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index a9872a6b5ac..5f9a64ad1c5 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -570,7 +570,7 @@ int drv_usb_kbd_init(void)
/* Deregister the keyboard. */
int usb_kbd_deregister(int force)
{
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
struct stdio_dev *dev;
struct usb_device *usb_kbd_dev;
struct usb_kbd_pdata *data;
diff --git a/configs/MPC8610HPCD_defconfig b/configs/MPC8610HPCD_defconfig
index ca8cb95d8cd..b4e053a34d2 100644
--- a/configs/MPC8610HPCD_defconfig
+++ b/configs/MPC8610HPCD_defconfig
@@ -6,6 +6,7 @@ CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
CONFIG_BOOTDELAY=10
# CONFIG_CONSOLE_MUX is not set
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
diff --git a/configs/MPC8641HPCN_36BIT_defconfig b/configs/MPC8641HPCN_36BIT_defconfig
index 6f8d8f5c859..8ffa5e955ea 100644
--- a/configs/MPC8641HPCN_36BIT_defconfig
+++ b/configs/MPC8641HPCN_36BIT_defconfig
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
CONFIG_BOOTDELAY=10
# CONFIG_CONSOLE_MUX is not set
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
diff --git a/configs/MPC8641HPCN_defconfig b/configs/MPC8641HPCN_defconfig
index 16163fcebe8..6f9bf01602e 100644
--- a/configs/MPC8641HPCN_defconfig
+++ b/configs/MPC8641HPCN_defconfig
@@ -6,6 +6,7 @@ CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
CONFIG_BOOTDELAY=10
# CONFIG_CONSOLE_MUX is not set
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
diff --git a/configs/apalis_t30_defconfig b/configs/apalis_t30_defconfig
index 41c1f522e26..4a1a67e1b05 100644
--- a/configs/apalis_t30_defconfig
+++ b/configs/apalis_t30_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_APALIS_T30=y
CONFIG_DEFAULT_DEVICE_TREE="tegra30-apalis"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Apalis T30 # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/at91rm9200ek_defconfig b/configs/at91rm9200ek_defconfig
index b6db8c41901..291fb0d9b35 100644
--- a/configs/at91rm9200ek_defconfig
+++ b/configs/at91rm9200ek_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
CONFIG_ARCH_AT91=y
CONFIG_TARGET_AT91RM9200EK=y
CONFIG_BOOTDELAY=3
+# CONFIG_SYS_STDIO_DEREGISTER is not set
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_HUSH_PARSER=y
diff --git a/configs/at91rm9200ek_ram_defconfig b/configs/at91rm9200ek_ram_defconfig
index e042f0bc28d..7c00ede0f9b 100644
--- a/configs/at91rm9200ek_ram_defconfig
+++ b/configs/at91rm9200ek_ram_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_AT91=y
CONFIG_TARGET_AT91RM9200EK=y
CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT"
CONFIG_BOOTDELAY=3
+# CONFIG_SYS_STDIO_DEREGISTER is not set
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_HUSH_PARSER=y
diff --git a/configs/beaver_defconfig b/configs/beaver_defconfig
index 0c5e59f8889..a2a146fd48c 100644
--- a/configs/beaver_defconfig
+++ b/configs/beaver_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_BEAVER=y
CONFIG_DEFAULT_DEVICE_TREE="tegra30-beaver"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra30 (Beaver) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/cardhu_defconfig b/configs/cardhu_defconfig
index ffd52c2729e..746b24ee69d 100644
--- a/configs/cardhu_defconfig
+++ b/configs/cardhu_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_CARDHU=y
CONFIG_DEFAULT_DEVICE_TREE="tegra30-cardhu"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra30 (Cardhu) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/cei-tk1-som_defconfig b/configs/cei-tk1-som_defconfig
index 89024b7854a..516884dc4d7 100644
--- a/configs/cei-tk1-som_defconfig
+++ b/configs/cei-tk1-som_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_CEI_TK1_SOM=y
CONFIG_DEFAULT_DEVICE_TREE="tegra124-cei-tk1-som"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra124 (TK1-SOM) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/cgtqmx6eval_defconfig b/configs/cgtqmx6eval_defconfig
index a2df031ddd1..1392f7e9b53 100644
--- a/configs/cgtqmx6eval_defconfig
+++ b/configs/cgtqmx6eval_defconfig
@@ -18,6 +18,7 @@ CONFIG_BOOTDELAY=3
# CONFIG_CONSOLE_MUX is not set
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_SPL=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="CGT-QMX6-Quad U-Boot > "
diff --git a/configs/colibri_t20_defconfig b/configs/colibri_t20_defconfig
index 897cd01f818..5f95e3eb99b 100644
--- a/configs/colibri_t20_defconfig
+++ b/configs/colibri_t20_defconfig
@@ -4,6 +4,7 @@ CONFIG_TEGRA20=y
CONFIG_TARGET_COLIBRI_T20=y
CONFIG_DEFAULT_DEVICE_TREE="tegra20-colibri"
CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Colibri T20 # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/colibri_t30_defconfig b/configs/colibri_t30_defconfig
index 42f32a929f9..de00afe1b01 100644
--- a/configs/colibri_t30_defconfig
+++ b/configs/colibri_t30_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_COLIBRI_T30=y
CONFIG_DEFAULT_DEVICE_TREE="tegra30-colibri"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Colibri T30 # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/dalmore_defconfig b/configs/dalmore_defconfig
index 25ae702f7cb..0a17ca45827 100644
--- a/configs/dalmore_defconfig
+++ b/configs/dalmore_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_DALMORE=y
CONFIG_DEFAULT_DEVICE_TREE="tegra114-dalmore"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra114 (Dalmore) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/dms-ba16-1g_defconfig b/configs/dms-ba16-1g_defconfig
index 859ea1fb764..d63b290b84f 100644
--- a/configs/dms-ba16-1g_defconfig
+++ b/configs/dms-ba16-1g_defconfig
@@ -7,6 +7,7 @@ CONFIG_BOOTDELAY=1
# CONFIG_CONSOLE_MUX is not set
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
diff --git a/configs/dms-ba16_defconfig b/configs/dms-ba16_defconfig
index c460f60b201..b40912b732c 100644
--- a/configs/dms-ba16_defconfig
+++ b/configs/dms-ba16_defconfig
@@ -6,6 +6,7 @@ CONFIG_BOOTDELAY=1
# CONFIG_CONSOLE_MUX is not set
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
diff --git a/configs/e2220-1170_defconfig b/configs/e2220-1170_defconfig
index 4df533f2e83..c88cd365eca 100644
--- a/configs/e2220-1170_defconfig
+++ b/configs/e2220-1170_defconfig
@@ -4,6 +4,7 @@ CONFIG_TEGRA210=y
CONFIG_DEFAULT_DEVICE_TREE="tegra210-e2220-1170"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra210 (E2220-1170) # "
# CONFIG_CMD_IMI is not set
diff --git a/configs/gwventana_defconfig b/configs/gwventana_defconfig
index c1a3c1c7857..67753adcd0b 100644
--- a/configs/gwventana_defconfig
+++ b/configs/gwventana_defconfig
@@ -17,6 +17,7 @@ CONFIG_FIT_VERBOSE=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL"
CONFIG_BOOTDELAY=3
+# CONFIG_SYS_STDIO_DEREGISTER is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SPL=y
CONFIG_SPL_STACK_R=y
diff --git a/configs/harmony_defconfig b/configs/harmony_defconfig
index 5c76af3f471..cc7106ffadb 100644
--- a/configs/harmony_defconfig
+++ b/configs/harmony_defconfig
@@ -4,6 +4,7 @@ CONFIG_TEGRA20=y
CONFIG_TARGET_HARMONY=y
CONFIG_DEFAULT_DEVICE_TREE="tegra20-harmony"
CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra20 (Harmony) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/jetson-tk1_defconfig b/configs/jetson-tk1_defconfig
index 4544c28cac3..b5c6106a11f 100644
--- a/configs/jetson-tk1_defconfig
+++ b/configs/jetson-tk1_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_JETSON_TK1=y
CONFIG_DEFAULT_DEVICE_TREE="tegra124-jetson-tk1"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra124 (Jetson TK1) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/medcom-wide_defconfig b/configs/medcom-wide_defconfig
index fc19b5fc9dc..c3caebb7a6a 100644
--- a/configs/medcom-wide_defconfig
+++ b/configs/medcom-wide_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_MEDCOM_WIDE=y
CONFIG_DEFAULT_DEVICE_TREE="tegra20-medcom-wide"
CONFIG_FIT=y
CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra20 (Medcom-Wide) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/mx6cuboxi_defconfig b/configs/mx6cuboxi_defconfig
index 3f007736033..22173cc9ebb 100644
--- a/configs/mx6cuboxi_defconfig
+++ b/configs/mx6cuboxi_defconfig
@@ -12,6 +12,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y
CONFIG_SPL_WATCHDOG_SUPPORT=y
CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL"
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_SPL=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
index 99e7e0b1d49..d0ecdb9cdad 100644
--- a/configs/mx6qsabrelite_defconfig
+++ b/configs/mx6qsabrelite_defconfig
@@ -5,6 +5,7 @@ CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE"
CONFIG_BOOTDELAY=3
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
diff --git a/configs/nitrogen6dl2g_defconfig b/configs/nitrogen6dl2g_defconfig
index 8342d353ab3..cd4b675dd3b 100644
--- a/configs/nitrogen6dl2g_defconfig
+++ b/configs/nitrogen6dl2g_defconfig
@@ -5,6 +5,7 @@ CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl2g.cfg,MX6DL,DDR_MB=2048"
CONFIG_BOOTDELAY=3
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
diff --git a/configs/nitrogen6dl_defconfig b/configs/nitrogen6dl_defconfig
index 262467838e8..7ea8f51782b 100644
--- a/configs/nitrogen6dl_defconfig
+++ b/configs/nitrogen6dl_defconfig
@@ -5,6 +5,7 @@ CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL,DDR_MB=1024"
CONFIG_BOOTDELAY=3
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
diff --git a/configs/nitrogen6q2g_defconfig b/configs/nitrogen6q2g_defconfig
index 06f44fd32a1..d9df123cf64 100644
--- a/configs/nitrogen6q2g_defconfig
+++ b/configs/nitrogen6q2g_defconfig
@@ -5,6 +5,7 @@ CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q2g.cfg,MX6Q,DDR_MB=2048"
CONFIG_BOOTDELAY=3
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
diff --git a/configs/nitrogen6q_defconfig b/configs/nitrogen6q_defconfig
index 289338961f7..0063df7c3b2 100644
--- a/configs/nitrogen6q_defconfig
+++ b/configs/nitrogen6q_defconfig
@@ -5,6 +5,7 @@ CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024"
CONFIG_BOOTDELAY=3
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
diff --git a/configs/nitrogen6s1g_defconfig b/configs/nitrogen6s1g_defconfig
index 9419fe92568..1572b9bb457 100644
--- a/configs/nitrogen6s1g_defconfig
+++ b/configs/nitrogen6s1g_defconfig
@@ -5,6 +5,7 @@ CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s1g.cfg,MX6S,DDR_MB=1024"
CONFIG_BOOTDELAY=3
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
diff --git a/configs/nitrogen6s_defconfig b/configs/nitrogen6s_defconfig
index 30e94f8736d..6c4061634e7 100644
--- a/configs/nitrogen6s_defconfig
+++ b/configs/nitrogen6s_defconfig
@@ -5,6 +5,7 @@ CONFIG_VIDEO=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512"
CONFIG_BOOTDELAY=3
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+# CONFIG_SYS_STDIO_DEREGISTER is not set
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig
index 2a1d318bc80..ae3f84c33e3 100644
--- a/configs/nyan-big_defconfig
+++ b/configs/nyan-big_defconfig
@@ -6,6 +6,7 @@ CONFIG_DEFAULT_DEVICE_TREE="tegra124-nyan-big"
CONFIG_FIT=y
CONFIG_FIT_BEST_MATCH=y
CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra124 (Nyan-big) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/p2371-0000_defconfig b/configs/p2371-0000_defconfig
index a8c9239c937..0b074ecc449 100644
--- a/configs/p2371-0000_defconfig
+++ b/configs/p2371-0000_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_P2371_0000=y
CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2371-0000"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra210 (P2371-0000) # "
# CONFIG_CMD_IMI is not set
diff --git a/configs/p2371-2180_defconfig b/configs/p2371-2180_defconfig
index de5817d8aa4..79797605603 100644
--- a/configs/p2371-2180_defconfig
+++ b/configs/p2371-2180_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_P2371_2180=y
CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2371-2180"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra210 (P2371-2180) # "
# CONFIG_CMD_IMI is not set
diff --git a/configs/p2571_defconfig b/configs/p2571_defconfig
index a6e80f7548a..a114ce3dda4 100644
--- a/configs/p2571_defconfig
+++ b/configs/p2571_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_P2571=y
CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2571"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra210 (P2571) # "
# CONFIG_CMD_IMI is not set
diff --git a/configs/p2771-0000-000_defconfig b/configs/p2771-0000-000_defconfig
index 88a5b1869b3..7956cdde6ca 100644
--- a/configs/p2771-0000-000_defconfig
+++ b/configs/p2771-0000-000_defconfig
@@ -4,6 +4,7 @@ CONFIG_TEGRA186=y
CONFIG_DEFAULT_DEVICE_TREE="tegra186-p2771-0000-000"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra186 (P2771-0000-000) # "
# CONFIG_CMD_IMI is not set
diff --git a/configs/p2771-0000-500_defconfig b/configs/p2771-0000-500_defconfig
index 1633ed22fcc..940bb5f9bf6 100644
--- a/configs/p2771-0000-500_defconfig
+++ b/configs/p2771-0000-500_defconfig
@@ -4,6 +4,7 @@ CONFIG_TEGRA186=y
CONFIG_DEFAULT_DEVICE_TREE="tegra186-p2771-0000-500"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra186 (P2771-0000-500) # "
# CONFIG_CMD_IMI is not set
diff --git a/configs/paz00_defconfig b/configs/paz00_defconfig
index 5e82a015ed5..be8708763be 100644
--- a/configs/paz00_defconfig
+++ b/configs/paz00_defconfig
@@ -4,6 +4,7 @@ CONFIG_TEGRA20=y
CONFIG_TARGET_PAZ00=y
CONFIG_DEFAULT_DEVICE_TREE="tegra20-paz00"
CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra20 (Paz00) MOD # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/plutux_defconfig b/configs/plutux_defconfig
index 0d3ffaa0b42..52854811a9a 100644
--- a/configs/plutux_defconfig
+++ b/configs/plutux_defconfig
@@ -6,6 +6,7 @@ CONFIG_DEFAULT_DEVICE_TREE="tegra20-plutux"
CONFIG_FIT=y
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra20 (Plutux) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/smdk2410_defconfig b/configs/smdk2410_defconfig
index c84ce521a35..1eba4f996e3 100644
--- a/configs/smdk2410_defconfig
+++ b/configs/smdk2410_defconfig
@@ -1,6 +1,7 @@
CONFIG_ARM=y
CONFIG_TARGET_SMDK2410=y
CONFIG_BOOTDELAY=5
+# CONFIG_SYS_STDIO_DEREGISTER is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="SMDK2410 # "
diff --git a/configs/tec-ng_defconfig b/configs/tec-ng_defconfig
index 81ffb486ac5..f830389e978 100644
--- a/configs/tec-ng_defconfig
+++ b/configs/tec-ng_defconfig
@@ -6,6 +6,7 @@ CONFIG_DEFAULT_DEVICE_TREE="tegra30-tec-ng"
CONFIG_FIT=y
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra30 (TEC-NG) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/tec_defconfig b/configs/tec_defconfig
index 24cd2935973..40c96eb31f5 100644
--- a/configs/tec_defconfig
+++ b/configs/tec_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_TEC=y
CONFIG_DEFAULT_DEVICE_TREE="tegra20-tec"
CONFIG_FIT=y
CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra20 (TEC) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/trimslice_defconfig b/configs/trimslice_defconfig
index 68adf8bd664..3efbb346ee9 100644
--- a/configs/trimslice_defconfig
+++ b/configs/trimslice_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_TRIMSLICE=y
CONFIG_DEFAULT_DEVICE_TREE="tegra20-trimslice"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra20 (TrimSlice) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/venice2_defconfig b/configs/venice2_defconfig
index 02d4ca96d2f..01f3c172a94 100644
--- a/configs/venice2_defconfig
+++ b/configs/venice2_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_VENICE2=y
CONFIG_DEFAULT_DEVICE_TREE="tegra124-venice2"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra124 (Venice2) # "
CONFIG_CMD_BOOTZ=y
diff --git a/configs/whistler_defconfig b/configs/whistler_defconfig
index 4874d5bb2dd..2c836616312 100644
--- a/configs/whistler_defconfig
+++ b/configs/whistler_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_WHISTLER=y
CONFIG_DEFAULT_DEVICE_TREE="tegra20-whistler"
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Tegra20 (Whistler) # "
CONFIG_CMD_BOOTZ=y
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 19f38e162e0..43c028ebe63 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -346,7 +346,7 @@ static int serial_post_probe(struct udevice *dev)
static int serial_pre_remove(struct udevice *dev)
{
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
struct serial_dev_priv *upriv = dev_get_uclass_priv(dev);
if (stdio_deregister_dev(upriv->sdev, 0))
diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h
index 92b82edb086..73ddbac5bfa 100644
--- a/include/configs/MIP405.h
+++ b/include/configs/MIP405.h
@@ -345,7 +345,6 @@
#define CONFIG_USB_UHCI
/* Enable needed helper functions */
-#define CONFIG_SYS_STDIO_DEREGISTER /* needs stdio_deregister */
#endif
/************************************************************
* Debug support
diff --git a/include/configs/MPC8610HPCD.h b/include/configs/MPC8610HPCD.h
index 4021be7b190..e3c9e5b30b5 100644
--- a/include/configs/MPC8610HPCD.h
+++ b/include/configs/MPC8610HPCD.h
@@ -283,7 +283,6 @@
************************************************************/
#define CONFIG_PCI_OHCI 1
#define CONFIG_USB_OHCI_NEW 1
-#define CONFIG_SYS_STDIO_DEREGISTER
#define CONFIG_SYS_USB_EVENT_POLL 1
#define CONFIG_SYS_USB_OHCI_SLOT_NAME "ohci_pci"
#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
index 94a9399aff4..e0b856f4ee0 100644
--- a/include/configs/MPC8641HPCN.h
+++ b/include/configs/MPC8641HPCN.h
@@ -361,7 +361,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
************************************************************/
#define CONFIG_PCI_OHCI 1
#define CONFIG_USB_OHCI_NEW 1
-#define CONFIG_SYS_STDIO_DEREGISTER
#define CONFIG_SYS_USB_EVENT_POLL 1
#define CONFIG_SYS_USB_OHCI_SLOT_NAME "ohci_pci"
#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
diff --git a/include/configs/PIP405.h b/include/configs/PIP405.h
index f02967bef10..f923f7cea0e 100644
--- a/include/configs/PIP405.h
+++ b/include/configs/PIP405.h
@@ -305,7 +305,6 @@
#define CONFIG_USB_UHCI
/* Enable needed helper functions */
-#define CONFIG_SYS_STDIO_DEREGISTER /* needs stdio_deregister */
/************************************************************
* Debug support
diff --git a/include/configs/VCMA9.h b/include/configs/VCMA9.h
index 75c6d50c6fb..bb26261ab50 100644
--- a/include/configs/VCMA9.h
+++ b/include/configs/VCMA9.h
@@ -103,7 +103,6 @@
#define CONFIG_DOS_PARTITION
/* Enable needed helper functions */
-#define CONFIG_SYS_STDIO_DEREGISTER /* needs stdio_deregister */
/* RTC */
#define CONFIG_RTC_S3C24X0
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 0b3f0342da9..0ac3ec7da4c 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -210,7 +210,6 @@
#define CONFIG_MXC_USB_FLAGS 0
#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
-#define CONFIG_SYS_STDIO_DEREGISTER
/* I2C */
#define CONFIG_SYS_I2C
diff --git a/include/configs/cyrus.h b/include/configs/cyrus.h
index cb85c6b21f4..8ce23e6def1 100644
--- a/include/configs/cyrus.h
+++ b/include/configs/cyrus.h
@@ -446,7 +446,6 @@
#define CONFIG_USB_EHCI_FSL
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
#define CONFIG_EHCI_IS_TDI
-#define CONFIG_SYS_STDIO_DEREGISTER
#define CONFIG_SYS_USB_EVENT_POLL
/* _VIA_CONTROL_EP */
#endif
diff --git a/include/configs/gr_ep2s60.h b/include/configs/gr_ep2s60.h
index 36a91c679dd..ad0c126e273 100644
--- a/include/configs/gr_ep2s60.h
+++ b/include/configs/gr_ep2s60.h
@@ -58,7 +58,6 @@
#if USE_GRUSB
#define CONFIG_USB_UHCI
/* Enable needed helper functions */
-#define CONFIG_SYS_STDIO_DEREGISTER /* needs stdio_deregister */
#endif
/*
diff --git a/include/configs/novena.h b/include/configs/novena.h
index ee4267a8225..ecc7e7efca9 100644
--- a/include/configs/novena.h
+++ b/include/configs/novena.h
@@ -142,7 +142,6 @@
#ifdef CONFIG_CMD_USB
#define CONFIG_USB_EHCI
#define CONFIG_USB_EHCI_MX6
-#define CONFIG_SYS_STDIO_DEREGISTER
#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX
diff --git a/include/configs/rpi.h b/include/configs/rpi.h
index 25a90cc2e2b..45c82349057 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -101,7 +101,6 @@
#define CONFIG_TFTP_TSIZE
#define CONFIG_MISC_INIT_R
#define CONFIG_SYS_USB_EVENT_POLL
-#define CONFIG_SYS_STDIO_DEREGISTER
#endif
/* Console UART */
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index b6533c33206..31ab7652abf 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -25,8 +25,6 @@
#define CONFIG_SYS_TIMER_RATE 1000000
#endif
-#define CONFIG_SYS_STDIO_DEREGISTER
-
/*
* Number of bits in a C 'long' on this architecture. Set this to 32 when
* building on a 32-bit machine.
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index f98a48b2c4b..e0464df0388 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -347,7 +347,6 @@ extern int soft_i2c_gpio_scl;
#ifdef CONFIG_USB_KEYBOARD
#define CONFIG_PREBOOT
-#define CONFIG_SYS_STDIO_DEREGISTER
#define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
#endif
diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
index b541937acd1..61bd489882e 100644
--- a/include/configs/tbs2910.h
+++ b/include/configs/tbs2910.h
@@ -116,7 +116,6 @@
#endif /* CONFIG_CMD_USB_MASS_STORAGE */
#ifdef CONFIG_USB_KEYBOARD
#define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
-#define CONFIG_SYS_STDIO_DEREGISTER
#define CONFIG_PREBOOT \
"usb start; " \
"if hdmidet; then " \
diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
index 3590be457ff..63b711be0f6 100644
--- a/include/configs/tegra-common.h
+++ b/include/configs/tegra-common.h
@@ -60,10 +60,6 @@
#define CONFIG_SYS_NO_FLASH
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_SYS_STDIO_DEREGISTER
-#endif
-
/*
* Increasing the size of the IO buffer as default nfsargs size is more
* than 256 and so it is not possible to edit it
diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
index f2c2b504ffc..3bf42b5027b 100644
--- a/include/configs/x86-common.h
+++ b/include/configs/x86-common.h
@@ -61,8 +61,6 @@
9600, 19200, 38400, 115200}
#define CONFIG_SYS_NS16550_PORT_MAPPED
-#define CONFIG_SYS_STDIO_DEREGISTER
-
#define CONFIG_CMDLINE_EDITING
#define CONFIG_COMMAND_HISTORY
#define CONFIG_AUTO_COMPLETE
diff --git a/include/stdio_dev.h b/include/stdio_dev.h
index 13f76be7c2b..e4fc8b138b4 100644
--- a/include/stdio_dev.h
+++ b/include/stdio_dev.h
@@ -100,7 +100,7 @@ int stdio_add_devices(void);
int stdio_init(void);
void stdio_print_current_devices(void);
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
int stdio_deregister(const char *devname, int force);
int stdio_deregister_dev(struct stdio_dev *dev, int force);
#endif
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index a0306a691d6..11b5a221ee6 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -7681,7 +7681,6 @@ CONFIG_SYS_STACK_LENGTH
CONFIG_SYS_STACK_SIZE
CONFIG_SYS_STATUS_C
CONFIG_SYS_STATUS_OK
-CONFIG_SYS_STDIO_DEREGISTER
CONFIG_SYS_STMICRO_BOOT
CONFIG_SYS_SUPPORT_64BIT_DATA
CONFIG_SYS_SXCNFG_VAL