pandora-u-boot.git
4 weeks agoLindent: Remove wrapper around indent tool
Javier Tia [Fri, 5 Sep 2025 20:53:46 +0000 (14:53 -0600)]
Lindent: Remove wrapper around indent tool

The Linux kernel has not maintained the same script since 2017-11-01,
and with clang-format included in U-Boot, it is not required anymore.

Signed-off-by: Javier Tia <javier.tia@linaro.org>
4 weeks agotools: zynqmp_psu_init_minimize.sh: Switch to clang-format
Javier Tia [Fri, 5 Sep 2025 20:53:45 +0000 (14:53 -0600)]
tools: zynqmp_psu_init_minimize.sh: Switch to clang-format

Replace the use of scripts/Lindent with clang-format in
zynqmp_psu_init_minimize.sh. This change is made to align with the rest
of the codebase that uses clang-format for code formatting. This ensures
consistency across all scripts in terms of code style and formatting.

Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Javier Tia <javier.tia@linaro.org>
4 weeks agoclang-format: Add configuration file
Javier Tia [Fri, 5 Sep 2025 20:53:44 +0000 (14:53 -0600)]
clang-format: Add configuration file

Introduce .clang-format configuration file to U-Boot, providing
significant improvements over the existing scripts/Lindent approach for
C code formatting.

Benefits of clang-format over scripts/Lindent:

- More comprehensive formatting rules: While Lindent relies on the basic
  'indent' tool with limited options, clang-format provides extensive
  control over code formatting with 800+ configuration options

- Better handling of complex code structures: clang-format understands
  modern C constructs and handles nested structures, macros, and complex
  expressions more intelligently

- IDE and editor integration: Native support in major development
  environments (VS Code, Vim, Emacs, etc.) enables real-time formatting

- Consistent results across environments: Eliminates variations between
  different versions of 'indent' tool and system configurations

- Active maintenance: clang-format is actively developed and updated,
  unlike the aging 'indent' tool

Alignment with Linux kernel practices:

Continues U-Boot alignment with Linux kernel development practices,
maintaining consistency between these closely related projects. The
Linux kernel adopted clang-format to modernize its code formatting
infrastructure and improve developer experience.

The .clang-format file is based on the Linux kernel configuration,
specifically copied from Linux kernel v6.16 tag, which itself builds
upon the initial introduction in commit d4ef8d3ff005c ("clang-format:
add configuration file").

Signed-off-by: Javier Tia <javier.tia@linaro.org>
6 weeks agoMerge tag 'u-boot-imx-next-20250905a' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Fri, 5 Sep 2025 16:48:05 +0000 (10:48 -0600)]
Merge tag 'u-boot-imx-next-20250905a' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/27573

- Several improvements for kontron-sl-mx6ul.
- Add Phytec imx8mp-libra-fpsc board
- Add redundant environment support for imx8m evk boards.
- Several improvements for phycore-imx93.

6 weeks agoAdd imx8mp-libra-fpsc board
Benjamin Hahn [Tue, 2 Sep 2025 06:07:32 +0000 (08:07 +0200)]
Add imx8mp-libra-fpsc board

Add new imx8mp-libra-fpsc board.
Bootph tags as well as USB device tree nodes are in u-boot.dtsi for now
and will be removed when upstreamed.
The Libra i.MX 8M Plus FPSC is a single board computer. It uses an i.MX
8M Plus FPSC [1] System on Module which utilizes the FPSC standard [2].

[1] https://www.phytec.eu/en/produkte/system-on-modules/phycore-imx-8m-plus-fpsc
[2] https://www.phytec.eu/en/produkte/system-on-modules/fpsc

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>
Tested-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Yannic Moog <y.moog@phytec.de>
6 weeks agoimx8m[m,n,p]_evk: Add redundant environment support
Fabio Estevam [Fri, 29 Aug 2025 19:28:15 +0000 (16:28 -0300)]
imx8m[m,n,p]_evk: Add redundant environment support

For reliable Over The Air update, it is recommended that redundant
environment is used.

Add redundant environment support for the i.MX8M EVK boards.

While at it, increase the environment size and adjust the offset.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
6 weeks agoboard: phytec: phycore-imx93: Use CONFIG_PHYTEC_EEPROM_BUS
Primoz Fiser [Thu, 28 Aug 2025 08:20:08 +0000 (10:20 +0200)]
board: phytec: phycore-imx93: Use CONFIG_PHYTEC_EEPROM_BUS

Switch to use CONFIG_PHYTEC_EEPROM_BUS instead of the hard coded value
of 2 for the EEPROM I2C bus for both SPL and U-Boot proper. Possible
since commit 88a1816a9b4e ("board: phytec: common: Add PHYTEC_EEPROM_BUS
to Kconfig").

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
6 weeks agoconfigs: imx93-phycore_defconfig: Disable CONFIG_AHAB_BOOT
Primoz Fiser [Thu, 28 Aug 2025 08:20:07 +0000 (10:20 +0200)]
configs: imx93-phycore_defconfig: Disable CONFIG_AHAB_BOOT

By default, lets disable configuration option CONFIG_AHAB_BOOT=y on the
phyCORE-i.MX93 based boards. This option is only used in the secureboot
context which is not provided by default anyway. Lets remove it from the
defconfig to not give false impressions it is supported out of the box
for this board.

On the other hand, in the context of PHYTEC secureboot, this option is
selected by the distro which enables CONFIG_AHAB_BOOT among other secure
boot related options and tweaks needed to properly support it.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Reviewed-by: Martin Schwan <m.schwan@phytec.de>
6 weeks agoarm: dts: imx93-phyboard-segin-u-boot: Clean-up already upstream nodes
Primoz Fiser [Thu, 21 Aug 2025 06:46:14 +0000 (08:46 +0200)]
arm: dts: imx93-phyboard-segin-u-boot: Clean-up already upstream nodes

Clean-up "imx93-phyboard-segin-u-boot.dtsi" internal device-tree from
nodes already part of the upstream device-tree since commit 79f3e77133bd
("Subtree merge tag 'v6.16-dts' of dts repo [1] into dts/upstream"). No
functional change is made with this commit.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
6 weeks agotools: imx8image: Make imx8image_check_params() static
Ilias Apalodimas [Tue, 12 Aug 2025 06:08:06 +0000 (09:08 +0300)]
tools: imx8image: Make imx8image_check_params() static

We are trying to enable -Wmissing-prototypes and this functiion is only
used locally. Mark it as static.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Peng Fan <peng.fan@nxp.com>
6 weeks agoimx: kontron-sl-mx6ul: Switch to OF_UPSTREAM
Frieder Schrempf [Mon, 25 Aug 2025 13:54:35 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Switch to OF_UPSTREAM

Use the upstream devicetrees instead of the local ones.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
[fabio: Remove imx6ul-kontron-bl.dtb and imx6ull-kontron-bl.dtb from Makefile]

6 weeks agoimx: kontron-sl-mx6ul: Force default environment for serial loader boot
Eberhard Stoll [Mon, 25 Aug 2025 13:54:34 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Force default environment for serial loader boot

In case of booting from serial loader (USB) we want to always use the
default environment in order to get a defined state that is
independent of any environment stored in persistent memory.

This way we can avoid corruption of the boot process during
development and manufacturing by existing environment settings in
flash.

Signed-off-by: Eberhard Stoll <eberhard.stoll@kontron.de>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
6 weeks agoimx: kontron-sl-mx6ul: Enable CONFIG_ENV_IS_NOWHERE
Eberhard Stoll [Mon, 25 Aug 2025 13:54:33 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Enable CONFIG_ENV_IS_NOWHERE

For some cases it is beneficial to not store the environment in
persistent memory, but instead use the default environment and
keep it in volatile RAM only. Allow this by enabling
CONFIG_ENV_IS_NOWHERE.

Signed-off-by: Eberhard Stoll <eberhard.stoll@kontron.de>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
6 weeks agoimx: kontron-sl-mx6ul: Enable watchdog and sysreset
Frieder Schrempf [Mon, 25 Aug 2025 13:54:32 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Enable watchdog and sysreset

Enable the watchdog and sysreset drivers and the wdt command.
This also fixes the non-working 'reset' command.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
6 weeks agoimx: kontron-sl-mx6ul: Autostart fastboot if booted from USB
Annette Kobou [Mon, 25 Aug 2025 13:54:31 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Autostart fastboot if booted from USB

For booting via USB we want to automatically start the fastboot
command in order to access the board via uuu or other tools.

This allows for easier bringup of new boards during development
and manufacturing.

Signed-off-by: Annette Kobou <annette.kobou@kontron.de>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
6 weeks agoimx: kontron-sl-mx6ul: Enable redundant environment
Oualid Derouiche [Mon, 25 Aug 2025 13:54:30 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Enable redundant environment

This aligns the MTD partitions on the SPI NOR with the kernel
devicetree and enables the redundant environment.

Signed-off-by: Oualid Derouiche <oualid.derouiche@kontron.de>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
6 weeks agoimx: kontron-sl-mx6ul: Enable fastboot support
Annette Kobou [Mon, 25 Aug 2025 13:54:29 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Enable fastboot support

Enable support for fastboot commands via USB.

Signed-off-by: Annette Kobou <annette.kobou@kontron.de>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
6 weeks agoimx: kontron-sl-mx6ul: Enable second ethernet interface
Frieder Schrempf [Mon, 25 Aug 2025 13:54:28 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Enable second ethernet interface

This ensures both interfaces can be used in U-Boot and both MAC addresses
are exported to the Linux kernel devicetree.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
6 weeks agoimx: kontron-sl-mx6ul: Set CONFIG_SDP_LOADADDR to fix SDP boot
Frieder Schrempf [Mon, 25 Aug 2025 13:54:27 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Set CONFIG_SDP_LOADADDR to fix SDP boot

We need to set CONFIG_SDP_LOADADDR to a valid RAM address to make
SDP boot work. Use the end of the DDR (256 MiB minimum) as other
boards do.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
6 weeks agoimx: kontron-sl-mx6ul: Enable standard boot and disable legacy distro boot
Frieder Schrempf [Mon, 25 Aug 2025 13:54:26 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Enable standard boot and disable legacy distro boot

Disable the legacy distro boot and use bootstd instead.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
6 weeks agoimx: kontron-sl-mx6ul: Fix include statements for local header
Frieder Schrempf [Mon, 25 Aug 2025 13:54:25 +0000 (15:54 +0200)]
imx: kontron-sl-mx6ul: Fix include statements for local header

The header from the local directory should use double quotes instead
of brackets. Otherwise the compiler might not search the local
directory.

Fixes: 93935acc6f1d ("imx: imx6ul: kontron-sl-mx6ul: Select correct boot and env device")
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
6 weeks agoMerge patch series "memtest performance improvements"
Tom Rini [Tue, 2 Sep 2025 20:11:45 +0000 (14:11 -0600)]
Merge patch series "memtest performance improvements"

Rasmus Villemoes <ravi@prevas.dk> says:

The first two patches make memtest run ~40x faster (when, as it should
be, dcache is disabled), with the second patch being responsible for
most of that. At least on the beagleboneblack which I used for
testing; other boards and configurations will likely see different
numbers.

This is for CONFIG_SYS_ALT_MEMTEST=y and
CONFIG_SYS_ALT_MEMTEST_BITFLIP=n; one could probably get a similar
improvement in the bitflip case since that also has a schedule() call
in the inner loop.

Link: https://lore.kernel.org/r/20250822181848.3325832-1-ravi@prevas.dk
6 weeks agomemtest: remove use of vu_long typedef in mem_test_alt
Rasmus Villemoes [Fri, 22 Aug 2025 18:18:48 +0000 (20:18 +0200)]
memtest: remove use of vu_long typedef in mem_test_alt

Hiding a qualifier such as "volatile" inside a typedef makes the code
much harder to understand. Since addr and dummy being
volatile-qualified are important for the correctness of the test code,
make it more obvious by spelling it out as "volatile ulong".

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Tested-by: Anshul Dalal <anshuld@ti.com>
6 weeks agomemtest: only call schedule() once for every 256 words
Rasmus Villemoes [Fri, 22 Aug 2025 18:18:47 +0000 (20:18 +0200)]
memtest: only call schedule() once for every 256 words

A function call itself for every word written or read+written in these
loops is bad enough. But since the memory test must be run with dcache
disabled, the schedule() call, traversing the linked list of
registered cyclic clients, and accessing the 'struct cyclic_info' for
each to see if any are due for a callback, is quite expensive. On a
beagleboneblack, testing a modest 16MiB region takes 2.5 minutes:

  => dcache off
  => time mtest 0x81000000 0x82000000 0 1
  Testing 81000000 ... 82000000:
  Iteration:      1
  Tested 1 iteration(s) with 0 errors.

  time: 2 minutes, 28.946 seconds

There is really no need for calling schedule() so frequently. It is
quite easy to limit the calls to once for every 256 words by using a
u8 variable. With that, the same test as above becomes 37 times
faster:

  => dcache off
  => time mtest 0x81000000 0x82000000 0 1
  Testing 81000000 ... 82000000:
  Iteration:      1
  Tested 1 iteration(s) with 0 errors.

  time: 4.052 seconds

Note that we are still making a total of

  3 loops * (4 * 2^20 words/loop) / (256 words/call) = 49152 calls

during those ~4000 milliseconds, so the schedule() calls are still
done less than 0.1ms apart.

These numbers are just for a beagleboneblack, other boards may have a
slower memory, but we are _two orders of magnitude_ away from
schedule() "only" being called at 100Hz, which is still more than
enough to ensure any watchdog is kept happy.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Tested-by: Anshul Dalal <anshuld@ti.com>
6 weeks agomemtest: don't volatile-qualify local variables
Rasmus Villemoes [Fri, 22 Aug 2025 18:18:46 +0000 (20:18 +0200)]
memtest: don't volatile-qualify local variables

It is obviously important that the addr pointer used to access the
memory region being tested is volatile-qualified, to prevent the
compiler from optimizing out the "write this value, read it back,
check that it is what we expect".

However, none of these auxiliary variables have any such need for,
effectively, being forced to live on the stack and cause each and
every reference to them to do a memory access.

This makes the memtest about 15% faster on a beagleboneblack.

Before:

  => dcache off
  => time mtest 0x81000000 0x81100000 0 1
  Testing 81000000 ... 81100000:
  Iteration:      1
  Tested 1 iteration(s) with 0 errors.

  time: 10.868 seconds

After:

  => dcache off
  => time mtest 0x81000000 0x81100000 0 1
  Testing 81000000 ... 81100000:
  Iteration:      1
  Tested 1 iteration(s) with 0 errors.

  time: 9.209 seconds

[Without the 'dcache off', there's no difference in the time, about
0.6s, but the memtest cannot usefully be done with dcache enabled.]

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Tested-by: Anshul Dalal <anshuld@ti.com>
6 weeks agoMerge tag 'mmc-power-next-2025-09-01' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 1 Sep 2025 20:32:00 +0000 (14:32 -0600)]
Merge tag 'mmc-power-next-2025-09-01' of https://source.denx.de/u-boot/custodians/u-boot-mmc into next

CI: https://source.denx.de/u-boot/custodians/u-boot-mmc/-/pipelines/27536

- Update compatibles for PMICs used by exynos devices
- Support system reset and reset status for pca9450
- Fix for pca9450 LDO5 registers and drop deprecated sd-vsel-gpios
- Two minor fixes found by smatch

7 weeks agommc: core: drop space before newline in trace printf
Bhimeswararao Matsa [Fri, 29 Aug 2025 02:11:31 +0000 (07:41 +0530)]
mmc: core: drop space before newline in trace printf

Remove unnecessary whitespace before '\n' in trace printf
format strings (checkpatch warning QUOTED_WHITESPACE_BEFORE_NEWLINE).

No functional change intended.

Signed-off-by: Bhimeswararao Matsa <bhimeswararao.matsa@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agommc: iproc_sdhci: Cannot test unsigned variable for negative
Andrew Goodbody [Wed, 30 Jul 2025 16:52:56 +0000 (17:52 +0100)]
mmc: iproc_sdhci: Cannot test unsigned variable for negative

In sdhci_iproc_execute_tuning the variable tuning_loop_counter is
unsigned and therefore will always fail the test for it being less than
0. Fix this by changing the variable type to be s8.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopower: pmic: pca9450: Add support for reset status
Primoz Fiser [Thu, 28 Aug 2025 11:24:05 +0000 (13:24 +0200)]
power: pmic: pca9450: Add support for reset status

PCA9450 PMIC supports reading the reset status from the PWRON_STAT
register. Bits 7-4 give indication of the PMIC reset cause:

 - PWRON (BIT7) - Power ON triggered by PMIC_ON_REQ input line,
 - WDOGB (BIT6) - Boot after cold reset by WDOGB pin (watchdog reset),
 - SW_RST (BIT5) - Boot after cold reset initiated by the software,
 - PMIC_RST (BIT4) - Boot after PMIC_RST_B input line trigger.

Add support for reading reset status via the sysreset framework in a
convenient printable format.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Reviewed-by: Paul Geurts <paul.geurts@prodrive-technologies.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopower: pmic: pca9450: Add support for system reset
Primoz Fiser [Thu, 28 Aug 2025 11:24:04 +0000 (13:24 +0200)]
power: pmic: pca9450: Add support for system reset

The family of PCA9450 PMICs have the ability to perform system resets.
Restarting via PMIC is preferred method of restarting the system as all
the peripherals are brought to a know state after a power-cycle. The
PCA9450 features a cold restart procedure which is initiated by an I2C
command 0x14 to the SW_RST register.

Support in Linux for restarting via PCA9450 PMIC has been added by
Linux commit 6157e62b07d9 ("regulator: pca9450: Add restart handler").

Now add support for it also in the U-Boot via sysreset framework.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Reviewed-by: Paul Geurts <paul.geurts@prodrive-technologies.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoboard: samsung: odroid: drop exynos_power_init
Henrik Grimler [Fri, 22 Aug 2025 18:33:33 +0000 (20:33 +0200)]
board: samsung: odroid: drop exynos_power_init

exynos_power_init sets up regulators for the emmc and sdcard, but
these regulators are already marked as always-on and boot-on and hence
are handled already by the regulator-uclass. Since we currently try to
set them up twice we get error -114 (EALREADY) from exynos_power_init
on every boot:

    LDO20@VDDQ_EMMC_1.8V: set 1800000 uV; enabling (ret: -114)
    LDO22@VDDQ_EMMC_2.8V: set 2800000 uV; enabling (ret: -114)
    LDO21@TFLASH_2.8V: set 2800000 uV; enabling (ret: -114)

Remove the superfluous exynos_power_init to silence these errors.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoARM: dts: trats: rename max8997-pmic regulators node
Henrik Grimler [Fri, 22 Aug 2025 18:33:32 +0000 (20:33 +0200)]
ARM: dts: trats: rename max8997-pmic regulators node

Linux uses just regulators { }; instead of voltage-regulators { };, so
this change aligns the DTSes found in the two projects.

The max8997 driver does not yet parse the regulators node, so we can
safely change its name without breaking anything.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopower: pmic: max8997: drop maxim,max8997 compatible
Henrik Grimler [Fri, 22 Aug 2025 18:33:31 +0000 (20:33 +0200)]
power: pmic: max8997: drop maxim,max8997 compatible

All u-boot users now use maxim,max8997-pmic instead, as does Linux's
DTSes, so we can now safely drop the maxim,max8997 compatible.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoARM: dts: exynos4210-trats: use maxim,max8997-pmic compatible
Henrik Grimler [Fri, 22 Aug 2025 18:33:30 +0000 (20:33 +0200)]
ARM: dts: exynos4210-trats: use maxim,max8997-pmic compatible

Instead of maxim,max8997. Linux uses maxim,max8997-pmic, so with this
change we align the trats DTS with its linux counterpart.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopower: pmic: max8997: support maxim,max8997-pmic compatible as well
Henrik Grimler [Fri, 22 Aug 2025 18:33:29 +0000 (20:33 +0200)]
power: pmic: max8997: support maxim,max8997-pmic compatible as well

Linux's DTSes uses maxim,max8997-pmic, so check for this compatible
as well so that max8997 pmic driver can support both u-boot and
Linux's DTSes.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopower: pmic: fix typo and capitalisation in max8997 Kconfig help msg
Henrik Grimler [Fri, 22 Aug 2025 18:33:28 +0000 (20:33 +0200)]
power: pmic: fix typo and capitalisation in max8997 Kconfig help msg

To make the help message slightly easier to understand.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoARM: dts: s5c1xx-goni: rename max8998-pmic regulators node
Henrik Grimler [Fri, 22 Aug 2025 18:33:27 +0000 (20:33 +0200)]
ARM: dts: s5c1xx-goni: rename max8998-pmic regulators node

Linux uses just regulators { }; instead of voltage-regulators { };, so
this change aligns the DTSes found in the two projects.

The max8998 driver does not yet parse the regulators node, so we can
safely change its name without breaking anything.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoARM: dts: exynos4210-universal_c210: rename max8998 regulators node
Henrik Grimler [Fri, 22 Aug 2025 18:33:26 +0000 (20:33 +0200)]
ARM: dts: exynos4210-universal_c210: rename max8998 regulators node

Linux uses just regulators { }; instead of voltage-regulators { };, so
this change aligns the DTSes found in the two projects.

The max8998 driver does not yet parse the regulators node, so we can
safely change its name without breaking anything.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopower: pmic: s2mps11: remove check for voltage-regulators node
Henrik Grimler [Fri, 22 Aug 2025 18:33:25 +0000 (20:33 +0200)]
power: pmic: s2mps11: remove check for voltage-regulators node

All devicetrees that use s2mps11 driver have been converted to use
regulators { };, so we can safely drop the voltage-regulators fallback
check.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoARM: dts: exynos5422-odroidxu3: rename s2mps11 regulators node
Henrik Grimler [Fri, 22 Aug 2025 18:33:24 +0000 (20:33 +0200)]
ARM: dts: exynos5422-odroidxu3: rename s2mps11 regulators node

With this both linux and u-boot uses the same node name, which
simplifies devicetree parsing in s2mps11 driver.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopower: pmic: s2mps11: look for both {voltage-,}regulators
Henrik Grimler [Fri, 22 Aug 2025 18:33:23 +0000 (20:33 +0200)]
power: pmic: s2mps11: look for both {voltage-,}regulators

Linux's DTSes uses regulators { }; while u-boot's DTSes uses
voltage-regulators { };.  Look for regulators, and fallback to
voltage-regulators if not found, so that both type of DTSes can be
used with the driver.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoarm: dts: imx8mp-dhcom-som: Remove deprecated sd-vsel-gpios
Frieder Schrempf [Mon, 11 Aug 2025 13:12:02 +0000 (15:12 +0200)]
arm: dts: imx8mp-dhcom-som: Remove deprecated sd-vsel-gpios

The sd-vsel-gpios property in the root of the PMIC node is deprecated
and therefore not parsed by the driver anymore. We can safely remove
this as it wasn't used anyway due to the pad not having the correct
pinmux settings.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoarm: dts: imx8mp-data-modul-edm-sbc: Remove deprecated sd-vsel-gpios
Frieder Schrempf [Mon, 11 Aug 2025 13:12:01 +0000 (15:12 +0200)]
arm: dts: imx8mp-data-modul-edm-sbc: Remove deprecated sd-vsel-gpios

The sd-vsel-gpios property in the root of the PMIC node is deprecated
and therefore not parsed by the driver anymore. We can safely remove
this as it wasn't used anyway due to the pad not having the correct
pinmux settings.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopmic: pca9450: Handle hardware with fixed SD_VSEL for LDO5
Frieder Schrempf [Mon, 11 Aug 2025 13:12:00 +0000 (15:12 +0200)]
pmic: pca9450: Handle hardware with fixed SD_VSEL for LDO5

There are two ways to set the output voltage of the LD05
regulator. First by writing to the voltage selection registers
and second by toggling the SD_VSEL signal.

Usually board designers connect SD_VSEL to the VSELECT signal
controlled by the USDHC controller, but in some cases the
signal is hardwired to a fixed low level (therefore selecting
3.3V as initial value for allowing to boot from the SD card).

In these cases, the voltage is only determined by the value
of the LDO5CTRL_L register. Introduce a property
nxp,sd-vsel-fixed-low to let the driver know that SD_VSEL
is low and there is no GPIO to actually get that
information from dynamically.

This is equivalent to the following change in Linux:

c8c1ab2c5cb7 ("regulator: pca9450: Handle hardware with fixed SD_VSEL for LDO5")

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopmic: pca9450: Fix control register for LDO5
Frieder Schrempf [Mon, 11 Aug 2025 13:11:59 +0000 (15:11 +0200)]
pmic: pca9450: Fix control register for LDO5

For LDO5 we need to be able to check the status of the SD_VSEL input in
order to know which control register is used. Read the status of the
SD_VSEL signal via GPIO and use the correct register accordingly.

To use this, the LDO5 node in the devicetree needs the sd-vsel-gpios
property to reference the GPIO that is used to read back the SD_VSEL
status internally. Please note that the SION bit in the IOMUX must be
set if the signal is muxed as VSELECT and controlled by the USDHC
controller.

This is equivalent to the following change in Linux:

3ce6f4f943dd ("regulator: pca9450: Fix control register for LDO5")

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopmic: pca9450: Fix enable register for LDO5
Frieder Schrempf [Mon, 11 Aug 2025 13:11:58 +0000 (15:11 +0200)]
pmic: pca9450: Fix enable register for LDO5

The LDO5 regulator has two configuration registers, but only
LDO5CTRL_L contains the bits for enabling/disabling the regulator.

This is equivalent to the following change in Linux:

f5aab0438ef1 ("regulator: pca9450: Fix enable register for LDO5")

Fixes: 326337fb005f ("pmic: pca9450: Add regulator driver")
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoRevert "pmic: pca9450: Add optional SD_VSEL GPIO for LDO5"
Frieder Schrempf [Mon, 11 Aug 2025 13:11:57 +0000 (15:11 +0200)]
Revert "pmic: pca9450: Add optional SD_VSEL GPIO for LDO5"

This reverts commit 2add0511757e2c5897a88b57c5ea8c912140e60f.

It turns out that all boards using the PCA9450 actually have the
SD_VSEL input connected to the VSELECT signal of the SoCs SD/MMC
interface. Therefore we don't need manual control for this signal
via GPIO and there aren't any users.

This is equivalent to the following change in Linux:

c73be62caabb ("Revert "regulator: pca9450: Add SD_VSEL GPIO for LDO5"")

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agopower: regulator: tps65910: Cannot test unsigned for being negative
Andrew Goodbody [Thu, 7 Aug 2025 16:35:22 +0000 (17:35 +0100)]
power: regulator: tps65910: Cannot test unsigned for being negative

The code in tps65910_regulator.c treats the field supply in struct
tps65910_regulator_pdata as an int and even tests the value for being
negative so change it from a u32 to int so that the code all works as
expected.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agotest: Update logic for video test
Tom Rini [Mon, 18 Aug 2025 16:54:06 +0000 (10:54 -0600)]
test: Update logic for video test

The video test here is specific to the sandbox SDL video driver, so only
build it when that is enabled rather than VIDEO is enabled.

Reported-by: Alison Chaiken <alison@she-devel.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 weeks agoMerge patch series "power: regulator: Fix some Smatch reported issues"
Tom Rini [Fri, 29 Aug 2025 22:45:27 +0000 (16:45 -0600)]
Merge patch series "power: regulator: Fix some Smatch reported issues"

Andrew Goodbody <andrew.goodbody@linaro.org> says:

Smatch reported some issues in the regulator drivers, mostly repeated
instances of testing an unsigned variable for being negative but also an
expression needing parenthesis to be interpreted as expected.

[trini: Drop 5/6 for now due to changes being requested on review]

Link: https://lore.kernel.org/r/20250807-pwr_regulator-v1-0-42a4105336ec@linaro.org
7 weeks agoMerge patch series "power: Address two Smatch reported issues"
Tom Rini [Fri, 29 Aug 2025 22:44:50 +0000 (16:44 -0600)]
Merge patch series "power: Address two Smatch reported issues"

Andrew Goodbody <andrew.goodbody@linaro.org> says:

Smatch reported issues with two power drivers due to redundant code and
an unitialised variable.

Link: https://lore.kernel.org/r/20250807-power_misc-v1-0-2ac672f15461@linaro.org
7 weeks agopower: Tighten some power driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:51:13 +0000 (15:51 -0600)]
power: Tighten some power driver dependencies

The MediaTek mt6323 power driver cannot build without access to some
platform specific header files. Express that requirements in Kconfig as
well.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 weeks agopower: Split *POWER_LEGACY portion of <power/pmic.h> out to new header
Tom Rini [Fri, 4 Jul 2025 21:50:21 +0000 (15:50 -0600)]
power: Split *POWER_LEGACY portion of <power/pmic.h> out to new header

The commends in include/power/pmic.h say that once SPL_DM_PMIC exists we
should update things. This has been true for some time, so let us update
this to have the legacy portions in their own header, which should not
be directly included. This cleans up the logic within the file too
slightly.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 weeks agopower: Correct dependencies on POWER_LEGACY
Tom Rini [Fri, 4 Jul 2025 21:50:20 +0000 (15:50 -0600)]
power: Correct dependencies on POWER_LEGACY

The POWER_LEGACY option functionally depends on not having DM_PMIC
enabled, so add that here.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 weeks agopower: regulator: tps65941: Cannot test unsigned for being negative
Andrew Goodbody [Thu, 7 Aug 2025 16:35:23 +0000 (17:35 +0100)]
power: regulator: tps65941: Cannot test unsigned for being negative

In tps65941_buck_val and tps65941_ldo_val hex is an unsigned variable
being assigned the return value from a function that returns int. Change
hex to be an int so that the following test for an error as a negative
value will work as expected.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
7 weeks agopower: regulator: rzg2l-usbphy: Add parenthesis to return expression
Andrew Goodbody [Thu, 7 Aug 2025 16:35:21 +0000 (17:35 +0100)]
power: regulator: rzg2l-usbphy: Add parenthesis to return expression

In order to get the expected result from
rzg2l_usbphy_regulator_get_enable the return expression needs
parenthesis so that the binary and is performed before the double
logical not.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
7 weeks agopower: regulator: palmas: Cannot test unsigned for being negative
Andrew Goodbody [Thu, 7 Aug 2025 16:35:20 +0000 (17:35 +0100)]
power: regulator: palmas: Cannot test unsigned for being negative

In palmas_smps_val and palmas_ldo_val hex is an unsigned variable being
assigned the return value from a function that returns int. Change hex
to be an int so that the following test for an error as a negative value
will work as expected.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
7 weeks agopower: regulator: lp87565: Cannot test unsigned for being negative
Andrew Goodbody [Thu, 7 Aug 2025 16:35:19 +0000 (17:35 +0100)]
power: regulator: lp87565: Cannot test unsigned for being negative

In lp87565_buck_val hex is an unsigned variable being assigned the return
value from a function that returns int. Change hex to be an int so that
the following test for an error as a negative value will work as expected.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
7 weeks agopower: regulator: lp873x: Cannot test unsigned for being negative
Andrew Goodbody [Thu, 7 Aug 2025 16:35:18 +0000 (17:35 +0100)]
power: regulator: lp873x: Cannot test unsigned for being negative

In lp873x_buck_val and lp873x_ldo_val hex is an unsigned variable being
assigned the return value from a function that returns int. Change hex
to be an int so that the following test for an error as a negative value
will work as expected.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
7 weeks agopower: power_i2c: ret is uninitialised if not DM_I2C
Andrew Goodbody [Thu, 7 Aug 2025 14:28:58 +0000 (15:28 +0100)]
power: power_i2c: ret is uninitialised if not DM_I2C

In pmic_reg_read ret is only assigned to inside #if
CONFIG_IS_ENABLED(DM_I2C) so move the test and return ret inside as well
and also guard the declaration of ret with CONFIG_IS_ENABLED(DM_I2C) to
prevent a warning about an unused variable.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
7 weeks agopower: axp: Remove redundant code
Andrew Goodbody [Thu, 7 Aug 2025 14:28:57 +0000 (15:28 +0100)]
power: axp: Remove redundant code

In axp_init after checking the chip ID there is an else clause that
returns ret. ret is guaranteed to be 0 at this point as the code would
have returned above if not. The next statement is a return 0 so the
return ret is redundant, remove it.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
7 weeks agoMerge tag 'xilinx-for-v2026.01-rc1' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 28 Aug 2025 13:54:38 +0000 (07:54 -0600)]
Merge tag 'xilinx-for-v2026.01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next

AMD/Xilinx/FPGA changes for v2026.01-rc1

mbv:
- Add it to CI loop

versal2:
- Wire UFS driver

serial:
- Add support for OF_PLATDATA in uartlite

misc:
- Mark some structures as const

7 weeks agoMerge tag 'fsl-qoriq-next-2025-08-27' of https://source.denx.de/u-boot/custodians...
Tom Rini [Wed, 27 Aug 2025 14:49:38 +0000 (08:49 -0600)]
Merge tag 'fsl-qoriq-next-2025-08-27' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next

CI: https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq/-/pipelines/27490

- Various patches from Andrew to address issues found by Smatch
- Reinitialize job ring in crypto fsl rng
- Set scaler values for fsl dspi CS-SCK and SCK-CS

7 weeks agodrivers: crypto: fsl: rng: Reinitialize job ring
Anthony Pighin (Nokia) [Wed, 27 Aug 2025 08:12:21 +0000 (16:12 +0800)]
drivers: crypto: fsl: rng: Reinitialize job ring

u-boot internals were being corrupted following an EFI callback to
get_rng(). One of the many footprints was a corruption of the EFI
protocols linked list.

A request for >16 bytes of random data is broken into smaller requests.
Those requests are fed in a loop to the CAAM RNG, which uses a job
queue ring for interaction.

However, the job queue descriptor is created only at probe time. That
descriptor may end up needing an endian swap (LS1046A) before being fed
to the CAAM RNG. This corrupts the descriptor for the next iteration,
since it will be blindly endian swapped yet again.

Two issues arise. The number of words to endian swap is taken from the
input descriptor itself. So on the second iteration, the length has been
corrupted. This results in a corruption past the end of the descriptor:
whatever is after in memory is endian swapped too. Second, some of the
entries in the descriptor are DMA addresses. If the descriptor is still
somehow considered valid after swapping, the data at the corrupted DMA
address is now trampled.

Linux properly initializes the descriptor for each iteration. This is
what is now done with this commit.

Signed-off-by: Anthony Pighin <anthony.pighin@nokia.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agofsl_dspi: set scaler values for CS-SCK and SCK-CS delays
Tomas Alvarez Vanoli [Wed, 20 Aug 2025 08:17:19 +0000 (10:17 +0200)]
fsl_dspi: set scaler values for CS-SCK and SCK-CS delays

These values were calculated but not set.
They are required for the calculation of the delays, as stated in the
"QorIQ LS1043A Reference Manual, Rev. 6, 07/2020" page 2172.

The delays are calculated as (1/freq)*PCSSCK*CSSCK and
(1/freq)*PASC*ASC.

Signed-off-by: Tomas Alvarez Vanoli <tomas.alvarez-vanoli@hitachienergy.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoserial: lpuart: Return value from correct variable
Andrew Goodbody [Mon, 11 Aug 2025 16:25:17 +0000 (17:25 +0100)]
serial: lpuart: Return value from correct variable

In get_lpuart_clk_rate if the call to clk_get_rate returns an error then
the call to return should pass the value of the error which is in rate
rather than ret which will be 0 as its value is not affected by this
error.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agodrivers: qe: avoid double free()
Andrew Goodbody [Fri, 8 Aug 2025 10:29:33 +0000 (11:29 +0100)]
drivers: qe: avoid double free()

Avoid calling free(addr) twice if the device for ucode is not found.
This patch repeats a similar fix but that only applied to code without
CONFIG_TFABOOT enabled. This patch applies to the code with
CONFIG_TFABOOT enabled.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agonet: fsl-mc: Incorrect variable used in error path
Andrew Goodbody [Mon, 4 Aug 2025 16:56:59 +0000 (17:56 +0100)]
net: fsl-mc: Incorrect variable used in error path

In mc_fixup_dpc_mac_addr noff is assigned the return value from
fdt_add_subnode so that is the variable that should be passed to
fdt_strerror and returned when negative.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agonet: fsl-mc: NULL check dflt_dpni before dereference
Andrew Goodbody [Mon, 4 Aug 2025 16:56:58 +0000 (17:56 +0100)]
net: fsl-mc: NULL check dflt_dpni before dereference

In dpni_exit there is a NULL check for dflt_dpni after it is
dereferenced a number of times. Instead move the NULL check to early in
the function. Also assign NULL to dflt_dpni after free in both dpni_init
and dpni_exit.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agonet: fsl-mc: NULL check dflt_dpbp before dereference
Andrew Goodbody [Mon, 4 Aug 2025 16:56:57 +0000 (17:56 +0100)]
net: fsl-mc: NULL check dflt_dpbp before dereference

In dpbp_exit there is a NULL check for dflt_dpbp after it is
dereferenced a number of times. Instead move the NULL check to early in
the function. Also assign NULL to dflt_dpbp after free in both dpbp_init
and dpbp_exit.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agonet: fsl-mc: NULL check dflt_dpio before dereference
Andrew Goodbody [Mon, 4 Aug 2025 16:56:56 +0000 (17:56 +0100)]
net: fsl-mc: NULL check dflt_dpio before dereference

In dpio_exit there is a NULL check for dflt_dpio but it happens after
dpio_dflt has been dereferenced a number of times already. Instead move
the NULL check to first thing in the function. Also assign NULL to
dflt_dpio after free in both dpio_init and dpio_exit.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agonet: fsl_enetc: Fix copy/paste error
Andrew Goodbody [Mon, 4 Aug 2025 16:56:55 +0000 (17:56 +0100)]
net: fsl_enetc: Fix copy/paste error

In netc_blk_ctrl_probe the test for failure of the function
clk_prepare_enable should not return PTR_ERR(ipg_clk) as it does not
check IS_ERR(ipg_clk) instead it should return err as that is what is
holding the error code in this case.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agonet: fm: Correct test for timeout
Andrew Goodbody [Mon, 4 Aug 2025 16:03:59 +0000 (17:03 +0100)]
net: fm: Correct test for timeout

In memac_wait_until_free and memac_wait_until_done the use of
post-decrement on the test in the while loop for a timeout means that
timeout will be equal to -1 on exit in that case. Adjust the test for
this expected value.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agonet: fm: NULL check dev before dereference
Andrew Goodbody [Mon, 4 Aug 2025 16:03:58 +0000 (17:03 +0100)]
net: fm: NULL check dev before dereference

In fm_eth_bind there is a dereference of dev before it is NULL checked.
Add a NULL check before the first dereference and remove a later NULL
check that is now redundant.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agonet: fm: Correct test for timeout
Andrew Goodbody [Mon, 4 Aug 2025 16:03:57 +0000 (17:03 +0100)]
net: fm: Correct test for timeout

In bmi_rx_port_disable and bmi_tx_port_disable the use of post-decrement
on the test in the while loop for a timeout means that timeout will be
equal to -1 on exit in that case. Adjust the test for this expected
value.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agoddr: fsl: Provide initial value for zqcs_init
Andrew Goodbody [Thu, 24 Jul 2025 15:32:55 +0000 (16:32 +0100)]
ddr: fsl: Provide initial value for zqcs_init

In the case of !zq_en zqcs_init is never assigned to although its value
is used. Correct by initialising zqcs_init to 0.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 weeks agomisc: fs_loader: Add request_firmware_into_buf_via_script() for flexible firmware...
Lucien.Jheng [Sun, 17 Aug 2025 15:02:03 +0000 (23:02 +0800)]
misc: fs_loader: Add request_firmware_into_buf_via_script() for flexible firmware loading via U-Boot script

This commit introduces a new API,
request_firmware_into_buf_via_script(), to the fs_loader framework.
This function allows firmware to be loaded into memory using
a user-defined U-Boot script, providing greater flexibility for
firmware loading scenarios that cannot be handled by static file
paths or device/partition selection alone.

Key features:
- The API runs a specified U-Boot script (by name), which is responsible
  for loading the firmware into memory by any means (e.g., load from MMC, USB, network, etc.).
- The script must set two environment variables: 'fw_addr'
  (the memory address where the firmware is loaded) and
  'fw_size' (the size of the firmware in bytes).
- The function validates these variables, copies the firmware into a newly
  allocated buffer (using memdup), and returns the pointer
  via the provided double pointer argument.
- The maximum allowed firmware size is checked to prevent buffer overflows.
- The environment variables are cleared after use to avoid stale data.
- Detailed error messages are provided for all failure conditions to aid debugging.

Usage example:
1. Define a U-Boot script in the environment that loads the firmware
   and sets the required variables:
   => env set my_fw_script 'load mmc 0:1 ${loadaddr} firmware.bin &&
   env set fw_addr ${loadaddr} && env set fw_size ${filesize}'

2. In your code, call the new API:
   void *fw_buf = NULL;
   int ret = request_firmware_into_buf_via_script(&fw_buf, 0x46000000, "my_fw_script");
   if (ret < 0)
return ret;

This approach allows board integrators and users to customize the firmware
loading process without modifying the source code,
simply by changing the script in the U-Boot environment.

Signed-off-by: Lucien.Jheng <lucienzx159@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[trini: Fix printf of size_t needing to use %zx]
Signed-off-by: Tom Rini <trini@konsulko.com>
7 weeks agoMerge patch series "Update SoM detection related code and configs"
Tom Rini [Tue, 26 Aug 2025 18:49:35 +0000 (12:49 -0600)]
Merge patch series "Update SoM detection related code and configs"

Wadim Egorov <w.egorov@phytec.de> says:

Update Kconfig options for phyCORE-AM62Ax to align with other boards and
prepare common board code for the upcoming phyCORE-AM62L which has the
SoM EEPROM connected on a different bus.

Link: https://lore.kernel.org/r/20250815111051.2277173-1-w.egorov@phytec.de
7 weeks agoconfigs: phycore_am62ax_a53_defconfig: Resync after savedefconfig
Wadim Egorov [Fri, 15 Aug 2025 11:10:51 +0000 (13:10 +0200)]
configs: phycore_am62ax_a53_defconfig: Resync after savedefconfig

Remove PHYTEC_SOM_DETECTION_BLOCKS after it was enabled per default
for this platform.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
7 weeks agoboard: phytec: phycore-am62a: Update SoM detection Kconfig options
Wadim Egorov [Fri, 15 Aug 2025 11:10:50 +0000 (13:10 +0200)]
board: phytec: phycore-am62a: Update SoM detection Kconfig options

Drop SUPPORT_EXTENSION_SCAN and enable PHYTEC_SOM_DETECTION_BLOCKS
to align with other PHYTEC platforms. These options were missed when
phyCORE-AM62Ax support was added.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
7 weeks agoboard: phytec: common: k3: Use CONFIG_PHYTEC_EEPROM_BUS
Dominik Haller [Fri, 15 Aug 2025 11:10:49 +0000 (13:10 +0200)]
board: phytec: common: k3: Use CONFIG_PHYTEC_EEPROM_BUS

Use CONFIG_PHYTEC_EEPROM_BUS instead of the hard coded value for the i2c bus.

Signed-off-by: Dominik Haller <d.haller@phytec.de>
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
7 weeks agoboard: phytec: common: Add PHYTEC_EEPROM_BUS to Kconfig
Dominik Haller [Fri, 15 Aug 2025 11:10:48 +0000 (13:10 +0200)]
board: phytec: common: Add PHYTEC_EEPROM_BUS to Kconfig

Add the option to choose a different bus number than 0 for the i2c eeprom
based som detection.

Signed-off-by: Dominik Haller <d.haller@phytec.de>
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
7 weeks agoMerge tag 'tpm-next-25082025' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 26 Aug 2025 17:24:49 +0000 (11:24 -0600)]
Merge tag 'tpm-next-25082025' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next

CI: https://source.denx.de/u-boot/custodians/u-boot-tpm/-/pipelines/27461

Tom removed an unused TPM driver and fixed a few prints to include
the 'z' prefix for size_t declaratiuons. Andrew fixed an unsigned int
comparision against < 0 in the tpm infineon driver.

7 weeks agoufs: amd-versal2: Configure RMMI and M-PHY registers for HS mode
Venkatesh Yadav Abbarapu [Thu, 24 Jul 2025 04:44:02 +0000 (10:14 +0530)]
ufs: amd-versal2: Configure RMMI and M-PHY registers for HS mode

Configure RMMI and M-PHY registers for HS mode required for selection of
bit rate series A or B. If it is not a calibrated part, then switch back
to SLOWAUTO_MODE and skip all these configurations.
Implemented below sequence as per the DWC RMMI databook.
1. Override RMMI CBRATESEL with the desired rate.
2. Set TX_CFGUPDT_0 to 1'b1 for one TX_CFGCLK_0 cycle.
3. Override PHY rx_req to 1, then poll on PHY rx_ack register till it
goes 1(both lanes).
4. Override PHY rx_req to 0, then poll on PHY rx_ack register till it
goes 0(both lanes).
5. Remove PHY rx_req override(both lanes).
6. Start the LS PMC.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250724044402.260149-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
7 weeks agoCI: Wire mbv32 combinations
Michal Simek [Thu, 31 Jul 2025 07:06:18 +0000 (09:06 +0200)]
CI: Wire mbv32 combinations

After upgrading to QEMU 10 by commit 1d782a3f229c ("Docker, CI: Update to
latest Ubuntu and Dockerfile") let's wire mbv32 which is the part of QEMU
to have it under regression.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/02e5c14552b05200ece94136db0077cbdd47738c.1753945577.git.michal.simek@amd.com
7 weeks agodm: core: Mark root_info as const
Michal Simek [Fri, 25 Jul 2025 12:01:22 +0000 (14:01 +0200)]
dm: core: Mark root_info as const

root_info driver structure is not changing that's why mark them as const
which ensure that structure will be moved from .data section to .rodata
section.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/18d92a93a9863ed0452e82a1f8e0ff9205adb4f9.1753444878.git.michal.simek@amd.com
7 weeks agomailbox: zynqmp-ipi: Mark zynqmp_ipi_dest_mbox_ops as const
Michal Simek [Fri, 25 Jul 2025 12:01:21 +0000 (14:01 +0200)]
mailbox: zynqmp-ipi: Mark zynqmp_ipi_dest_mbox_ops as const

Operations are not changing that's why mark them as const which ensure that
structure will be moved from .data section to .rodata section.
Also mark them as static because they are not used out of this file.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b7e5dc8841f6e904a7365f2ed45248609c007ddd.1753444878.git.michal.simek@amd.com
7 weeks agoclk: zynqmp: Mark zynqmp_clk_ops as const
Michal Simek [Fri, 25 Jul 2025 12:01:20 +0000 (14:01 +0200)]
clk: zynqmp: Mark zynqmp_clk_ops as const

Operations are not changing that's why mark them as const which ensure that
structure will be moved from .data section to .rodata section.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/92eb9e90189d8b96246966633478662076da7185.1753444878.git.michal.simek@amd.com
7 weeks agoserial: uartlite: Add support for OF_PLATDATA
Michal Simek [Wed, 23 Jul 2025 09:06:47 +0000 (11:06 +0200)]
serial: uartlite: Add support for OF_PLATDATA

The first change is to list DM_DRIVER_ALIAS for compatible string to be
able to match the driver. Only xps one is listed because opb one is likely
unused for quite a long time.

The second change is to add dtplat structure to plat data and fill register
base in probe.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b494dbad529e919d33977b8ea6e6dbcd14e78907.1753261604.git.michal.simek@amd.com
7 weeks agoserial: uartlite: Use private data instead of platform
Michal Simek [Wed, 23 Jul 2025 09:06:46 +0000 (11:06 +0200)]
serial: uartlite: Use private data instead of platform

plat data should be used only in probe or of_to_plat to fill it information
from DT. Then in probe platform data should be stored in private structure
which should be used by the other driver functions.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/8d32af596f80a2220d9f5d7fb98476e6d2b5f303.1753261604.git.michal.simek@amd.com
7 weeks agoxilinx: Make XILINX_OF_BOARD_DTB_ADDR depending on OF_BOARD only
Michal Simek [Tue, 22 Jul 2025 08:15:05 +0000 (10:15 +0200)]
xilinx: Make XILINX_OF_BOARD_DTB_ADDR depending on OF_BOARD only

board_fdt_blob_setup() is guarded by OF_BOARD already that's why make no
sense to depend also on OF_SEPARATE.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/063b2e618afb05a32d66218f3631a5f23b30ea3e.1753172103.git.michal.simek@amd.com
7 weeks agoMerge tag 'v2025.10-rc3' into next
Tom Rini [Mon, 25 Aug 2025 19:28:49 +0000 (13:28 -0600)]
Merge tag 'v2025.10-rc3' into next

Prepare v2025.10-rc3

8 weeks agoPrepare v2025.10-rc3 v2025.10-rc3
Tom Rini [Mon, 25 Aug 2025 19:06:38 +0000 (13:06 -0600)]
Prepare v2025.10-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
8 weeks agoremoteproc: k3: update compatible for am654 syscon
Anshul Dalal [Thu, 14 Aug 2025 15:21:43 +0000 (20:51 +0530)]
remoteproc: k3: update compatible for am654 syscon

The existing compatible name for U-Boot's k3 system controller driver
i.e "ti,am625-system-controller" has been added to linux[1] device-tree.
This compatible in kernel is meant for configuring the Control Module
registers (CTRL_MMR0).

However in U-Boot, the matching driver was being used to load the system
firmware on the secure M-cores by the R5 SPL and therefore must be
updated to a different compatible to avoid conflicts.

Therefore, this patch renames all references of the compatible to
"ti,am654-tisci-rproc-r5". The "-r5" is appended so as to avoid any
future conflicts since r5 specific compatibles should only be useful for
U-Boot.

[1]: 5959618631fe ("dt-bindings: mfd: ti,j721e-system-controller: Add compatible string for AM654")
     https://lore.kernel.org/r/20250421214620.3770172-2-afd@ti.com

Signed-off-by: Anshul Dalal <anshuld@ti.com>
8 weeks agoboard: phytec: phycore_am6xx: Add rauc to bootmeths
Wadim Egorov [Mon, 18 Aug 2025 10:26:05 +0000 (12:26 +0200)]
board: phytec: phycore_am6xx: Add rauc to bootmeths

Add rauc to bootmeths variable if BOOTMETH_RAUC is enabled.
This is setting a proper default for RAUC enabled systems.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Martin Schwan <m.schwan@phytec.de>
8 weeks agobootstd: rauc: Do not select BOOTMETH_GLOBAL
Martin Schwan [Fri, 15 Aug 2025 07:12:56 +0000 (09:12 +0200)]
bootstd: rauc: Do not select BOOTMETH_GLOBAL

Since the bootmeth "rauc" is not a global boot method, do not select the
corresponding BOOTMETH_GLOBAL option.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
8 weeks agoMerge tag 'xilinx-for-v2025.10-rc3' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 25 Aug 2025 16:06:03 +0000 (10:06 -0600)]
Merge tag 'xilinx-for-v2025.10-rc3' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

AMD/Xilinx/FPGA changes for v2025.10-rc3

Fix smatch issues in zynqmp ipi and pinctrl drivers

zynqmp:
- Add missing zu1cg device
- Add missing ethernet alias for kr260-revB
- Define empty BOOTENV_DEV_SHARED_XSPI macro

fpga:
- Address reported coverity issues

net:
- axi_emac: Fix timeout test

versal2:
- Define usb_pgood_delay for fix device detection

8 weeks agoconfigs: versal2: Add usb_pgood_delay for versal2 boards
Venkatesh Yadav Abbarapu [Mon, 18 Aug 2025 04:53:04 +0000 (10:23 +0530)]
configs: versal2: Add usb_pgood_delay for versal2 boards

Add usb_pgood_delay to ensure proper detection of USB devices.
Increase the USB power good delay for versal2 specific boards,
as certain USB sticks may not be detected without it.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250818045304.4058177-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
8 weeks agonet: axi_emac: Fix timeout test
Andrew Goodbody [Mon, 18 Aug 2025 09:24:36 +0000 (10:24 +0100)]
net: axi_emac: Fix timeout test

The timeout test in axi_dma_init is not correct due to the
post-decrement used on the timeout variable which will mean timeout is
not 0 if the timeout occurs. Make the timeout variable an int instead of
a u32 and then test for timeout being -1.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Link: https://lore.kernel.org/r/20250806-net_xilinx_axi-v2-1-6311cf59451d@linaro.org
Signed-off-by: Michal Simek <michal.simek@amd.com>
8 weeks agoarm64: versal2: Define BOOTENV_DEV_SHARED_XSPI when distro is disabled
Michal Simek [Wed, 30 Jul 2025 14:32:01 +0000 (16:32 +0200)]
arm64: versal2: Define BOOTENV_DEV_SHARED_XSPI when distro is disabled

When DISTRO_DEFAULT is disabled there is missing empty
BOOTENV_DEV_SHARED_XSPI macro defined.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4c195468c0341ddd2aca98f83cdcbd40117cc9ee.1753885919.git.michal.simek@amd.com