]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
9 months agoarm: dts: rockchip: Use sdmmc node from dts/upstream on RK3528
Jonas Karlman [Wed, 30 Jul 2025 23:52:43 +0000 (23:52 +0000)] 
arm: dts: rockchip: Use sdmmc node from dts/upstream on RK3528

Drop the sdmmc node from soc u-boot.dtsi and instead use the sdmmc node
from rk3528.dtsi with v6.16-dts now merged to dts/upstream.

This cleanup has no intended functional change.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: rk3528-generic: Fix boot after dts/upstream v6.16-dts merge
Jonas Karlman [Wed, 30 Jul 2025 23:52:42 +0000 (23:52 +0000)] 
rockchip: rk3528-generic: Fix boot after dts/upstream v6.16-dts merge

The rk3528-generic target can no longer boot after v6.16-dts was merged
into dts/upstream, and instead end up in a boot loop:

  No serial driver found
  resetting ...

After Linux commit 34d2730fbbdd ("arm64: dts: rockchip: move rk3528
i2c+uart aliases to board files") there is no longer an alias for
serial0 defined for the U-Boot only rk3528-generic device tree.

Add a board specific aliases node that include the missing serial0 alias
to resolve the boot issue and ensure that stdout-path = "serial0:..."
can be resolved by U-Boot.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agork3288: add fdtoverlay_addr_r to default env
Marius Dinu [Wed, 11 Jun 2025 11:04:54 +0000 (11:04 +0000)] 
rk3288: add fdtoverlay_addr_r to default env

rk3288 is missing fdtoverlay_addr_r.
The new addresses match those used by rk3308.
Tested on Asus TinkerBoard S.

Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@vrull.eu>
Cc: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agoboard: rockchip: unblock CAN bus in spl_board_init on Jaguar
Jakob Unterwurzacher [Tue, 17 Jun 2025 08:42:52 +0000 (10:42 +0200)] 
board: rockchip: unblock CAN bus in spl_board_init on Jaguar

GPIO0_B7 is routed to TXI of the on-board CAN transceiver. The
line has a pull-down per SoC default.

This means the CAN transceiver transmits a dominant zero
and blocks the CAN bus until Linux boots and reconfigures the pin.

Let's switch to pull-up as soon as we can (i.e. in SPL).
This cuts down the "bus is blocked" time from 10 seconds to < 1 second.

Of course, to this needs CONFIG_SPL_BOARD_INIT, so enable it
the Jaguar defconfig.

Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: puma-rk3399: enable "env erase" command
Quentin Schulz [Fri, 27 Jun 2025 13:30:19 +0000 (15:30 +0200)] 
rockchip: puma-rk3399: enable "env erase" command

Erasing the environment to start from scratch is actually very useful
and "env erase" is the proper way to do it instead of using "env
default -a && env save", so let's enable support for it.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: ringneck-px30: enable "env erase" command
Quentin Schulz [Fri, 27 Jun 2025 13:30:18 +0000 (15:30 +0200)] 
rockchip: ringneck-px30: enable "env erase" command

Erasing the environment to start from scratch is actually very useful
and "env erase" is the proper way to do it instead of using "env
default -a && env save", so let's enable support for it.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: jaguar-rk3588: enable "env erase" command
Quentin Schulz [Fri, 27 Jun 2025 13:30:17 +0000 (15:30 +0200)] 
rockchip: jaguar-rk3588: enable "env erase" command

Erasing the environment to start from scratch is actually very useful
and "env erase" is the proper way to do it instead of using "env
default -a && env save", so let's enable support for it.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: tiger-rk3588: enable "env erase" command
Quentin Schulz [Fri, 27 Jun 2025 13:30:16 +0000 (15:30 +0200)] 
rockchip: tiger-rk3588: enable "env erase" command

Erasing the environment to start from scratch is actually very useful
and "env erase" is the proper way to do it instead of using "env
default -a && env save", so let's enable support for it.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agoboard: rockchip: Add ArmSoM Sige5
Jonas Karlman [Fri, 1 Aug 2025 20:43:39 +0000 (20:43 +0000)] 
board: rockchip: Add ArmSoM Sige5

ArmSoM-Sige5 adopts the second-generation 8nm high-performance AIOT
platform Rockchip RK3576, with a 6 TOPS computing power NPU and support
for up to 16GB of large memory. It supports 4K video encoding and
decoding, offers rich interfaces including dual gigabit Ethernet ports,
WiFi 6 & BT5, and various video outputs.

Features tested on a ArmSoM Sige5 v1.1:
- SD-card boot
- eMMC boot
- Ethernet
- PCIe NVMe

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agophy: rockchip: naneng-combphy: Add support for RK3576
Jon Lin [Fri, 1 Aug 2025 20:43:38 +0000 (20:43 +0000)] 
phy: rockchip: naneng-combphy: Add support for RK3576

Add support for the PCIe/USB3/SATA combo PHYs used in the RK3576 SoC.

Config values are taken from vendor U-Boot linux-6.1-stan-rkr5 tag.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: clk: clk_rk3576: Add dummy CLK_REF_PCIEx_PHY support
Jonas Karlman [Fri, 1 Aug 2025 20:43:37 +0000 (20:43 +0000)] 
rockchip: clk: clk_rk3576: Add dummy CLK_REF_PCIEx_PHY support

Add dummy support for the CLK_REF_PCIEx_PHY clocks to allow probe of the
phy-rockchip-naneng-combphy driver on RK3576.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agophy: rockchip: usbdp: Add support for RK3576
Frank Wang [Fri, 1 Aug 2025 20:32:44 +0000 (20:32 +0000)] 
phy: rockchip: usbdp: Add support for RK3576

Add support for the USB3.0+DP PHY used in the RK3576 SoC.

Config values are taken from vendor U-Boot linux-6.1-stan-rkr5 tag.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agophy: rockchip-inno-usb2: Add support for RK3576
Frank Wang [Fri, 1 Aug 2025 20:32:43 +0000 (20:32 +0000)] 
phy: rockchip-inno-usb2: Add support for RK3576

Add support for the USB2.0 PHYs used in the RK3576 SoC.

Config values are taken from vendor U-Boot linux-6.1-stan-rkr5 tag.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agousb: dwc3-generic: Use combined glue and ctrl node for RK3576
Jonas Karlman [Fri, 1 Aug 2025 20:32:42 +0000 (20:32 +0000)] 
usb: dwc3-generic: Use combined glue and ctrl node for RK3576

Like Rockchip RK3328, RK3568 and RK3588, the RK3576 also have a single
node to represent the glue and ctrl for USB 3.0.

Use rk_ops as driver data to select correct ctrl node for RK3576 DWC3.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agoarm: dts: rockchip: Include OTP in U-Boot pre-reloc phase for RK3576
Jonas Karlman [Fri, 1 Aug 2025 20:32:41 +0000 (20:32 +0000)] 
arm: dts: rockchip: Include OTP in U-Boot pre-reloc phase for RK3576

Update rk3576-u-boot.dtsi to include OTP in U-Boot pre-reloc phase for
checkboard() to be able to read information about the running SoC model
and variant from OTP and print it during boot:

  U-Boot 2025.04 (Apr 22 2025 - 20:43:17 +0000)

  Model: Generic RK3576
  SoC:   RK3576
  DRAM:  8 GiB

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: rk3576: Implement checkboard() to print SoC variant
Jonas Karlman [Fri, 1 Aug 2025 20:32:40 +0000 (20:32 +0000)] 
rockchip: rk3576: Implement checkboard() to print SoC variant

Implement checkboard() to print current SoC model used by a board when
U-Boot proper is running.

  U-Boot 2025.04 (Apr 22 2025 - 20:43:17 +0000)

  Model: Generic RK3576
  SoC:   RK3576
  DRAM:  8 GiB

Information about the SoC model and variant is read from OTP.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agoboard: rockchip: Add minimal generic RK3576 board
Jonas Karlman [Fri, 1 Aug 2025 20:32:39 +0000 (20:32 +0000)] 
board: rockchip: Add minimal generic RK3576 board

Add a minimal generic RK3576 board that only have eMMC, SDMMC and USB
OTG enabled. This defconfig can be used to boot from eMMC or SD-card on
most RK3576 boards that follow reference board design.

eMMC and SD-card boot tested on:
- ArmSoM CM5
- ArmSoM Sige5
- FriendlyElec NanoPi M5
- Luckfox Omni3576
- Toybrick TB-RK3576D

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: Add default USB_GADGET_PRODUCT_NUM for RK3576
Jonas Karlman [Fri, 1 Aug 2025 20:32:38 +0000 (20:32 +0000)] 
rockchip: Add default USB_GADGET_PRODUCT_NUM for RK3576

Use 0x350e as the default USB Product ID for Rockchip RK3576, same PID
being used by the BootROM when the device is in MASKROM mode.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorng: rockchip_rng: Add compatible for RK3576
Jonas Karlman [Fri, 1 Aug 2025 20:32:37 +0000 (20:32 +0000)] 
rng: rockchip_rng: Add compatible for RK3576

The RK3576 SoC contains a RKRNG block that can be used to generate
random numbers using the rockchip_rng driver.

Add compatible for RK3576 to support random numbers:

  => rng list
  RNG #0 - rng@2a410000

  => rng
  00000000: 36 dd ab 98 ec fb fe d1 cf 36 b3 e1 9b 3d 00 90  6........6...=..
  00000010: f5 84 de 75 6b 27 48 9e 13 62 12 6c 50 ca 47 1a  ...uk'H..b.lP.G.
  00000020: b3 4d fc 43 c5 b5 2d be 07 27 03 26 bb 69 61 2a  .M.C..-..'.&.ia*
  00000030: 6f 70 01 83 4e ce 91 7a 5a 6c 7c 00 43 87 3e c5  op..N..zZl|.C.>.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agousb: gadget: rockchip: Fix spacing around the Kconfig option
Tom Rini [Wed, 2 Jul 2025 01:03:46 +0000 (19:03 -0600)] 
usb: gadget: rockchip: Fix spacing around the Kconfig option

This Kconfig option used spaces and not tabs for indentation. Switch to
tabs.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agousb: gadget: rockchip: Add missing dependency
Tom Rini [Wed, 2 Jul 2025 01:03:45 +0000 (19:03 -0600)] 
usb: gadget: rockchip: Add missing dependency

The rockchip usb gadget driver cannot build without platform specific
headers being available. Express that requirement in Kconfig as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agoarm64: dts: rockchip: roc-3328-cc: use 1600 ddr4 timing
Da Xue [Tue, 10 Jun 2025 19:08:20 +0000 (19:08 +0000)] 
arm64: dts: rockchip: roc-3328-cc: use 1600 ddr4 timing

Swap the ROC-3328-CC from DDR4 666 to 1600 timing to boost performance.

Signed-off-by: Da Xue <da@libre.computer>
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agoram: rk3328: add ddr4-1600 sdram timing
Da Xue [Tue, 10 Jun 2025 19:08:19 +0000 (19:08 +0000)] 
ram: rk3328: add ddr4-1600 sdram timing

Add DDR4 1600MHz SDRAM timing data from LibreComputer u-boot sources
for the ROC-3328-CC board.

Signed-off-by: Da Xue <da@libre.computer>
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: Add support for GameForce Ace
Chris Morgan [Tue, 10 Jun 2025 03:06:16 +0000 (22:06 -0500)] 
rockchip: Add support for GameForce Ace

The GameForce Ace is an RK3588S based handheld gaming device.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: px30/rk3326: Implement checkboard() to print SoC variant
Quentin Schulz [Tue, 10 Jun 2025 09:42:50 +0000 (11:42 +0200)] 
rockchip: px30/rk3326: Implement checkboard() to print SoC variant

This implements checkboard() to print the current SoC model used by a
board, e.g. one of:

SoC:   PX30
SoC:   PX30S
SoC:   PX30K
SoC:   RK3326
SoC:   RK3326S

when U-Boot proper is running.

The information is read from the OTP and also the DDR_GRF. There's no
public information as far as I know about the layout and stored
information on OTP but this was provided by Rockchip themselves through
their support channel.

The OTP stores the information of whether the SoC is PX30K or something
else. To differentiate between PX30/RK3326 and PX30S/RK3326S, one needs
to read some undocumented bitfield in a DDR_GRF register as done in
vendor kernel,
c.f. https://github.com/armbian/linux-rockchip/blob/rk-6.1-rkr5.1/drivers/soc/rockchip/rockchip-cpuinfo.c#L118-L133.

I do not own a PX30S, nor RK3326/RK3326S so cannot test it works
properly.

Also add the OTP node to the pre-relocation phase of U-Boot proper so
that the SoC variant can be printed when DISPLAY_BOARDINFO is enabled.
This is not required if DISPLAY_BOARDINFO_LATE is enabled because this
happens after relocation. If both are enabled, then the SoC variant will
be printed twice in the boot log, e.g.:

U-Boot 2025.07-rc3-00014-g7cb731574ae6-dirty (May 28 2025 - 13:52:47 +0200)

Model: Theobroma Systems PX30-uQ7 SoM on Haikou devkit
SoC:   PX30  <---- due to DISPLAY_BOARDINFO
DRAM:  2 GiB
PMIC:  RK809 (on=0x40, off=0x00)
Core:  293 devices, 27 uclasses, devicetree: separate
MMC:   mmc@ff370000: 1, mmc@ff390000: 0
Loading Environment from MMC... Reading from MMC(1)... OK

In:    serial@ff030000
Out:   serial@ff030000
Err:   serial@ff030000
Model: Theobroma Systems PX30-uQ7 SoM on Haikou devkit
SoC:   PX30  <----- due to DISPLAY_BOARDINFO_LATE
Net:   eth0: ethernet@ff360000

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months agorockchip: rockchip-inno-usb2: Fix Synchronous Abort on usb start
Alex Shumsky [Thu, 3 Jul 2025 06:04:48 +0000 (09:04 +0300)] 
rockchip: rockchip-inno-usb2: Fix Synchronous Abort on usb start

Fix NULL pointer dereference that happen when rockchip-inno-usb2 clock
enabled before device probe. This early clock enable call happen in process
of parent clock activation added in ac30d90f3367.

Fixes: 229218373c22 ("phy: rockchip-inno-usb2: Add support for clkout_ctl_phy").
Fixes: ac30d90f3367 ("clk: Ensure the parent clocks are enabled while reparenting")
Co-authored-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Alex Shumsky <alexthreed@gmail.com>
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months agoMerge branch 'master' of git://source.denx.de/u-boot-usb
Tom Rini [Fri, 29 Aug 2025 20:58:45 +0000 (14:58 -0600)] 
Merge branch 'master' of git://source.denx.de/u-boot-usb

- Fix a use after free error in cdns3 gadget support in some cases.

9 months agousb: cdns3: Do not access memory after free
Andrew Goodbody [Wed, 13 Aug 2025 16:30:12 +0000 (17:30 +0100)] 
usb: cdns3: Do not access memory after free

The call to cdns3_gadget_ep_free_request will free priv_req so do the
call to list_del_init which accesses the memory pointed to by priv_req
before the free.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
9 months 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

9 months 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

10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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
10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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.

10 months agoMerge tag 'u-boot-stm32-20250825' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Tue, 26 Aug 2025 14:33:10 +0000 (08:33 -0600)] 
Merge tag 'u-boot-stm32-20250825' of https://source.denx.de/u-boot/custodians/u-boot-stm

CI: https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/27466

- Enable OF_UPSTREAM_BUILD_VENDOR for stm32mp25_defconfig
- Fix to avoid inifite loop in stm32_sdmmc2 driver
- Populate oobavail field of nand_ecclayout in stm32_fmc2_nand driver

10 months agoMerge tag 'u-boot-at91-fixes-2025.10-a' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 26 Aug 2025 14:30:21 +0000 (08:30 -0600)] 
Merge tag 'u-boot-at91-fixes-2025.10-a' of https://source.denx.de/u-boot/custodians/u-boot-at91

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

This set includes smatch fixes for clocks and mmc and one QSPI fix.

10 months 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>
10 months 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
10 months 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
10 months 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
10 months 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
10 months 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
10 months 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
10 months 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
10 months 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

10 months 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>
10 months 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>
10 months 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>
10 months 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>
10 months 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

10 months agoconfigs: stm32mp25: Enable OF_UPSTREAM_BUILD_VENDOR
Patrice Chotard [Thu, 14 Aug 2025 12:09:38 +0000 (14:09 +0200)] 
configs: stm32mp25: Enable OF_UPSTREAM_BUILD_VENDOR

Initially, only one STM32MP25 based board was available, the
stm32mp257f-ev1 board which was set by default in stm32mp25_defconfig.

Since commit 79f3e77133bd ("Subtree merge tag 'v6.16-dts' of dts repo [1] into dts/upstream")
we inherited of a second MP25 based board which is the stm32mp257f-dk board.

Enable OF_UPSTREAM_BUILD_VENDOR and set OF_UPSTREAM_VENDOR to allow all
STMicroelectronics DT compilation.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
10 months agommc: stm32_sdmmc2: avoid infinite while loop
Christophe Kerello [Tue, 12 Aug 2025 13:55:26 +0000 (15:55 +0200)] 
mmc: stm32_sdmmc2: avoid infinite while loop

Avoid unlimited while loop by adding a timeout. The timeout is
calculated based on a minimal throughput of 256 KB/s.
The timeout is set at least to 2 seconds.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
10 months agomtd: rawnand: stm32_fmc2: set available OOB bytes per page
Christophe Kerello [Tue, 12 Aug 2025 12:35:11 +0000 (14:35 +0200)] 
mtd: rawnand: stm32_fmc2: set available OOB bytes per page

File system such as YAFFS2 need to know the number of available
OOB bytes per page to be able to choose if they should locate their
metadata in the data area or in the spare area.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
10 months 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>
10 months 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>
10 months 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
10 months agoarm64: zynqmp: Add missing ethernet alias for kr260-revB
Michal Simek [Tue, 29 Jul 2025 13:55:20 +0000 (15:55 +0200)] 
arm64: zynqmp: Add missing ethernet alias for kr260-revB

Ethernet aliases are used in fdt_fixup_ethernet() to inject
local-mac-address in every boot for OS. Similar change has been done for
other carrier cards by commit c4a711253613 ("arm64: zynqmp: Describe
ethernet controllers via aliases on SOM").

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/87d88dba98f7ed96463964684ee45a506d557226.1753797318.git.michal.simek@amd.com
10 months agofpga: lattice: Remove unused support
Michal Simek [Mon, 28 Jul 2025 07:07:54 +0000 (09:07 +0200)] 
fpga: lattice: Remove unused support

There is no single platform which is using this driver that's why remove it
completely. Some issues regarding this code are also reported by Coverity
(CID 583143, 583144, 583145, 583146).

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/367cd55ab8d9fb262ac23fe748babc6b2b59bee0.1753686468.git.michal.simek@amd.com
10 months agofpga: Remove ancient ACEX1K support
Michal Simek [Mon, 28 Jul 2025 07:07:53 +0000 (09:07 +0200)] 
fpga: Remove ancient ACEX1K support

Coverity (CID 583149) reports issue on code which is not enabled by any
real platform that's why remove it completely.

Acked-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20fe425910b6266a2bf0555bda67f60c1dd3aa61.1753686468.git.michal.simek@amd.com
10 months agofpga: xilinx: Check valid desc structure
Michal Simek [Mon, 28 Jul 2025 07:07:52 +0000 (09:07 +0200)] 
fpga: xilinx: Check valid desc structure

FPGA validation can fail and return value needs to be checked.

Addresses-Coverity-ID: CID 583150: Null pointer dereferences  (NULL_RETURNS)
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/876b6f8dbc99ca305460183dbd18635a35ccc989.1753686468.git.michal.simek@amd.com
10 months agofpga: cyclon2: Remove message never printed
Alexander Dahl [Mon, 4 Aug 2025 09:08:16 +0000 (11:08 +0200)] 
fpga: cyclon2: Remove message never printed

else branch is never reached.  Print "Done." anyways to keep behaviour.

Addresses-Coverity-ID: 583148
Link: https://lore.kernel.org/u-boot/20250725132645.GA1807455@bill-the-cat/
Fixes: f0ff4692ff33 ("Add FPGA Altera Cyclone 2 support Patch by Heiko Schocher, 15 Aug 2006")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Link: https://lore.kernel.org/r/20250804090816.42603-1-ada@thorsis.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
10 months agosoc: xilinx: zynqmp: Fix zu1cg device detection
Frank Böwingloh [Fri, 8 Aug 2025 12:31:34 +0000 (14:31 +0200)] 
soc: xilinx: zynqmp: Fix zu1cg device detection

Currently u-boot displayed a zu1cg soc as "Chip:  zu1eg".
A value of 0468_8093h in the IDCODE (CSU) Register defines a ZU1 soc
not only for the EG family but also for the CG family as described
in the Xilinx Zynq UltraScale+ UG1085 documentation in Table 1-2.

Signed-off-by: Frank Böwingloh <f.boewingloh@beckhoff.com>
Cc: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20250808123134.636-1-f.boewingloh@beckhoff.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
10 months agopinctrl: zynqmp: Avoid using uninitialised variable
Andrew Goodbody [Thu, 7 Aug 2025 10:04:05 +0000 (11:04 +0100)] 
pinctrl: zynqmp: Avoid using uninitialised variable

In zynqmp_pinconf_set if param is PIN_CFG_IOSTANDARD or
PIN_CONFIG_POWER_SOURCE and zynqmp_pm_pinctrl_get_config returns an
error then value will not be assigned to when its value is tested to be
not equal to arg. Add code to only test value not equal to arg if ret is
false.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Link: https://lore.kernel.org/r/20250807-pinctrl_misc-v1-4-eeb564a1b032@linaro.org
Signed-off-by: Michal Simek <michal.simek@amd.com>
10 months agopinctrl: zynqmp: Ensure ret is initialised
Andrew Goodbody [Thu, 7 Aug 2025 10:04:04 +0000 (11:04 +0100)] 
pinctrl: zynqmp: Ensure ret is initialised

In zynqmp_pinctrl_prepare_func_groups if called with func->ngroups == 0
then ret will not be assigned to before its value is returned on exit.
Initialise ret to ensure it is always valid.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Link: https://lore.kernel.org/r/20250807-pinctrl_misc-v1-3-eeb564a1b032@linaro.org
Signed-off-by: Michal Simek <michal.simek@amd.com>
10 months agomailbox: zynqmp: Fix off by 1 errors
Andrew Goodbody [Mon, 28 Jul 2025 15:47:09 +0000 (16:47 +0100)] 
mailbox: zynqmp: Fix off by 1 errors

Use resource_size to correctly calculate the size to pass to
devm_ioremap and avoid the off by 1 errors previously present.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Link: https://lore.kernel.org/r/20250728-zynqmp-ipi-v1-1-b2bd144a9521@linaro.org
Signed-off-by: Michal Simek <michal.simek@amd.com>
10 months agotpm: tis_infineon: Cannot test unsigned for being negative
Andrew Goodbody [Wed, 13 Aug 2025 10:40:05 +0000 (11:40 +0100)] 
tpm: tis_infineon: Cannot test unsigned for being negative

tpm_tis_i2c_get_burstcount returns a size_t but also returns -EBUSY if
the TPM is surrently busy. As size_t is an unsigned type simply testing
for < 0 will not work so change the test for being equal to -EBUSY which
will work. Also remove the trivial comments.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
10 months agotpm: tpm_tis_infineon: Make use of 'z' for printing size_t
Tom Rini [Wed, 6 Aug 2025 14:55:19 +0000 (08:55 -0600)] 
tpm: tpm_tis_infineon: Make use of 'z' for printing size_t

When printing the contents of an size_t variable we need to use z prefix
to the format character in order to get the correct format type
depending on 32 or 64bit-ness.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
10 months agotpm: cr50_i2c: Make use of 'z' for printing size_t
Tom Rini [Wed, 6 Aug 2025 14:55:18 +0000 (08:55 -0600)] 
tpm: cr50_i2c: Make use of 'z' for printing size_t

When printing the contents of an size_t variable we need to use z prefix
to the format character in order to get the correct format type
depending on 32 or 64bit-ness.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
10 months agotpm: tpm_tis_st33zp24: Remove unused drivers
Tom Rini [Wed, 6 Aug 2025 14:55:17 +0000 (08:55 -0600)] 
tpm: tpm_tis_st33zp24: Remove unused drivers

The tpm_tis_st33zp24_i2c and tpm_tis_st33zp24_spi drivers are unused.
Remove them.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
10 months agoMerge branch 'u-boot-nand-23082025' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Sun, 24 Aug 2025 14:01:29 +0000 (08:01 -0600)] 
Merge branch 'u-boot-nand-23082025' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash

CI: https://source.denx.de/u-boot/custodians/u-boot-nand-flash/-/pipelines/27449

This series address issues found by Andrew Goodbody and David Regan. Add
a new benchmark tool from Miguel and small feature

10 months agoMerge branch 'master' of git://source.denx.de/u-boot-usb
Tom Rini [Sat, 23 Aug 2025 19:53:34 +0000 (13:53 -0600)] 
Merge branch 'master' of git://source.denx.de/u-boot-usb

- A DWC2 fix, i.MX95 USB3 PHY support and i.MX95 OTG support

10 months agoMerge tag 'u-boot-imx-master-20250823' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Sat, 23 Aug 2025 19:52:54 +0000 (13:52 -0600)] 
Merge tag 'u-boot-imx-master-20250823' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

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

- Fix the environment location when booting from USB on i.MX93.
- Fix env location when booting from USB on phycore-imx93.
- Fix conflict early SPL malloc address on imx93 boards.

10 months agousb: dwc2: fix reset logic in dwc2_core_reset
Patrick Delaunay [Wed, 23 Jul 2025 15:09:16 +0000 (17:09 +0200)] 
usb: dwc2: fix reset logic in dwc2_core_reset

Use GUSBCFG_FORCEHOSTMODE to detected the HOST forced mode as it is done
in the Linux driver drivers/usb/dwc2/core.c:dwc2_core_reset().

The host polling must be executed only if the current mode is host,
either due to the force HOST mode (which persists after core reset)
or the connector id pin.

The GUSBCFG_FORCEDEVMODE bits is used to force the device mode (for
example used on STM32MP1x platform) and when it is activated the DWC2 reset
failed with the trace:
"dwc2_core_reset: Waiting for GINTSTS_CURMODE_HOST timeout"

Fixes: c5d685b8993c ("usb: dwc2: Unify flush and reset logic with v4.20a support")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Junhui Liu <junhui.liu@pigmoral.tech>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
10 months agousb: ehci-mx6: Add i.MX95 OTG support
Tim Harvey [Mon, 21 Jul 2025 18:02:05 +0000 (11:02 -0700)] 
usb: ehci-mx6: Add i.MX95 OTG support

When the usb node is defined dr_mode="otg" ehci_usb_phy_mode() is called
to determine the mode from status registers.

The IMX95RM does not currently define the USBNC STATUS register but it is
assumed to be an omission as the first three registers are defined.
It has been expirimentally verified that the USBNC_PHY_STATUS register
at offset 0x23C bit4 (USBNC_PHYSTATUS_ID_DIG) reads 0 when USB_ID is GND
and 1 when floating.

Use is_imx9() as this driver works for i.MX91, i.MX93 and i.MX95 and all
of these determine the role based on the USBNC_PHY_STATUS register.

Fixes: 801b5fafd35d "(usb: ehci-mx6: Add i.MX95 support")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
10 months agophy: phy-imx8mq-usb: Add support for i.MX95 USB3 PHY
Tim Harvey [Wed, 9 Jul 2025 15:24:08 +0000 (08:24 -0700)] 
phy: phy-imx8mq-usb: Add support for i.MX95 USB3 PHY

Add initial support for i.MX95 USB.30 PHY, which is similar to
the i.MX8MQ and i.MX8MP USB PHY.

The i.MX95 USB3 PHY has a Type-C Assist block (TCA) consisting of two
functional blocks (XBar assist and VBus assist) and is documented
in the i.MX95 RM Chapter 163.3.8 Type-C assist (TCA) block.

Instead of relying on an external MUX for Type-C plug orientation the
XBar can handle the flip internally.

Add initial support for i.MX95 by:
 - allowing the driver to be enabled i.MX95
 - resetting the XBar
 - configuring the TCA in System Configuration mode (which was determined
   to be necessary to enable the PHY in device-mode)

Follow-on support will need to be added to steer the XBar based on
either board design (if only one pair is brought out) or if used with a
Type-C controller.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Tested-by: Alice Guo <alice.guo@nxp.com>
10 months agomtd: nand: Do not dereference before NULL check
Andrew Goodbody [Thu, 31 Jul 2025 16:21:32 +0000 (17:21 +0100)] 
mtd: nand: Do not dereference before NULL check

In nanddev_init mtd and memorg are assigned values that dereference nand
but this happens before a NULL check for nand. Move the assignments
after the NULL check.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
10 months agocmd: mtd: Enable speed benchmarking
Miquel Raynal [Mon, 4 Aug 2025 09:21:37 +0000 (11:21 +0200)] 
cmd: mtd: Enable speed benchmarking

Linux features a flash_speed speed test from the mtd-utils suite, U-Boot
does not. Benchmarks are useful for speed improvement developments as
well as troubleshooting or regression testing sometimes.

Enable a benchmark option to enable this feature.

Example of output on a Nuvoton platform:

MA35D1> mtd read nor0 0x81000000 0 0x10000
Reading 65536 byte(s) at offset 0x00000000
MA35D1> mtd read.benchmark nor0 0x81000000 0 0x10000
Reading 65536 byte(s) at offset 0x00000000
Read speed: 3752kiB/s

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>