Each arch has its own set of functions related to booting. Rather than
including them for each enabled command, have a single rule to include
them, using the new 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>
The condition here is reversed, which makes link and coral very slow,
leading to lab failures.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes 6182d2bdb6 ("common: board: make initcalls static")
Change board_init_f(), board_init_f_r() and board_init_r() to make
static calls instead of iterating over the init_sequence_f,
init_sequence_f_r and init_sequence_r arrays, respectively. This makes
the code a simpler (and even more so when initcall_run_list() is
later removed) and it reduces the binary size as well. Tested with
xilinx_zynqmp_kria_defconfig; bloat-o-meter results:
- With LTO
add/remove: 106/196 grow/shrink: 10/28 up/down: 31548/-33829 (-2281)
Total: Before=1070471, After=1068190, chg -0.21%
- Without LTO
add/remove: 0/54 grow/shrink: 3/0 up/down: 2322/-2832 (-510)
Total: Before=1121723, After=1121213, chg -0.05%
Execution time does not change in a noticeable way.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
The mcr and msr instructions are available in Thumb mode only if
Thumb2 is supported. Therefore, if __thumb2__ is not set, make
sure we switch to ARM mode by inserting a .arm directive in the
inline assembly.
Fixes LTO link errors with kirkwood platforms, triggered by a later
commit:
tools/buildman/buildman -o /tmp/build -eP sheevaplug
[...]
{standard input}:24085: Error: selected processor does not support `mrc p15,0,r3,c1,c0,0' in Thumb mode
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
The message "DRAM: 2 GiB (effective 32 GiB)" can be a little confusing,
modify the message s/effective/total to make it more evident.
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Enable logging, TPM and the lsblk and cat commands. These are all useful
for using and debugging the EFI app.
For the 32-bit app, enable CONFIG_BOARD_EARLY_INIT_R so that the EFI
devices are scanned.
Series-to: u-boot
Series-cc: heinrich
Cover-letter:
x86: efi: Various app improvements to support bootstd
This series makes a number of improvements to the EFI app. Mostly it
applies to x86 but the ARM version will share some improvements.
The main updates are:
- Improve linker scripts and options to detect missing symbols and
remove unused code
- Enable bootstd and provide a default which can find an extlinux OS on
EFI media
- Make the 32/64-bit apps more similar in terms of features and link
script
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:458676
Use bootstd for booting. Add the -p option since we may wish to boot
from an extlinux file even if a EFI partition is present.
Disable the bootz command since this is not applicable for x86 and
causes bootstd to attempt it anyway.
Signed-off-by: Simon Glass <sjg@chromium.org>
The cache is managed by the first-stage EFI firmware, so the 'cache'
command is not useful.
SCSI and AHCI are not used in the app, since it relies on EFI for all
block devices.
Make sure all three options are not present in the 32/64-bit apps.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add --gc-sections to help reduce the size of the EFI app. Add a check
for undefined symbols too, since using these can hang or crash the app.
Signed-off-by: Simon Glass <sjg@chromium.org>
These two files are not used in the EFI app and it does not make sense
to compile them in. Omit relocate.c and physmem.c
Signed-off-by: Simon Glass <sjg@chromium.org>
The EFI app has its own way of handling the global_data pointer,
regardless of which arch is in use. Skip the jump_to_copy() function
since it calls the arch-specific arch_setup_gd().
Signed-off-by: Simon Glass <sjg@chromium.org>
Although GD_FLG_SKIP_RELOC is enabled for the app, the code for
relocation is still present in the image. Add a few dummy functions
needed on x86.
Signed-off-by: Simon Glass <sjg@chromium.org>
Mark important sections with KEEP so that the linker will not remove
them when garbage-collection is (later) enabled.
Provide a _end symbol so that this can be accessed in setup_mon_len()
Signed-off-by: Simon Glass <sjg@chromium.org>
The 32- and 64-bit scripts are more different than they need to be.
Make some changes to both so that it is easier to see the necessary
differences.
For the 32-bit script this is mostly just whitespace. For the 64-bit
script the eh_frame section is discarded and the .data section is
reordered.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a Kconfig option to easily enable debugging of the app using the
recommended method. Provide some docs too.
Signed-off-by: Simon Glass <sjg@chromium.org>
Update the links to an embedded style. Also drop the part about needing
to support ARM, as this is done now.
Signed-off-by: Simon Glass <sjg@chromium.org>
The current name of 'efi_media' is annoying in that it must be given
with 'bootflow scan'. We would prefer to use 'bootflow scan efi', for
example.
Rename the driver to 'efi'.
Signed-off-by: Simon Glass <sjg@chromium.org>
By default, if a boot partition is found, no further partitions are
scanned on the same media.
This can be inconvenient in the case where there is an EFI
boot-partition present (mounted as /boot/efi), but extlinux is being
used to boot (e.g. mounted as /boot).
Provide a -p flag for 'bootflow scan' to allow any partition to be
scanned.
Signed-off-by: Simon Glass <sjg@chromium.org>
The help for 'bootflow scan' is missing some flags. Tidy this up and
update the docs as well, keeping the flags in alpha order.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present the -bios option is used to specify the firmware, but this does
not allow settings to be adjusted.
Use the pflash method instead, with a separate variables file, so that
settings can be changed.
Add a -g option to tell QEMU to stop and wait for gdb to connect.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a -v option for verbose output. For now this just shows the QEMU
cmdline before starting it. This allows the user to start it separately,
perhaps tweaking the args.
Signed-off-by: Simon Glass <sjg@chromium.org>
Bring this script into line with build-qemu so an OS and release can be
specified. As with that script, only Ubuntu is supported for now.
Signed-off-by: Simon Glass <sjg@chromium.org>
This is a useful feature when booting the EFI app, so add this option to
the build-efi script too, matching the same option in build-qemu
Signed-off-by: Simon Glass <sjg@chromium.org>
This provides a few clean-ups:
- sort the imports correctly
- sort the arguments (-v is in the wrong place)
- use os_arch for the OS architecture, to match build-efi
Signed-off-by: Simon Glass <sjg@chromium.org>
Ilias Apalodimas <ilias.apalodimas@linaro.org> says:
Last time the kbuild scripts were synced with the Linux kernel was on the
4.20 release. Updating directly to 6.x makes the diff difficult to read, so
let's do the changes incrementally and bump to 5.1 first.
Since the number of commits is big, I am splitting this in multiple series.
This one includes most of the commits for Makefile.build,
Makefile.lib and some from Makefile.
commit eeb5687a7139649e ("kbuild: add -Werror=strict-prototypes flag unconditionally")
commit 3812b8c5c5d5 ("kbuild: make -r/-R effective in top Makefile for old Make versions")
commit b421b8a6cb87 ("kbuild: remove unused archmrproper")
commit 1a49b2fd8f58 ("kbuild: strip whitespace in cmd_record_mcount findstring")
commit 88110713ca9dfb ("kbuild: hardcode genksyms path and remove GENKSYMS variable")
commit 1d8001ef358 ("kbuild: generate modules.order only when CONFIG_MODULES=y")
commit 45c4372d00 ("kbuild: refactor quiet_modtag")
commit b39a691617e4 commit ("kbuild: remove redundant quiet_modtag for $(obj-m)")
commit 5439f09f488f ("kbuild: remove redundant 'set -e' from cmd_* defines")
commit e5d289100d3a ("kbuild: remove trailing semicolon from cmd_* passed to if_changed_rule")
commit 3a2429e1faf4 ("kbuild: change if_changed_rule for multi-line recipe")
commit ee3e46b7efd2 ("kbuild: refactor modversions build rules")
commit 4317ee3b6a5e ("kbuild: remove redundant 'set -e' from sub_cmd_record_mcount")
commit 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd files")
commit 898f5a009f22 ("kbuild: move archive command to scripts/Makefile.lib")
commit b79c6aa6a1f1 ("kbuild: remove unnecessary in-subshell execution")
commit afa974b77128 ("kbuild: add real-prereqs shorthand for $(filter-out FORCE,$^)")
commit ecbd10d90e94 ("kbuild: simplify rules of data compression with size appending")
commit 58156ba4468f ("kbuild: skip 'addtree' and 'flags' magic for external module build")
commit 172caf1993b7 ("kbuild: remove redundant target cleaning on failure")
commit f3fd4a3f3a38 ("kbuild: remove redundant 'set -e' from filechk_offsets")
commit a2237fec1e06 ("kbuild: Enable dtc graph_port warning by default")
commit 70523a3ce5ff ("kbuild: disable dtc simple_bus_reg warnings by default")
commit e4aca4595005 ("kbuild: de-duplicate fixdep usage")
Link: https://lore.kernel.org/r/20250520052153.307194-1-ilias.apalodimas@linaro.org
If an Unexpected exception is thrown in a test, an undefined variable
error is reported. Fix this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 85d7dae377 ("test: Detect dead connections")
If a BootFail exception is thrown in a test, it is not handled
correctly. Use the correct fixture variable 'ubman_fix' to resolve this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: d9ed4b75ad ("test/py: Drop u_boot_ prefix on test files")
Add tests that check that SPL can generate a standard passage on ARM and
that U-Boot proper can accept it successfully.
Series-change: 4
- Finish the commit message
Series-to: u-boot
Series-cc: ilias, heinrich, trini
Series-cc: François Ozog <francois.ozog@linaro.org>
Series-cc: Bill Mills <bill.mills@linaro.org>
Series-cc: Raymond Mao <raymond.mao@linaro.org>
Series-version: 5
Series-process-log: sort, uniq
Series-links: 3:453293
Cover-letter:
passage: Define a standard for firmware data flow
This series adds a standard way of passing information between different
firmware phases. This already exists in U-Boot at a very basic level, in
the form of a bloblist containing an spl_handoff structure, but the intent
here is to define something useful across projects.
The need for this is growing as firmware fragments into multiple binaries
each with its own purpose. Without any run-time connection, we must rely
on build-time settings which are brittle and painful to keep in sync.
This feature is named 'standard passage' since the name is more unique
than many others that could be chosen, it is a passage in the sense that
information is flowing from one place to another and it is standard,
because that is what we want to create.
The implementation is mostly a pointer to a bloblist in a register, with
an extra register to point to a devicetree, for more complex data. This
should cover all cases (small memory footprint as well as complex data
flow) and be easy enough to implement on all architectures.
The emphasis is on enabling open communcation between binaries, not
enabling passage of secret, undocumented data, although this is possible
in a private environment.
To try this out:
$ ./scripts/build-qemu -a arm -rsx
This will build and run QEMU for arm64 and you should see the standdard
passage working:
Core: 49 devices, 13 uclasses, devicetree: passage
This series is available at u-boot-dm/pass-working
END
Cover-changes: 2
- Rebase to master (dropping bloblist patches already applied)
Series-changes: 3
- Add tests for azure
- Add test for aarch64
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I321f53b875ffb594a569796509e64830b9f3fe09
Add checks / documentation for blobs which are already in the list. This
brings U-Boot up to the standard required by the standard-passage
documentation.
Cover-changes: 3
- Rebase to -master
Signed-off-by: Simon Glass <sjg@chromium.org>
Add documentation about standard passage and update the maintainers.
Series-changes: 2
- Add detailed arch-specific information
- Add comments about passing a bloblist to Linux
- Add comments about how to pass standard passage to EFI
- Fix 'it' typo
Series-changes: 3
- Fix 'that' typo
- Update docs for the various code changes
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I91d5b9ae45e8d1081b1e165620ad1946bd69af00
Add a file which can be used to check that structs used in standard
passage do compile. No other validation is done at present, but could be
considered later.
Signed-off-by: Simon Glass <sjg@chromium.org>
Check that the standard passage works on ARM, by setting it up in SPL
and making sure that it comes through correctly in U-Boot proper.
Series-changes: 2
- Add a devicetree for qemu-arm so that qemu_arm_spl can work
Series-changes: 3
- Add support for a 64-bit test also
- Add conditions to avoid enaling the test on qemu_arm_sbsa
Series-changes: 5
- Enable the test for any board which uses OF_PASSAGE
Signed-off-by: Simon Glass <sjg@chromium.org>
This is not needed now, as the startup protocol is handled in
arch-specific code early in boot.
Drop BLOBLIST_PASSAGE_MANDATORY as well, as OF_BLOBLIST is enough to
cover this. With standard passage the devicetree is accessed before the
bloblist is inited.
Signed-off-by: Simon Glass <sjg@chromium.org>