The bootflow menu creates an image at position -4, expecting that it
will be relative to the right side of the display.
With the recently added alignment feature, this is not supported. Update
the implementation to calculation the correct position instead. Update
the tests to match.
Signed-off-by: Simon Glass <sjg@chromium.org>
In some cases it is useful to use expo with a mouse (or touchpad). Add
a way to tell expo to find and record a mouse device.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fix up send_key_obj() to mention a missing argument. Add a bit more
detail in scene_send_key() to explain what 'processing' means.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present boxes are not supported in the expo_build format. Also, it is
now possible to draw filled boxes, a recently added feature to the video
API.
Expand the box feature slightly to resolve these two items.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
If there is no console (e.g. in a test) this function segfaults. Add
the console as a parameter so it is clear that it is needed. Check for
it in the caller.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present only an outline boxes is supported, albeit with a thickness
parameter. Provide a way to draw a filled rectangle.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
This crept in a while back, so let's drop it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 184fc0379d ("bootflow: bootmeth_efi: Handle fdt not available.")
Make use of bootflow_guess_label() to get the label for a menu, since it
provides more information for the EFI app.
Signed-off-by: Simon Glass <sjg@chromium.org>
The 'bootflow list' command supports looking at the EFI device-path when
available. Move this piece into a common function so it can be used
elsewhere.
This updates the output from 'bootflow list'.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a new 'fdt reserved' subcommand that displays all reserved memory
regions defined in the device tree's /reserved-memory node. This command
provides a formatted table showing the ID, name, start address, and size
of each reserved memory region.
Avoid a conflict with the existing 'fdt resize' command. Update the docs
and add a test.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a new helper which lists the subnodes of the reserved-memory node.
This can be helpful when checking the devicetree before booting.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
This should add the filename provided to the image, not the original
bootflow filename. Fix it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 114dd14e38 ("bootmeth: Update the read_file() method to...")
For a fake go, we should tell the event not to actually do anything
irreversable, so pass the flag along.
Move the enum into a separate event_decl.h header file since otherwise
we must include bootm.h which causes a breakage with qemu-ppce500
We also don't want to pull event.h into the tools build, since it uses
types like u8 which are not available outside U-Boot
Signed-off-by: Simon Glass <sjg@chromium.org>
This shows an image type as an OS, which is not correct. Fix it up to
show both.
Series-changes: 2
- Add a colon so it is clear that 'load_os type' is not a compound term
Signed-off-by: Simon Glass <sjg@chromium.org>
The conversion to using an event was not done correctly, with the
result that it has no effect. Fix it, by passing in the length and
actually using the returned address.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 207bf34de7 ("boot: efi: Use an event to relocate the OS")
In some cases a board may wish to do some final processing before
starting the OS. An example is the EFI app, which may wish to call
exit-boot-services.
Add an event to permit this.
Series-to: concept
Cover-letter:
boot: Allow lmb-allocation of compression buffer with booti
ARM 'booti' images (as created by Linux 'make Image') typically need to
be compressed. At present the decompression buffer is described by a
pair of environment variables: kernel_comp_addr_r and kernel_comp_size
This is quite inflexible, since the buffer size and location must be
pre-set in the environment, before the OS size is known.
For the EFI app, it is quite difficult to work with a fixed buffer. It
is not in control of the memory map so it may be that the requested
buffer address is not available.
This series updates the boot implementation to allow the variables to
be omitted, with lmb allocations done in this case. This resolves the
problem in the EFI app, with kernels which come from extlinux.conf
When the EFI app loads another app, a similar problem is present, but
with the EFI bootmeth, also resolved in this series.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Unfortunately no one else has taken up this migration. For now, reword a
a comment to more correctly describe what the event uses.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function is very simple at present, only supporting a fixed buffer
of a fixed size.
For cases where the address is not provided, we may still want to set a
limit on the size.
Support lmb reservation of an existing buffer as using lmb to reserved a
new buffer. Use the provided size information to select a suitable size
for the decompression buffer.
Signed-off-by: Simon Glass <sjg@chromium.org>
If the OS size is not known, or zero, refuse to decompress it.
Note that the 'booti' command does not have this information, but in
that case, kernel loading is handled by its own function called
booti_start()
Signed-off-by: Simon Glass <sjg@chromium.org>
The size of the loaded OS file can be useful when decompressing, or to
check that the. FIT image matches its size. Add an os_size field for
this in struct bootm_info so it can be recorded.
Signed-off-by: Simon Glass <sjg@chromium.org>
Some environment variables affect the operation of bootm. Reading these
variables is buried within the boot code at present.
Ideally this information should be in struct bootm_info so that it can
be provided directly, without needing the environment variables. Also it
should support allocation if the variables are not provided.
As a first step towards this, add an explicit read of the variables,
storing the values. For now this only covers kernel_comp_addr_r and
kernel_comp_size
Signed-off-by: Simon Glass <sjg@chromium.org>
The bootm code handles a large number of variables. It is helpful to be
able to see which code paths are taken, when something doesn't work as
expected.
Add some debugging which can be enabled if needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
The app cannot know the address to use in advance, so does not have a
value for kernel_addr_r in its environment, if it even has an
environment.
Allocate memory for the kernel instead. Limit it to 64MB which seems
like plenty for the distros out there. It is enough to load a full
kernel if needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present this function only uses two fields, but it also needs to
access the kernel-compression info. In preparation for that, pass in the
whole struct.
Series-to: concept
Series-cc: heinrich
Cover-letter:
boot: Start to remove dependency on kernel_addr_r etc.
Before bootstd, boot scripts were used to boot distros. These worked by
using a 'load' command to load a file and a 'bootm' command to boot.
Obviously these commands need addresses, so the approach taken was to
define a number of environment variables to provide them, for the
various situations. These are documented at [1].
With bootstd, booting is built into U-Boot so there is no real need for
these variables. Also, bootstd records all loaded images in a list, so
knows where and what they are.
However, since bootstd uses much of the same code as the bootm command,
for example, to date it has used these same variables.
This is OK to some extent, since boards maintainers have got used to the
need to statically configure the addresses used for a kernel, ramdisk,
devicetree, etc. But is does cause problems:
- since the kernel and initrd can grow quite a bit from year to year,
sometimes the values need to be updated to save space [2]
- some boards don't have fixed addresses (such as the EFI app)
- fixed values means that much more space must be provided than is
normally needed; for this reason the ramdisk is generally at the
highest address
The variables do have some benefit, e.g. for people who want things
loaded at a known location, so it makes sense to keep them around. But
they should be optional.
This series starts the process of removing the requirement for these
variables, focussing on the extlinux code. It mostly consists of
refactoring.
Several functions are updated to support lmb reservation. At least for
filesystems, bootstd can query the file size and use lmb to reserve the
required amount of (aligned) memory. The bootmeth read_file() method is
updated to handle this. When decompressing, bootm is updated to support
reservation (instead of an address) for the decompressed file.
With these in place, various patches are provided to work this new
feature into the pxe_utils code used by extlinux.
The next step after this is to attack the bootm code itself, so that the
struct bootm_info controls the addresses, without any environment
variables. That will be the subject of the next series.
[1] https://docs.u-boot.org/en/latest/develop/distro.html#required-environment-variables
[2] https://patchwork.ozlabs.org/project/uboot/patch/20241220003447.2913443-5-sjg@chromium.org/
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Converting back and forth between a string and a ulong does not make
much sense. Simplify the code by adding a separate value for the kernel
address.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function is needlessly convoluted, reading the kernel address as a
string, possibly adding the FIT configuration, then parsing that to
obtain the kernel address again.
Create a kern_addr variable to hold the kernel address, so we can
simplify the code.
Signed-off-by: Simon Glass <sjg@chromium.org>
We normally require environment variables when loading files using PXE/
syslinux. This is not really necessary, since we can use lmb to find a
suitable space.
Add support for reserving space in get_relfile_envaddr(), which is the
commonly used function for reading a file. Use env_get() so no error is
shown if the environment variable does not exist.
Signed-off-by: Simon Glass <sjg@chromium.org>
It doesn't seem worth allocating space for a label when it is normally
going to be under 20 characters. Use a fixed-sized string (with plenty
of space) instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
This is a string, so add a string suffix to make that clear.
Switch the assignment order in label_run_boot(), since the FDT is loaded
after the kernel.
Signed-off-by: Simon Glass <sjg@chromium.org>
Several of the strings in this struct would be better off as addresses,
now that they are passed around a fair bit.
Start by converting initrd_addr_str to ulong
Signed-off-by: Simon Glass <sjg@chromium.org>
Update this function to return the address obtained from the environment
variable. That will allow the caller to know where the image ended up.
For now this is not used.
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide some helper functions which can set the string value of a field
in struct bootm_info from an address.
Signed-off-by: Simon Glass <sjg@chromium.org>
In some cases we don't have a particular address to read into so would
like one reserved. Adjust this function to support that.
Signed-off-by: Simon Glass <sjg@chromium.org>
In some cases we don't have a particular address to read into so would
like one reserved. Adjust this function to support that.
For now, sysbot_read_file() fails if the address is not provided. This
will be resolved in a later patch.
Signed-off-by: Simon Glass <sjg@chromium.org>
In some cases we don't have a particular address to read into so would
like one reserved. Adjust the read_file() method to support this.
Signed-off-by: Simon Glass <sjg@chromium.org>
When 'bootflow read' is used to read images, initrd_str is not inited
before strdup() is called. Note that this is only used by developers.
Set the variable to an empty string to start.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present we require this environment variable in order to do any
booting. The check for this actually later (the '"malloc fail' message)
but there is a possible NULL access before getting to that point.
Check it immediately after reading.
Signed-off-by: Simon Glass <sjg@chromium.org>
Some callers may want a maximum size smaller than 1G so add a parameter
for the caller to use.
Series-to: concept
Cover-letter:
Continue development of the EFI app (part A)
This series expand the EFI app to include more of the required
functionality for booting:
- access to device-path functions
- disable networking (to be dealt with later)
- rename BOOTMETH_EFI_LOADER since this should be usable by the app
- move towards getting EFI booting going in the app
- various script improvemens to support continued development
END
Signed-off-by: Simon Glass <sjg@chromium.org>
The EFI loader uses a rather unpleasant global for starting images. For
now the only way we intended to support booting EFI apps from the U-Boot
EFI app is via a bootmeth.
Update the condition so that the 'bootefi' command only works from the
EFI loader.
Future work may enable the 'bootefi' command for the app.
Signed-off-by: Simon Glass <sjg@chromium.org>
Once the EFI app supports booting an OS, this bootmeth will work without
CONFIG_EFI_LOADER being enabled. Rename it so this is clear.
Signed-off-by: Simon Glass <sjg@chromium.org>