Add a new 'video images' command which lists the graphical images that
are compiled into U-Boot. Generally the only one is the logo.
Series-to: concept
Series-cc: heinrich
Cover-letter:
video: Tidy up embedded graphical images
U-Boot includes a few graphical images which are compiled in, such as
the logo and the BGRT logo used for EFI.
At present these are handled by a Makefile rule which looks for files
ending with '_logo.bmp'.
This series moves these into a new drivers/video/images directory and
puts them in a linker list, so it is possible to see what images are
available.
Adding a new image is simpler, just requiring the addition of the normal
'obj-y += file.bmp' rule.
This series also adds a new 'video' command which provides the existing
'setcurs' and 'lcdputs' as subcommands, along with documentation and
tests.
It also adds a more convenient 'write' subcommand.
END
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 2:44 1:43
Series-version: 3
Move the BGRT image to use the same video_image linker-list approach
as the other embedded image. Move it into the drivers/video/images
directory and rename it to 'bgrt.bmp' since we know it is an image.
Drop the old bgrt Makefile rule as it is no-longer needed.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Move u_boot_logo.bmp into drivers/video/images and include it in the
build.
Make use of the new video_image_get() macro to obtain the logo.
Drop the old SPLASH_...() macros.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
It is inconvenient to have to access graphical images as independent
symbols. Create a new rule which handles any file mentioned in
drivers/video/images/Makefile
For each graphical image, embed in the image and create a linker-list
entry for it.
Series-changes: 2
- Use Canonical copyright
Series-changes: 3
- Rename it to video_defs.h since we will use it elsewhere
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a new 'video' command with 'setcursor' and 'puts' subcommands that
provide an alternative interface to the existing setcurs and lcdputs
commands.
Update the test is updated to test both the legacy commands and the new
'video' command.
Series-changes: 2
- Correct confusing output text which should be 16 instead of 10
- Improve docs for row and col
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a simple test for the setcurs and lcdputs commands.
Series-changes: 2
- Pull out the docs into a separate patch
- Update test result for hex
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Add documentation and a simple test for the setcurs and lcdputs
commands.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-changes: 2
- Split out docs into its own patch; use video: tag
Signed-off-by: Simon Glass <sjg@chromium.org>
Commands in U-Boot should use hex consistently. Update this command
accordingly.
Series-changes: 2
- Add new patch to switch this command to use hex
Signed-off-by: Simon Glass <sjg@chromium.org>
This command is not really needed for link, which is near its code-size
limit. Disable it, before we add more subcommands.
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide some developer documentation on the priority feature for global
bootmeths.
Series-changes: 2
- Add a bit more detail suggested by Heinrich
Series-to: concept
Series-cc: heinrich
Cover-letter:
boot: Support priority for global bootmeths
At present global bootmeths always run first, before all other
bootmeths. Optimisations in the code take advantage of this, putting
them at the end, so they can be used once and then forgotten.
In some cases it is useful to run global bootmeths later in the boot.
For example, the EFI-bootmgr bootmeth may itself scan devices and the
network, so running it first can hold up the boot significantly for
boards not actually relying on EFI-bootmgr to boot.
This series introduces a new field in global bootmeths which indicates
the priority, using the same scheme as is used with bootdev hunters.
Thus it is possible to insert the EFI-bootmgr bootmeth just before the
hunter for network bootdevs is invoked.
Despite the simplicity of the concept and the relatively small series,
this is a fairly significant enhancement. It is also quite tricky to
implement, largely due to the way the original code was written, with
global bootmeths being a small, size-optimised add-on to the original
bootstd implementation.
For now we only allow each global bootmeth to run at most once, but this
implementation is written in a way that we could relax that if needed.
Then the bootmeth itself could decide whether to run at any particular
point in the bootflow iteration.
Size growth is about 390 bytes on Thumb2 (e.g. firefly-rk3288) if
CONFIG_BOOTMETH_GLOBAL is enabled, which it normally is. With that
disabled (which saves about 4K on the same platform), there is no
growth.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:41
Series-version: 2
At present the EFI bootmgr scans all devices in the system before
deciding which one to boot. Ideally it would use the bootstd iterator
for this, but in the meantime, give it a lower priority, so it runs
just before the network devices.
Note that if there are no hunted network devices hunted, then it will
run at the end, after all bootdevs are exhausted. In other words, it
will always run.
Series-changes: 2
- Update commit message to indicate the bootmeth will always run
- Document how the priority was chosen
Signed-off-by: Simon Glass <sjg@chromium.org>
When there are no more bootdevs we should still go through the global
bootmeths, since some may not have yet been used, if their priority has
not yet come up.
Add a final check for this at the end of the iterator.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present before scanning global bootmeths, the iterator sets the
method count to the index of the first global bootmeth. Now that we
support scanning the global bootmeths multiple times, we must leave this
count alone.
Check against have_global and first_glob_method instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Allow bootmeths to select when they want to run, using the bootdev
priority. Provide a new bootmeth_glob_allowed() function which checks if
a bootmeth is ready to use.
Fix a comment in bootflow_system() which is a test for global bootmeths.
Signed-off-by: Simon Glass <sjg@chromium.org>
Use the methods_done flags to make sure that each global bootmeth is
only used once. For now this has no effect, since they are all processed
at the start.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add the logic to scan through the global bootmeths for every new
bootdev, in preparation for allowing global bootmeths to select where in
the hunter ordering they go.
Use a new bootmeth_glob_allowed() function to check if a bootmeth is
allowed, ensuring that each can run at most once.
For now this has no actual effect, since the global bootmeths are
unconditionally processed at the start, with iter->methods_done being
updated to include all of them. Therefore when scanning again, no
unprocessed global bootmeths will be found.
Signed-off-by: Simon Glass <sjg@chromium.org>
The code at the end of iter_inc() is already somewhat tortuous. Before
making it worse, move it into a function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a bitfield which tracks when bootmeths have been used. This will be
needed when global bootmeths can be used later in the iteration.
Fix a missing bootflow_free() while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
The current 'doing_global' refers to being in the state of processing
global bootmeths. Since global bootmeths are currently used once at the
start, it becomes false once the last global bootmeth has been used.
In preparation for allowing bootmeths to run at other points in the
bootstd interation, add a new 'have_global' flag which tracks whether
there are any global bootmeths in the method_order[] list. It is set up
when iteration starts. Unlike doing_global which resets back to false
after the global bootmeths have been handled, once have_global is set to
true, it remains true for the entire iteration process. This provides a
quick check as to whether global-bootmeth processing is needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
For now we only support dropping non-global bootmeths from the
iteration. Update first_glob_method in that case and add a few checks
that things are correct.
Signed-off-by: Simon Glass <sjg@chromium.org>
These have different behaviour from normal bootmeths and we are about to
enhance it. So add a test and also an extra check in bootflow_iter()
Signed-off-by: Simon Glass <sjg@chromium.org>
It is helpful in tests to be able to show the bootflow that is being
examined. Move show_bootflow() into boot/ and rename it.
Series-changes: 2
- Add a log_err() for an invalid state
Signed-off-by: Simon Glass <sjg@chromium.org>
This function is the core of the bootstd iteration. Add some debugging
for the decisions it makes along the way, to make it easier to track
what is going on.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a few comments about global bootmeths and first_glob_method
Fix a broken line in bootmeth_setup_iter_order() while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Unfortunately we cannot do this yet, as when booting with QEMU the
devicetree is provided at the start of memory. Until we have a built-in
way to handle copying this, we must retain the fdt_addr variable.
This reverts commit acc02734be265e92ec88ace5ac097ccb3099d40f.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a keyboard driver which returns keys produced by EFI.
This is basically the same as the serial driver but it doesn't combine
input and output into one driver, allowing more control when using a
separate screen.
Add the required devicetree fragment for ARM (only).
Series-to: concept
Series-cc: heinrich
Cover-letter:
efi: Tidy up some commands and provide a keyboard driver
This series collect various odds and ends to make the ARM EFI app show
a menu that looks reasonable, including truetype fonts and a new
keyboard driver, selectable by setting stdin to 'efi-kbd'.
Some highlights:
- fix some bugs in addr_find and part_find and adds docs / tests
- reset pager when clearing the console
- use at least 1G of memory with EFI since the app allocates 512M
- allow NEON registers so floating point can work (truetype)
- show the global_data flags with bdinfo
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Create a new file in lib/efi to handle conversion of keys from EFI
format to characters, so we can use it from multiple places. Update the
serial_efi driver accordingly.
Signed-off-by: Simon Glass <sjg@chromium.org>
This variable is not needed in the ARM app and can be confusing since
there might not be memory at this location. Drop it.
Signed-off-by: Simon Glass <sjg@chromium.org>
The current compiler is gcc-13 which presumably has fixed this bug.
Revert the work-around so we can enable Truetype which needs floating
point.
This reverts commit f43312c974.
Sometimes we want to position items individually rather than relying on
the automatic scene layout. Provide a flag for this, expanding the type
to cope.
Also add an assertion that the flags fit in the available space.
Signed-off-by: Simon Glass <sjg@chromium.org>
Several items use the SCENEOB_DISPLAY_MAX setting which does not work
with alignment. Some others have a negative height, which is now
checked, so results in the item being invisible.
Fix these problems.
Signed-off-by: Simon Glass <sjg@chromium.org>
There should be no need to parse the LMB tables manually. Use the
allocation-function provided instead. Adjust the argument checks while
we are here.
Also enable this command for sandbox and the EFI app, so it is built in
CI.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function uses #ifdefs and ends up with a very large indent, Split
it into two separate functions, one for the EFI app and one for other
builds.
Drop the use of config.h while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Recent work removed the if_type member. Update the code to use the new
method for obtaining the interface type.
Use hex so that large partition numbers (>=10) work correctly.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a way to specify the (fake) Ubuntu release being used, so that we
can (later) add more tests for this case.
Signed-off-by: Simon Glass <sjg@chromium.org>