Add a VBE-ABrec bootmeth so that the VBE state can be accessed.
Series-changes: 2
- Add new patch with a bootmeth driver for abrec
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than a weak function, use the recently added event to adjust the
OS load-address. Tidy up the code a little while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
The current margin between the menu label and the following objects is
much larger than is needed. Reduce it.
Signed-off-by: Simon Glass <sjg@chromium.org>
In some cases we want to change the image data used by a scene_img. Add
a function to handle this.
Adjust the BMP function to use a const for the data, since it is not
allowed to change it.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present all coordinates are absolute and must fit within the display.
This makes it hard to create an expo which can work on any size of
display, a key goal of expo.
Add the concept of a nominal size, to which all coordinates conform. Once
the real display-size is known, expo can in principle (i.e. with later
work) scale the coordinates and objects according.
Signed-off-by: Simon Glass <sjg@chromium.org>
These files can have tabs, but they are currently parsed as separate
lines. Fix this.
Also, some files provide a separate 'menu label' which has more
information than the 'label', so use that if available.
Finally, we don't yet have the ability to parse all entries in the
file until the user actually boots the extlinux.conf file. At present,
this means that the last entry is shown. It seems better to use the
first entry, so update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
When the user presses 'up' when on the top menu item, it is a waste of
time to refresh since nothing has changed.
Add a new return code from this function to indicate that the UI must be
refreshed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Allow the caller to detect when a keypress has actually resulted in a
change of the item that is pointed to.
Signed-off-by: Simon Glass <sjg@chromium.org>
Use CONFIG_ZBOOT instead of CONFIG_CMD_ZBOOT as the condition for
supporting booting from a zImage, so that this works when CONFIG_CMDLINE
is disabled.
Series-to: heinrich
Cover-letter:
boot: Enable bootstd features without CMDLINE
This series refactors various Kconfig options to allow programmatic boot
to operate on x86.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
OS files are typicallly provided on an ext4 filesystem. This is normally
enabled due to other options, but enable it in case not. This is needed
by the EFI app when CMDLINE is not enabled, for example.
Signed-off-by: Simon Glass <sjg@chromium.org>
This option does not related to commands. Move it into boot/Kconfig and
adjust it to depend on CONFIG_BOOT rather than CONFIG_CMD_BOOTM
Simplify the 'depends on' while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
This option does not related to commands. Move it into boot/Kconfig and
adjust it to depend on CONFIG_BOOT
Simplify the 'depends on' while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
These options belong in boot/Kconfig since they are not related to
commands. Move them and adjust them to depend on CONFIG_BOOT
Signed-off-by: Simon Glass <sjg@chromium.org>
The bootm.c and bootm_os.c files are used by various boot commands, not
just bootm.
Update the Makefile condition to use CONFIG_BOOT instead of
CONFIG_CMD_BOOTM so that this code can be used when CMDLINE is disabled.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present we assume that the cmdline is enabled, so CMD_BOOTM is used
to determine the presence of the boot_run() function.
As a first step towards enabling boot_run() without CONFIG_CMDLINE,
create a new BOOT option. Select it in BOOT_DEFAULTS and make CMD_BOOTM
depend on it. Make it default y to mirror the bootm command.
The intention with this option is that it covers the core code used by
all boot commands (e.g. zboot, bootm, booti). This includes
bootm_run_states() and functions called from there.
The name 'BOOT' is used instead of 'BOOTM', since bootm is actually a
command and it may be that we might wish, for example, to enable the
'zboot' part of the boot functionality, without enabling the 'bootm'
part of it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Currently, when decompressing a gzip-compressed image during bootm, a
generic error such as "inflate() returned -5" is shown when the buffer is
too small. However, it is not immediately clear that this is caused by
CONFIG_SYS_BOOTM_LEN being too small.
This patch improves error handling by:
- Detecting Z_BUF_ERROR (-5) returned from the inflate() call
- Suggesting the user to increase CONFIG_SYS_BOOTM_LEN when applicable
- Preserving the original return code from zunzip() instead of overwriting
it with -1
By providing clearer hints when decompression fails due to insufficient
buffer size, this change helps users diagnose and fix boot failures more
easily.
Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
The bootstd code itself does not have any dependency on BLK in order to
build. However, in order to minimize size growth of non-migrated
platforms, change this from being "default y" to "default y if BLK".
This will make it easier to begin migration of platforms which do not
have any BLK-class device but do want to use bootstd.
Signed-off-by: Tom Rini <trini@konsulko.com>
The booti command does not use the CONFIG_SYS_BOOTM_LEN value and
instead sets a maximum decompression-buffer size of 10x the size of the
compressed data.
Add this as an option in bootm_load_os() so that booting without the
command-line works in the same way as the 'booti' command.
Link: https://lore.kernel.org/u-boot/2ad3b1c5-b6e7-47e2-b225-834b821cc5c4@kwiboo.se/
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Jonas Karlman <jonas@kwiboo.se>
Fixes: b13408021d ("boot: pxe: Use bootm_...() functions where possible")
RISC-V uses a similar linux 'Image' format to ARM64, so add support for
it in bootm_load_os()
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Move this logic into a function so we can give it a sensible name.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Insets are handled inconsistently at present, since menus use them to
offset the label text, whereas textlines don't. This is done because
menus need the margin to be visible when opened. However this causes an
alignment issue when menus and textlines appear in the same cedit.
Remove the offsets from menus and compensate by adjusting the bounding
boxes used for highlighting and the opened menu.
Line up menu items and textlines vertically and add a style option for
textlines to control how much padding is added.
Add a test to check the positions of objects in a cedit, since this is
more direct than the rendering tests. Add style information so that the
impact can be seen.
Signed-off-by: Simon Glass <sjg@chromium.org>
There is no need to create a new ID and it makes it harder for tests to
locate objects. Use the ID provided in the file, if any.
Signed-off-by: Simon Glass <sjg@chromium.org>
With fixed coordinates it is difficult to create scenes that can work on
any display size. Add a separate 'requested' bounding box for each
object and sync it when required.
With future work, this will allow scaling the nominal coordinates so
that an expo can be rendered correctly on a wider range of displays.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than hard-coding the distance between the labels and the key,
measure the width of the pointer to determine the space needed.
Tweak a few tests according. It isn't possible to get the same result
when the font-size differs.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present the components of each menu item are set at fixed positions.
Use an 'x' variable instead, so that we can eventually move to taking
account of the actual dimensions of the items.
Signed-off-by: Simon Glass <sjg@chromium.org>
The goal here is to obtain the dimensions of the edit field, which does
not change.
Since scene_arrange() now handles setting the bounding-box size based on
the dimensions there is no need to do it here.
Adjust the code to simply set up the dimensions.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is possible that positions, styling or even text have changed since
the scene was initially arranged, so recalculate the dimensions of all
objects before arranging the scene.
Signed-off-by: Simon Glass <sjg@chromium.org>
A menu's dimensions are currently only used for positioning the
component parts of the menu, i.e. the label, key, description and
preview.
Move the logic for this entirely into the scene_menu file and drop the
logic at the top level.
Signed-off-by: Simon Glass <sjg@chromium.org>
Switch the order of these two calls since dims for each object should be
figured out before moving to arranging things.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than drawing the poointer with a hard-coded position elsewhere in
the code, add a field to hold this value.
Move the check for the pointer position up so that the ordering of the
tests matches the order that the fields are dealt with in
scene_menu_arrange()
Signed-off-by: Simon Glass <sjg@chromium.org>
Rename the existing expo_apply_theme() to expo_setup_theme() and adjust
the former so that it applies a theme which has already been read into
the struct. This will make it easier for tests to check theme
adjustments, since they won't have to put them in a node.
Add the white-on-black property into the theme struct while we are.
Signed-off-by: Simon Glass <sjg@chromium.org>
We always call this with false first, then true. Drop the parameter and
handle this within the function itself.
Signed-off-by: Simon Glass <sjg@chromium.org>
Moving from one scene to another should not result in the scene being
re-arranged. Drop this, so that tests can have more control of when
scenes are arranged.
Also drop the scene_arrange() call when applying a theme, for the same
reason.
Add the now-required scene_arrange() to cedit and bootmenu
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide a convenient function which arranges the current scene in an
expo. Make use of this in bootflow_menu
Signed-off-by: Simon Glass <sjg@chromium.org>
When testing menu items it is easier to check that the correct preview
is shown if the preview images are different. Make a copy of the image
and modify the palette for the second menu item, so this is obvious.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass a pointer to a memory mapped initrd and its size to
efi_binary_run. The EFI stack will register an EFI_LOAD_FILE2_PROTOCOL
for the next boot stage to access this initrd.
Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
One of the problems an OS may face, when running in EFI, is that
a mounted ISO, after calling ExitBootServices goes away, if that ISO
is resident in RAM memory as a ramdisk.
ACPI has NFIT and NVDIMM support to provide ramdisks to the OS, but we
don't have anything in place for DTs. Linux and device trees have support
for persistent memory devices. So add a function that can inject a pmem
node in a DT, so we can pass information on the ramdisk the OS.
Signed-off-by: Masahisa Kojima <kojima.masahisa@socionext.com>
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Sometimes, it is necessary to provide an additional bootargs string to
the kernel command line.
We have a real scenario where one U-Boot blob needs to boot several
kernel images: the vendor-patched kernel image and the latest upstream
kernel image. The Amlogic (Meson architecture) tty driver has different
tty suffixes in these kernels: the vendor uses 'ttySx', while the
upstream implementation uses 'ttyAMLx'. The initial console setup is
provided to the kernel using the kernel command line (bootargs). For the
vendor kernel, we should use 'console=ttyS0,115200', while for the
upstream kernel, it must be 'console=ttyAML0,115200'. This means we have
to use different command line strings depending on the kernel version.
To resolve this issue, we cannot use the CMDLINE_EXTEND kernel
configuration because it is considered legacy and is not supported for
the arm64 architecture. CMDLINE_EXTEND is outdated primarily because we
can provide additional command line strings through the
'chosen/bootargs' FDT node. However, U-Boot uses this node to inject the
U-Boot bootargs environment variable content, which results in U-Boot
silently overriding all data in the 'chosen/bootargs' node. While we do
have the board_fdt_chosen_bootargs() board hook to address such issues,
this function lacks any FDT context, such as the original value of the
'chosen/bootargs' node.
This patch introduces a read-only (RO) fdt_property argument to
board_fdt_chosen_bootargs() to share the original 'chosen/bootargs' data
with the board code. Consequently, the board developer can decide how to
handle this information for their board setup: whether to drop it or
merge it with the bootargs environment.
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
It should be structured this way to demonstrate to the caller that
freeing the return value is unnecessary and that the caller cannot
modify it.
The function fdt_setprop() includes a parameter with a const char*
prototype, so it is better to use the const qualifier.
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
The expo now has all that is needed to apply a suitable theme, so drop
this unnecessary code. Any further tweaks can be added to the generic
expo code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Apply the theme, calculate dimensions, highlight the menu and arrange
the scene correctly, so that everything is ready to go when the expo
is rendered.
Signed-off-by: Simon Glass <sjg@chromium.org>
Some callers may wish to add items later as they are discovered. Split
the setup code into its own function, to permit this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than returning a bootflow, return the index of the bootflow. This
will allow callers to do their own translation to bootflows or some
other data structure.
Also return a special code when the user tries to move the pointer, so
that the caller can cancel the boot-menu timeout, if this is in use.
Signed-off-by: Simon Glass <sjg@chromium.org>
The menu is currently quite basic. Make use of some recently added
features in expo, to:
- Show proper prompts
- Highlight the current item
- Centre text
- Use multi-line text instead of two independent lines
- Put a box around the items
Signed-off-by: Simon Glass <sjg@chromium.org>
It is often necessary to centre objects within the display area. Add a
special position value to indicate this.
Signed-off-by: Simon Glass <sjg@chromium.org>