console: Add option to keep it silent until env is loaded
PATCH 1/1 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.
--- common/Kconfig | 10 ++++++++++ common/console.c | 5 +++++ 2 files changed, 15 insertions(+)
common/Kconfig +10 -0
@@ -120,6 +120,16 @@ config SILENT_CONSOLE_UPDATE_ON_RELOC (e.g. NAND). This option makes the value of the 'silent' environment variable take effect at relocation. +config SILENT_CONSOLE_UNTIL_ENV + bool "Keep console silent until environment is loaded" + depends on SILENT_CONSOLE + help + This option makes sure U-Boot will never use the console unless the + environment from flash does not contain the 'silent' variable. If + set, the console is kept silent until after the environment was + loaded. Use this in combination with PRE_CONSOLE_BUFFER to print out + earlier messages after loading the environment when allowed. + config PRE_CONSOLE_BUFFER bool "Buffer characters before the console is available" help
common/console.c +5 -0
@@ -893,6 +893,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;
Signature · 1 line
2.36.1
Hi Harald,
Quoted 13 lines · Harald Seiler
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_BUFFERis also used, the buffer will now be flushed if the console should not be silenced.
Quoted 5 lines
Signed-off-by Harald Seiler <[email protected]>--- common/Kconfig | 10 ++++++++++ common/console.c | 5 +++++ 2 files changed, 15 insertions(+)
This seems OK to me. You might want to implement the silent-console device tree property in console_update_silent() too, which was dropped in the conversion to driver model.
Hi Simon,
Quoted 22 lines · Simon Glass
Hi Harald,
Quoted 13 lines · Harald Seiler
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_BUFFERis also used, the buffer will now be flushed if the console should not be silenced.Quoted 5 lines
Signed-off-by Harald Seiler <[email protected]>--- common/Kconfig | 10 ++++++++++ common/console.c | 5 +++++ 2 files changed, 15 insertions(+)
Quoted 3 lines
This seems OK to me. You might want to implement the silent-console device tree property in
console_update_silent()too, which was dropped in the conversion to driver model.
This looks interesting, I'll have to look into it.
Do you know if there's any effort towards supporting such a flag in the kernel as well? I had to remove the serial console property from my DT and instead pass console info via cmdline to make the silent console work. A "pure DT" solution of any sort would have been nicer of course...
Signature · 1 line
Harald
Hi Harald,
Quoted 30 lines · Harald Seiler
Hi Simon,
Quoted 22 lines · Simon Glass
Hi Harald,
Quoted 13 lines · Harald Seiler
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_BUFFERis also used, the buffer will now be flushed if the console should not be silenced.Quoted 5 lines
Signed-off-by Harald Seiler <[email protected]>--- common/Kconfig | 10 ++++++++++ common/console.c | 5 +++++ 2 files changed, 15 insertions(+)Quoted 3 lines
This seems OK to me. You might want to implement the silent-console device tree property in
console_update_silent()too, which was dropped in the conversion to driver model.
Quoted 7 lines
This looks interesting, I'll have to look into it.
Do you know if there's any effort towards supporting such a flag in the kernel as well? I had to remove the serial console property from my DT and instead pass console info via cmdline to make the silent console work. A "pure DT" solution of any sort would have been nicer of course...
The console's 'silent' flag is propagated to Linux by dropping the 'console=' text from the bootargs. See fixup_silent_linux().
Regards,
Simon
Quoted 3 lines
--
Harald
Hi Simon,
Quoted 35 lines · Simon Glass
Hi Harald,
Quoted 32 lines · Harald Seiler
Hi Simon,
Quoted 22 lines · Simon Glass
Hi Harald,
Quoted 13 lines · Harald Seiler
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_BUFFERis also used, the buffer will now be flushed if the console should not be silenced.Quoted 5 lines
Signed-off-by Harald Seiler <[email protected]>--- common/Kconfig | 10 ++++++++++ common/console.c | 5 +++++ 2 files changed, 15 insertions(+)Quoted 3 lines
This seems OK to me. You might want to implement the silent-console device tree property in
console_update_silent()too, which was dropped in the conversion to driver model.This looks interesting, I'll have to look into it.
Quoted 8 lines
Quoted 5 lines
Do you know if there's any effort towards supporting such a flag in the kernel as well? I had to remove the serial console property from my DT and instead pass console info via cmdline to make the silent console work. A "pure DT" solution of any sort would have been nicer of course...
The console's 'silent' flag is propagated to Linux by dropping the 'console=' text from the bootargs. See
fixup_silent_linux().
Right, this is what I am relying on right now. The problem is that this does not have any effect when console= is not used and the console is instead passed using the /chosen/stdout-path DT property.
I was wondering whether U-Boot should maybe delete this property from the DT passed to Linux when going silent...
(But of course this is unrelated to the original patch here)
Signature · 1 line
Harald
Hi Harald,
Quoted 45 lines · Harald Seiler
Hi Simon,
Quoted 41 lines · Simon Glass
Hi Harald,
Quoted 37 lines · Harald Seiler
Hi Simon,
Quoted 22 lines · Simon Glass
Hi Harald,
Quoted 13 lines · Harald Seiler
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_BUFFERis also used, the buffer will now be flushed if the console should not be silenced.Quoted 5 lines
Signed-off-by Harald Seiler <[email protected]>--- common/Kconfig | 10 ++++++++++ common/console.c | 5 +++++ 2 files changed, 15 insertions(+)Quoted 3 lines
This seems OK to me. You might want to implement the silent-console device tree property in
console_update_silent()too, which was dropped in the conversion to driver model.This looks interesting, I'll have to look into it.
Do you know if there's any effort towards supporting such a flag in the kernel as well? I had to remove the serial console property from my DT and instead pass console info via cmdline to make the silent console work. A "pure DT" solution of any sort would have been nicer of course...
Quoted 6 lines
Quoted 2 lines
The console's 'silent' flag is propagated to Linux by dropping the 'console=' text from the bootargs. See
fixup_silent_linux().Right, this is what I am relying on right now. The problem is that this does not have any effect when
console=is not used and the console is instead passed using the/chosen/stdout-pathDT property.
OK.
Quoted 3 lines
I was wondering whether U-Boot should maybe delete this property from the DT passed to Linux when going silent...
Yes it probably should!
Quoted 2 lines
(But of course this is unrelated to the original patch here)
Regards,
Simon
Quoted 7 lines · Harald Seiler
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.
Quoted 7 lines
After the environment from flash is loaded, the console will be silenced/unsilenced depending on it. If
PRE_CONSOLE_BUFFERis also used, the buffer will now be flushed if the console should not be silenced.Signed-off-by Harald Seiler <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom