Commit Graph

2613 Commits

Author SHA1 Message Date
GitLab CI
31d651bd97 chore: Bump version for release candidate 2026.02-rc1 2025-12-22 10:41:05 +00:00
Manorit Chawdhry
ef37f2e5dc Makefile: Match the full path to ccache for filtering
One can use ccache by keeping ccache in PATH or by providing the full
path to ccache as well. Providing the full path to ccache fails as the
current regex tries to look for ccache being the initial token during
filtering.

Do a greedy search to remove anything before ccache for regex matching.

Fixes: 04b1d84221 ("Makefile: fix empty MK_ARCH when using ccache")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
(cherry picked from commit c06705a9a1)
2025-12-19 09:40:26 -07:00
Mark Kettenis
6515b7d2ad Makefile: avoid non-standard sed expressions
The '?' that is used in the sed expression that determines MK_ARCH
is part of the extended regular expression syntax, but the default
behaviour of sed as specified by POSIX is to use only basic regular
expression syntax.  Use the equivalent '\{0,1\}' instead as
suggested by the OpenBSD re_format(7) man page.

Fixes: 04b1d84221 ("Makefile: fix empty MK_ARCH when using ccache")
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Quentin Schulz <quentin.schulz@cherry.de>
(cherry picked from commit 57b6fb7eb1)
2025-12-17 02:30:38 +00:00
GitLab CI
a7a93faecd chore: Bump version for final release 2025.12 2025-12-01 10:46:17 +00:00
GitLab CI
634ace57a6 chore: Bump version for release candidate 2025.12-rc3 2025-11-17 10:39:37 +00:00
Simon Glass
5bdf2b673d Allow excluding efi_main from the library
In the case where this is provided by a Rust main program we don't want
to include it. Add the logic to remove it.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 08:40:05 -07:00
Simon Glass
561c939a82 ulib: Allow undefined symbols in the library
At present it isn't possible for ulib to call a function outside the
library, since it produces a link error.

Relax this contraint, so we can call a main() function provided by the
main program.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 08:40:05 -07:00
Simon Glass
9b41b0fbe7 Add an option to select whether the shared library is built
The shared library is useful only with sandbox, so add an option to
allow it to be disabled, e.g. for EFI builds.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 06:23:59 -07:00
GitLab CI
e4c38498ad chore: Bump version for final release 2025.10 2025-10-06 09:45:35 +00:00
GitLab CI
238eb7c102 chore: Bump version for release candidate 2025.10-rc3 2025-09-22 09:40:05 +00:00
Simon Glass
a5009484b8 Makefile: Set the correct version for today
We should be in the -rc2 release at present, with the new numbering, so
update the Makefile

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-12 05:04:21 -06:00
GitLab CI
88b9c00663 chore: Bump version for release candidate 2025.10-rc2 2025-09-12 09:41:21 +00:00
Simon Glass
44127a8185 ulib: Add a Rust example
The U-Boot library can be used from Rust fairly easily. Add an example
for this, following along the lines of the existing ulib example.

Note that the new way of representing C strings is not used for now,
since it is not available in v1.75 of cargo, as shipped by Ubuntu 24.04

Co-developed-by: Claude <noreply@anthropic.com>
Co-developed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-11 15:19:22 -06:00
Simon Glass
1a89708f16 ulib: Makefile: Plumb in creation of the API header
Plumb in generation of the u-boot-api.h file, containing renamed symbols
for inclusion by the program being linked with ulib.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-08 13:09:58 -06:00
Simon Glass
e2d0a0d8da ulib: Makefile: Plumb in renaming symbols for ulib
Plumb this feature in, so that symbols are renamed as expected.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-08 13:09:58 -06:00
Simon Glass
791e1b746c ulib: Makefile: Create a library with renamed symbols
Add a way to create a .ulib-objs file which contains all of the object
files from the build, but with symbols renamed according to the
rename.syms file.

The file excludes main() which is present in the sandbox build, so that
programs which link with libu-boot can provide their own main()

For now this file is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-08 13:09:58 -06:00
Simon Glass
f2c378f0f9 ulib: Provide an example of how to build with ulib
Add an example Makefile which shows how to build against U-Boot from
outside the U-Boot source tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-05 15:47:39 -06:00
Simon Glass
c3841693b3 sandbox: Make use of PLATFORM_LIBS for ulib_test
Rather than specifying the sandbox-specific arguments in the main
Makefile, make use of PLATFORM_LIBS which has (more than) what we need.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-05 15:22:18 -06:00
Simon Glass
fa9a519562 ulib: Allow building of the libraries to be disabled
Provide a NO_LIB option which disables building the libraries. This
saves a little time.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-05 12:51:05 -06:00
Simon Glass
9bdbea4092 ulib: Provide a test program for the static library
Create a static version of the library test. This requires a linker
script, since the linker lists much be correctly placed within the final
executable.

Provide a linker script for the sandbox version.

Add both test files to the clean target.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-05 12:51:05 -06:00
Simon Glass
2786961c63 ulib: Add static-library build support
Sometimes it is more convenient to link an application directly with a
static library.

Add build rules to create libu-boot.a as a static library alongside the
existing shared library (libu-boot.so).

The static library is a fat archive containing all U-Boot object files
except for arch/sandbox/cpu/main.o since it contains main().

A temporary thin archive is used to collect all the objects.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-05 12:51:05 -06:00
Simon Glass
318f3aee3d ulib: sandbox: Move the linker-script name into config.mk
Each architecture will have its own version of the linker script, so use
a Makefile variable for it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-05 12:51:05 -06:00
Simon Glass
18d0bb3158 Kconfig: Rename API to LEGACY_API
Update Kconfig use use CONFIG_LEGACY_API since the API is now
deprecated.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-05 07:02:18 -06:00
Simon Glass
9268e78e44 api: Rename the api/ directory
Rename this directory legacy_api since it is now considered legacy.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-05 07:02:10 -06:00
Simon Glass
dec5db9b35 ulib: Enable building the ulib test program
Now that the required pieces are in place, add the test program into the
build. Provide the linker script too.

The library requires CONFIG_CMDLINE, at least initially, so don't
attempt to build it when there is no command line.

For clang, an error is produced, so disable it in that case too:

   test/ulib/ulib_test.o: file not recognized: file format not recognized

For now the program just crashes on startup, due to mon_len being larger
than available RAM.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-04 14:23:55 -06:00
Simon Glass
d505912174 ulib: Create a test program for the shared library
Provide a host program which can use the shared library. For now this
operates similarly to sandbox itself, but future work will make it more
flexible.

Leave it out of the build, since there are a few other pieces needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-04 14:23:55 -06:00
Simon Glass
19a76dfb5e ulib: Support building U-Boot as a shared library
Provide a rule which creates a libu-boot.so file which can be used to
provide some of U-Boot's functionality to another program.

Move the RISCV up a line so it is clear that it relates to the u-boot
target.

For now this is not very useful, as everything is bound together, and
U-Boot will just start normally when the library is used (including
waiting for the user to type commands!). Further work will improve this
over time.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-04 14:23:55 -06:00
GitLab CI
1dd869d9ba chore: Bump version for release candidate 2025.09-rc1 2025-09-01 10:12:06 +00:00
GitLab CI
bfab0f797e chore: Bump version to 2025.08 2025-08-04 12:11:33 +00:00
Simon Glass
d43aab19fb efi: Create a common file for the stub
There is some duplicated code across x86 and ARM even though they have
slightly different implementations.

They both call efi_stub_exit_boot_services() and this function does not
relate to the app, so belongs better outside the general-purpose efi.c
file.

Create a new efi_stub C file containing this function. Leave out the
efi_ prefix since this is obvious from the directory name.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:26:34 -06:00
Simon Glass
0b00c34e7c efi: Drop the efi_ prefix on the arch-specific stub files
These are already in the lib/efi/ directory so the extra efi_ prefix is
redundant and makes files harder to find. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:26:34 -06:00
Simon Glass
72afce26be scripts: Add a script check consistency of linker lists
If linker lists have inconsistent alignment it can cause strange
runtime errors. Add a script that can detect and report these problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-29 06:53:46 -06:00
Bryan Brattlof
fd7290c2b2 binman: add atf-bl1 to etypes
Some SoCs require a Trusted Firmware-A (TF-A) AP Trusted ROM (BL1) to
initialize the SoC before U-Boot can run properly. Add an atf-bl1 etype
so we can properly package BL1 into a final binary

Signed-off-by: Bryan Brattlof <bb@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>
2025-06-10 14:09:14 -06:00
Simon Glass
0dccad74d8 Mark this tree as a concept
Use a 'Concept' tag for the experimental U-Boot so that it is clear it
is experimental.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-07 11:39:43 -06:00
Tom Rini
bf030467d2 Merge patch series "Update kbuild"
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
2025-05-31 10:07:09 +01:00
Simon Glass
e60873c8f3 passage: Support an incoming passage
Plumb in the ability for U-Boot proper to accept an incoming standard
passage from a previous phase, such as SPL or TF-A. This allows data to
be passed from binary to binary when firmware is booting.

Series-changes: 2
- Rebase to master
- Rework global_data for new stdpass convention

Series-changes: 3
- Move passage.h into this patch
- Add passage_valid() to decide if stdpass was provided
- Move arch_passage_entry() into this patch
- Make the global_data fields present only when needed

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-29 17:21:36 +01:00
Simon Glass
5f4327ec9f efi: Rename the lib/efi directory
This directory was created when U-Boot gained the ability to run as an
EFI app in 2015. Since then the EFI-loader feature has been added.

The code in lib/efi is not actually used by the loader, so the name is
confusing.

Rename the directory to efi_client to indicate that it includes files
just for U-Boot being a client of EFI, i.e. the EFI app and stub.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 08:02:11 +01:00
Ilias Apalodimas
cc23cb1894 efi_loader: Moved the generated ESL file to objtree
Tom reports that generating the ESL file we need for authenticated
capsule updates fails to work on azure which expects a RO git tree.

Move it to $(objtree)

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-27 08:54:53 +01:00
Ilias Apalodimas
261b422aed efi_loader: Move public cert for capsules to .rodata
commit ddf67daac3 ("efi_capsule: Move signature from DTB to .rodata")
was reverted in
commit 47a25e81d3 ("Revert "efi_capsule: Move signature from DTB to .rodata"")
because that's what U-Boot was usually doing -- using the DT to store
configuration and data. Some of the discussions can be found here [0].

(Ab)using the device tree to store random data isn't ideal though.
On top of that with new features introduced over the years, keeping
the certificates in the DT has proven to be problematic.
One of the reasons is that platforms might send U-Boot a DTB
from the previous stage loader using a transfer list which won't contain
the signatures since other loaders are not  aware of internal
U-Boot ABIs. On top of that QEMU creates the DTB on the fly, so adding
the capsule certificate there does not work and requires users to dump
it and re-create it injecting the public keys.

Now that we have proper memory permissions for arm64, move the certificate
to .rodata and read it from there.

[0] https://lore.kernel.org/u-boot/CAPnjgZ2uM=n8Qo-a=DUkx5VW5Bzp5Xy8=Wgmrw8ESqUBK00YJQ@mail.gmail.com/

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Jonathan Humphreys <j-humphreys@ti.com>  # on TI sk-am62p-lp
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-A311D-CC
Tested-by: Raymond Mao <raymond.mao@linaro.org>
2025-05-16 14:45:26 +02:00
Heinrich Schuchardt
5b690046a9 Makefile: let clean remove capsule_in.capsule*.efi-capsule
Update the CLEAN_FILES list to remove capsule*.*.efi-capsule.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-16 14:45:24 +02:00
Tom Rini
2825b387b0 Kbuild: Always use $(PHASE_)
It is confusing to have both "$(PHASE_)" and "$(XPL_)" be used in our
Makefiles as part of the macros to determine when to do something in our
Makefiles based on what phase of the build we are in. For consistency,
bring this down to a single macro and use "$(PHASE_)" only.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-01 05:56:48 -06:00
Raymond Mao
528a145a55 mbedtls: refactor mbedtls build for XPL
Refactor the entire kconfig page for mbedtls, adapt mbedtls makefile
and default config file using 'XPL_', in order to have independent
mbedtls kconfig options in U-Boot Proper, SPL, TPL and VPL.
User can choose legacy or mbedtls libraries for them independently.

Set mbedtls native hashing libraries as default when MBEDTLS_LIB,
SPL_MBEDTLS_LIB, TPL_MBEDTLS_LIB or VPL_MBEDTLS_LIB is selected.

If users prefer using U-Boot legacy hashing libraries, please select
MBEDTLS_LIB_HASHING_ALT, SPL_MBEDTLS_LIB_HASHING_ALT,
TPL_MBEDTLS_LIB_HASHING_ALT or VPL_MBEDTLS_LIB_HASHING_ALT for U-Boot
Proper, SPL, TPL and VPL respectively.

Moreover, rename a few kconfig options and update their descriptions to
improve the consistency of terminology.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-01 05:56:48 -06:00
Simon Glass
eb82ca7cbe efi: Generate the app as a shared library
The app should be built as a shared library, with position-independent
code and the -shared flags. Update the Makefile to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-27 05:31:43 -06:00
Simon Glass
06b75366ac Makefile: Avoid using TEXT_BASE with the EFI APP
This value is not available with the EFI app. Add a condition to avoid
introducing errors when linking.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-03-27 05:28:53 -06:00
Simon Glass
0408f93544 test: Move fdt-overlay-test rule into test/
The Makefile rules for tests should be within test/Makefile so move the
'fdt-overlay' rule over.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
0685170546 test: Move optee-test rule into test/
The Makefile rules for tests should be within test/Makefile so move the
'optee' rule over.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
f65aeeabd7 test: Move env-test rule into test/
The Makefile rules for tests should be within test/Makefile so move the
'env' rule over.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
07ebcdd543 test: Tweak FDT-overlay tests
Use fdt_overlay consistently in the identifiers and file/dir names.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Marek Vasut
f168da34d0 Makefile: Drop SPL_FIT_GENERATOR support
The SPL_FIT_GENERATOR is long superseded by binman, drop SPL_FIT_GENERATOR
support as there are no more users.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/22109373594b6a5d1110be9420ccd8fbb93a61d3.1730452668.git.michal.simek@amd.com
2025-02-10 04:38:21 -07:00
Michal Simek
f038defa61 binman: Add option for pointing to separate description
Adding binman node with target images description can be unwanted feature
but as of today there is no way to disable it.
Also on size constrained systems it is not useful to add binman description
to DTB.
Introduce BINMAN_DTB Kconfig symbol which allows separate DTB for target
from DTB for binman itself.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f1379d2587f9bf279a7a75c318aabbc1b35ee0c6.1730452668.git.michal.simek@amd.com
2025-02-10 04:38:21 -07:00