When an stdio device is provided by a driver model device, optionally
show the uclass.
Be careful to avoid increasing code size, since this is a common
command.
Signed-off-by: Simon Glass <sjg@chromium.org>
The 'dev' variable is generally used for driver model, so change
do_coninfo() to use sdev, to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
Detect if there is no terminal present (this only works on sandbox) and
skip sending ANSI characters when the CLI starts up. This avoids having
them in logs, for example.
Signed-off-by: Simon Glass <sjg@chromium.org>
The post system requires use of CFG_xxx values which are only included
via the config.h header. Most files don't include this now.
The serial.h header includes post.h which causes a build error on any
platform which enables CONFIG_POST, such as pg_wcom_seli8
Add an explicit #include of config.h in the post.h header file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Sandbox is often run with the display disabled, so even though it has a
video device, it is not being shown. Provide a way to detect this. For
all other platforms, we assume the display is shown, when there is a
video device.
Series-changes: 2
- Add new patch to provide a way to tell if the video is visible
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a serial_is_tty() function that determines if the serial console
is connected to a terminal. For sandbox, this uses os_isatty() to
check stdin, except for cooked mode, where we don't want to assume
anything about the terminal.
For other platforms, it always returns true.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Add serial_priv structure to serial uclass to cache terminal dimensions.
When serial_query_size() successfully queries the terminal, store the
results in the uclass-private data for later retrieval.
This avoids repeated terminal queries and improves performance when
different subsystems need the terminal size.
Series-changes: 3
- Drop unnecessary 'dev' argument
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
The EFI loader has some code to check the size (rows and columns) of an
attached terminal. Move this over to the serial uclass so that it can be
used elsewhere.
Create a new CONFIG_SERIAL_TERM_PRESENT to control whether it should be
used. Enable that for the EFI loader to preserve existing behaviour.
Adjust the implementation so that it returns a useful error code on
failure. Put the ESC and cESC values in the serial.h header.
Series-changes: 3
- Update comment for serial_query_size()
Signed-off-by: Simon Glass <sjg@chromium.org>
Add support for sorting EFI variables by name when using printenv -e.
The -s flag sorts variables alphabetically before display, useful when
dealing with large numbers of variables.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-to: concept
Series-cc: heinrich
Cover-letter:
efi: Improvements to env print -e
Printing EFI variables can be quite verbose, with many hundreds of lines
of text. Part of this is because GUIDs and hex dumps are included. It
can also be hard to find a few variables visually in an unsorted list.
This series makes the feature more user-friendly:
- Puts verbose output behind a -v flag, so that 'env print -e' behaves
more like 'env print'
- Adds a -s option to sort the list
END
Series-links: 1:15
Rather than printing as we go, add variables to an alist so they can be
printed when all variables are present.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than freeing the variable in several places, put it at the end.
Assume failure by default, returning success only if all steps passed.
Signed-off-by: Simon Glass <sjg@chromium.org>
This variable name is quite long. There is only one 'name' (the variable
name) and it has to be u16 as it is an EFI variable. So rename it to
'name'.
Signed-off-by: Simon Glass <sjg@chromium.org>
Change the default behavior of 'printenv -e' to show only EFI variable
names. The previous verbose output is now available with the -v flag.
This makes the command more user-friendly for quick variable listing.
Update documentation to reflect the new behavior and provide examples
of all three output modes: default (names only), -n (details without
hex dump), and -v (full verbose output).
It might be nicer to use -d to enable the dump, rather than have it on
by default.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Now that the EFI app supports booting Ubuntu via the EFI bootmeth, add
a test for this, for ARM. This uses the sjg lab.
Series-to: concept
Series-cc: heinrich
Cover-letter:
efi: app: Support booting an OS
This series completes the work to get the EFI app booting an EFI
application (e.g. Ubuntu):
- efidebug dh now works, and is slightly enhanced
- device paths which refer to the underlying EFI layer can now be
requested by the app
- a test is provided, for EFI on ARM booting into Ubuntu using the sjg
lab
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:12
Add proper device-path handling for UCLASS_EFI_MEDIA devices in both
dp_size() and dp_fill() functions. This enables EFI applications to use
firmware device-paths for media devices accessed through the EFI block
I/O protocol.
Add some debugging while we are here.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
If a component name is available, show it, along with the supported
languages.
Also indicate at the top if the handle is a driver, rather than listing
that protocol at the end.
Signed-off-by: Simon Glass <sjg@chromium.org>
Make use of the boot-time services rather than internal functions, so
that the app can implement this command.
Signed-off-by: Simon Glass <sjg@chromium.org>
The 'efidebug dh' command dereferences a handle to obtain the device
name.
The format of an EFI handle is not defined by the spec, so when running
in the app we cannot assume that the handle can be dereferenced. Even if
the EFI provider happens to be U-Boot it might be a different version.
So don't try display the device name with the app.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than accessing the EFI loader's structure, create an
efi_get_boot() function to match that used by the app, so that the
call to protocols_per_handle() can operate in the app as well.
Signed-off-by: Simon Glass <sjg@chromium.org>
Even if this is a subtle dig at EFI, it is only used once and there is
not much benefit in retaining it. Access the system-table directly,
instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
The intend of this macro is to debug calls from an app. But the efidebug
command is not an app, so it really doesn't make a lot of sense to call
via that macro. Remove EFI_CALL() from do_efi_show_handles() so that the
app can use this code.
Signed-off-by: Simon Glass <sjg@chromium.org>
If only a single test runs, it does not set the max_count variable, so
it remains as zero. Handle this situation as a special case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Archived series currently cause an error when autolink is attempted. Add
a check to avoid this.
Series-to: u-boot
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:458284
The name 'x86a' must be parsed as a branch name, not as versio 86 of
branch 'x'. Correct the regex and add a test for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Sometimes series don't have a cover letter. Add a --use-commit option to
easily use the first commit's subject instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Sometimes it is useful to include archived series in the progress report
so you can see all the work completed. Add a flag for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Sometimes it is useful to include archived series in the listing so you
can see which series could potentially be unarchived. Add a flag for
this.
Add a --include-archived option to the 'series ls' command for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function is needed by 'patman status', meaning that it must import
cser_helper which needs pygit2
Move it to patchstream so that pygit2 is not needed for the
'patman status' command.
Signed-off-by: Simon Glass <sjg@chromium.org>
If pygit2 does not exist, patman refuses to work at all, but most
subcommands don't need it. Move the imports to resolve this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Mention the efidebug command specifically the EFI-app documentaion, to
highlight its usefulness.
Series-to: concept
Series-cc: heinrich
Cover-letter:
efi: Move towards the EFI app booting EFI applications
This series adds various new features to the EFI app, mostly by moving
code over from the EFI loader implementation.
In particular it adds support for the efidebug command (with only a
subset of subcommands so far).
The main approach is to make use of the system table (for both the app
and the loader) instead of directly calling EFI-loader code.
It also includes a few fixes, which likely have no effect but will help
to avoid confusion in future.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-version: 2
Series-changes: 2
- Mention the 'dh' subcommand
- Mention that 'order' allows the boot order to be changed
- Mention the eficonfig command and the underlying UEFI firmware
Series-links: 2:10
The app has a function of this name, but it does not return any value.
Return success (always) so that we can use the same signature.
Signed-off-by: Simon Glass <sjg@chromium.org>
This file contains some useful utility functions which are not specific
to the EFI loader. Move them to lib/efi so they can be used by the app.
Signed-off-by: Simon Glass <sjg@chromium.org>
This printf() extension is useful for the app. Add an implementation of
efi_dp_str() so that it works as expected.
Signed-off-by: Simon Glass <sjg@chromium.org>
Some protocols are generally useful for the app and it makes sense to
store these in the priv struct rather than requesting them each time
they are needed.
Add a new function which locates the device-path-to-text protocol and
stores it.
Signed-off-by: Simon Glass <sjg@chromium.org>