Commit Graph
106456 Commits
Author SHA1 Message Date
Marek VasutandHeinrich Schuchardt bbc19c6bcf doc: board: renesas: Document SH/Aarch32/Aarch64 toolchain setup
Add documents which briefly outline how to set up the SH4/Aarch32/Aarch64
toolchains, for future use in Renesas documentation. Reference all these
documents in the renesas list of boards "Arch" column.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2026-07-16 00:40:42 +02:00
Vincent StehléandHeinrich Schuchardt 4df21944bd efi_loader: fix missing EFI_EXIT in efi_disconnect_controller
We are missing a call to EFI_EXIT() when returning from
efi_disconnect_controller(), which we need after having called EFI_ENTRY().

Fix this by jumping to the common error path, which does call EFI_EXIT().

Even though the common error path may try to free child_handle_buffer, this
cannot harm in our case as it always NULL.

This is inspired by a barebox fix. [1]

Link: https://git.pengutronix.de/cgit/barebox/commit/?id=080db65e39a877b000baaf843c997a69821dfe69 [1]
Fixes: 314bed6c85 ("efi_loader: fix DisconnectController() for sole child")
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: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2026-07-16 00:40:42 +02:00
Karl ChanandHeinrich Schuchardt b96d3bbb6d doc: boards: amlogic: update documentation for Beelink GT1 Ultimate
fix formatting

Signed-off-by: Karl Chan <exxxxkc@getgoogleoff.me>

The patch replaces Unicode NO-BREAK-SPACE U+00A2 by SPACE U+0020.

Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2026-07-16 00:40:42 +02:00
Heinrich Schuchardt da91be14c1 qfw: fix RSDP ext_checksum recomputation
table_compute_checksum() returns the value that makes the byte sum of
the buffer zero. If the ext_checksum field already contains a non-zero
value (as QEMU's firmware-provided RSDP does), adding that existing
value into the sum produces an incorrect complement. Zero the field
before calling table_compute_checksum() so the calculation starts from
a clean state, matching the pattern used in acpi_write_rsdp().

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2026-07-16 00:40:42 +02:00
Tom Rini 8dbe57ba64 Merge patch series "tools: qconfig: print a proper error when database is missing"
Julien Stephan <jstephan@baylibre.com> says:

When I first ran ./tools/qconfig.py, it immediately crashed with a
Python traceback because the configuration database had not yet been
generated.

This series adds a simple pre-check that detects this condition and
prints a clear error message instructing the user to generate the
database first using the -b option, instead of failing with an unhandled
exception.

While looking at the script, I also noticed that the help text still
references the obsolete moveconfig.rst document. This series updates
that reference as well.

Link: https://lore.kernel.org/r/20260702-qconfig-check-for-db-v1-0-f0b96bf8fa44@baylibre.com
2026-07-14 15:42:08 -06:00
Julien StephanandTom Rini ab106a8564 qconfig: Rename the doc link in help text
This was missed during the renaming of the tool. Fix it.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Fixes: ea4d6dead3 ("moveconfig: Rename the tool to qconfig")
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-07-14 15:41:23 -06:00
Julien StephanandTom Rini e24624017f tools: qconfig: print a proper error when database is missing
When CONFIG_DATABASE does not exist, read_database() would fail with a
Python traceback. Add a pre-check to print a clear message asking the
user to generate the database first with the -b option.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-07-14 15:41:23 -06:00
Tom Rini 21ee6442ed Merge patch series "pinctrl: aspeed: Add AST2700 pinctrl drivers"
Billy Tsai <billy_tsai@aspeedtech.com> says:

The AST2700 is Aspeed's 7th-generation BMC SoC with a dual-die
architecture: SoC0 (CPU die) and SoC1 (I/O die) each have their own SCU
with independent multi-function pin controls. Initial AST2700 platform
support is already merged in next, including the ast2700.dtsi pinctrl0
and pinctrl1 nodes, but no pinctrl driver backs them yet.

This series adds one pinctrl driver per die, each followed by a patch
adding its pin configuration support. Both drivers use the generic
pinctrl framework and are compatible with the Linux kernel device tree
bindings, using the same group and function names as the Linux
aspeed,ast2700-soc0/soc1-pinctrl drivers so pin states can be shared
between the kernel and U-Boot device trees.

Patch 1 adds the SoC0 driver, which models each (function, group) pair
as a flat register mask/value table covering eMMC, VB, VGA DDC, JTAG
master port select, PCIe RC PERST and USB2/USB3 port routing. Patch 2
adds SoC0 pin configuration support: every GPIO18A/GPIO18B ball has
its own IO control register providing a 3 mA to 41 mA drive strength
selector and bias control.

Patch 3 adds the SoC1 driver, porting the per-pin 4-bit multi-function
selector scheme (220 pins, 238 groups, 217 functions) together with
the virtual pins for PCIe RC2 PERST, the USB2 port C/D mode and SGMII
controls. Patch 4 adds SoC1 pin configuration support: a per-pin bias
enable bit and sparse 2-bit drive strength fields (4 mA to 16 mA in
4 mA steps) mirroring the Linux driver layout.

The bias-disable, bias-pull-down, bias-pull-up and drive-strength
properties can be applied per pin or per group. Both drivers implement
gpio_request_enable so the GPIO driver can reclaim pins through the
gpio-ranges already present in ast2700.dtsi, and provide
get_pin_muxing so "pinmux status" reports the active signal of every
pin.

Link: https://lore.kernel.org/r/20260702-pinctrl-v1-0-4d2bd89fc213@aspeedtech.com
2026-07-14 15:41:13 -06:00
Billy TsaiandTom Rini 02d74afe94 pinctrl: aspeed: Add AST2700 SoC1 pinconf support
The SoC1 SCU provides a bias enable bit per pin in the registers at
0x480 (setting the bit disables the bias; the pull direction is fixed
in silicon) and 2-bit drive strength fields at 0x4C0 selecting 4 mA to
16 mA in 4 mA steps. The pin-to-field mapping of the drive strength
registers is sparse and non-linear, so it is kept in a lookup table
mirroring the Linux driver; pins without an entry reject
drive-strength with -ENOTSUPP.

Support the bias-disable, bias-pull-down, bias-pull-up and
drive-strength properties per pin and per group, and select PINCONF so
the generic pinctrl framework parses them.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
2026-07-14 15:40:20 -06:00
Billy TsaiandTom Rini c0e2aeb9df pinctrl: aspeed: Add AST2700 SoC1 pinctrl driver
Add the pinctrl driver for the AST2700 SoC1 (I/O) die.

Unlike previous Aspeed generations, the SoC1 SCU assigns every pin a
4-bit multi-function selector field in a contiguous register range
starting at SCU 0x400, eight pins per register. Only bits [2:0] of
each field select the function; bit 3 is reserved read-only and must
not be written. The driver therefore keeps per-pin group tables and
per-function mux values, mirroring the Linux
aspeed,ast2700-soc1-pinctrl driver, and shares the same device tree
bindings: 220 pins, 238 groups and 217 functions with identical names,
so pin states written for the Linux driver work unmodified.

A few controls live outside the pin-indexed range and are handled as
virtual pins: PCIERC2_PERST (SCU 0x908), the USB2 port C/D mode fields
(SCU 0x3B0) and SGMII0 (SCU 0x47C).

The gpio_request_enable hook restores a pin to GPIO by writing mux
value 0, except for the ADC-capable balls W17..AB19 where function 1
selects GPIO and 0 selects the ADC input.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
2026-07-14 15:40:20 -06:00
Billy TsaiandTom Rini ada5d0e7e2 pinctrl: aspeed: Add AST2700 SoC0 pinconf support
Each GPIO18A/GPIO18B ball has its own IO control register starting at
SCU 0x480, providing a 4-bit drive strength selector (3 mA to 41 mA in
hardware-defined steps), a bias enable bit and a pull direction bit.

Extend the group table with the pin members of the ball-backed groups
so bias-disable, bias-pull-down, bias-pull-up and drive-strength
properties can be applied per group as well as per pin. The routing
groups (USB, JTAG, PCIe RC) have no package balls and reject pin
configuration with -ENOTSUPP.

Select PINCONF so the generic pinctrl framework parses the pin
configuration properties.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
2026-07-14 15:40:20 -06:00
Billy TsaiandTom Rini 1b87385aac pinctrl: aspeed: Add AST2700 SoC0 pinctrl driver
The AST2700 is a dual-die BMC SoC: SoC0 (CPU die) and SoC1 (I/O die)
each have their own SCU with independent multi-function pin controls.

Add the pinctrl driver for the SoC0 die. The driver uses the generic
pinctrl framework and is compatible with the Linux kernel device tree
bindings, i.e. pin states are described with the same "function" and
"groups" properties and the same names as the Linux
aspeed,ast2700-soc0-pinctrl driver.

Unlike the older AST2500/AST2600 SCUs where each signal is enabled by
independent bits, the SoC0 mux selections mix single-bit enables
(eMMC, VGA DDC, VB strap), multi-bit selector fields (JTAG master port
select, USB2/USB3 port routing) and reset-control bits (PCIe RC
PERST). Model each (function, group) pair as one register
mask/value write so all of them fit a single flat table.

The gpio_request_enable hook releases the GPIO18A/GPIO18B pins to GPIO
mode by clearing every signal enable bit that claims the pin, matching
the Linux driver behaviour.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
2026-07-14 15:40:20 -06:00
Tom Rini 501d76ca80 Merge tag 'mmc-for-2026.10-rc1' of https://git.u-boot-project.org/u-boot/custodians/u-boot-mmc
CI: https://git.u-boot-project.org/u-boot/custodians/u-boot-mmc/-/pipelines/614

- Add PMBUS regulator, thermal and test
- Add regulator helper to set voltage within an acceptable range
- Update dw_mmc to use in-spec voltage range for vqmmc
- Fix regulator_enable/disable() macros
- Clear LPUART OR STAT in tstc to avoid hang
- Add MAINTAINERS entry for SDHCI
2026-07-14 07:59:50 -06:00
Casey ConnollyandTom Rini 83f6cbb871 get_maintainer.pl: tighten up git contributors cc list
get_maintainer in U-Boot is configured to include contributors and patch
reviewers from the git history in the CC list, going back 1 year if they
have contributed more than 5% of the patches.

This is well suited to some core U-Boot code that has a long history and
doesn't get much love from any dedicated maintainer but for newer code
and board code in general as well as defconfigs it can be frustrating
for some contributors who do not wish to be CC'd on patches as well as a
general issue when dead emails are included.

While it would be desirable to just remove the --git flag and encourage
those interested to configure lei or just add themselves to MAINTAINERS
it perhaps makes more sense to phase it out gradually.

As a first step, reduce the time period that will be checked in the git
history from 1 year to 6 months, this still offers plenty of leeway for
contributions to the last 1/2 U-Boot releases. In addition, bump up the
required percentage of contributions from 5% to 15% and reduce the limit
on the number of "git maintainers" (i.e. unique S-o-b/A-b/R-b tags) from
5 to 2.

These changes should reduce the size of CC lists while still including
recent active contributors.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-07-13 17:06:40 -06:00
Dario BinacchiandTom Rini 8d50a5ce72 test: cmd: part: fix integer handling in setup_gpt_partitions()
Coverity reports an INTEGER_OVERFLOW issue because ut_asserteq() compares
an unsigned int (mmc_dev_num) with ret, which can hold a negative error
code.

Addresses-Coverity-ID: CID 646439: Integer handling issues  (INTEGER_OVERFLOW)
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2026-07-13 17:06:37 -06:00
Shiva TripathiandTom Rini ab2266aff3 tools: binman: ti_board_cfg: Add configurable sw-rev support
The software revision field in the combined board config binary header
was hardcoded to 1, preventing independent control from SBL SWREV
configured via ti-secure-rom's sw-rev property.

Add support for the optional 'sw-rev' DTS property in ti_board_config
nodes, which sets the SWREV byte in the header. Defaults to 1 for
backward compatibility.

Signed-off-by: Shiva Tripathi <s-tripathi1@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-07-13 17:06:33 -06:00
James HilliardandTom Rini 58c2284a1a cmd: fdt: keep control FDT during checksign
The fdt checksign command accepts an optional address for an FDT
containing public keys. It currently installs that blob as gd->fdt_blob
before verifying the FIT configuration.

This breaks verification with DM-backed crypto drivers which have not
probed yet, since the later probe path expects gd->fdt_blob to remain
U-Boot's control FDT. For example, an ECDSA verifier can be bound from
the control FDT but fail to probe after fdt checksign points
gd->fdt_blob at the key-only DTB.

Add a FIT config verification helper that takes the key blob explicitly
and use it from fdt checksign. This keeps gd->fdt_blob unchanged while
still allowing the command to verify against an external key DTB.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2026-07-13 17:06:29 -06:00
Tom Rini 02f8b8ab6d Gitlab CI: Switch to git.u-boot-project.org
Now that we have everything available on git.u-boot-project.org, switch
URLs to that location.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2026-07-13 07:35:20 -06:00
Vincent JardinandPeng Fan 722a822787 test: dm: pmbus: test pmbus command and framework
Add dm unit tests that drive every pmbus subcommand handler against
the sandbox PMBus chip emulator:
  dev (select by bus:addr and by regulator-name), list, info,
  telemetry, status, dump, read, write, clear, vout, scan and help.

Tested using:

  ./u-boot -T -c "ut dm pmbus*"

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-13 11:24:45 +08:00
Vincent JardinandPeng Fan 995cc3383b test: dm: pmbus: add a sandbox PMBus chip emulator
Add a UCLASS_I2C_EMUL driver that emulates a PMBus 1.x compliant chip
behind the sandbox I2C bus, plus the test.dts wiring and sandbox
defconfig that bind it to the generic PMBus regulator
(compatible = "pmbus"). This design is a stub only: it lets the
follow-up dm unit test drive lib/pmbus.c, the generic regulator and
the pmbus CLI command with no real hardware.

The emulator models a flat per-command 16-bit register file and the
three identification block strings (MFR_ID / MFR_MODEL /
MFR_REVISION). READ_IIN and READ_POUT are deliberately left
unimplemented (the chip NAKs them) so the telemetry printer's
"(not supported)" path is exercised, mirroring a real buck that only
calibrates a subset of the sensor classes.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-13 11:24:40 +08:00
Vincent JardinandPeng Fan a5639a4d7b thermal: pmbus: add PMBus die-temp driver
The driver is a thin UCLASS_THERMAL: its get_temp reads the
temperature of its parent regulator through the pmbus helper
(READ_TEMPERATURE_1), without any chip-specific code.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-13 11:23:28 +08:00
Vincent JardinandPeng Fan 073bc87752 board: nxp: vid: introduce PMBus framework support
Wire board/nxp/common/vid.c into the <pmbus.h> framework so the legacy
NXP AVS path stops carrying its own duplicate copy of the PMBus
protocol and instead consumes the shared constants, decoders, and
transport helpers.

vid.c is the legacy NXP AVS/pre-kernel voltage-trim path for lx2160 CPUs.
It does PMBus to whichever core-rail voltage monitor the board carries:
LTC3882 or ISL68233 are selected with
CONFIG_VOL_MONITOR_LTC3882_*/CONFIG_VOL_MONITOR_ISL68233_*.

Before this change the file kept its own local PMBUS_CMD_* command-code
defines, its own inline LINEAR16 mantissa/exponent math, and called
into I2C through the I2C_READ/I2C_WRITE NXP wrappers in
board/nxp/common/i2c_common.{c,h} which is a parallel implementation of
exactly what <pmbus.h> + lib/pmbus.c provides.

The intent is to make vid.c an consumer of the new PMBus.

Compatibility with the former support:

  - CLI unchanged: vdd_override and vdd_read keep their existing
    semantics, return codes, and diagnostic output.

  - I2C transport unchanged on the wire: the framework's pmbus_*
    helpers call dm_i2c_read/dm_i2c_write: the same DM I2C
    backing that vid.c's former I2C_READ/I2C_WRITE macros already
    routed through on DM_I2C.

  - Numeric decode is bit-equivalent: pmbus_reg2data_linear16() and
    pmbus_data2reg_linear16() implement the PMBus 1.3 Part II
    mantissa/exponent.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-13 09:16:58 +08:00
Vincent JardinandPeng Fan a5491e9f0a power: regulator: add MPS MPQ8785 PMBus regulator driver
Per-chip UCLASS_REGULATOR driver for the MPS MPQ8785 / MPM3695 /
MPM3695-25 / MPM82504 family, layered on the shared pmbus_helper
adapter. Runs Linux's mpq8785_identify() VOUT_MODE switch
(LINEAR16 vs DIRECT m=64 R=1) at probe time, applies the optional
mps,vout-fb-divider-ratio-permille DT property, and walks the
documented MPS ADDR_VBOOT windows on MFR_ID failure so a
die-revision address shift just works.

Publishes the pmbus mps last|clear last|clear force vendor
extension subcommands (NVM PROTECTION_LAST read and clear) when
CMD_PMBUS is enabled.

Adapted from Linux code.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-13 09:16:57 +08:00
Vincent JardinandPeng Fan 350b7c83b6 power: regulator: add generic PMBus UCLASS_REGULATOR adapter
PMBus regulators differ in numeric formats and quirks, not in how they
are driven. Share that common behaviour as a regulator-uclass adapter
so chip drivers and the pmbus CLI do not each reimplement the decode
and transport, and add a catch-all driver on compatible = "pmbus" for
compliant chips that have no dedicated driver yet.

Gated by CONFIG_DM_REGULATOR_PMBUS_HELPER and
CONFIG_DM_REGULATOR_PMBUS_GENERIC.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-13 09:16:57 +08:00
Vincent JardinandPeng Fan cfb4272552 pmbus: add PMBus 1.x framework, CLI, and binding
Add U-Boot's PMBus 1.x layer: the decoder/transport library, the
pmbus CLI command and a generic DT binding.

The subsequent commits provide the UCLASS_REGULATOR adapter and per-chip
drivers.

U-Boot's PMBus support is not a hwmon clone of Linux's
drivers/hwmon/pmbus/. Linux owns the runtime side (polling, sysfs,
alert IRQs, fan loops). U-Boot owns the boot-time side in order to,

 - identify the PMBus regulators a board carries: MFR_ID/
   MFR_MODEL/MFR_REVISION + sanity checks.
 - print telemetry (VIN/VOUT/IIN/IOUT/POUT/TEMP) so an
   operator can confirm rail voltages and faults before the kernel
 - decode any chip alerts (STATUS_VOUT/STATUS_IOUT/STATUS_INPUT/
   STATUS_TEMPERATURE/STATUS_CML) so a boot log shows why the
   previous boot failed or the board had been power cycled because
   of an outage (typically over temperature or under current).

Out of scope by design: no periodic polling, no sysfs, no fan-speed
control loop, no PMBUS_VIRT_* sensor virtualisation, no caching.
If a use case needs any of those, the answer should be "wait until
Linux comes up". It shall remain a thin layer.

The constants and structural shape (command codes, status bit names,
sensor-class enum, format enum, struct pmbus_driver_info) are
mirrored from Linux drivers/hwmon/pmbus/pmbus.h verbatim. The
decoders/encoders are reimplemented from the PMBus 1.3
specification because the surrounding hwmon context (struct
pmbus_data, sysfs caching, hwmon publication) does not apply.

The main benefits:

  - One framework + CLI for any board carrying PMBus regulators:
    no per-board PMBus implementation required anymore.
  - Boards call pmbus_print_telemetry() / pmbus_print_status_word()
    directly from boot init for a snapshot, sharing all decode +
    format-dispatch with the CLI.
  - Linux-compatible constants and DT binding so porting an existing
    drivers/hwmon/pmbus/ chip is mechanical.
  - Boot-time AVS/VID rail trim reuses the same decoders and
    encoders as the CLI and the regulator path: no duplicate math.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-13 09:16:57 +08:00
Marek VasutandPeng Fan b17e6419ad serial: lpuart: Clear the OR STAT in tstc to prevent hang
Clear the STAT register OR bit every time in .tstc callback, otherwise
a condition may occur when data are fed into the RX FIFO, the FIFO did
overflow, the OR bit is set and prevents any new data from being added
into the RX FIFO, the OR bit is never cleared, and watermark read back
is always 0. If this condition occurs, the .tstc callback will always
report no new characters, and the OR bit will never be cleared, so the
U-Boot shell will be unresponsive until next reboot or kernel boot.

This is easy to trigger on MX95, power on the system and send traffic
on UART from host to the MX95, the MX95 FIFO will overflow and the
U-Boot console will become unresponsive.

Fix this by clearing the OR bit early, in .tstc callback. This way,
even if an overflow occurs, there will be slight loss of RX data, but
the U-Boot console will not become unresponsive.

Signed-off-by: Marek Vasut <marex@nabladev.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-12 16:18:32 +08:00
Jonas KarlmanandPeng Fan 0f04bbf9ab power: regulator: Fix regulator_enable/disable() macros
The commit 076265b75e ("compat: regulator: add enable/disable macros")
added regulator_enable/disable() macros to provide a closer analogue to
the Linux API.

These new macros wrap regulator_set_enable() that may return detailed
error codes and should typically not directly be called by drivers.

Change the macros to wrap regulator_set_enable_if_allowed() that masks
error codes consumers typically do not expect to closer match the
behavior of the Linux API.

Also move the macros outside the #if #else blocks to make the macros
available when !CONFIG_IS_ENABLED(DM_REGULATOR).

Fixes: 076265b75e ("compat: regulator: add enable/disable macros")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-12 16:18:32 +08:00
Jonas KarlmanandPeng Fan 35c3e733fe mmc: sdhci: Use CONFIG_IS_ENABLED for MMC_IO_VOLTAGE
Use CONFIG_IS_ENABLED() instead of IS_ENABLED() when checking the
MMC_IO_VOLTAGE symbol so the Kconfig option is evaluated correctly for
xPL builds.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-12 16:18:32 +08:00
Jonas KarlmanandPeng Fan 9118fc77f0 mmc: dw_mmc: Allow use of in-spec voltage range for vqmmc-supply
The Rockchip RK3399 SoC SDMMC IO domain supports 1.8V and 3.0V mode, and
the 3.0V mode is within SD Standards allowed 2.7V-3.6V range. However,
the commit 0b75109b6a ("mmc: dw_mmc: return error for invalid voltage
setting") help enforce strict 1.8V and 3.3V when setting vqmmc-supply
making mmc_set_signal_voltage() now fail for MMC_SIGNAL_VOLTAGE_330 and
leading to an improper switch to MMC_SIGNAL_VOLTAGE_180.

Use regulator_set_value_clamp() to set an SD Standards voltage range,
1.70V-1.95V and 2.7V-3.6V, I/O voltage instead of requiring an exact
regulator value to closer match Linux and to fix use of 3.3V signal
voltage on Rockchip RK3399 boards using MMC_IO_VOLTAGE=y.

Fixes: 0b75109b6a ("mmc: dw_mmc: return error for invalid voltage setting")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-12 16:18:32 +08:00
Jonas KarlmanandPeng Fan 10acd5bc9a test: dm: regulator: Add regulator_set_value_clamp() tests
Add a sandbox LDO3 with a configurable 1.8V to 3.3V range and use it
to test regulator_set_value_clamp().

Test in-range requests, clamping against the regulator limits, invalid
ranges outside the regulator limits and a min value higher than max.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-12 16:18:32 +08:00
Jonas KarlmanandPeng Fan 0663b4f553 power: regulator: Add helper to set voltage within an acceptable range
Add regulator_set_value_clamp() that clamps a requested target voltage
to both caller-provided limits and the regulator constraints before
setting the regulator voltage value.

Return -EINVAL when the caller limits cannot be satisfied by the
regulator constraints or when the requested range is invalid.

This helper will initially be used to set vqmmc-supply voltage within an
acceptable range according to SD Standards, i.e. 1.70V-1.95V and
2.7V-3.6V.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-12 16:18:32 +08:00
Tanmay KathpaliaandPeng Fan 5badf4e82a MAINTAINERS: add entry for SDHCI Cadence driver
Add a MAINTAINERS entry for the Cadence SDHCI driver files
(drivers/mmc/sdhci-cadence*). The original authors
(Masahiro Yamada <yamada.masahiro@socionext.com> and
Kuan Lim Lee <kuanlim.lee@starfivetech.com>) email addresses are no
longer reachable. Add myself as maintainer since I am actively
maintaining and developing these files.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-12 09:53:22 +08:00
Tom Rini 6741b0dfb4 Merge patch series "fs: btrfs: add support for readdir"
Alexey Charkov <alchark@flipper.net> says:

Btrfs in U-boot currently uses a custom callback for ls and doesn't
expose the standard opendir/readdir/closedir interface, making it harder
to use in generic code. One area where this would be useful is in
discovering BLS type 1 entries [1] on a Btrfs filesystem.

Add support for the standard interface, and implement ls in terms of it.

[1] https://lore.kernel.org/u-boot/20260604-bls-v1-0-4ce6d1ee4711@flipper.net/
Link: https://lore.kernel.org/r/20260626-btrfs-readdir-v2-0-7dd43f72d1b4@flipper.net
2026-07-10 15:55:23 -06:00
Alexey CharkovandTom Rini 31cf3f1778 fs: btrfs: use fs_ls_generic() and drop custom implementation
Now that generic callbacks for opendir/readdir/closedir are implemented,
the custom btrfs_ls() implementation is no longer needed, along with the
btrfs_iter_dir() callback iterator.

Use fs_ls_generic() instead.

Signed-off-by: Alexey Charkov <alchark@flipper.net>
Reviewed-by: Qu Wenruo <wqu@suse.com>
2026-07-10 15:55:01 -06:00
Alexey CharkovandTom Rini 5f064aef5d fs: btrfs: implement opendir(), readdir() and closedir()
Add support for generic directory iteration with opendir(), readdir() and
closedir() in the btrfs filesystem driver.

Signed-off-by: Alexey Charkov <alchark@flipper.net>
Reviewed-by: Qu Wenruo <wqu@suse.com>
2026-07-10 15:55:01 -06:00
Naveen Kumar ChaudharyandTom Rini e0d10a4b85 cmd: x86: zboot: remove duplicate zboot_setup() call in do_zboot_setup
do_zboot_setup() invokes zboot_setup() twice: once with proper error
reporting, and again immediately afterwards with no diagnostic. The
second call re-runs the entire boot parameter setup on the
already-populated zero page, which is at best wasted work and at
worst leaves the structure in an unexpected state.

Drop the stray second invocation; the first call already covers both
success and failure handling.

Fixes: cb19931ee5 ("x86: zboot: Drop intermediate zboot_setup() function")
Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
2026-07-10 15:52:59 -06:00
Naveen Kumar ChaudharyandTom Rini bd93d8ea10 cmd: upl: fix off-by-one argc check in do_upl_read
do_upl_read() guards against missing arguments with "argc < 1", but
argc always counts argv[0] (the command name) so that condition is
never true. The function then unconditionally dereferences argv[1],
which is out of bounds when the user runs "upl read" with no address
argument and feeds garbage into hextoul()/map_sysmem().

Use "argc < 2" so the address argument is actually required.

Fixes: 264f4b0b34 ("upl: Add a command")
Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
2026-07-10 15:52:36 -06:00
Naveen Kumar ChaudharyandTom Rini b81e716b26 cmd: ini: avoid NULL deref when loadaddr/filesize env vars are unset
When the user runs "ini <section>" without explicit address or size
arguments, do_ini() falls back to env_get("loadaddr") and
env_get("filesize") and passes the results straight to hextoul().
env_get() returns NULL for an undefined variable and hextoul() does
not tolerate a NULL pointer, so on a board without these variables
set the command dereferences NULL.

Fetch the strings into locals first, reject the NULL case with
CMD_RET_USAGE, and only then convert to numeric values.

Fixes: c167cc0203 ("Add a new "ini" command")
Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
2026-07-10 15:52:16 -06:00
Naveen Kumar ChaudharyandTom Rini 9df08fb181 cmd: host: fix duplicate device_unbind and wrong error message in unbind
do_host_unbind()'s error handler for device_unbind() prints the
misleading message "Cannot attach file" and then calls device_unbind()
a second time on the same device, both of which look like copy-paste
mistakes left over from neighbouring code.

Remove the duplicate device_unbind() call and report the correct
failure with the device name.

Fixes: 952018117a ("dm: sandbox: Switch over to using the new host uclass")
Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
2026-07-10 15:51:21 -06:00
Naveen Kumar ChaudharyandTom Rini dc3606a961 cmd: clone: report destination block number on dest write error
The error path of the destination blk_dwrite() prints srcblk, which
refers to the source device's block counter and is unrelated to the
write that just failed. This produces misleading diagnostics that
point at the wrong block on the wrong device when a clone aborts on
a write error.

Print destblk so the message identifies the block that actually
failed, mirroring the existing "Src read error @blk %ld" message
above which correctly uses srcblk.

Fixes: 4a4830cf91 ("cmd: add clone command")
Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
2026-07-10 15:50:48 -06:00
Richard Genoud (TI)andTom Rini b1d083e444 remoteproc: k3-r5: Fix crash when issuing rproc init
Prevent NULL pointer dereference with lockstep mode.

Since commit 21d03d60e909 ("j7200 defconfig: add rproc commands"),
issuing rproc init command with cluster configured in lockstep results
in a NULL pointer dereference.

This is because ti_sci_proc_request() is called on both cores on the
same cluster, without checking if they are populated.
To fix that, only request the core being probed, as there is no need to
request the other one.

Moreover, the old code was requesting both cores in lockstep mode, but
only releasing one:
it called k3_r5f_proc_request() with ti_sci_proc_release(), instead of
using k3_r5f_proc_request()/k3_r5f_proc_release() or
ti_sci_proc_request()/ti_sci_proc_release().

So, replacing k3_r5f_proc_request() by ti_sci_proc_request() restores
the intended behavior.

Fixes: 21d03d60e909 ("j7200 defconfig: add rproc commands")
Signed-off-by: Richard Genoud (TI) <richard.genoud@bootlin.com>
2026-07-10 15:46:11 -06:00
Anshul DalalandTom Rini 199a088b96 treewide: Kconfig: use bool instead of tristate
U-Boot does not support modules, so having tristate options is useless.

Therefore this patch does a blind replace of all tristate options to
bool tree-wide.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
Reviewed-by: Heiko Schocher <hs@nabladev.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Romain Gantois <romain.gantois@bootlin.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-07-10 15:45:57 -06:00
Tom Rini 9652e00aaa Merge tag 'u-boot-rockchip-2026.10-20260710' of https://git.u-boot-project.org/u-boot/custodians/u-boot-rockchip
CI: https://git.u-boot-project.org/u-boot/custodians/u-boot-rockchip/-/pipelines/597

- Add new rockchip custodian,
- Remove inactive rockchip custodian,
- Preemptively fix rk3528/rk356x DTS issue that will come with 7.1
  upstream DTS sync,
- Fix typo in doc,
- Fix variable used before being set in rockchip_nfc,
- Fix asm-operand-widths clang warning for RK3528, RK3576 and RK3588,
- Work around HW undefined state for NVMEs on RK3588 Jaguar,
- Added support for new devices:
  - LinkEase EasePi R1
  - 9Tripod X3568 v4
2026-07-10 10:04:04 -06:00
Coia PrantandQuentin Schulz b5deaa71fb board: rockchip: Add support for 9Tripod X3568 v4
The 9Tripod X3568 v4 is an RK3568-based SBC, just like the RK3568-EVB.
It always uses soldered connections between the X3568CV2/X3568CV3/X3568CV4 core board
and the X3568bv4 I/O board.

The differences between the core boards
- PCB size, layout
- CPU (RK3568B2/RK3568J)
- Memory type (DDR4/LPDDR4/LPDDR4X) and size
- eMMC size
- DSI/EDP resistor values
Although the components vary, they maintain full compatibility.

The X3568 board has multiple hardware revisions, and we currently support v4 (I/O board).

Specification:
- SoC: RockChip RK3568 ARM64 (4 cores)
- eMMC: 16-128 GB
- RAM: 2-16 GB
- Power: DC 12V 2A
- Ethernet: 2x YT8521SC RGMII (10/100/1000 Mbps)
- Wireless radio: 802.11b/g/n/ac/ax dual-band
- LED:
  Power: AlwaysOn
  User: GPIO
- Button:
  VOL+: SARADC/0 <35k µV>
  VOL-: SARADC/0 <450k µV>
  Power/Reset: PMIC RK809
- CAN
  CAN/1: 4-pin (PH 2.0)
- PWM
  PWM/4: Backlight DSI/0 DSI/1
  PWM/7: IR Receiver [may not install]
- UART:
  UART/2: Debug TTL - 1500000 8N1 (1.25mm)
  UART/3: TTL (PH 2.0)
  UART/4: TTL (PH 2.0)
  UART/8: AP6275S Bluetooth
  UART/9: TTL (PH 2.0)
- I2C:
  I2C/0: PMIC RK809
  I2C/1: Touchscreen DSI/0 DSI/1
  I2C/4: Camera
  I2C/5: RTC@51 PCF8563
- I2S:
  I2S/0: miniHDMI Sound
  I2S/1: RK809 Audio Codec
  I2S/3: AP6275S Bluetooth Sound
- SDMMC:
  SDMMC/0: microSD (TF) slot
  SDMMC/2: AP6275S SDIO WiFi card
- Camera: 1x CSI
- Video: miniHDMI / DSI0 (MIPI/LVDS) / DSI1 (MIPI/EDP)
- Audio: miniHDMI / MIC on-board / Speaker / SPDIF / 3.5mm Headphones / AP6275S Bluetooth
- USB:
  USB 2.0 HOST x2
  USB 2.0 HOST x3 (4-pin)
  USB 2.0 OTG x1 (shared with USB 3.0 OTG/HOST) [slot may not install]
  USB 3.0 HOST x1
  USB 3.0 OTG/HOST x1
- SATA: 1x SATA 3.0 with Power/4-pin [slot may not install]
- PCIe: 1x PCIe 3.0 x2 (x4 connector) [power/clock/slot may not install]

Link:
- https://appletsapi.52solution.com/media/X3568V4%E5%BC%80%E5%8F%91%E6%9D%BF%E7%A1%AC%E4%BB%B6%E6%89%8B%E5%86%8C.pdf
- https://blog.gov.cooking/archives/research-ninetripod-x3568-v4-and-flash.html

Signed-off-by: Coia Prant <coiaprant@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Link: https://patch.msgid.link/20260709185101.2149485-1-coiaprant@gmail.com
Signed-off-by: Quentin Schulz <u-boot@0leil.net>
2026-07-10 10:52:20 +02:00
Jakob UnterwurzacherandQuentin Schulz 6037673a10 board: rockchip: set M.2 NVMe PERSTN low in spl_board_init on Jaguar
As it is, an NVMe's built-in PERSTN pull-up fights against the
SoC's built-in pull-down which results in an undefined logic state
on the Samsung SSD 980 and likely others.

Fix that by forcing PERSTN low as early as possible, which is SPL.

Both Linux and U-Boot (via "pci enum") set the pin high later
as needed and the NVMe is detected fine.

Oscillocope shots ("x" means undefined logic state at around 1.5V):

Before:

	3V3     ____|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
	PERSTN  ____xxxxxxxxxxxxxxx_|‾‾‾‾‾
	PCICLK  ____∿∿∿∿∿∿∿∿∿∿∿∿___∿∿∿∿∿∿∿
                    ^U-Boot     ^ Linux

After:

	3V3     ____|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
	PERSTN  ____x_______________|‾‾‾‾‾
	PCICLK  ____∿∿∿∿∿∿∿∿∿∿∿∿___∿∿∿∿∿∿∿
                    ^U-Boot     ^ Linux

With this change, the power-up sequence conforms to PCIe specs,
except a remaining short PERSTN glitch. The glitch is about 400ms
long. It could be shortened by moving the logic to TPL, but
completely fixing it is only possible in hardware.

Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Link: https://patch.msgid.link/20260625-pub-jaguar-puma-ringneck-tiger-v2025-07_nvme-v2-1-c57bf1020d63@cherry.de
Signed-off-by: Quentin Schulz <u-boot@0leil.net>
2026-07-10 10:45:05 +02:00
Quentin SchulzandQuentin Schulz 07ab38e11f rockchip: fix asm-operand-widths clang warning
CONFIG_COUNTER_FREQUENCY is currently 24000000 for all SoCs, meaning it
fits in a 32b type. For 64b SoCs, it's an issue since the registers are
64b.

clang complains that we're trying to fit a 32b value into a 64b
register:

arch/arm/mach-rockchip/rk3528/rk3528.c:98:45: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths]
   98 |         asm volatile("msr cntfrq_el0, %0" : : "r" (CONFIG_COUNTER_FREQUENCY));
      |                                                    ^
include/generated/autoconf.h:372:34: note: expanded from macro 'CONFIG_COUNTER_FREQUENCY'
  372 | #define CONFIG_COUNTER_FREQUENCY 24000000
      |                                  ^
/home/qschulz/work/upstream/u-boot/arch/arm/mach-rockchip/rk3528/rk3528.c:98:32: note: use constraint modifier "w"
   98 |         asm volatile("msr cntfrq_el0, %0" : : "r" (CONFIG_COUNTER_FREQUENCY));
      |                                       ^~
      |                                       %w0

Even though cntfrq_el0[1] is only using the 32b LSB of its 64b, use the
'x' operand modifier[2] to force the value to be 64b and fix the
warning.

[1] https://developer.arm.com/documentation/ddi0601/2026-03/AArch64-Registers/CNTFRQ-EL0--Counter-timer-Frequency-Register?lang=en
[2] https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#AArch64-Operand-Modifiers

Suggested-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://patch.msgid.link/20260423-rk35-cnt-freq-v1-1-8f07677be5ca@cherry.de
Signed-off-by: Quentin Schulz <u-boot@0leil.net>
2026-07-09 20:25:10 +02:00
Liangbin LianandQuentin Schulz 3a8b3cdd83 rockchip: rk3568: Add support for LinkEase EasePi R1
LinkEase EasePi R1 [1] is a high-performance mini router.

Specification:
- Rockchip RK3568
- 2GB/4GB LPDDR4 RAM
- 16GB on-board eMMC
- 1x M.2 key for 2280 NVMe (PCIe 3.0)
- 1x USB 3.0 Type-A
- 1x USB 2.0 Type-C (for USB flashing)
- 2x 1000 Base-T (native, RTL8211F)
- 2x 2500 Base-T (PCIe, RTL8125B)
- 1x HDMI 2.0 Output
- 12v DC Jack
- 1x Power key connected to PMIC
- 2x LEDs (one static power supplied, one GPIO controlled)

[1] https://doc.linkease.com/zh/guide/easepi-r1/hardware.html

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://patch.msgid.link/20260625125818.18914-2-jjm2473@gmail.com
Signed-off-by: Quentin Schulz <u-boot@0leil.net>
2026-07-09 20:11:03 +02:00
Johan JonkerandQuentin Schulz 3f6d1416a8 mtd: nand: raw: rockchip_nfc: fix oobfree length calculation
The oobfree[0].length calculation depends on the
rknand->metadata_size value, but this is calculated
after the function rk_nfc_ecc_init is called. Move this
calculation to a location before it's value is required.

Fixes: 1b3fcb3c04 ("mtd: nand: raw: rockchip_nfc: add layout structure")
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Tested-by: Hüseyin BIYIK <boogiepop@gmx.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Link: https://patch.msgid.link/12b6e0d5-637e-446e-9e4b-82c82e6fad40@gmail.com
Signed-off-by: Quentin Schulz <u-boot@0leil.net>
2026-07-09 19:49:22 +02:00
Tom Rini 5a7117b0a2 Merge tag 'i2c-updates-for-2026.10-rc1' of https://git.u-boot-project.org/u-boot/custodians/hs/u-boot-i2c
i2c updates for 2026.10-rc1

- i2c: designware: fix i2c probe error
  from Coben

  It would be good to have some Testers...

- i2c: nx_i2c: updates from Peng

  - Added License information
  - use dev_read_addr_ptr()

- cmd: kconfig: i2c: add missing I2C API dependency
  from Julien
2026-07-09 11:42:48 -06:00
Johan JonkerandQuentin Schulz 9b23812382 rockchip: doc: fix typo evb-rk3288-rk808_defconfig
Use correct defconfig name for evb-rk3288-rk808.

Fixes: f339d6a9c3 ("rockchip: Switch remaining rk3288 boards to upstream devicetree")
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Link: https://patch.msgid.link/d0f7ce27-ad87-4910-be25-e867b5af4956@gmail.com
Signed-off-by: Quentin Schulz <u-boot@0leil.net>
2026-07-09 19:03:39 +02:00