aboutsummaryrefslogtreecommitdiff
path: root/common/console.c
diff options
context:
space:
mode:
authorHarald Seiler <hws@denx.de>2022-07-06 13:19:10 +0200
committerTom Rini <trini@konsulko.com>2023-01-12 11:25:17 -0500
commit33965c7e18a44b1b15c83921393a9cfc123f0e90 (patch)
tree566a967c7605e13b9a9fcb9617a16244caa78509 /common/console.c
parentf58885d002302b8047446a6a15f7376bb7b1ea32 (diff)
downloadu-boot-33965c7e18a44b1b15c83921393a9cfc123f0e90.zip
u-boot-33965c7e18a44b1b15c83921393a9cfc123f0e90.tar.gz
u-boot-33965c7e18a44b1b15c83921393a9cfc123f0e90.tar.bz2
console: Add option to keep it silent until env is loaded
Add a config-option which forces the console to stay silent until the proper environment is loaded from flash. This is important when the default environment does not silence the console but no output must be printed when 'silent' is set in the flash environment. After the environment from flash is loaded, the console will be silenced/unsilenced depending on it. If PRE_CONSOLE_BUFFER is also used, the buffer will now be flushed if the console should not be silenced. Signed-off-by: Harald Seiler <hws@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index 10ab361..e4301a4 100644
--- a/common/console.c
+++ b/common/console.c
@@ -970,6 +970,11 @@ static bool console_update_silent(void)
if (!IS_ENABLED(CONFIG_SILENT_CONSOLE))
return false;
+ if (IS_ENABLED(CONFIG_SILENT_CONSOLE_UNTIL_ENV) && !(gd->flags & GD_FLG_ENV_READY)) {
+ gd->flags |= GD_FLG_SILENT;
+ return false;
+ }
+
if (env_get("silent")) {
gd->flags |= GD_FLG_SILENT;
return false;