[PATCH] console: Add option to keep it silent until env is loaded

Harald Seiler hws at denx.de
Mon Jul 18 17:07:56 CEST 2022


Hi Simon,

On Wed, 2022-07-13 at 09:28 -0600, Simon Glass wrote:
> Hi Harald,
> 
> On Tue, 12 Jul 2022 at 05:58, Harald Seiler <hws at denx.de> wrote:
> > 
> > Hi Simon,
> > 
> > On Tue, 2022-07-12 at 04:58 -0600, Simon Glass wrote:
> > > Hi Harald,
> > > 
> > > On Wed, 6 Jul 2022 at 05:19, Harald Seiler <hws at denx.de> wrote:
> > > > 
> > > > 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 at denx.de>
> > > > ---
> > > >  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.
> > 
> > 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().

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)

-- 
Harald


More information about the U-Boot mailing list