]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
3 weeks agopower: domain: zynqmp: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:14 +0000 (14:22 +0200)] 
power: domain: zynqmp: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: tegra186: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:13 +0000 (14:22 +0200)] 
power: domain: tegra186: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: scmi: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:12 +0000 (14:22 +0200)] 
power: domain: scmi: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: sandbox: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:11 +0000 (14:22 +0200)] 
power: domain: sandbox: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: mtk: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:10 +0000 (14:22 +0200)] 
power: domain: mtk: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: meson-secure-pwrc: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:09 +0000 (14:22 +0200)] 
power: domain: meson-secure-pwrc: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: meson-gx-pwrc: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:08 +0000 (14:22 +0200)] 
power: domain: meson-gx-pwrc: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: meson-ee-pwrc: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:07 +0000 (14:22 +0200)] 
power: domain: meson-ee-pwrc: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: imx8mp-mediamix: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:06 +0000 (14:22 +0200)] 
power: domain: imx8mp-mediamix: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: imx8m: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:05 +0000 (14:22 +0200)] 
power: domain: imx8m: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: imx8: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:04 +0000 (14:22 +0200)] 
power: domain: imx8: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: imx8-legacy: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:03 +0000 (14:22 +0200)] 
power: domain: imx8-legacy: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: bcm6328: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:02 +0000 (14:22 +0200)] 
power: domain: bcm6328: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: domain: apple: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:22:01 +0000 (14:22 +0200)] 
power: domain: apple: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agommc: cv1800b_sdhci: honor 'no-1-8-v' DT property
Hiago De Franco [Thu, 7 May 2026 23:48:36 +0000 (20:48 -0300)] 
mmc: cv1800b_sdhci: honor 'no-1-8-v' DT property

CV1800B SDHCI controller does support 1.8V, however, boards like
MilkV-Duo 256M do not have a VCCIO 1.8V regulator (the bus is wired for
3.3V only).

These boards set 'no-1-8-v' in their device tree, and mmc_of_parse()
does respect this property. Later, when sdhci_setup_cfg() is called, it
reads SDHCI_CAPABILITIES_1 from the hardware and unconditionally adds
the UHS caps again based on what the controller advertises. Since the
board cannot switch to 1.8V, the host issues CMD11 (voltage switch
request), the card transitions, but the bus stays at 3.3V. The SD card
stops responding until the next power cycle.

Before calling sdhci_setup_cfg(), set the SDHCI_QUIRK_NO_1_8_V quirk
when 'no-1-8-v' is present. The quirk causes the SDR104/SDR50/DDR50 bits
to be masked out of the caps, allowing the card to initialize properly.

This matches the pattern used by zynq_sdhci.

Fixes: eb36f28ff721 ("mmc: cv1800b: Add sdhci driver support for cv1800b SoC")
Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agopower: pmic: emul: Staticize and constify driver ops
Marek Vasut [Fri, 8 May 2026 12:23:58 +0000 (14:23 +0200)] 
power: pmic: emul: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agommc: bootstd: Staticize and constify driver ops
Marek Vasut [Thu, 7 May 2026 22:07:48 +0000 (00:07 +0200)] 
mmc: bootstd: Staticize and constify driver ops

Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agommc: sdhci: Start status timeout after command issue
Tanmay Kathpalia [Sat, 9 May 2026 17:59:32 +0000 (23:29 +0530)] 
mmc: sdhci: Start status timeout after command issue

The status polling timeout in sdhci_send_command() should measure the
time spent waiting for the command interrupt after the command has been
issued.

Do not initialize the timer at function entry, since the command inhibit
wait and setup path can consume time before SDHCI_COMMAND is written.
Start the timer immediately after issuing the command instead.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 weeks agogpio: Correct dependencies for MCP230xx
Charles Perry [Thu, 7 May 2026 18:51:22 +0000 (11:51 -0700)] 
gpio: Correct dependencies for MCP230xx

This driver depends on DM_I2C and DM_SPI, add it.

Fixes: 3b639f643889 ("gpio: mcp230xx: Add support for models with SPI interface.")
Signed-off-by: Charles Perry <charles.perry@microchip.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 weeks agoboard: ti: am335x: Conditional MDIO PAD configuration instead of static for AM335_ICE
Parvathi Pudi [Thu, 7 May 2026 06:23:49 +0000 (11:53 +0530)] 
board: ti: am335x: Conditional MDIO PAD configuration instead of static for AM335_ICE

This patch removes the static MDIO pinmux configuration from
rmii1_pin_mux[] and instead configures the MDIO pins conditionally
during board_init(). Previously, the MDIO_CLK and MDIO_DATA pins
were always configured for CPSW in mux.c, which could lead to
unnecessary pin ownership and conflicts in scenarios where CPSW
is not used.

With this change, the MDIO pins are configured only when required,
ensuring that CPSW Ethernet functionality in U-Boot remains unaffected.
This approach keeps Ethernet boot behavior intact and provides cleaner
separation between CPSW and other Ethernet use cases.

Reviewed-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com>
Signed-off-by: Parvathi Pudi <parvathi@couthit.com>
3 weeks agortc: ds1307: Handle oscillator stop flag set on ds1339 chip
Ronan Dalton [Tue, 5 May 2026 04:25:31 +0000 (16:25 +1200)] 
rtc: ds1307: Handle oscillator stop flag set on ds1339 chip

Currently the oscillator stop flag (OSF) bit is never checked or cleared
on the DS1339 RTC chip.

On getting the time from the RTC, check if the OSF bit is set, log a
warning, and clear the flag. This matches the behavior of the DS1337
chip.

Note that the `date` command always reads from the RTC even when
setting or resetting the date, so the OSF flag is cleared in those cases
as well.

Signed-off-by: Ronan Dalton <ronan.dalton@alliedtelesis.co.nz>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Francesco Dolcini <francesco.dolcini@toradex.com>
Cc: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 weeks agoMerge patch series "test: Quote variables in 'test -n' expressions across boards"
Tom Rini [Thu, 14 May 2026 21:39:22 +0000 (15:39 -0600)] 
Merge patch series "test: Quote variables in 'test -n' expressions across boards"

Simon Glass <sjg@chromium.org> says:

Several boards use 'test -n ${var}' (unquoted) in env scripts to detect
an empty variable and trigger a fallback or skip a hook. That works only
because of a U-Boot 'test' quirk where calls with argc < 3 returned
false; an empty variable made the expression 'test -n' (one operand) and
hit that path.

Commit 8b0619579b22 ("cmd: test: fix handling of single-argument form of
test") aligned 'test' with POSIX so those expressions flipped to true.
f7e7c55e53e8 ("cmd: test: add bug-compatibility special case for 'test
-n'") restored the old behaviour for the exact 'test -n' (one arg) case,
so the boards are not broken at runtime today, but the reliance on a
bug-compat path isn't great.

This series updates various boards to quote each affected variable so
the emptiness check is explicit and does not depend on the
special-case path.

Each commit carries a Fixes: tag pointing at 8b0619579b22

Link: https://lore.kernel.org/r/20260503204936.3151124-1-sjg@chromium.org
3 weeks agoaristainetos2: Quote rescue_reason in rescueboot test
Simon Glass [Sun, 3 May 2026 20:49:24 +0000 (14:49 -0600)] 
aristainetos2: Quote rescue_reason in rescueboot test

The rescueboot script optionally runs a per-board rescue_reason hook
with:

    if test -n ${rescue_reason}; then run rescue_reason; fi;

The default state is "no rescue reason script", i.e. rescue_reason
unset.  The expression then expands to 'test -n' with no operand and
relies on a U-Boot 'test' quirk that treats a missing operand as
false to skip the run.

Quote the variable so an unset rescue_reason expands to 'test -n ""'
and the emptiness check is explicit.

Fixes: 8b0619579b22 ("cmd: test: fix handling of single-argument form of test")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@nabladev.com>
3 weeks agomccmon6: Quote recovery_status in bootcmd test
Simon Glass [Sun, 3 May 2026 20:49:23 +0000 (14:49 -0600)] 
mccmon6: Quote recovery_status in bootcmd test

The mccmon6 bootcmd starts with:

    if test -n ${recovery_status}; then run boot_recovery; ...

The default state is "no recovery requested", i.e. recovery_status
unset.  The expression then expands to 'test -n' with no operand and
relies on a U-Boot 'test' quirk that treats a missing operand as
false to skip recovery.

Quote the variable so an unset recovery_status expands to 'test -n ""'
and the emptiness check is explicit.

Fixes: 8b0619579b22 ("cmd: test: fix handling of single-argument form of test")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ɓukasz Majewski <lukma@nabladev.com>
3 weeks agobeaglev_fire: Quote no_of_overlays in design test
Simon Glass [Sun, 3 May 2026 20:49:22 +0000 (14:49 -0600)] 
beaglev_fire: Quote no_of_overlays in design test

On beaglev_fire, design_overlays gates an overlay-application loop
on:

    if test -n ${no_of_overlays}; then ...

The default state is "no overlays", i.e. no_of_overlays unset. The
expression then expands to 'test -n' with no operand and relies on a
U-Boot 'test' quirk that treats a missing operand as false to skip
the loop.

Quote the variable so an unset no_of_overlays expands to 'test -n ""'
and the emptiness check is explicit.

Fixes: 8b0619579b22 ("cmd: test: fix handling of single-argument form of test")
Signed-off-by: Simon Glass <sjg@chromium.org>
3 weeks agosiemens: Quote A/B flags in env tests
Simon Glass [Sun, 3 May 2026 20:49:21 +0000 (14:49 -0600)] 
siemens: Quote A/B flags in env tests

The Siemens am33x-common, env-common and draco-etamin headers gate
boot-partition selection logic on:

    if test -n ${A}; then ...
    if test -n ${B}; then ...

A and B are flags that the upgrade machinery sets to mark "the other
partition just became active".  The default state is unset, in which
case the expression expands to 'test -n' with no operand and relies
on a U-Boot 'test' quirk that treats a missing operand as false to
skip the branch.

Quote each variable so an unset A or B expands to 'test -n ""' and
the emptiness check is explicit.

Fixes: 8b0619579b22 ("cmd: test: fix handling of single-argument form of test")
Signed-off-by: Simon Glass <sjg@chromium.org>
3 weeks agoti: Quote board_init in ti_common.env
Simon Glass [Sun, 3 May 2026 20:49:20 +0000 (14:49 -0600)] 
ti: Quote board_init in ti_common.env

bootcmd_ti_mmc skips a per-board init hook with:

    if test -n ${board_init}; then run board_init; fi;

The default case is "no board override", i.e. board_init unset. The
expression then expands to 'test -n' with no operand and relies on a
U-Boot 'test' quirk that treats a missing operand as false to skip the
run.

Quote the variable so an unset board_init expands to 'test -n ""' and
the emptiness check is explicit.

Fixes: 8b0619579b22 ("cmd: test: fix handling of single-argument form of test")
Signed-off-by: Simon Glass <sjg@chromium.org>
3 weeks agoMerge patch series "add memdup_nul(), use it and memdup() in a few places"
Tom Rini [Tue, 12 May 2026 21:41:52 +0000 (15:41 -0600)] 
Merge patch series "add memdup_nul(), use it and memdup() in a few places"

Rasmus Villemoes <ravi@prevas.dk> says:

There are quite a few places where we allocate X+1 bytes, initialize
the first X bytes via memcpy() and then set the last byte to 0.

The kernel has a helper for that, kmemdup_nul(). Introduce a similar
one, and start making use of it in a few places. Also the existing
memdup() helper can be put to more use.

There are lots more places one could modify. But for code shared with
host tools, one would need to do some refactoring, putting memdup()
and memdup_nul() in their own str-util.c TU which could then also be
included in the tools build.

Link: https://lore.kernel.org/r/20260421075439.16696-1-ravi@prevas.dk
3 weeks agotest: lib: add test of memdup_nul()
Rasmus Villemoes [Tue, 21 Apr 2026 07:54:39 +0000 (09:54 +0200)] 
test: lib: add test of memdup_nul()

Add a very basic test of the new memdup_nul() helper.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 weeks agodrivers/core: use memdup() instead of malloc()+memcpy()
Rasmus Villemoes [Tue, 21 Apr 2026 07:54:38 +0000 (09:54 +0200)] 
drivers/core: use memdup() instead of malloc()+memcpy()

Use memdup() instead of open-coding it.

In the dm_setup_inst() case, there was never any reason to use
calloc(), as the whole allocation is definitely initialized via the
immediately following memcpy().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
3 weeks agocommon/cli.c: use memdup_nul() in run_command_list()
Rasmus Villemoes [Tue, 21 Apr 2026 07:54:37 +0000 (09:54 +0200)] 
common/cli.c: use memdup_nul() in run_command_list()

Use memdup_nul() instead of open-coding it.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
3 weeks agolib/hashtable.c: use memdup_nul() in himport_r
Rasmus Villemoes [Tue, 21 Apr 2026 07:54:36 +0000 (09:54 +0200)] 
lib/hashtable.c: use memdup_nul() in himport_r

We have memdup_nul() for exactly this pattern of duplicating a block
of memory and ensuring there's a nul byte after the copy.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
3 weeks agolib/string.c: implement strdup() and strndup() in terms of memdup_nul()
Rasmus Villemoes [Tue, 21 Apr 2026 07:54:35 +0000 (09:54 +0200)] 
lib/string.c: implement strdup() and strndup() in terms of memdup_nul()

With the addition of memdup_nul(), strdup() and strndup() can be
implemented as one-liners.

While not required by POSIX or C, do keep the behaviour of gracefully
accepting a NULL source and simply return NULL.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
3 weeks agolib/string.c: introduce memdup_nul() helper
Rasmus Villemoes [Tue, 21 Apr 2026 07:54:34 +0000 (09:54 +0200)] 
lib/string.c: introduce memdup_nul() helper

This is completely analogous to the linux kernel's kmemdup_nul()
helper, apart from the lack of the gfp_t argument: Allocate a buffer
of size {len}+1, copy {len} bytes from the given buffer, and add a
final nul byte.

This pattern exists in a number of places, so this helper can reduce
some boilerplate code.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
3 weeks agolib/string.c: drop pointless __HAVE_ARCH_STRDUP
Rasmus Villemoes [Tue, 21 Apr 2026 07:54:33 +0000 (09:54 +0200)] 
lib/string.c: drop pointless __HAVE_ARCH_STRDUP

There has never been an arch-specific optimized implementation of
str[n]dup, nor is there likely to ever be one, because unlike their
cousins strlen(), strcpy() and similar that simply read/write the
src/dst, the dup functions by definition involve memory allocation. So
drop this irrelevant cpp guard.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
3 weeks agostdio: drop stdio_clone
Rasmus Villemoes [Tue, 21 Apr 2026 07:54:32 +0000 (09:54 +0200)] 
stdio: drop stdio_clone

The helper stdio_clone only has a single caller, so it certainly
doesn't need to be public. But in fact, it is merely an open-coded
memdup() - which for some reason uses calloc() even if the whole
allocation is obviously immediately overwritten.

Drop it and just use memdup() directly.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
3 weeks agostring: fix prototype of memdup()
Rasmus Villemoes [Tue, 21 Apr 2026 07:54:31 +0000 (09:54 +0200)] 
string: fix prototype of memdup()

It doesn't make sense to restrict memdup() to only return char*
pointers, especially when it is already defined to accept void*. This
makes it uglier to use to e.g. duplicate a struct.

Make it return void*, just as kmemdup() does in the kernel (and which
our kmemdup() in fact also does).

While in here, make a small optimization: memcpy() is defined to
return the destination register, so we write this in a way that the
compiler may do a tail call.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
3 weeks agoPrepare v2026.07-rc2 v2026.07-rc2
Tom Rini [Mon, 11 May 2026 22:05:08 +0000 (16:05 -0600)] 
Prepare v2026.07-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
3 weeks agoMerge tag 'dm-pull-11may26b' of git://git.denx.de/u-boot-dm
Tom Rini [Mon, 11 May 2026 20:44:30 +0000 (14:44 -0600)] 
Merge tag 'dm-pull-11may26b' of git://git.denx.de/u-boot-dm

CI: https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/30065

- Add missing bintool docstrings
- Minor patman fix
- Fix small ACPI bug

3 weeks agoMerge patch series "j721s2: j784s4: Add workaround for errata i2437"
Tom Rini [Mon, 11 May 2026 18:33:52 +0000 (12:33 -0600)] 
Merge patch series "j721s2: j784s4: Add workaround for errata i2437"

Udit Kumar <u-kumar1@ti.com> says:

Add a necessary hardware errata workaround for J721S2 and J784S4.

Bootlogs
https://gist.github.com/uditkumarti/da2a489a78d3241ecd2791c9df1c1317

Link: https://lore.kernel.org/r/20260415152152.3048491-1-u-kumar1@ti.com
3 weeks agoarch: mach-k3: j784s4_init: Add workaround for errata i2437
Neha Malcom Francis [Wed, 15 Apr 2026 15:21:52 +0000 (20:51 +0530)] 
arch: mach-k3: j784s4_init: Add workaround for errata i2437

Add the workaround proposed for J784S4 errata i2437 (link) for SE
clock-gating turning off too early. Without this, a hardware bug present
in C7120 leads to C7120 CPU hanging.

Link: https://www.ti.com/lit/pdf/sprz536
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
3 weeks agoarch: mach-k3: j721s2_init: Add workaround for errata i2437
Neha Malcom Francis [Wed, 15 Apr 2026 15:21:51 +0000 (20:51 +0530)] 
arch: mach-k3: j721s2_init: Add workaround for errata i2437

Add the workaround proposed for J721S2 errata i2437 (link) for SE
clock-gating turning off too early. Without this, a hardware bug present
in C7120 leads to C7120 CPU hanging.

Link: https://www.ti.com/lit/pdf/sprz530
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
3 weeks agoarm: mach-k3: arm: mach-k3: Add writel_verify macro for register write verification
Udit Kumar [Wed, 15 Apr 2026 15:21:50 +0000 (20:51 +0530)] 
arm: mach-k3: arm: mach-k3: Add writel_verify macro for register write verification

Add a helper macro to write and verify a 32-bit value to a memory-mapped
register. This is essential for hardware errata workarounds that require
confirmation that register writes have taken effect before proceeding with
initialization.

Signed-off-by: Udit Kumar <u-kumar1@ti.com>
3 weeks agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 11 May 2026 18:26:03 +0000 (12:26 -0600)] 
configs: Resync with savedefconfig

Resync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 weeks agofs: ubifs: fix bugs involving symlinks in ubifs_findfile
Peter Collingbourne [Tue, 5 May 2026 10:38:16 +0000 (03:38 -0700)] 
fs: ubifs: fix bugs involving symlinks in ubifs_findfile

When encountering a symlink pointing to an absolute path, ubifs_findfile
would return the target of the symlink as the result instead of resolving
any following components in the original path. Fix it by following the
same code path that is used for relative paths except that we set the
next inode to the root if we see a leading slash.

The existing code used memcpy and sprintf to copy the symlink target
into a fixed size stack buffer and was therefore vulnerable to buffer
overflows with a sufficiently long symlink target. Fix it by using a
heap buffer for the temporary path during path resolution.

Signed-off-by: Peter Collingbourne <peter@pcc.me.uk>
Fixes: 9d7952e4c636 ("ubifs: Add support for looking up directory and relative symlinks")
3 weeks agobinman: Use bintool wrappers for PKCS#11 tools in tests
Simon Glass [Tue, 5 May 2026 18:12:55 +0000 (12:12 -0600)] 
binman: Use bintool wrappers for PKCS#11 tools in tests

The PKCS#11 signing tests in ftest.py call tools.run('softhsm2-util', ...)
directly (and the equivalent for pkcs11-tool and p11-kit), even though
the test setup has already constructed the corresponding Bintool
instances. As Quentin Schulz observed on v1, the bintool wrapper for
these tools is currently used only as an "is this installed?" probe.

Route the eight remaining call sites in ftest.py through
<bintool>.run_cmd(...), which the Bintool base class already provides.
The change is test-side only; no production binman code calls these
tools.

Suggested-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
3 weeks agobinman: Flesh out the softhsm2-util bintool docstring
Simon Glass [Tue, 5 May 2026 18:12:54 +0000 (12:12 -0600)] 
binman: Flesh out the softhsm2-util bintool docstring

The Sphinx-generated bintools.rst currently produces an empty section
for this bintool, since its class docstring is only a single line and
so the body under the heading is blank.

Extend the docstring with a short description of what softhsm2-util
does and how binman uses it, so the generated documentation has useful
content.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
3 weeks agobinman: Flesh out the pkcs11-tool bintool docstring
Simon Glass [Tue, 5 May 2026 18:12:53 +0000 (12:12 -0600)] 
binman: Flesh out the pkcs11-tool bintool docstring

The Sphinx-generated bintools.rst currently produces an empty section
for this bintool, since its class docstring is only a single line and
so the body under the heading is blank.

Extend the docstring with a short description of what pkcs11-tool does
and how binman uses it, so the generated documentation has useful
content.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
3 weeks agobinman: Flesh out the p11-kit bintool docstring
Simon Glass [Tue, 5 May 2026 18:12:52 +0000 (12:12 -0600)] 
binman: Flesh out the p11-kit bintool docstring

The Sphinx-generated bintools.rst currently produces an empty section
for this bintool, since its class docstring is only a single line and
so the body under the heading is blank.

Extend the docstring with a short description of what p11-kit does and
how binman uses it, so the generated documentation has useful content.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
3 weeks agopatman: fix use in worktree
Ludwig Nussel [Wed, 29 Apr 2026 12:18:51 +0000 (14:18 +0200)] 
patman: fix use in worktree

When using a worktree '.git' actually is a file and pygit2
init_repository() does not like that. The intention is not to create
a new git repo anyway so use normal constructor instead of
init_repository().

Signed-off-by: Ludwig Nussel <ludwig.nussel@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 weeks agoacpi: fix initial RSDT and XSDT size
Heinrich Schuchardt [Mon, 20 Apr 2026 16:47:25 +0000 (18:47 +0200)] 
acpi: fix initial RSDT and XSDT size

When creating the RSDT and the XSDT table they contain no entries.
The table size therefore must equal the header size.

Without this change a NULL deference has been observed in
acpi_find_table() when running `ut dm` on sandbox64_defconfig
executed via `sudo ./u-boot -D`.

Fixes: 94ba15a3f13f ("x86: Move base tables to a writer function")
Fixes: 7e586f69070d ("acpi: Put table-setup code in its own function")
Fixes: ab5efd576c4e ("x86: acpi: Adjust order in acpi_table.c")
Fixes: 867bcb63e79f ("x86: Generate a valid ACPI table")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Update dm_test_acpi_ctx_and_base_tables() in test/dm/acpi.c to expect
sizeof(struct acpi_table_header) for the initial table length (instead
of sizeof(*rsdt) / sizeof(*xsdt)), and to compute the checksum over
header->length bytes rather than the full struct size:
Signed-off-by: Simon Glass <sjg@chromium.org>
3 weeks agoMerge tag 'u-boot-at91-fixes-2026.07-a' of https://source.denx.de/u-boot/custodians... 948/head 966/head
Tom Rini [Sat, 9 May 2026 13:31:55 +0000 (07:31 -0600)] 
Merge tag 'u-boot-at91-fixes-2026.07-a' of https://source.denx.de/u-boot/custodians/u-boot-at91

First set of u-boot-at91 fixes for the 2026.07 cycle:

- Cleanup some useless code

3 weeks agoMerge branch 'master' of git://source.denx.de/u-boot-usb
Tom Rini [Sat, 9 May 2026 13:31:22 +0000 (07:31 -0600)] 
Merge branch 'master' of git://source.denx.de/u-boot-usb

- DWC3 crash fix, Kconfig logic corrections

3 weeks agousb: dwc3: Fix crash on fastboot exit due to incorrect memory free
Balaji Selvanathan [Thu, 7 May 2026 15:20:35 +0000 (20:50 +0530)] 
usb: dwc3: Fix crash on fastboot exit due to incorrect memory free

The dwc3_free_one_event_buffer() function incorrectly called free()
on event buffer structures allocated with devm_kzalloc(). This
caused heap corruption and a synchronous abort when exiting
fastboot mode via "fastboot continue".

Device-managed memory is automatically freed when the device is
removed, so manual deallocation causes the heap allocator to access
corrupted metadata.

Fixes: 884b10e86a05 ("usb: dwc3: core: fix memory leaks in event buffer cleanup")
Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Reviewed-by: Marek Vasut <marek.vasut+usb@mailbox.org>
3 weeks agousb: Correct dependencies around USB_EMUL
Tom Rini [Mon, 23 Mar 2026 14:38:36 +0000 (08:38 -0600)] 
usb: Correct dependencies around USB_EMUL

The symbol USB_EMUL is how sandbox has access to USB. It's
implementation however enforces a few other requirements. It must have
SCSI enabled, and in turn that means it must have BLK enabled. Finally,
we should not be using SANDBOX itself as a symbol to decide what to
build or not build here, as SANDBOX is selected for COMPILE_TEST builds
as well and so may not have enabled the sandbox specific USB support.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marek.vasut+usb@mailbox.org>
3 weeks agoreset: Correct dependencies for RESET_RZG2L_USBPHY_CTRL
Tom Rini [Mon, 23 Mar 2026 14:32:02 +0000 (08:32 -0600)] 
reset: Correct dependencies for RESET_RZG2L_USBPHY_CTRL

As exposed by "make randconfig", we have an issue with the dependencies
for RESET_RZG2L_USBPHY_CTRL. As this functionally depends on
REGULATOR_RZG2L_USBPHY, express this dependency directly in Kconfig as
well.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 weeks agousb: gadget: Correct dependencies for USB_RENESAS_USBHS
Tom Rini [Mon, 23 Mar 2026 19:53:08 +0000 (13:53 -0600)] 
usb: gadget: Correct dependencies for USB_RENESAS_USBHS

The USB_RENESAS_USBHS functionality can only work with DM_USB_GADGET
enabled, so express this dependency in Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 weeks agotest: fit: Use shared make_fname from fit_util
Aristo Chen [Fri, 1 May 2026 05:51:04 +0000 (05:51 +0000)] 
test: fit: Use shared make_fname from fit_util

test_fit.py declares a local make_fname closure that is byte-identical
to fit_util.make_fname. Drop the local copy and call the shared helper
at all seven call sites so there is one definition to maintain.

No behavioural change. Both implementations return
os.path.join(ubman.config.build_dir, basename).

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 weeks agovirtio: fix boot device hunting in qemu with virtio
Ludwig Nussel [Mon, 4 May 2026 07:10:23 +0000 (09:10 +0200)] 
virtio: fix boot device hunting in qemu with virtio

Commit 70101c3217ae ("virtio: mmio: Return error codes on probe
failures") returns -ENODEV where it would return 0 before. That path is
apparently hit in qemu and breaks boot device discovery
(virtio_bootdev_hunt() expects only ENOENT). So return -ENOENT in
that path instead.
The remaining two error returns in the function are untouched as I
don't know where they play a role.

Signed-off-by: Ludwig Nussel <ludwig.nussel@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Kuan-Wei Chiu <visitorckw@gmail.com>
3 weeks agoboot: image-fit.c: check target, not source, for 8-byte alignment when loading FDT
Rasmus Villemoes [Mon, 4 May 2026 14:44:55 +0000 (16:44 +0200)] 
boot: image-fit.c: check target, not source, for 8-byte alignment when loading FDT

A number of our boards no longer boot with v2026.04, ironically as a
result of the effort to ensure 8-byte alignment of the dtb passed to
the kernel and getting rid of the fdt_high=0xffffffff.

The problem exists when the FIT image does specify a (properly
aligned) load address to use for the fdt. For example, we have

fdt-am335x-boneblack.dtb {
description = "Flattened Device Tree blob";
data = /incbin/(...);
...
load = <0x88000000>;
}

Now, with v2026.04 and depending on just exactly where that data ends
up, in a good case we see

     Loading fdt from 0x8a8c6e10 to 0x88000000
     Booting using the fdt blob at 0x88000000
  Working FDT set to 88000000
     Loading Kernel Image to 86008000
  WARNING:
  The 'fdt_high' environment variable is set to ~0. This is known to cause
  boot failures due to placement of DT at non-8-byte-aligned addresses.
  This system will likely fail to boot. Unset the 'fdt_high' environment
  variable and submit a fix upstream.
     Using Device Tree in place at 88000000, end 8801af2f
  Working FDT set to 88000000
  Starting kernel ...
  [    0.000000] Booting Linux on physical CPU 0x0

and the board boots (though with that ominous warning). However,
modifying the .its file a little, e.g. just removing the word "blob"
from the description, we end up with

     Loading fdt from 0x8a8c6e14 to 0x88000000
     Booting using the fdt blob at 0x9df94718
  Working FDT set to 9df94718
     Loading Kernel Image to 86008000
  WARNING:
  The 'fdt_high' environment variable is set to ~0. This is known to cause
  boot failures due to placement of DT at non-8-byte-aligned addresses.
  This system will likely fail to boot. Unset the 'fdt_high' environment
  variable and submit a fix upstream.
  Failed to reserve memory for fdt at 0x9df94718
  FDT creation failed!
  resetting ...

Notice how the "Loading fdt from" line still claims to load the fdt to
that 0x88000000 address, but since this "else if" clause looks at the
source address (buf) and comes before the "else if (load != data)"
clause, we end up doing the "allocate another buffer to use as target"
instead of actually copying to 0x88000000, but then the "fdt_high=~0"
logic in boot_relocate_fdt() obviously fails to do an lmb-reservation
of that area, and the boot fails.

When there's no load= property in the fdt node, this should not change
anything. But when there is, it is the alignment of that target which
is relevant, not the alignment of the fdt blob within the FIT
image. With this patch applied, we instead get the expected

     Loading fdt from 0x8a8c6e14 to 0x88000000
     Booting using the fdt blob at 0x88000000
  Working FDT set to 88000000
     Loading Kernel Image to 86008000
  WARNING:
  The 'fdt_high' environment variable is set to ~0. This is known to cause
  boot failures due to placement of DT at non-8-byte-aligned addresses.
  This system will likely fail to boot. Unset the 'fdt_high' environment
  variable and submit a fix upstream.
     Using Device Tree in place at 88000000, end 8801af2f
  Working FDT set to 88000000

  Starting kernel ...

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Fixes: 8fbcc0e0e839 ("boot: Assure FDT is always at 8-byte aligned address")
Reviewed-by: Simon Glass <sjg@chromium.org>
3 weeks agolib: fdtdec: validate bloblist FDT before consuming libfdt size
Raymond Mao [Wed, 6 May 2026 14:55:33 +0000 (10:55 -0400)] 
lib: fdtdec: validate bloblist FDT before consuming libfdt size

Coverity Scan defects are observed in fdtdec_apply_bloblist_dtos(),
since the live FDT taken from the bloblist is passed to libfdt helpers
which consume header size/offset fields:
- fdt_open_into()
- fdt_pack()

Validate the bloblist FDT with fdt_check_full() before calling
fdt_open_into() and again after applying overlays before calling
fdt_pack(). This makes the libfdt consumers operate on a checked FDT
blob while keeping the existing flow unchanged.

Also normalize libfdt return codes from this path to errno values,
including the overlay callback path through bloblist_apply_blobs().

Fixes: b70cbbfbf94f ("fdtdec: apply DT overlays from bloblist")
Addresses-Coverity-ID: CID 645837: (TAINTED_SCALAR)
Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
3 weeks agoMakefile: remove block from conv=block, sync in SPL alignment dd
Brad Klingerman [Fri, 1 May 2026 14:38:50 +0000 (09:38 -0500)] 
Makefile: remove block from conv=block, sync in SPL alignment dd

The line that produces $(SPL_BIN)-align.bin invokes dd with
conv=block,sync but no cbs= operand. The result of dd conv=block
without cbs= is unspecified. GNU coreutils outputs anyway, but
uutils (default in Ubuntu 26.04 LTS) errors out for files with
newlines, including SPL binaries, producing:

    dd: conv=block or conv=ubnblock specified without cbs=N

Either the block operand must be removed, or cbs=N must be added.
conv=block is for converting newline-terminated variable-length
records to fixed-length space-padded ones, which is meaningless
for a binary SPL image. The intent of the rule is 4-byte
alignment, which conv=sync alone provides by padding the final
block to bs= bytes with NULs.

During build, u-boot-spl-align.bin errors silently due to '@'.

Reproduced with uutils dd 0.8.0:

    $ dd if=/dev/urandom of=/tmp/in bs=1 count=10000
    $ dd if=/tmp/in of=/tmp/out conv=block,sync bs=4
    dd: conv=block or conv=unblock specified without cbs=N
    $ dd if=/tmp/in of=/tmp/out conv=sync bs=4
    [succeeds]

Output is byte-identical to GNU dd's output for binary input.

Signed-off-by: Brad Klingerman <bdklingerman@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 weeks agoMerge tag 'mmc-for-2026.07-rc2' of https://source.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Thu, 7 May 2026 02:13:39 +0000 (20:13 -0600)] 
Merge tag 'mmc-for-2026.07-rc2' of https://source.denx.de/u-boot/custodians/u-boot-mmc

- Enable FPWM bits for tps65941
- Use max-frequency to get clock rate for msm_sdhci
- Fix and update for pfuze100

4 weeks agoMerge tag 'mips-fixes-for-v2026.07' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 6 May 2026 14:55:26 +0000 (08:55 -0600)] 
Merge tag 'mips-fixes-for-v2026.07' of https://source.denx.de/u-boot/custodians/u-boot-mips

- mips: mtmips: align MT7621 image blobs to 8-byte boundary

4 weeks agoMerge tag 'efi-2026-07-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Wed, 6 May 2026 14:45:57 +0000 (08:45 -0600)] 
Merge tag 'efi-2026-07-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2026-07-rc2-2

CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/29993

UEFI:

* initialize variables in efi_dp_from_http()
* cmd: eficonfig: adjust struct eficonfig_entry, field key
* efi_dt_fixup: use fdtdec_get_bool() for reading boolean no-map property
* efi_selftest_memory: check for duplicates first
* simplify efi_mem_sort() using list_for_each_entry_safe

Others:

* lmb: document allocation flags constants

4 weeks agoMerge tag 'net-20260506' of https://source.denx.de/u-boot/custodians/u-boot-net
Tom Rini [Wed, 6 May 2026 14:44:55 +0000 (08:44 -0600)] 
Merge tag 'net-20260506' of https://source.denx.de/u-boot/custodians/u-boot-net

Pull request net-20260506.

net:
- phy: dp83867: default to 2ns delay if unspecified in device-tree
- nfs: fix buffer overflow in nfs_readlink_reply()
- cpsw: Add cpsw-switch DT binding support
- phy: add common PHY polarity properties support
- phy: adin: add support for the ADIN1200 phy
- macb: support for instances with less features
- phy: mscc: add support for the VSC8572

net-lwip:
- wget: correct diagnostic output

4 weeks agoMerge tag 'fsl-qoriq-for-2026.07-rc2' of https://source.denx.de/u-boot/custodians...
Tom Rini [Wed, 6 May 2026 14:43:32 +0000 (08:43 -0600)] 
Merge tag 'fsl-qoriq-for-2026.07-rc2' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq

- Add USB Hub (USB5744) management support for ten64
- Various DT fixes for ls1088a
- Fix dead default for SYS_L3_SIZE for powerpc

4 weeks agomips: mtmips: align MT7621 image blobs to 8-byte boundary
Shiji Yang [Sun, 12 Apr 2026 12:12:25 +0000 (20:12 +0800)] 
mips: mtmips: align MT7621 image blobs to 8-byte boundary

MT7621 doesn't boot on u-boot v2026.04. Fix it by correcting the
u-boot aligned offset.

Fixes: d9e183a04c92 ("MIPS: Assure end of U-Boot is at 8-byte aligned offset")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
4 weeks agonet: phy: mscc: add support for the VSC8572
Charles Perry [Tue, 5 May 2026 13:57:49 +0000 (06:57 -0700)] 
net: phy: mscc: add support for the VSC8572

This is similar to the VSC8574 according to the Linux commit that adds
support for it [1].

This was tested on an HX1000 board with SGMII (PIC64-HX SoC which has a
GEM MAC).

[1]: https://lore.kernel.org/all/dfabe39a52efcd2cfff9358f271b8673143503b8.1480497966.git.neill.whillans@codethink.co.uk/

Signed-off-by: Charles Perry <charles.perry@microchip.com>
Reviewed-by: Manikandan Muralidharan <manikandan.m@microchip.com>
4 weeks agonet: macb: add gigabit implementation for fixed-link
Christian DREHER [Tue, 28 Apr 2026 18:04:08 +0000 (20:04 +0200)] 
net: macb: add gigabit implementation for fixed-link

A fixed gigabit link on a non-gigabit controller is only rejected
during PHY init (even though there is no PHY to init), because, on
device-tree parsing, the controller is not probed, and it is still
unknown whether it is gigabit-capable.

This code was only tested on emulator with a full-duplex RGMII
interface, but is expected to work in GMII or half-duplex as well.

Signed-off-by: Christian DREHER <christian.dreher@nanoxplore.com>
4 weeks agonet: macb: do not set user_io when it does not exist
Christian DREHER [Tue, 28 Apr 2026 18:04:07 +0000 (20:04 +0200)] 
net: macb: do not set user_io when it does not exist

Cadence Ethernet MAC has a feature named user_io, which provides
some input and some output signals for arbitrary purpose in the SoC.
From the driver code, I understand that, on Atmel SoC, it is used to
drive the PHY mode.

At least on Cadence IP7014 r1p12, this feature is optional, and I am
working on a SoC that does not instantiate it. The presence of this
feature is advertised in DCFG1, this patch merely disables the access
to the user_io register based on this information.

I did not apply this change to the non-gigabit capable versions of
the IP, as I do not have documentation for them, and a new non-gigabit
instance is unlikely to appear. I prefer avoiding regressions on old
systems.

Signed-off-by: Christian DREHER <christian.dreher@nanoxplore.com>
4 weeks agonet: macb: use SA1 for MAC filtering on GEM
Christian DREHER [Tue, 28 Apr 2026 18:04:06 +0000 (20:04 +0200)] 
net: macb: use SA1 for MAC filtering on GEM

The MACB uses specific address registers (SA Top and Bottom) to
filter source or destination MAC addresses.
On the Gigabit Ethernet version, SA1B is @0x88.
On the non-GEM version, SA1B is @0x98.

Before this commit, the code was always writing 0x98. By chance,
on GEM, this is the address of SA3B, allowing the driver to work
anyway.

The motivation for this change is to be able to use the driver on
an instance of the GEM with less than 4 SA registers.

Signed-off-by: Christian DREHER <christian.dreher@nanoxplore.com>
4 weeks agonet: macb: include arch/clk.h only when necessary
Christian DREHER [Tue, 28 Apr 2026 18:04:05 +0000 (20:04 +0200)] 
net: macb: include arch/clk.h only when necessary

It does not exist in my setup (an on-going arm64 SoC), and removing
it does not cause any missing declaration, but some code called when
CONFIG_CLK is missing calls get_macb_pclk_rate, which is only defined
in arch/arm/mach-at91/include/mach/clk.h

Signed-off-by: Christian DREHER <christian.dreher@nanoxplore.com>
4 weeks agonet: phy: adin: add support for the ADIN1200 phy
Rasmus Villemoes [Tue, 28 Apr 2026 11:15:32 +0000 (13:15 +0200)] 
net: phy: adin: add support for the ADIN1200 phy

The ADIN1200 chip is register compatible with the ADIN1300, but only
supports 10/100 Mbit.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
4 weeks agotest: dm: add PHY common props unit tests and sandbox DT nodes
Lucien.Jheng [Sat, 25 Apr 2026 08:06:49 +0000 (16:06 +0800)] 
test: dm: add PHY common props unit tests and sandbox DT nodes

Add sandbox DM unit tests for the PHY common properties library and the
corresponding device tree test nodes to arch/sandbox/dts/test.dts.
Also enable CONFIG_PHY_COMMON_PROPS in configs/sandbox_defconfig so
the tests are built and run in the sandbox environment.

The test file covers rx/tx polarity lookups for all relevant cases:

  - missing property (defaults to PHY_POL_NORMAL)
  - single value without names array (applies to all modes)
  - count mismatch between values and names arrays (-EINVAL)
  - name found by exact match
  - name not found with no "default" fallback (-EINVAL)
  - name not found with a "default" entry (uses fallback value)
  - unsupported polarity value (-EOPNOTSUPP)

Ported from Linux KUnit test:
  linux/drivers/phy/phy-common-props-test.c

Signed-off-by: Lucien.Jheng <lucienzx159@gmail.com>
4 weeks agonet: phy: airoha: air_en8811: use standard rx-polarity/tx-polarity properties
Lucien.Jheng [Sat, 25 Apr 2026 08:06:48 +0000 (16:06 +0800)] 
net: phy: airoha: air_en8811: use standard rx-polarity/tx-polarity properties

Replace the proprietary airoha,pnswap-rx / airoha,pnswap-tx boolean
device tree properties with the standard rx-polarity and tx-polarity
properties defined in phy-common-props.yaml.

Backward compatibility is maintained by reading the legacy boolean
properties first and passing them as the default_pol argument to
phy_get_rx/tx_polarity(). If the standard properties are absent the
legacy values are used transparently, so existing device trees remain
functional without modification.

Link: https://git.kernel.org/linus/66d8a334b57e64e43810623b3d88f0ce9745270b
Signed-off-by: Lucien.Jheng <lucienzx159@gmail.com>
4 weeks agophy: add common PHY properties support
Lucien.Jheng [Sat, 25 Apr 2026 08:06:47 +0000 (16:06 +0800)] 
phy: add common PHY properties support

Add a new PHY_COMMON_PROPS library that provides helper functions for
PHY drivers to read standardized polarity properties from the device
tree node:

  - phy_get_rx_polarity() / phy_get_tx_polarity()
  - phy_get_manual_rx_polarity() / phy_get_manual_tx_polarity()

The dt-bindings/phy/phy.h header with PHY_POL_NORMAL, PHY_POL_INVERT,
and PHY_POL_AUTO constants is provided via dts/upstream/include, which
is already in the build include path.

Ported from Merge tag 'phy-for-7.0':
  git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy

Link: https://git.kernel.org/linus/e7556b59ba65179612bce3fa56bb53d1b4fb20db
Signed-off-by: Lucien.Jheng <lucienzx159@gmail.com>
4 weeks agonet: cpsw: Support new cpsw-switch DT bindings
Markus Schneider-Pargmann (TI) [Fri, 10 Apr 2026 11:04:06 +0000 (13:04 +0200)] 
net: cpsw: Support new cpsw-switch DT bindings

Upstream devicetrees use a newer DT binding using cpsw-switch
compatibles. The bindings are a bit different, so two functions are
introduced to capture the differences, cpsw_eth_of_to_plat_switch() and
cpsw_eth_of_to_plat_legacy().

Signed-off-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com>
4 weeks agonet: cpsw: Use driver data for phy_sel
Markus Schneider-Pargmann (TI) [Fri, 10 Apr 2026 11:04:05 +0000 (13:04 +0200)] 
net: cpsw: Use driver data for phy_sel

Use driver data to pass the correct gmii_sel function. This way new
compatibles don't need manual compatible matching as is done in
cpsw_phy_sel().

Signed-off-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com>
4 weeks agonet: cpsw: Remove compat string argument
Markus Schneider-Pargmann (TI) [Fri, 10 Apr 2026 11:04:04 +0000 (13:04 +0200)] 
net: cpsw: Remove compat string argument

The string is already in the priv struct, remove it from the argument
list.

Signed-off-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com>
4 weeks agonet: cpsw: Fix error message
Markus Schneider-Pargmann (TI) [Fri, 10 Apr 2026 11:04:03 +0000 (13:04 +0200)] 
net: cpsw: Fix error message

It should complain about mac_control here.

Signed-off-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com>
4 weeks agonet: lwip/wget: don't print progress bar when silent
Heinrich Schuchardt [Tue, 28 Apr 2026 18:14:34 +0000 (20:14 +0200)] 
net: lwip/wget: don't print progress bar when silent

When the EFI sub-system request to silence output, do not output a progress
bar.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
4 weeks agonet: lwip/wget: don't print content size twice
Heinrich Schuchardt [Tue, 28 Apr 2026 18:14:33 +0000 (20:14 +0200)] 
net: lwip/wget: don't print content size twice

If wget_info->silent is set, we should not print anything.

If wget_info->silent we print the received content size.
Printing the value of the Content-Length header is redundant

For chunked transfer no Content-Length header is sent.
The content length is returned as HTTPC_CONTENT_LEN_INVALID by the LwIP
library. In this case we were incorrectly printing '4 GiB'.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
4 weeks agonet: lwip/wget: missing linefeed in diagnostic output
Heinrich Schuchardt [Tue, 28 Apr 2026 18:14:32 +0000 (20:14 +0200)] 
net: lwip/wget: missing linefeed in diagnostic output

With NET_LWIP wget produces this output with an overlong line
and missing white space:

    => wget $kernel_addr_r http://example.com/
    #################################################  4 GiB540 bytes transferred in 2 ms (263.7 KiB/s)
    Bytes transferred = 540 (21c hex)

Removing the condition on inserting a line feed yields:

    => wget $kernel_addr_r http://example.com/
    #################################################  4 GiB
    540 bytes transferred in 2 ms (263.7 KiB/s)
    Bytes transferred = 540 (21c hex)

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
4 weeks agonet: nfs: fix buffer overflow in nfs_readlink_reply()
Sebastian Josue Alba Vives [Thu, 9 Apr 2026 16:44:40 +0000 (10:44 -0600)] 
net: nfs: fix buffer overflow in nfs_readlink_reply()

nfs_readlink_reply() validates rlen only against the incoming packet
length (inherited from CVE-2019-14195), but not against the destination
buffer nfs_path_buff[2048]. A malicious NFS server can send a valid
READLINK reply where pathlen + rlen exceeds sizeof(nfs_path_buff),
overflowing the BSS buffer into adjacent memory.

The recent fix in fd6e3d34097f addressed the same overflow class in
net/lwip/nfs.c but left the legacy path in net/nfs-common.c unpatched.

Add bounds checks before both memcpy calls in nfs_readlink_reply():
- relative path branch: reject if pathlen + rlen >= sizeof(nfs_path_buff)
- absolute path branch: reject if rlen >= sizeof(nfs_path_buff)

Fixes: cf3a4f1e86 ("net: nfs: Fix CVE-2019-14195")
Cc: stable@vger.kernel.org
Signed-off-by: Sebastian Alba Vives <sebasjosue84@gmail.com>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
4 weeks agonet: phy: dp83867: default to 2ns delay if unspecified in device-tree
Siddharth Vadapalli [Mon, 6 Apr 2026 12:45:57 +0000 (18:15 +0530)] 
net: phy: dp83867: default to 2ns delay if unspecified in device-tree

Since Linux commit c360eb0c3ccb ("dt-bindings: net: ethernet-controller:
Add informative text about RGMII delays"), the interpretation of RGMII
delays has changed. Prior to the commit, the RGMII Variant among "rgmii",
"rgmii-id", "rgmii-rxid" and "rgmii-txid" clearly specified whether it is
the MAC or the PHY that "should" add the delay. However, post that commit,
the RGMII Variant only specifies whether or not there is a delay on the
PCB traces between the MAC and the PHY, leaving it open as to who adds the
delay.

Hence, instead of enforcing the existence of the device-tree properties
"ti,rx-internal-delay" and "ti,tx-internal-delay", default to a delay
of 2ns, while continuing to override this delay with the aforementioned
properties, if they exist in the device-tree.

This is in line with the Linux driver implementation updated by commit
6bf78849371d ("net: phy: dp83867: use 2ns delay if not specified in DTB").

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Anshul Dalal <anshuld@ti.com>
4 weeks agoconfigs: ten64: add USB start to preboot
Mathew McBride [Fri, 1 May 2026 01:36:09 +0000 (11:36 +1000)] 
configs: ten64: add USB start to preboot

There are two reasons why the USB stack needs to be
started before handing to bootflow or other boot
sequences:

1. When a USB hub is present on the board, we need to
do the required sequences to make it usable

2. To make USB storage devices 'visible' to bootflow
without further intervention

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoarm: dts: remove local copy of Ten64 board DTS
Mathew McBride [Fri, 1 May 2026 01:36:08 +0000 (11:36 +1000)] 
arm: dts: remove local copy of Ten64 board DTS

This board has been migrated to the upstream / kernel
device tree version (OF_UPSTREAM), so remove the
old 'local' copies that are no longer required.

However, the -u-boot.dtsi append needs to remain,
because the SoC fsl-ls1088a-u-boot.dtsi is required
for some devices (like PCIe controllers and DPAA2 ethernet)
to properly enumerate under U-Boot.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoconfigs: ten64: switch to OF_UPSTREAM
Mathew McBride [Fri, 1 May 2026 01:36:07 +0000 (11:36 +1000)] 
configs: ten64: switch to OF_UPSTREAM

Two recent additions to the mainline device tree allow us
to switch away from the local U-Boot copy:

* Board/embedded controller (traverse,ten64-controller)
  is now in the mainline device tree.
* USB Hub (USB5744) connections were also added to
  the mainline device tree but not in U-Boot.

The LS1088A and Ten64 device trees in U-Boot were actually
'synced' to mainline some time ago, so the content
(except for the changes mentioned above) is identical.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoconfigs: ten64: enable USB_ONBOARD_HUB (USB5744) option
Mathew McBride [Fri, 1 May 2026 01:36:06 +0000 (11:36 +1000)] 
configs: ten64: enable USB_ONBOARD_HUB (USB5744) option

Ten64 board revs A through C have a Microchip USB5744
hub on the board, which must be configured over I2C
at boot time to become usable.

This function has not been part of the mainline
U-Boot for this board until now, as a mainline driver
and device-tree binding is now available for the USB5744.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoconfigs: ten64: enable OF_BOARD_FIXUP
Mathew McBride [Fri, 1 May 2026 01:36:05 +0000 (11:36 +1000)] 
configs: ten64: enable OF_BOARD_FIXUP

We have added board_fix_fdt to remove elements from U-Boot's
internal FDT related to the USB hub, so CONFIG_OF_BOARD_FIXUP
needs to be enabled to utilize it.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoboard: ten64: remove USB hub references from internal FDT when needed
Mathew McBride [Fri, 1 May 2026 01:36:04 +0000 (11:36 +1000)] 
board: ten64: remove USB hub references from internal FDT when needed

More recent revisions of the Ten64 board do not have a USB Hub
(USB5744). The references to the USB5744 need to be removed in U-Boot's
internal FDT to avoid the USB5744 setup being invoked on these boards.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoboard: ten64: add fdt fixup to hide usb hub topology
Mathew McBride [Fri, 1 May 2026 01:36:03 +0000 (11:36 +1000)] 
board: ten64: add fdt fixup to hide usb hub topology

The USB Hub (microchip,usb5744) can enter a dis-/reconnect loop
if a driver tries to re-initialise the hub over I2C.

On the Ten64 board, this process only needs to be run once
per system reset cycle, which is carried out by U-Boot.

As there are distributions shipping with the affected
driver by default, the best solution is to remove
the USB hub topology information from the FDT passed
to the operating system, so the OS won't attempt
to re-initialise the USB hub under any circumstance.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoarm: gpio: include integer type definitions for gpio.h
Mathew McBride [Fri, 1 May 2026 01:36:02 +0000 (11:36 +1000)] 
arm: gpio: include integer type definitions for gpio.h

Both consumers and sub-arch specific versions of gpio.h
may reference stdint or other non-C90 type definitions.

Ensure the common ones are available by including linux/types.h
before any other headers.

This issue came to light when the usb onboard hub driver
was enabled for ten64_tfa_defconfig:

In file included from ./arch/arm/include/asm/gpio.h:2,
 from common/usb_onboard_hub.c:10:
./arch/arm/include/asm/arch/gpio.h:17:9: error: unknown type name 'ulong'
   17 |         ulong addr;
./arch/arm/include/asm/arch/gpio.h:18:9: error: unknown type name 'ulong'
   18 |         ulong size;
./arch/arm/include/asm/arch/gpio.h:19:9: error: unknown type name 'uint'
   19 |         uint ngpios;

(In this instance, the cited errors actually originate from
arch/arm/include/asm/arch-fsl-layerscape/gpio.h, which is included
by the arm top level asm/gpio.h)

Implemented as per suggestion from Quentin Schulz in Link:

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Link: https://lore.kernel.org/u-boot/35038a9a-fa5a-4f9f-b34e-17cc80a7824c@cherry.de/
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoarm: dts: layerscape: Fix SPI flash compatible string issue
Ye Li [Fri, 17 Apr 2026 14:16:37 +0000 (22:16 +0800)] 
arm: dts: layerscape: Fix SPI flash compatible string issue

When CONFIG_DM_SPI_FLASH is enabled, sf command will default find
device from DT which requires to use "jedec,spi-nor" compatible
string not obsoleted "spi-flash". So update NXP LS DTS to use
new compatible string

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoarm: dts: layerscape: Fix DT build warning in SPI nodes
Ye Li [Fri, 17 Apr 2026 14:16:36 +0000 (22:16 +0800)] 
arm: dts: layerscape: Fix DT build warning in SPI nodes

There are lots of DT warning in layerscape DTS files like:
node name for SPI buses should be 'spi' and SPI bus unit address
format error.
Update the spi node name and flash node name to avoid build warning

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoarm: dts: fsl-ls1088a: Enable USB nodes
Ye Li [Fri, 17 Apr 2026 14:15:29 +0000 (22:15 +0800)] 
arm: dts: fsl-ls1088a: Enable USB nodes

Enable USB nodes in -u-boot.dtsi. After sync dts with kernel, USB
nodes status are set to disabled. So "usb start" does not work on
ls1088ardb and ls1088aqds.

Fixes: 10ff7e6b043b ("arm: dts: fsl-ls1088a: sync usb controller nodes with Linux")
Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Wei Lu <w.lu@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoarm: dts: fsl-ls1088a: Enable SD device
Ye Li [Fri, 17 Apr 2026 14:15:28 +0000 (22:15 +0800)] 
arm: dts: fsl-ls1088a: Enable SD device

Due to update of fsl-ls1088a.dtsi in previous patch, the esdhc
node is disabled, so u-boot can't to probe any eSDHC controller.

Fixes: fd4f7b0158d0 ("arm: dts: fsl-ls1088a: move and sync existing bindings to be under /soc")
Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Wei Lu <w.lu@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoarm: dts: fsl-ls1088a: Set dpmac nodes default to disabled
Ye Li [Fri, 17 Apr 2026 14:14:37 +0000 (22:14 +0800)] 
arm: dts: fsl-ls1088a: Set dpmac nodes default to disabled

Disable ethernet controller dpmac nodes in fsl-ls1088a.dtsi. Board
dts is responsible to enable them. Otherwise will meet failure from
ldpaa_eth driver on LS1088AQDS board, because only few dpmac
controllers can be enabled on this board.

Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Wei Lu <w.lu@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 weeks agoarm: dts: fsl-ls1088a-qds: Fix missed -u-boot.dtsi
Ye Li [Fri, 17 Apr 2026 14:14:36 +0000 (22:14 +0800)] 
arm: dts: fsl-ls1088a-qds: Fix missed -u-boot.dtsi

LS1088AQDS u-boot contains multiple DTB files:
fsl-ls1088a-qds-21-x.dtb and fsl-ls1088a-qds-29-x.dtb.
It does not use default device tree fsl-ls1088a-qds.dtb

However, the nodes updated in fsl-ls1088a-qds-u-boot.dtsi are not
included for fsl-ls1088a-qds-21-x.dts and fsl-ls1088a-qds-29-x.dts,
so fail to get any output from serial.

Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Wei Lu <w.lu@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>