]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
4 days agoconfigs: disable SPL_BOOTZ to preserve spl size
Anshul Dalal [Mon, 27 Oct 2025 14:17:03 +0000 (19:47 +0530)] 
configs: disable SPL_BOOTZ to preserve spl size

In the existing behaviour, CMD_BOOTZ is not enabled by default which
means zimage.o is not compiled in the SPL in falcon mode unless
explicitly enabled. This changes now as SPL_BOOTZ is default y for
falcon users which leads to larger SPL size with zimage.o being present.

This patch modifies the defconfigs that used falcon mode but don't
require zimage support.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
4 days agospl: remove usage of CMD_BOOTx from image parsing
Anshul Dalal [Mon, 27 Oct 2025 14:17:02 +0000 (19:47 +0530)] 
spl: remove usage of CMD_BOOTx from image parsing

Using CMD_* configs from spl doesn't make logical sense. Therefore
this patch replaces the checks for CMD_BOOTx with newly added library
symbols LIB_BOOT[IMZ] and SPL_LIB_BOOT[IMZ] which are enabled by their
respective CMD_* or SPL_* counterparts.

On platforms with non-secure falcon mode, SPL_BOOTZ is enabled by
default for 32-bit ARM systems and SPL_BOOTI is enabled by default for
64-bit ARM and RISCV.

The respective C files (image.c/zimage.c) are compiled based on library
symbols $(PHASE_)LIB_BOOTx instead which are in turn selected by both
CMD_BOOTx and SPL_BOOTx as required.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 days agoMerge tag 'efi-2026-01-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 26 Oct 2025 13:51:18 +0000 (07:51 -0600)] 
Merge tag 'efi-2026-01-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2026-01-rc1-2

CI:

* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/28024

Documentation:

* develop: virtio: Fix qemu example (true/false -> on/off)
* separate read and write command documentation
* usage: Add general rule for `$?`
* askenv: Reword and remove return value
* seama: Reword return value section
* usage: Use glob for all commands
* Fix typos and formatting

UEFI:

* console: support editable input fields

12 days agodoc/usage: Add a reference to General rules for commands
Tom Rini [Fri, 24 Oct 2025 17:22:09 +0000 (11:22 -0600)] 
doc/usage: Add a reference to General rules for commands

For clarity, add a reference link to the start of the section on command
documentation that all commands follow some general rules.

Signed-off-by: Tom Rini <trini@konsulko.com>
12 days agodoc: usage: Use glob for all commands
Tom Rini [Fri, 24 Oct 2025 17:22:08 +0000 (11:22 -0600)] 
doc: usage: Use glob for all commands

Make use of the glob syntax to automatically include all command
documents.

Signed-off-by: Tom Rini <trini@konsulko.com>
12 days agodoc: seama: Reword return value section
Tom Rini [Fri, 24 Oct 2025 16:02:59 +0000 (10:02 -0600)] 
doc: seama: Reword return value section

With the addition of general text about how the return value is handled,
reference that while retaining the additional information about setting
$seama_image_size

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
12 days agodoc: askenv: Reword and remove return value
Tom Rini [Fri, 24 Oct 2025 16:02:58 +0000 (10:02 -0600)] 
doc: askenv: Reword and remove return value

With the addition of general text about how the return value is handled,
remove the examples from the askenv documentation as they are all normal
expected results.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
12 days agodoc: usage: Add general rule for `$?`
Tom Rini [Fri, 24 Oct 2025 16:02:57 +0000 (10:02 -0600)] 
doc: usage: Add general rule for `$?`

For nearly all commands in U-Boot the '?' variable is handled the same
way with 0 meaning success, 1 meaning any failure.  Explain this in the
general rules section of the cmdline documentation (with a link to a
counter example) and then remove the redundant wording from most
commands. We retain a section about the return value in a number of
places where we are doing something such as always returning a specific
value or we have useful additional information to go along with the
normal return codes.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
12 days agodoc: develop: virtio: Fix qemu example (true/false -> on/off)
Wolfgang Wallner [Fri, 24 Oct 2025 15:12:05 +0000 (17:12 +0200)] 
doc: develop: virtio: Fix qemu example (true/false -> on/off)

The given qemu examples use true/false, while qemu actually on/off.

Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
12 days agodoc: Fix whitespace in devicetree example in overlay-fdt-boot.rst
Wolfgang Wallner [Fri, 24 Oct 2025 15:12:04 +0000 (17:12 +0200)] 
doc: Fix whitespace in devicetree example in overlay-fdt-boot.rst

Fix the whitespace and add a missing quotation mark
(default = "foo-reva.dtb") in overlay-fdt-boot.rst.

Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
12 days agoboot: Fix typo
Wolfgang Wallner [Fri, 24 Oct 2025 15:12:03 +0000 (17:12 +0200)] 
boot: Fix typo

Fix a typo in image-fit.c.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
12 days agobootm: Fix typo in bootm.h
Wolfgang Wallner [Fri, 24 Oct 2025 15:12:02 +0000 (17:12 +0200)] 
bootm: Fix typo in bootm.h

Fix a typo in include/bootm.h.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
12 days agoimage: Fix typos in image.h
Wolfgang Wallner [Fri, 24 Oct 2025 15:12:01 +0000 (17:12 +0200)] 
image: Fix typos in image.h

Fix some typos in include/image.h.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
12 days agoboot: kconfig: Fix typos
Wolfgang Wallner [Fri, 24 Oct 2025 15:12:00 +0000 (17:12 +0200)] 
boot: kconfig: Fix typos

Fix typos in boot/Kconfig.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
12 days agodoc: Fix typos
Wolfgang Wallner [Fri, 24 Oct 2025 15:11:59 +0000 (17:11 +0200)] 
doc: Fix typos

Fix typos/wording in various files in doc/.

Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: E Shattow <e@freeshell.de>
12 days agodoc: develop: Change formatting to make binman doc more readable
Wolfgang Wallner [Fri, 24 Oct 2025 15:11:58 +0000 (17:11 +0200)] 
doc: develop: Change formatting to make binman doc more readable

Change the formatting of binman.rst so that the compiled HTML output
becomes more readable. Changes include enumerations and the escaping of
arguments starting with a double dash (e.g. --debug).

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
12 days agodoc: develop: Fix typos in binman/binman.rst
Wolfgang Wallner [Fri, 24 Oct 2025 15:11:57 +0000 (17:11 +0200)] 
doc: develop: Fix typos in binman/binman.rst

Fix some typos in binman.rst.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
12 days agoefi_loader: efi_console: support editable input fields
Casey Connolly [Thu, 23 Oct 2025 14:26:46 +0000 (16:26 +0200)] 
efi_loader: efi_console: support editable input fields

When editing eficonfig "optional data" (typically cmdline arguments)
it's useful to be able to edit the string rather than having to re-type
the entire thing. Implement support for editing buffers to make this a
whole lot nicer. Specifically, add support for moving the cursor with
the arrow keys and End key as well as deleting backwards with the delete
key.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
12 days agodoc: separate read and write command documentation
Heinrich Schuchardt [Sat, 18 Oct 2025 11:07:44 +0000 (13:07 +0200)] 
doc: separate read and write command documentation

* Avoid two step navigation to get to the description of the write command.
* Add missing index entries
* Correct formatting of the examples.
* Describe configuration and return value.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 days agoMerge patch series "firmware: scmi: Support SCMI LMM/CPU protocol for i.MX95"
Tom Rini [Fri, 24 Oct 2025 18:09:02 +0000 (12:09 -0600)] 
Merge patch series "firmware: scmi: Support SCMI LMM/CPU protocol for i.MX95"

Peng Fan (OSS) <peng.fan@oss.nxp.com> says:

i.MX95 System Manager(SM) implements Logical Machine Management(LMM) and
CPU protocol to manage Logical Machine(LM) and CPUs(eg, M7).

To manage M7 in a separate LM or in same LM as U-Boot/Linux itself. LMM
APIs and CPU APIs are needed.

When M7 is in LM 'lm-m7', and this LM is managable by 'uboot-lm', U-Boot
could use LMM_BOOT, LMM_SHUTDOWN and etc to manage 'lm-m7'.

If in same LM, use CPU_START, CPU_STOP, CPU_RESET_VECTOR_SET and etc to
manage M7.

Both LMM/CPU APIs will be used by remoteproc driver.

The documentation could be found in Linux Kernel:
drivers/firmware/arm_scmi/vendors/imx/imx95.rst

Link: https://lore.kernel.org/r/20251017-scmi-lmm-v1-0-9fd41e7a5ac0@nxp.com
13 days agobootstd: make it possible to use tftp for netboot with standardboot
Benjamin Hahn [Tue, 21 Oct 2025 14:34:17 +0000 (16:34 +0200)] 
bootstd: make it possible to use tftp for netboot with standardboot

Add the option to load the bootscript with the tftp command (static IP)
instead of the dhcp command (dynamic IP). For this a new function
tftpb_run similar to dhcp_run, is needed. The selection of which command
to use can be done with the ip_dyn environment variable, which can be
set to yes or no. The ip_dyn variable was chosen as it is already in use
on the imx platforms.
Also edit the bootstd doc.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
13 days agofirmware: scmi: Add i.MX95 SCMI CPU Protocol
Peng Fan [Fri, 17 Oct 2025 09:32:34 +0000 (17:32 +0800)] 
firmware: scmi: Add i.MX95 SCMI CPU Protocol

This protocol allows an agent to start, stop a CPU or set reset vector.
It is used to manage auxiliary CPUs in an LM (e.g. additional cores in an
AP cluster).

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alice Guo <alice.guo@nxp.com>
13 days agophy: ti: phy-j721e-wiz: Allow reinitialization when SERDES is pre-configured
Hrushikesh Salunke [Fri, 17 Oct 2025 05:25:19 +0000 (10:55 +0530)] 
phy: ti: phy-j721e-wiz: Allow reinitialization when SERDES is pre-configured

Move the SERDES configuration check after clock and reset initialization
and change it from a hard failure to a skip of WIZ initialization. This
allows the driver to probe successfully when the SERDES has been
pre-configured by a previous boot stage (e.g., ROM or SPL).

This approach aligns with how the Linux kernel handles pre-configured
SERDES, where the driver gracefully skips reinitialization rather than
failing to probe.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
13 days agofirmware: scmi: Add i.MX95 SCMI LMM protocol driver
Peng Fan [Fri, 17 Oct 2025 09:32:33 +0000 (17:32 +0800)] 
firmware: scmi: Add i.MX95 SCMI LMM protocol driver

Add Logical Machine Management(LMM) protocol which is intended for boot,
shutdown, and reset of other logical machines (LM). It is usually used to
allow one LM to manager another used as an offload or accelerator engine.

Following Linux Kernel, created a separate folder for holding vendor
protocol drivers.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alice Guo <alice.guo@nxp.com>
13 days agoarm: armv8: Make save_boot_params simpler
Ilias Apalodimas [Thu, 16 Oct 2025 13:27:43 +0000 (16:27 +0300)] 
arm: armv8: Make save_boot_params simpler

The idiom used in save_boot_params is common for armv7.
In armv8 is much easier to do the same thing with adr/adrp.

So let's simplify the code a bit.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 days agofirmware: scmi: Support probe vendor ID 0x80 and 0x82
Peng Fan [Fri, 17 Oct 2025 09:32:32 +0000 (17:32 +0800)] 
firmware: scmi: Support probe vendor ID 0x80 and 0x82

Preparing to add i.MX LMM and CPU protocol driver, support probe SCMI
vendor ID 0x80(i.MX SCMI LMM ID) and 0x82(i.MX SCMI CPU ID). And use
Kconfig option to support conditional compilation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alice Guo <alice.guo@nxp.com>
13 days agoenv: fat, ubi: Fix gd->env_valid for the first write
Tom Rini [Tue, 21 Oct 2025 20:37:01 +0000 (14:37 -0600)] 
env: fat, ubi: Fix gd->env_valid for the first write

As resolved and explained in detail in commit e589d5822cac ("env: spi:
Fix gd->env_valid for the first write") and archived discussion there is
a corner case where we don't do the right thing with redundant
environments. This same exact check was present in the mmc code and
resolved with commit 813a0df27a8a ("env: Invert gd->env_valid for
env_mmc_save") and in the discussion of that patch, I noted that both
fat and ubi (and at the time, sf) were doing the same thing. Take the
time now to correct fat and ubi environment.

Signed-off-by: Tom Rini <trini@konsulko.com>
13 days agofirmware: scmi: Cleanup the SCMI MISC ID
Peng Fan [Fri, 17 Oct 2025 09:32:31 +0000 (17:32 +0800)] 
firmware: scmi: Cleanup the SCMI MISC ID

SCMI_IMX_PROTOCOL_ID_MISC was never used, so drop it. And move
SCMI_PROTOCOL_ID_IMX_MISC out of enum scmi_std_protocol to
scmi_nxp_protocols.h, because it is i.MX specific and following Linux
Kernel style, use macro definition.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alice Guo <alice.guo@nxp.com>
13 days agofirmware: scmi: Conditionally compile protocol support
Peng Fan [Fri, 17 Oct 2025 09:32:30 +0000 (17:32 +0800)] 
firmware: scmi: Conditionally compile protocol support

Add conditional compilation for SCMI protocol support in scmi_get_protocol()
and scmi_add_protocol() based on corresponding Kconfig options. This ensures
that only the enabled protocols are compiled and accessed, and reducing binary
size.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alice Guo <alice.guo@nxp.com>
13 days agomakefile: Fix recursive makes
Ilias Apalodimas [Wed, 22 Oct 2025 12:23:15 +0000 (15:23 +0300)] 
makefile: Fix recursive makes

Since the Kbuild bump to 5.1 and specifically
commit af1a9935708a ("kbuild: make -r/-R effective in top Makefile for old Make versions")
the recursion rules have changed.

'make O=/output/dir/' as well as './test/py/test.py --bd sandbox --build'
is working fine but anything that recursively called the makefile was
failing e.g 'make tests', 'make qcheck' etc, which calls a bash script
that ends up calling the makefile again.

The reason is that the internal 'sub_make_done' variable of the makefile
was set after the first pass and the output dir was never evaluated
properly.  Reset the variable value if we are executing any of these
tests.

Fixes: af1a9935708a ("kbuild: make -r/-R effective in top Makefile for old Make versions")
Reported-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Test-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 weeks agoMerge patch series "boot: Support priority for global bootmeths"
Tom Rini [Wed, 22 Oct 2025 20:17:16 +0000 (14:17 -0600)] 
Merge patch series "boot: Support priority for global bootmeths"

Simon Glass <sjg@chromium.org> says:

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.

Link: https://lore.kernel.org/r/20251015154423.908468-1-sjg@chromium.org
2 weeks agoboot: Run the EFI bootmgr just before network devices
Simon Glass [Wed, 15 Oct 2025 15:44:14 +0000 (16:44 +0100)] 
boot: Run the EFI bootmgr just before network devices

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.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 weeks agoboot: Run global bootmeths after all bootdevs are exhausted
Simon Glass [Wed, 15 Oct 2025 15:44:13 +0000 (16:44 +0100)] 
boot: Run global bootmeths after all bootdevs are exhausted

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.

Update the documentation to match the new behaviour of global bootmeths.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 weeks agoboot: Don't change the method count after global bootmeths
Simon Glass [Wed, 15 Oct 2025 15:44:12 +0000 (16:44 +0100)] 
boot: Don't change the method count after global bootmeths

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>
2 weeks agoboot: Implement a priority for global bootmeths
Simon Glass [Wed, 15 Oct 2025 15:44:11 +0000 (16:44 +0100)] 
boot: Implement a priority for global bootmeths

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>
2 weeks agoboot: Only run global bootmeths once each
Simon Glass [Wed, 15 Oct 2025 15:44:10 +0000 (16:44 +0100)] 
boot: Only run global bootmeths once each

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>
2 weeks agoboot: Support rescanning the global bootmeths
Simon Glass [Wed, 15 Oct 2025 15:44:09 +0000 (16:44 +0100)] 
boot: Support rescanning the global bootmeths

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>
2 weeks agoboot: Keep track of which bootmeths have been used
Simon Glass [Wed, 15 Oct 2025 15:44:08 +0000 (16:44 +0100)] 
boot: Keep track of which bootmeths have been used

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>
2 weeks agoboot: Add a flag for whether there are global bootmeths
Simon Glass [Wed, 15 Oct 2025 15:44:07 +0000 (16:44 +0100)] 
boot: Add a flag for whether there are global bootmeths

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>
2 weeks agoboot: Update first_glob_method when dropping a bootmeth
Simon Glass [Wed, 15 Oct 2025 15:44:06 +0000 (16:44 +0100)] 
boot: Update first_glob_method when dropping a bootmeth

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>
2 weeks agoboot: Add a new test for global bootmeths
Simon Glass [Wed, 15 Oct 2025 15:44:05 +0000 (16:44 +0100)] 
boot: Add a new test for global bootmeths

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>
2 weeks agoboot: Try all bootmeths on the final partition
Simon Glass [Wed, 15 Oct 2025 15:44:04 +0000 (16:44 +0100)] 
boot: Try all bootmeths on the final partition

At present, normally when one bootmeth fails on a partition, we move on
and try the next bootmeth. However, this was not the case for the final
partition due to a bug. Rework the logic so that all partitions are
treated the same.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 weeks agoMerge patch series "Add support for dynamic MMU configuration"
Tom Rini [Wed, 22 Oct 2025 18:23:48 +0000 (12:23 -0600)] 
Merge patch series "Add support for dynamic MMU configuration"

Anshul Dalal <anshuld@ti.com> says:

In U-Boot, TI only provides a single memory map for all k3 platforms, this
does not scale for devices where atf and optee lie outside the range 0x80000000
- 0x80080000 and 0x9e780000 - 0xa0000000 respectively.

There are also issues for devices with < 2GiB of memory (eg am62SiP with 512MiB
of RAM) as the maximum size for the first DRAM bank is hardcoded to 2GiB in the
current memory map. Furthermore the second DRAM bank is mapped even for devices
that only have a single bank.

Therefore this patch set adds the required functionality to create the MMU table
at runtime based on the device-tree.

The patch set has been build tested on all effected platforms but boot-tested
only on TI's K3 EVMs, the beagleplay and phytec's phycore-am6* platforms.

The following effected boards have not been boot tested:
 - verdin-am62
 - iot2050

Link: https://lore.kernel.org/r/20251017131540.3636067-1-anshuld@ti.com
2 weeks agoarm: mach-k3: reserve space for page table entries
Anshul Dalal [Fri, 17 Oct 2025 13:15:33 +0000 (18:45 +0530)] 
arm: mach-k3: reserve space for page table entries

With the memory map configuration being done dynamically, reserve extra
space during U-Boot relocation to ensure we have enough for the fixups.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agomach-k3: add carveouts for TFA and optee
Anshul Dalal [Fri, 17 Oct 2025 13:15:32 +0000 (18:45 +0530)] 
mach-k3: add carveouts for TFA and optee

K3 platforms have reserved memory regions for TFA and OPTEE which should
be unmapped for U-Boot. While other "no-map" memory regions like the
memory pools for remote cores should not be unmapped to allow U-Boot to
load firmware during remoteproc.

Therefore this patch adds the necessary fdt fixups to properly set the
load address for TFA/OPTEE and unmaps both by mmu_unmap_reserved_mem.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2 weeks agomach-k3: add reserved memory fixups for next boot stage
Anshul Dalal [Fri, 17 Oct 2025 13:15:31 +0000 (18:45 +0530)] 
mach-k3: add reserved memory fixups for next boot stage

The boot flow in K3 platforms requires the subsequent boot stages to be
aware of the memory reserved for previous boot binaries. In the regular
boot sequence of:

R5 SPL -> ATF -> OP-TEE -> A-core SPL -> U-Boot -> Kernel,

Both A-core SPL and U-Boot should be made aware of the memory reserved
for ATF and OP-TEE from their device-tree. Currently this information is
absent.

Therefore this patch adds the reserved-memory regions as part of
spl_perform_arch_fixups for the next stage's DT. This is called during
both R5 and A-core SPL which fixes up the DT for their respective next
stages: A-core SPL and U-Boot proper.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2 weeks agospl: split spl_board_fixups to arch/board specific
Anshul Dalal [Fri, 17 Oct 2025 13:15:30 +0000 (18:45 +0530)] 
spl: split spl_board_fixups to arch/board specific

The current spl_board_fixups API allows for modification of spl_image
before the SPL jumps to it. This can be used to modify the DT for the
next boot stage, however the current API only allows either the machine
arch or the board to use it.

This limits the utility of the API as there might be certain fixups that
should be applied to all boards sharing the same machine architecture
with others being board specific.

For TI's K3 specifically, this prevents us from performing architecture
level fixups since a lot of TI boards are already making use of the
spl_board_fixups API.

Therefore this patch splits the API into two to allow both board and the
architecture specific fixups. The order is kept as arch then board to
give board specific fixups the precedence.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2 weeks agoarm: armv8: mmu: add mmu_unmap_reserved_mem
Anshul Dalal [Fri, 17 Oct 2025 13:15:29 +0000 (18:45 +0530)] 
arm: armv8: mmu: add mmu_unmap_reserved_mem

For armv8, U-Boot uses a static map defined as 'mem_map' for configuring
the MMU's page tables, done by mmu_setup.

Though this works well for simpler platforms, it makes creating runtime
carveouts by modifying the static array at runtime exceedingly complex
like in mach-snapdragon/board.c.

Creation of such carveouts are much better handled by APIs such as
mmu_change_region_attr once the page tables are configured. Usually such
carveouts are configured via the device-tree's reserved-memory node
which provides the address and size for the carveout.

Therefore this patch adds mmu_unmap_reserved_mem which acts as a wrapper
over mmu_change_region_attr, helping unmap a reserved-memory region.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2 weeks agomach-k3: map all banks using mem_map_from_dram_banks
Anshul Dalal [Fri, 17 Oct 2025 13:15:28 +0000 (18:45 +0530)] 
mach-k3: map all banks using mem_map_from_dram_banks

The static memory map for K3 (k3_mem_map) only maps the first DRAM bank
and therefore doesn't scale for platforms with multiple memory banks.

This patch modifies enable_caches to add mem_map_from_dram_banks which
appends all the memory banks to k3_mem_map before calling mmu_setup.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2 weeks agoarm: armv8: mmu: add mem_map_from_dram_banks
Anshul Dalal [Fri, 17 Oct 2025 13:15:27 +0000 (18:45 +0530)] 
arm: armv8: mmu: add mem_map_from_dram_banks

For armv8, U-Boot uses a static map defined as 'mem_map' for configuring
the MMU as part of mmu_setup.

But since the exact configuration of memory banks might not be known at
build time, many platforms such as imx9, versal2 etc. utilize
gd->bd->bi_dram to configure the static map at runtime.

Therefore this patch adds a new API mem_map_from_dram_banks that
modifies the static map in a similar way. Allowing the caller to map all
dram banks by just passing the index to last entry in their mem_map and
it's length.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2 weeks agoarm: armv8: invalidate dcache entries on dcache_enable
Anshul Dalal [Fri, 17 Oct 2025 13:15:26 +0000 (18:45 +0530)] 
arm: armv8: invalidate dcache entries on dcache_enable

In dcache_enable, currently the dcache entries are only invalidated when
the MMU is not enabled. This causes issues when dcache_enable is called
with the MMU already configured, in such cases the existing dcache
entries are not flushed which might result in un-expected behavior.

This patch invalidates the cache entries on every call of dcache_enable
before enabling dcache (by setting CR_C). This makes dcache_enable
behave similar to icache_enable as well.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2 weeks agoarm: armv8: mmu: export mmu_setup
Anshul Dalal [Fri, 17 Oct 2025 13:15:25 +0000 (18:45 +0530)] 
arm: armv8: mmu: export mmu_setup

The mmu_setup function configures the page tables based on the board
supplied mem_map struct array. It is called implicitly as part of
dcache_enable but this limits us to only be able to use APIs such as
mmu_change_region_attr only after caches are enabled.

This might lead to speculative accesses before we can unmap a region
that is marked as cacheable in the static memory map.

Therefore this patch exports the mmu_setup function in mmu.h allowing
users to have more control over when the mmu is configured.

For K3 specifically this allows for the following configuration sequence
as part of enable_caches:

static mem_map fixups (TODO) -> mmu_setup -> carveouts using
mmu_change_region_attr (TODO) -> icache/dcache enable

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2 weeks agomach-k3: use custom enable_cache
Anshul Dalal [Fri, 17 Oct 2025 13:15:24 +0000 (18:45 +0530)] 
mach-k3: use custom enable_cache

U-Boot's provided enable_caches enforces the following sequence:
icache_enable -> mmu_setup (as part of dcache_enable) -> dcache_enable

Whereas for K3 devices, we would like to add entries to the provided
static array (k3_mem_map) as per gd->bd->bi_dram and then call mmu_setup
to configure the MMU but also create carveouts for TFA/TEE before we
enable caches to prevent speculative accesses to the region. Thus the
following desired sequence:

add dram banks -> mmu_setup -> carveout TFA/TEE -> icache/dcache enable

Therefore this patch adds K3's own implementation of enable_cache for
ARM64, allowing for greater control over the cache enablement sequence.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2 weeks agomach-k3: use minimal memory map for all K3
Anshul Dalal [Fri, 17 Oct 2025 13:15:23 +0000 (18:45 +0530)] 
mach-k3: use minimal memory map for all K3

The K3 family of SoCs encompasses a wide variety of devices with varying
DDR configurations and memory carveout requirements, the current static
memory map provides basic support for TI EVMs but does not scale well
for newer platforms (such as AM62SiP with 512MiB of RAM).

Therefore this patch replaces the existing memory map with a minimal
one, that could be more easily modified at runtime.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2 weeks agoMerge tag 'net-20251022' of https://source.denx.de/u-boot/custodians/u-boot-net
Tom Rini [Wed, 22 Oct 2025 15:07:56 +0000 (09:07 -0600)] 
Merge tag 'net-20251022' of https://source.denx.de/u-boot/custodians/u-boot-net

Pull request net-20251022

net:
- airoha: improvements
- Tighten a few more driver dependencies
- designware: fix bitbang init error
- phy: Make driver overloading get_phy_id depend on !COMPILE_TEST
- phy: add paged PHY register accessors
- make dhcp_run() common for NET and NET_LWIP
- dwc_eth_ops: Correct check for FDT_64BIT
- mediatek: mt7988: various fixup + MDIO detach
- phy: aquantia: switch to use phy_get_ofnode(), fix bindings typo

net-legacy:
- bootp: Prevent buffer overflow to avoid leaking the RAM content
- tftp: make TFTP ports unconditionally configurable

misc:
- uthreads: Make use of CONFIG_IS_ENABLED consistently

2 weeks agoMerge tag 'u-boot-at91-2026.01-a' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Wed, 22 Oct 2025 15:06:11 +0000 (09:06 -0600)] 
Merge tag 'u-boot-at91-2026.01-a' of https://source.denx.de/u-boot/custodians/u-boot-at91

First set of u-boot-at91 features for the 2026.01 cycle:

This small fixes set includes a change on clocks register value and a
fix for the sam9x60ek default timer.

2 weeks agonet: designware: fix bitbang init error
Jim Liu [Tue, 14 Oct 2025 05:20:05 +0000 (13:20 +0800)] 
net: designware: fix bitbang init error

The Synchronous Abort and reset errors occurred due
to incorrect parameter passing during initialization.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
[jf: add missing #if IS_ENABLED(CONFIG_BITBANGMII)]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2 weeks agonet: phy: Make driver overloading get_phy_id depend on !COMPILE_TEST
Tom Rini [Fri, 10 Oct 2025 17:36:33 +0000 (11:36 -0600)] 
net: phy: Make driver overloading get_phy_id depend on !COMPILE_TEST

With commit 597fe041a85f ("net/phy: enable get_phy_id redefinable") we
made get_phy_id a public but weak function, so that PHY drivers that had
required non-standard ways of getting the PHY ID could be supported.
However, overloading a weak function multiple times is (rightly) a link
error. At this point, we have two PHYs which make use of this feature,
so make both of them only available when COMPILE_TEST is unset, as part
of being able to support "allyesconfig" in the future.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 weeks agonet: bootp: Prevent buffer overflow to avoid leaking the RAM content
Paul HENRYS [Thu, 9 Oct 2025 15:43:28 +0000 (17:43 +0200)] 
net: bootp: Prevent buffer overflow to avoid leaking the RAM content

CVE-2024-42040 describes a possible buffer overflow when calling
bootp_process_vendor() in bootp_handler() since the total length
of the packet is passed to bootp_process_vendor() without being
reduced to len-(offsetof(struct bootp_hdr,bp_vend)+4).

The packet length is also checked against its minimum size to avoid
reading data from struct bootp_hdr outside of the packet length.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2 weeks agonet: phy: add paged PHY register accessors
Lucien.Jheng [Mon, 6 Oct 2025 12:49:15 +0000 (20:49 +0800)] 
net: phy: add paged PHY register accessors

Synchronize paged PHY helpers with Linux v6.17.

Add support for PHY devices that use paged register access by
implementing the following functions:
- phy_save_page(): Save current page number
- phy_select_page(): Switch to a specific page and return previous page
- phy_restore_page(): Restore previously saved page

Also adds read_page and write_page callbacks to the phy_driver
structure to enable driver-specific page handling.

These helpers allow safe access to paged PHY registers by ensuring
proper page selection and restoration,
even in error conditions, which will be used by the Airoha PHY driver.

Signed-off-by: Lucien.Jheng <lucienzx159@gmail.com>
2 weeks agonet: airoha: increase the number of rx network buffers
Mikhail Kshevetskiy [Wed, 8 Oct 2025 07:31:39 +0000 (10:31 +0300)] 
net: airoha: increase the number of rx network buffers

According to commit 997786bbf473 ("drivers/net/airoha_eth: fix stalling
in package receiving") the minimal possible value of SYS_RX_ETH_BUFFER
is 4. Unfortunately it's too small for reliable ping.

Observations shows that SYS_RX_ETH_BUFFER must be at least 8.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2 weeks agonet: airoha: simplify rx/free packet logic a bit
Mikhail Kshevetskiy [Wed, 8 Oct 2025 07:31:38 +0000 (10:31 +0300)] 
net: airoha: simplify rx/free packet logic a bit

The commit 997786bbf473 ("drivers/net/airoha_eth: fix stalling in package
receiving") can be improved. Instead of returning previous descriptor
it's possible:
 * do nothing in even descriptor case
 * return 2 descriptor to the queue (current and previous) in the odd
   descriptor case.

This patch:
 * implements above approach
 * remove logic not required within new approach
 * adds note that PKTBUFSRX must be even and larger than 7
   for reliable driver operations

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2 weeks agonet: make dhcp_run() common for NET and NET_LWIP
Jerome Forissier [Thu, 9 Oct 2025 12:30:14 +0000 (14:30 +0200)] 
net: make dhcp_run() common for NET and NET_LWIP

There are currently two implementations of dhcp_run(): one in cmd/net.c
for NET and one in net/lwip/dhcp.c for NET_LWIP. There is no
justification for that. Therefore, move the NET version into
net/net-common.c to be used by both stacks, and drop the NET_LWIP
version which by the way does not look totally correct.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Acked-by: Benjamin Hahn <B.Hahn@phytec.de>
2 weeks agonet: mediatek: move MT7531 MMIO MDIO to dedicated driver
Christian Marangi [Sat, 20 Sep 2025 16:09:44 +0000 (18:09 +0200)] 
net: mediatek: move MT7531 MMIO MDIO to dedicated driver

In preparation for support of MDIO on AN7581, move the MT7531 MMIO logic
to a dedicated driver and permit usage of the mdio read/write function
to the mtk_eth driver.

This only affect MT7988 that can use MMIO operation to access the Switch
register. The MT7988 code is updated to make use of the external driver.

This permits Airoha driver to make use of DM_MDIO to bind for the MT7531
driver that have the same exact register.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 weeks agonet: mediatek: mt7988: free allocated MDIO bus on cleanup
Christian Marangi [Sat, 20 Sep 2025 16:09:43 +0000 (18:09 +0200)] 
net: mediatek: mt7988: free allocated MDIO bus on cleanup

Correctly free the MDIO Bus on calling cleanup function. While at it
also fix a copy-paste error and rename the cleanup function name to the
more specific name.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 weeks agonet: mediatek: mt7988: restore PHY page on PHY setting exit
Christian Marangi [Sat, 20 Sep 2025 16:09:42 +0000 (18:09 +0200)] 
net: mediatek: mt7988: restore PHY page on PHY setting exit

On exiting the phy_setting function for MT7988, the PHY page is never
restored to Page 0. This can cause all kind of problem with reading the
status of the PHY at runtime.

Correctly restore PHY page on exiting the PHY setting function.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 weeks agonet: mediatek: mt7531/7988: fix broken PHY turn ON/OFF
Christian Marangi [Sat, 20 Sep 2025 16:09:41 +0000 (18:09 +0200)] 
net: mediatek: mt7531/7988: fix broken PHY turn ON/OFF

The PHY for MT7531/MT7988 are never actully turned ON/OFF for the
affected PHY as we are read/writing to the wrong PHY address.

This is caused by the fact that we use the MT753X_PHY_ADDR macro 2
times offsetting the address multiple times.

One in the _setup() function and one in the mt7531_mii_read/write.

Drop the additional usage of MT753X_PHY_ADDR in setup() to correctly
set the PHY.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 weeks agodoc: bindings: fix aquantia-phy.txt typo
Beiyan Yun [Tue, 23 Sep 2025 07:12:59 +0000 (15:12 +0800)] 
doc: bindings: fix aquantia-phy.txt typo

Fix typo: "weays" -> "ways"

Signed-off-by: Beiyan Yun <root@infi.wang>
2 weeks agonet: phy: aquantia: switch to use phy_get_ofnode()
Beiyan Yun [Tue, 23 Sep 2025 07:12:58 +0000 (15:12 +0800)] 
net: phy: aquantia: switch to use phy_get_ofnode()

Use PHY API phy_get_ofnode() helper to get PHY DT node.

Signed-off-by: Beiyan Yun <root@infi.wang>
2 weeks agonet: Tighten more driver dependencies
Tom Rini [Thu, 25 Sep 2025 20:44:14 +0000 (14:44 -0600)] 
net: Tighten more driver dependencies

In this case, the mediatek network drivers cannot build outside of
ARCH_MEDIATEK or ARCH_MTMIPS, and so express this requirement in Kconfig
as well. In the case of DWC_ETH_XGMAC / DWC_ETH_XGMAC_SOCFPGA, the file
controlled by the DWC_ETH_XGMAC option references a socfpga-specific
array defined in the file controlled by DWC_ETH_XGMAC_SOCFPGA. Rework
these options in Kconfig to handle this dependency.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 weeks agonet: Remove BOOTP_VENDOREX support
Tom Rini [Thu, 25 Sep 2025 20:44:13 +0000 (14:44 -0600)] 
net: Remove BOOTP_VENDOREX support

It has been over a decade since we had a platform that implemented the
bootp vendor extension support hook. Remove this option due to lack of
use.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2 weeks agonet: Add SYS_FAULT_MII_ADDR to Kconfig
Tom Rini [Thu, 25 Sep 2025 20:44:12 +0000 (14:44 -0600)] 
net: Add SYS_FAULT_MII_ADDR to Kconfig

The support found under SYS_FAULT_ECHO_LINK_DOWN requires that the
SYS_FAULT_MII_ADDR symbol also be set. This wasn't previously found in
Kconfig, so add it now.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2 weeks agoarm: socfpga: Tighten a few more driver dependencies
Tom Rini [Thu, 25 Sep 2025 20:44:11 +0000 (14:44 -0600)] 
arm: socfpga: Tighten a few more driver dependencies

Some drivers which depend on SoCFPGA specific headers had not had
appropriate dependencies list in Kconfig. Add ARCH_SOCFPGA or
TARGET_SOCFPGA_SOC64 where appropriate.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 weeks agouthreads: Make use of CONFIG_IS_ENABLED consistently
Tom Rini [Wed, 1 Oct 2025 20:30:50 +0000 (14:30 -0600)] 
uthreads: Make use of CONFIG_IS_ENABLED consistently

We do not yet support UTHREADS in xPL phases. However, we have the need
to dummy out certain functions so that xPL can build when full U-Boot
has UTHREADS enabled. Update the few places that need to use
CONFIG_IS_ENABLED so that we have the correct dummy in xPL.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2 weeks agotftp: make TFTP ports unconditionally configurable
Alvin Šipraga [Thu, 2 Oct 2025 09:43:36 +0000 (11:43 +0200)] 
tftp: make TFTP ports unconditionally configurable

A few lines of code being guarded by the CONFIG_TFTP_PORT option seems
an unnecessary restriction on the TFTP support provided by a vanilla
U-Boot image. In cases where the TFTP server cannot run as superuser -
and hence cannot run on the well-known port 69 - this quirk incurs a
full reconfiguration and rebuild of the bootloader only in order to
select the appropriate destination port.

Remove the CONFIG_TFTP_PORT option entirely and make the tftpdstp and
tftpsrcp variables always have an effect. Their being unset will mean
that U-Boot behaves the same as if CONFIG_TFTP_PORT was unset. Update
the documentation accordingly. And fix up the single board which was
originally enabling this option.

Signed-off-by: Alvin Šipraga <alvin@pqrs.dk>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2 weeks ago.mailmap: update email address for Chen-Yu Tsai
Chen-Yu Tsai [Mon, 20 Oct 2025 14:55:27 +0000 (22:55 +0800)] 
.mailmap: update email address for Chen-Yu Tsai

The email forwarder I'm using has run into severe problems with Gmail
lately. Switch over to my kernel.org address.

Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2 weeks agoenv: Invert gd->env_valid for env_mmc_save 815/head
Jasper Orschulko [Fri, 10 May 2024 11:38:34 +0000 (13:38 +0200)] 
env: Invert gd->env_valid for env_mmc_save

The A/B update strategy of the env's has a gap in the first 2 calls of saveenv.
The env's are stored twice on the first memory area if:
gd->env_valid == ENV_INVALID.

u-boot=> saveenv
Saving Environment to MMC... Writing to MMC(1)... OK
u-boot=> saveenv
Saving Environment to MMC... Writing to MMC(1)... OK  <-- !!!
u-boot=> saveenv
Saving Environment to MMC... Writing to redundant MMC(1)... OK
u-boot=> saveenv
Saving Environment to MMC... Writing to MMC(1)... OK

This is the same issue as resolved in commit e589d5822cac ("env: spi:
Fix gd->env_valid for the first write")

Signed-off-by: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com>
Signed-off-by: Jasper Orschulko <jasper@fancydomain.eu>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
[trini: Amend the commit message]
---
Changes in v2:
- Rebase to current master
- Amend the commit message to reference the SPI version of this fix,
  which had significant follow-up discussion.

2 weeks agospl: Restore args file being default in falcon mode
Tom Rini [Mon, 20 Oct 2025 19:55:08 +0000 (13:55 -0600)] 
spl: Restore args file being default in falcon mode

When falcon mode is enabled and SPL_OS_BOOT_SECURE is not enabled,
restore the previous default behavior of having an args file be
expected. Platforms which are using a FIT image here and do not need
this can update at their convenience to disable this option now.

Fixes: b1a3ed068869 ("spl: make args file optional in falcon mode")
Signed-off-by: Tom Rini <trini@konsulko.com>
2 weeks agoMerge patch series "Add support for secure falcon mode: disable args file"
Tom Rini [Mon, 20 Oct 2025 17:54:43 +0000 (11:54 -0600)] 
Merge patch series "Add support for secure falcon mode: disable args file"

Anshul Dalal <anshuld@ti.com> says:

Continuing from the last series[1], this patch series addresses the requirement
to disable the args file in falcon mode.

The args file is used in falcon mode for loading the device-tree for the kernel.
However in secure falcon mode, the expected payload is a FIT containing a signed
device-tree and kernel image. Thus removing the need to load the extra args
file in the first place. Also, loading the extra file without any authentication
mechanism exposes an attack vector and should therefore be disabled to keep the
boot secure.

This patch set builds on the last few to first optionally allow for loading the
args file in non-secure falcon boot flow [1/3] and then disable them altogether
in the next patch [2/3] for secure falcon mode.

[1]: https://lore.kernel.org/u-boot/20251006101057.4172248-1-anshuld@ti.com/
Link: https://lore.kernel.org/r/20251009115846.897186-1-anshuld@ti.com
2 weeks agospl: set fdt address as spl_image arg in falcon mode
Anshul Dalal [Thu, 9 Oct 2025 11:58:45 +0000 (17:28 +0530)] 
spl: set fdt address as spl_image arg in falcon mode

The arg field of `struct spl_image_info` is used by jump_to_image_linux
as the argument for the kernel in falcon mode.

Since commit 601cebc29d2a ("cmd: spl: Remove ATAG support from this
command"), fdt is the only valid argument for kernel in falcon mode.

However fdt was only being set as the argument in nor and xip boot
modes, this patch fixes it for all boot modes and removes the now
redundant code from spl_nor and spl_xip.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agospl: prevent loading args file in secure falcon mode
Anshul Dalal [Thu, 9 Oct 2025 11:58:44 +0000 (17:28 +0530)] 
spl: prevent loading args file in secure falcon mode

The expected payload for the SPL in secure falcon mode is a fitImage
that contains the kernel image and the DT. This removes the need to load
an additional args file, which exposes an additional attack vector since
it can not be verified.

Therefore this patch disables loading of the arg file when
SPL_OS_BOOT_SECURE is set.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agospl: make args file optional in falcon mode
Anshul Dalal [Thu, 9 Oct 2025 11:58:43 +0000 (17:28 +0530)] 
spl: make args file optional in falcon mode

Falcon mode loads a kernel file and an args file which is the
device-tree. However in the case of kernel file being a FIT that
contains the device-tree within it, loading the args file is not
required.

Therefore, this patch introduces a new SPL_OS_BOOT_ARGS config options
that allows us to enable or disable loading of the args file in falcon
mode.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agoMerge patch series "Add support for secure falcon mode: disable fallback"
Tom Rini [Mon, 20 Oct 2025 16:17:54 +0000 (10:17 -0600)] 
Merge patch series "Add support for secure falcon mode: disable fallback"

Anshul Dalal <anshuld@ti.com> says:

Continuing from the last series[1], this patch series addresses the requirement of
allowing no fallbacks in secure falcon mode.

To do this in a clean way, all the falcon mode logic for each boot media was
refactored to a corresponding *_load_image_os function whereas the regular
boot is implemented in *_load_image, this allows us to easily return early in
case the *_load_image_os function fails with secure mode enabled.

The series also introduces the new SPL_OS_BOOT_SECURE config symbol which
enables secure falcon boot flow.

The generic flow after the patch series looks as follows:

static int spl_<bootmedia>_load_image(...) {
if (CONFIG_IS_ENABLED(OS_BOOT)) {

ret = spl_<bootmedia>_load_image_os(...);

puts("Failcon mode failed\n");
if (CONFIG_IS_ENABLED(OS_BOOT_SECURE)) {
puts("no fallback allowed!\n");
return ret;
}

puts("Falling back to U-Boot\n");
}

/* Regular boot flow */
}

[1]: https://lore.kernel.org/u-boot/20250923124639.667718-1-anshuld@ti.com/
Link: https://lore.kernel.org/r/20251017193318.4124997-1-anshuld@ti.com
2 weeks agospl: falcon: disable fallback to U-Boot on failure
Anshul Dalal [Fri, 17 Oct 2025 19:33:12 +0000 (01:03 +0530)] 
spl: falcon: disable fallback to U-Boot on failure

Instead of falling back to the standard U-Boot boot flow, we should just
halt boot if the expected boot flow in falcon mode fails.

This prevents a malicious actor from accessing U-Boot proper if they can
cause a boot failure on falcon mode.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agospl: nand: refactor spl_nand_load_image for falcon mode
Anshul Dalal [Fri, 17 Oct 2025 19:33:11 +0000 (01:03 +0530)] 
spl: nand: refactor spl_nand_load_image for falcon mode

This patch moves the falcon mode handling logic out of
spl_ubi_load_image to spl_ubi_load_image_os, this allows for cleaner
handling for fallback to U-Boot in case falcon mode fails.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agospl: nor: refactor spl_nor_load_image for falcon mode
Anshul Dalal [Fri, 17 Oct 2025 19:33:10 +0000 (01:03 +0530)] 
spl: nor: refactor spl_nor_load_image for falcon mode

This patch moves the falcon mode handling logic out of
spl_nor_load_image to spl_nor_load_image_os, this allows for cleaner
handling for fallback to U-Boot in case falcon mode fails.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agospl: spi: refactor spl_spi_load_image for falcon mode
Anshul Dalal [Fri, 17 Oct 2025 19:33:09 +0000 (01:03 +0530)] 
spl: spi: refactor spl_spi_load_image for falcon mode

This patch moves the falcon mode handling logic out of
spl_spi_load_image to spl_spi_load_image_os, this allows for cleaner
handling for fallback to U-Boot in case falcon mode fails.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agospl: ubi: refactor spl_ubi_load_image for falcon mode
Anshul Dalal [Fri, 17 Oct 2025 19:33:08 +0000 (01:03 +0530)] 
spl: ubi: refactor spl_ubi_load_image for falcon mode

This patch moves the falcon mode handling logic out of
spl_ubi_load_image to spl_ubi_load_image_os, this allows for cleaner
handling for fallback to U-Boot in case falcon mode fails.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agospl: mmc: split spl_mmc_do_fs_boot into regular/os_boot
Anshul Dalal [Fri, 17 Oct 2025 19:33:07 +0000 (01:03 +0530)] 
spl: mmc: split spl_mmc_do_fs_boot into regular/os_boot

Currently the logic to handle falcon mode as well as the regular boot is
inside spl_mmc_do_fs_boot, this prevents us from cleanly extending
falcon mode functionality like toggleable fallback to U-Boot proper.

Therefore this patch splits the logic into spl_mmc_fs_load and
spl_mmc_fs_load_os to handle the regular boot and falcon mode use case.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agospl: Kconfig: add SPL_OS_BOOT_SECURE config symbol
Anshul Dalal [Fri, 17 Oct 2025 19:33:06 +0000 (01:03 +0530)] 
spl: Kconfig: add SPL_OS_BOOT_SECURE config symbol

This patch adds the new SPL_OS_BOOT_SECURE symbol that enables secure
boot flow in falcon mode. This symbol can be used to disable certain
inherently insecure options during falcon boot.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 weeks agoRevert "spi: cadence-qspi: Remove cdns, is-dma property handling"
Michal Simek [Mon, 20 Oct 2025 13:13:42 +0000 (15:13 +0200)] 
Revert "spi: cadence-qspi: Remove cdns, is-dma property handling"

This reverts commit a040578d8270ed8788d7663808ea63ce5ffd7840.

Based on feedback other SOCs (for example Star64) are using driver in non
DMA mode which is causing issues that's why revert this patch.
cdns,is-dma should be removed differently.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reported-by: E Shattow <e@freeshell.de>
2 weeks agoMerge tag 'efi-2026-01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 20 Oct 2025 14:27:19 +0000 (08:27 -0600)] 
Merge tag 'efi-2026-01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2026-01-rc1

CI:

  * https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/27944

Documentation:

 * samsung: Extend E850-96 documentation to be comprehensive
 * environment: fix links to Linux kernel documentation
 * sandbox: fix typos
 * document dmareset command
 * ti: j722s_evm: drop outdated boot note

UEFI:

 * Prevent leak of memory from tmp_files
 * Correctly check if the HTTP protocol is found
 * Use ESRT_FW_TYPE_SYSTEMFIRMWARE instead of ESRT_FW_TYPE_UNKNOWN
 * dbginfodump: use guid definition

Others:

 * lib/uuid: add support for efi debug image info table guid

2 weeks agodoc: ti: j722s_evm: drop outdated boot note
Peter Robinson [Fri, 17 Oct 2025 11:20:24 +0000 (12:20 +0100)] 
doc: ti: j722s_evm: drop outdated boot note

The j722s_evm support is now largely complete and is certainly
not limited to UART boot so drop the confusing note from the docs.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2 weeks agolib: uuid: add efi debug image info table guid
Vincent Stehlé [Mon, 13 Oct 2025 14:21:09 +0000 (16:21 +0200)] 
lib: uuid: add efi debug image info table guid

Add the EFI Debug Image Info Table GUID to the translation table used by
uuid_guid_get_str().

This allows to print a human readable table name with `efidebug tables'
instead of "(unknown)".

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 weeks agoefi_loader: dbginfodump: use guid definition
Vincent Stehlé [Mon, 13 Oct 2025 14:21:08 +0000 (16:21 +0200)] 
efi_loader: dbginfodump: use guid definition

Use the Debug Image Info Table GUID definition from efi_api.h instead or
redefining it locally.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 weeks agodoc: environment: fix links to Linux kernel documentation
Mattia Narducci [Fri, 10 Oct 2025 19:31:45 +0000 (21:31 +0200)] 
doc: environment: fix links to Linux kernel documentation

Architecture-specific documentation in the Linux kernel was moved to
the arch/ subdirectory.

Signed-off-by: Mattia Narducci <mattianarducci1@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 weeks agoefi_loader: Use ESRT_FW_TYPE_SYSTEMFIRMWARE instead of ESRT_FW_TYPE_UNKNOWN
Ilias Apalodimas [Fri, 10 Oct 2025 10:59:31 +0000 (13:59 +0300)] 
efi_loader: Use ESRT_FW_TYPE_SYSTEMFIRMWARE instead of ESRT_FW_TYPE_UNKNOWN

We currently set the firmware image type to ESRT_FW_TYPE_UNKNOWN.

The spec defines the following:
ESRT_FW_TYPE_UNKNOWN 0x00000000
ESRT_FW_TYPE_SYSTEMFIRMWARE 0x00000001
ESRT_FW_TYPE_DEVICEFIRMWARE 0x00000002
ESRT_FW_TYPE_UEFIDRIVER 0x00000003

Since we don't support updating DEVICEFIRMWARE or UEFIDRIVER types,
let's switch over to SYSTEMFIRMWARE which seems more appropriate.

Suggested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 weeks agodoc: sandbox: fix typos
Lukas Zirpel [Thu, 9 Oct 2025 10:18:02 +0000 (12:18 +0200)] 
doc: sandbox: fix typos

Fix two typos in the sandbox docs.

Signed-off-by: Lukas Zirpel <lukas@zirpel.de>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 weeks agocmd/dma: documentation
Brian Sune [Wed, 8 Oct 2025 20:41:03 +0000 (04:41 +0800)] 
cmd/dma: documentation

This explains how
to use the new U-Boot command 'dmareset'.

Signed-off-by: Brian Sune <briansune@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 weeks agoefi_loader: correctly check if the HTTP protocol is found
Heinrich Schuchardt [Mon, 6 Oct 2025 13:39:03 +0000 (15:39 +0200)] 
efi_loader: correctly check if the HTTP protocol is found

In function efi_http_service_binding_destroy_child() phandler is created as
as a local variable. If efi_search_protocol() fails, phandler will hold a
random value from the stack. Even it is not zero, we must not use it.

If efi_search_protocol() succeeds, the pointer has already be dereferenced,
so checking against NULL makes not sense here.

If ChildHandle is not a valid UEFI handle, we must return
EFI_INVALID_PARAMETER.

Use a single location for EFI_EXIT().

Addresses-Coverity-ID: CID 531974 (Unchecked return value)
Fixes: 5753dc3f6572 ("efi_loader: Prevent dereference of uninitialised variable")
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>