[PATCH v8 16/25] efi: Allow easy selection of serial-only operation

Simon Glass sjg at chromium.org
Tue Jan 4 11:52:14 CET 2022


Hi Heinrich,

On Thu, 30 Dec 2021 at 23:18, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> On 12/29/21 19:57, Simon Glass wrote:
> > Add info about how to select vidconsole or serial.
> >
> > Also set up a demo boot command.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> > (no changes since v2)
> >
> > Changes in v2:
> > - Add a better boot command too
> >
> >   include/configs/efi-x86_app.h | 25 +++++++++++++++++++++++++
> >   1 file changed, 25 insertions(+)
> >
> > diff --git a/include/configs/efi-x86_app.h b/include/configs/efi-x86_app.h
> > index 6061a6db0a4..33afb7ca0f9 100644
> > --- a/include/configs/efi-x86_app.h
> > +++ b/include/configs/efi-x86_app.h
> > @@ -10,8 +10,33 @@
> >
> >   #undef CONFIG_TPM_TIS_BASE_ADDRESS
> >
> > +/*
> > + * Select the output device: Put an 'x' prefix before one of these to disable it
> > + */
> > +
> > +/*
> > + * Video output - can normally continue after exit_boot_services has been
> > + * called, since output to the display does not require EFI services at that
> > + * point. U-Boot sets up the console memory and does its own drawing.
> > + */
> >   #define CONFIG_STD_DEVICES_SETTINGS "stdin=serial\0" \
> >                                       "stdout=vidconsole\0" \
> >                                       "stderr=vidconsole\0"
> >
> > +/*
> > + * Serial output with no console. Run qemu with:
> > + *
> > + *    -display none -serial mon:stdio
> > + *
> > + * This will hang or fail to output on the console after exit_boot_services is
> > + * called.
>
> In lib/efi/efi_stub.c, efi_main() you set use_uart=true. Couldn't you do
> a similar thing in the app?

Well use_uart is a bit of a hack - just using a hard-coded x86 UART.
See putc() in efi_stub.c - it is just for debugging. There seem to be
importants periods in EFI where debug output is not supported.

>
> Instead of hard coding a specific UART it would be preferable both for
> the EFI stub as well as for the app to use the debug console defined by
> CONFIG_DEBUG_UART.

Well the app uses the con_out thing, so doesn't use a specific UART.

The stub uses the same thing while EFI is available, but uses the hack
when it is not. The console used by DEBUG_UART should be the same
driver as the 'serial' one selected here, so I think it is already
what you want.

I suspect we can make the serial and video enable/disable at runtime
but that seems like a separate problem.

Regards,
Simon


More information about the U-Boot mailing list