]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
2 months agoMerge patch series "dm: core: use {s,u}32 instead of int for dev_read_{s,u}32_default"
Tom Rini [Wed, 11 Jun 2025 19:31:45 +0000 (13:31 -0600)] 
Merge patch series "dm: core: use {s,u}32 instead of int for dev_read_{s,u}32_default"

Quentin Schulz <foss+uboot@0leil.net> says:

Out of all the dev_read_*_default functions, only two do not properly
use the type as argument and return type: dev_read_u32_default and
dev_read_s32_default. They both use int instead of u32/s32.

Considering that it's generally not guaranteed that an int is 4 bytes
but also for consistency sake, let's have them use the expected type.

Note that I have not tested this, just stumbled upon that inconsistency
by chance.

Link: https://lore.kernel.org/r/20250528-dev_read_x32_default-v1-0-6ab1734dd7a2@cherry.de
2 months agodm: core: use s32 instead of int for dev_read_s32_default
Quentin Schulz [Wed, 28 May 2025 13:06:19 +0000 (15:06 +0200)] 
dm: core: use s32 instead of int for dev_read_s32_default

dev_read_s32_default is for getting an s32 from a Device Tree property
and allows to take a default value if that property is missing.

Considering it calls ofnode_read_u32_default which takes a u32 and
returns a u32, it should do the same instead of using an int, especially
considering that int size is typically architecture-specific, as opposed
to s32/u32.

s32 and u32 being the same size, dev_read_s32* functions calling
ofnode_read_u32_default shouldn't be an issue (at the type level at
least) as the information will be stored appropriately in 4B regardless
of the sign.

This incidentally matches all other dev_read_*_default functions.

Fixes: a1b17e4f4c82 ("dm: core: Add a function to read into a unsigned int")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agodm: core: use u32 instead of int for dev_read_u32_default
Quentin Schulz [Wed, 28 May 2025 13:06:18 +0000 (15:06 +0200)] 
dm: core: use u32 instead of int for dev_read_u32_default

dev_read_u32_default is for getting a u32 from a Device Tree property
and allows to take a default value if that property is missing.

Considering it calls ofnode_read_u32_default which takes a u32 and
returns a u32, it should do the same instead of using an int, especially
considering that int size is typically architecture-specific, as opposed
to u32.

This incidentally matches all other dev_read_*_default functions (except
dev_read_s32_default which will be tackled in the next commit).

Fixes: 47a0fd3bad38 ("dm: core: Implement live tree 'read' functions")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agoMerge tag 'u-boot-stm32-20250611' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Wed, 11 Jun 2025 15:47:10 +0000 (09:47 -0600)] 
Merge tag 'u-boot-stm32-20250611' of https://source.denx.de/u-boot/custodians/u-boot-stm into next

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

- Add clock and reset drivers support for STM32MP25
- Add STM32H747-Discovery board support
- Add tamp_nvram driver
- Add SPL support and clock tree init to STM32MP13 RCC driver
- Add STM32MP13xx ram support
- Add support for STM32 Image V2.0 for STM32MP13xx
- Fix SYSRAM size on STM32MP13xx
- Fix DBGMCU macro on STM32MP13xx
- Auto-detect ROM API table on STM32MP15xx

2 months agoboard: stm32: add stm32h747-discovery board support
Dario Binacchi [Sat, 7 Jun 2025 09:37:17 +0000 (11:37 +0200)] 
board: stm32: add stm32h747-discovery board support

The board includes an STM32H747XI SoC with the following resources:
 - 2 Mbytes Flash
 - 1 Mbyte SRAM
 - LCD-TFT controller
 - MIPI-DSI interface
 - FD-CAN
 - USB 2.0 high-speed/full-speed
 - Ethernet MAC
 - camera interface

Detailed information can be found at:
https://www.st.com/en/evaluation-tools/stm32h747i-disco.html

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoARM: dts: stm32: add stm32h747i-disco-u-boot DTS file
Dario Binacchi [Sat, 7 Jun 2025 09:37:16 +0000 (11:37 +0200)] 
ARM: dts: stm32: add stm32h747i-disco-u-boot DTS file

Add stm32h747i-disco-u-boot DTS file with FMC SDRAM node and its
pinmux settings.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoARM: dts: stm32: support STM32h747i-disco board
Dario Binacchi [Sun, 27 Apr 2025 07:43:27 +0000 (09:43 +0200)] 
ARM: dts: stm32: support STM32h747i-disco board

The board includes an STM32H747XI SoC with the following resources:
 - 2 Mbytes Flash
 - 1 Mbyte SRAM
 - LCD-TFT controller
 - MIPI-DSI interface
 - FD-CAN
 - USB 2.0 high-speed/full-speed
 - Ethernet MAC
 - camera interface

Detailed information can be found at:
https://www.st.com/en/evaluation-tools/stm32h747i-disco.html

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20250427074404.3278732-9-dario.binacchi@amarulasolutions.com
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
[ upstream commit: 49ba8fc6eab63165639ffbb9f976222d39739cab ]

(cherry picked from commit 19c508dc3d584dc81c0cc6a05576f436022db5b6)

2 months agoARM: dts: stm32: add an extra pin map for USART1 on stm32h743
Dario Binacchi [Sun, 27 Apr 2025 07:43:26 +0000 (09:43 +0200)] 
ARM: dts: stm32: add an extra pin map for USART1 on stm32h743

Add an additional pin map configuration for using the USART1 controller
on the stm32h743 MCU.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20250427074404.3278732-8-dario.binacchi@amarulasolutions.com
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
[ upstream commit: 8e71dfe46a4a1e9505b1a327470f879b63388968 ]

(cherry picked from commit 9d5ec2c9c5d5131e701447c5c32aaf6c688c6e01)

2 months agoARM: dts: stm32: add pin map for UART8 controller on stm32h743
Dario Binacchi [Sun, 27 Apr 2025 07:43:25 +0000 (09:43 +0200)] 
ARM: dts: stm32: add pin map for UART8 controller on stm32h743

Add a pin map configuration for using the UART8 controller on the
stm32h743 MCU.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20250427074404.3278732-7-dario.binacchi@amarulasolutions.com
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
[ upstream commit: 47d16ab94b8e5e85aedba3cd22cfdf3877bf1dfb ]

(cherry picked from commit 59621a6472cd6eeb748ed6d6202a21d0f3cc5a83)

2 months agoARM: dts: stm32: add uart8 node for stm32h743 MCU
Dario Binacchi [Sun, 27 Apr 2025 07:43:24 +0000 (09:43 +0200)] 
ARM: dts: stm32: add uart8 node for stm32h743 MCU

Add support for UART8 by applying the settings specified in the
reference manual RM0433.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20250427074404.3278732-6-dario.binacchi@amarulasolutions.com
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
[ upstream commit: 07aa43adae2363c3734055aeba0789536fa0f8f2 ]

(cherry picked from commit 8fe35c381c7c6db1b95c80be551afada1e9f28e0)

2 months agodt-bindings: clock: stm32h7: rename USART{7,8}_CK to UART{7,8}_CK
Dario Binacchi [Sun, 27 Apr 2025 07:43:23 +0000 (09:43 +0200)] 
dt-bindings: clock: stm32h7: rename USART{7,8}_CK to UART{7,8}_CK

As stated in the reference manual RM0433, the STM32H743 MCU has
USART1/2/3/6, UART4/5/7/8, and LPUART1. The patches make all the clock
macros for the serial ports consistent with the documentation.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250427074404.3278732-5-dario.binacchi@amarulasolutions.com
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
[ upstream commit: ecab3c40fa49a2073c4c916ebff9496a6b5db7bd ]

(cherry picked from commit aae9a01929183784bf3e2a8001aba408bd0dadf3)

2 months agodt-bindings: arm: stm32: add compatible for stm32h747i-disco board
Dario Binacchi [Sun, 27 Apr 2025 07:43:21 +0000 (09:43 +0200)] 
dt-bindings: arm: stm32: add compatible for stm32h747i-disco board

The board includes an STM32H747XI SoC with the following resources:
 - 2 Mbytes Flash
 - 1 MByte SRAM
 - LCD-TFT controller
 - MIPI-DSI interface
 - FD-CAN
 - USB 2.0 high-speed/full-speed
 - Ethernet MAC
 - camera interface

Detailed information can be found at:
https://www.st.com/en/evaluation-tools/stm32h747i-disco.html

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250427074404.3278732-3-dario.binacchi@amarulasolutions.com
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
[ upstream commit: 815d49f61ea049075482161f897aa13e1ae30cbb ]

(cherry picked from commit 06f64674b332c7db4ac56a4dccb0e960d25bea24)

2 months agoARM: dts: stm32h7-pinctrl: add _a suffix to u[s]art_pins phandles
Dario Binacchi [Sun, 27 Apr 2025 07:43:20 +0000 (09:43 +0200)] 
ARM: dts: stm32h7-pinctrl: add _a suffix to u[s]art_pins phandles

Allow expanding possible configurations for the same peripheral,
consistent with the scheme adopted in Linux.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/r/20250427074404.3278732-2-dario.binacchi@amarulasolutions.com
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
[ upstream commit: 6a36dca4375fce51b627f5a985a79fc8b8bd7f55 ]

(cherry picked from commit 9a72c83f2e670087ae2d6dc54d2926f16c6762d0)

2 months agostm32mp: Add tamp_nvram driver
Simeon Marijon [Mon, 19 May 2025 11:23:54 +0000 (13:23 +0200)] 
stm32mp: Add tamp_nvram driver

TAMP backup registers will be exposed as nvmem cells.

Each registers ([0..127] for STM32MP2, [0..31] for STM32MP1) could be
exposed as nvmem cells under the nvram node in device tree

Signed-off-by: Simeon Marijon <simeon.marijon@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 months agotools: stm32image: Add support for STM32 Image V2.0
Marek Vasut [Mon, 12 May 2025 17:09:47 +0000 (19:09 +0200)] 
tools: stm32image: Add support for STM32 Image V2.0

Add support for generating STM32 Image V2.0, which is used by STM32MP13xx.
The image header layout is similar to STM32MP15xx STM32 Image V1.0, but is
different enough to justify duplicate functions to generate the v2 image.
This code at least attempts to align the V1 and V2 image handling where
possible.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
2 months agoram: stm32mp1: Add STM32MP13xx support
Marek Vasut [Mon, 12 May 2025 17:09:05 +0000 (19:09 +0200)] 
ram: stm32mp1: Add STM32MP13xx support

Add support for configuring DRAM controller on STM32MP13xx SoC.
The DRAM controller is basically identical to the DWC controller
on STM32MP15xx SoC, except the bus width is reduced from 32bit to
16bit and a few registers and bits are therefore not present.

Handle the difference by factoring these parts out. Use IS_ENABLE()
as much as possible to assure code which is not enabled on builds
for a single SoC gets compiled out. Handle the different offset of
RCC_DDRITFCR register and missing DDRC2 clock the same way.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
2 months agoclk: stm32mp13: Add SPL support and clock tree init to STM32MP13 RCC driver
Marek Vasut [Mon, 12 May 2025 17:08:29 +0000 (19:08 +0200)] 
clk: stm32mp13: Add SPL support and clock tree init to STM32MP13 RCC driver

Add SPL support and clock tree init to STM32MP13 RCC driver. This
consists of two parts, make SCMI into an optional dependency and
add clock tree initialization. The SCMI dependency is made optional
first by registering the few core clock provided by SCMI clock as
fixed clock, and second by letting the clock core parse out the
clock configuration from SoC registers. The clock initialization
code is derived from STM32MP15xx clock tree initialization code,
which is almost identical, except for the use of new PLL2000 for
PLL1 on STM32MP13xx .

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
2 months agoclk: stm32mp13: Fix typo in STM32MP13 RCC driver
Marek Vasut [Mon, 12 May 2025 16:51:33 +0000 (18:51 +0200)] 
clk: stm32mp13: Fix typo in STM32MP13 RCC driver

Fix basic typo, missing t in security . No functional change .

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoARM: stm32: Auto-detect ROM API table on STM32MP15xx
Marek Vasut [Mon, 12 May 2025 16:45:14 +0000 (18:45 +0200)] 
ARM: stm32: Auto-detect ROM API table on STM32MP15xx

The ROM API table location is passed to the SPL by BootROM in register r0,
make use of this, store the content of r0 and later use it to access the
ROM API table to determine current boot device.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoARM: stm32: Fix DBGMCU macro on STM32MP13xx
Marek Vasut [Mon, 12 May 2025 16:44:53 +0000 (18:44 +0200)] 
ARM: stm32: Fix DBGMCU macro on STM32MP13xx

The DBGMCU block is available at address 0x50081000 both on STM32MP13xx
and on STM32MP15xx . There is no reason to limit the DBGMCU macro being
set only on STM32MP15xx , remove the ifdeffery.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoARM: stm32: Fix SYSRAM size on STM32MP13xx
Marek Vasut [Mon, 12 May 2025 16:44:04 +0000 (18:44 +0200)] 
ARM: stm32: Fix SYSRAM size on STM32MP13xx

The STM32MP13xx has only 128 kiB of SYSRAM starting at address 0x2ffe0000 .
The STM32MP15xx has 256 kiB of SYSRAM starting at address 0x2ffc0000 . Make
sure both SoCs configure ARMV7_SECURE_BASE correctly . Define the SYSRAM
base in stm32.h to be consistent with the STM32MP15xx macro.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoARM: stm32: Drop unnecessary space
Marek Vasut [Mon, 12 May 2025 16:11:37 +0000 (18:11 +0200)] 
ARM: stm32: Drop unnecessary space

Drop a space after tab, no functional change.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoconfigs: stm32mp25: increase SYS_MALLOC_F_LEN to 0x60000
Patrice Chotard [Tue, 27 May 2025 13:27:55 +0000 (15:27 +0200)] 
configs: stm32mp25: increase SYS_MALLOC_F_LEN to 0x60000

Due activation of SCMI, we need to increase SYS_MALLOC_F_LEN value
to avoid following message:

U-Boot 2025.04-01224-g75b77a2a6d31-dirty (Apr 25 2025 - 11:23:30 +0200)

alloc space exhausted ptr 400040 limit 400000
alloc space exhausted ptr 400020 limit 400000
alloc space exhausted ptr 400060 limit 400000
alloc space exhausted ptr 400060 limit 400000

Set SYS_MALLOC_F_LEN to 0x60000 to fix this issue.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 months agoconfigs: stm32mp13: increase SYS_MALLOC_F_LEN to 0x210000
Patrice Chotard [Mon, 9 Jun 2025 12:53:13 +0000 (14:53 +0200)] 
configs: stm32mp13: increase SYS_MALLOC_F_LEN to 0x210000

Due SCMI update to protocol v2.0, we need to increase
SYS_MALLOC_F_LEN value to avoid following message:
alloc space exhausted ptr 200040 limit 200000

Set SYS_MALLOC_F_LEN to 0x210000 to fix this issue.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoARM: dts: stm32: switch from fixed to scmi clocks for stm32mp257f-ev1
Patrice Chotard [Tue, 27 May 2025 13:27:54 +0000 (15:27 +0200)] 
ARM: dts: stm32: switch from fixed to scmi clocks for stm32mp257f-ev1

SCMI clocks are now available, switch from fixed to SCMI clocks.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 months agoreset: stm32mp25: add stm32mp25 reset driver
Gabriel Fernandez [Tue, 27 May 2025 13:27:53 +0000 (15:27 +0200)] 
reset: stm32mp25: add stm32mp25 reset driver

Implement STM32MP25 reset drivers using stm32-core-reset API.
This reset stm32-reset-core API and will be able to use DT binding
index started from 0.

This patch also moves legacy reset into stm32 directory reset.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoclk: stm32: fix clock counter
Gabriel Fernandez [Tue, 27 May 2025 13:27:52 +0000 (15:27 +0200)] 
clk: stm32: fix clock counter

In RCC the ops of the CCF registered CLK device can be called directly,
this patch avoid recursive call of clk_ function done by CCF clock
framework which update the clock information, for example
clk_enable is called 2 times, clkp->enable_count is increased 2 times.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agophy: stm32-usbphyc: manage properly the clk identifier with CCF
Patrick Delaunay [Tue, 27 May 2025 13:27:51 +0000 (15:27 +0200)] 
phy: stm32-usbphyc: manage properly the clk identifier with CCF

Add private uclass data for "stm32-usbphyc-clk" as it is not done
by the driver model.

This clk struct is needed by CCF to save the unique id used to identify
each clock.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoclk: scmi: manage properly the clk identifier with CCF
Patrick Delaunay [Tue, 27 May 2025 13:27:50 +0000 (15:27 +0200)] 
clk: scmi: manage properly the clk identifier with CCF

Each clock identifier needs to be unique when CCF is activated,
and it is not respected today by SCMI clock driver.

This patch supports a unique clk id by using the uclass API
clk_get_id() / dev_clk_dm() and by activating by default
CONFIG_CLK_AUTO_ID with CCF which adds an offset to the SCMI
clock identifiers.

After this patch, the SCMI clock driver can coexist with other
clock provider without conflict, they can share internal identifier
[0..N] defined in their binding and the clock ID = 0
(reserved for dummy clock) is no more used.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoclk: fixed_rate: configure clock ID with CONFIG_CLK_AUTO_ID
Patrick Delaunay [Tue, 27 May 2025 13:27:49 +0000 (15:27 +0200)] 
clk: fixed_rate: configure clock ID with CONFIG_CLK_AUTO_ID

Update CLK ID to avoid 0 id, used for dummy clock with CCF
and to allow selection by clk_get_by_id, used to
get private data associated to the UCLASS_CLK device

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agosandbox: test: update for CONFIG_CLK_AUTO_ID support
Patrick Delaunay [Tue, 27 May 2025 13:27:48 +0000 (15:27 +0200)] 
sandbox: test: update for CONFIG_CLK_AUTO_ID support

Update the existing test dm_test_clk_ccf() with new CLK_ID macro.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoclk: sandbox: update driver for CONFIG_CLK_AUTO_ID support
Patrick Delaunay [Tue, 27 May 2025 13:27:47 +0000 (15:27 +0200)] 
clk: sandbox: update driver for CONFIG_CLK_AUTO_ID support

Update the sandbox driver to allow support of the
CONFIG_CLK_AUTO_ID by using the new API clk_get_id()
to get the internal SANDBOX identifier.

With CONFIG_CLK_AUTO_ID, clk->id have the also seq identifier.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoclk: add CONFIG_CLK_AUTO_ID
Patrick Delaunay [Tue, 27 May 2025 13:27:46 +0000 (15:27 +0200)] 
clk: add CONFIG_CLK_AUTO_ID

Add a new config CONFIG_CLK_AUTO_ID to support a unique clk id
for all the clock providers, managed by clk uclass, when the clock
reference arg[0] is the same.

When the CONFIG is activated, the clock id is limited to the lower
CLK_ID_SZ = 24 bits in default clock xlate function
and the sequence number + 1 of the clk provider device is
added for the 8 higher bits.

We use sequence number + 1 to avoid the "dummy" clock id = 0,
used for invalid clock when CCF is activated.

When this config is activated, the new function clk_get_id()
should be used to get back the internal reference to clock
for the each clock provider.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoclk: stm32mp25: implement clock check security function
Gabriel Fernandez [Tue, 27 May 2025 13:27:45 +0000 (15:27 +0200)] 
clk: stm32mp25: implement clock check security function

Check clock security to avoid access at boot time.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoclk: stm32mp25: Add clock driver support
Gabriel Fernandez [Tue, 27 May 2025 13:27:44 +0000 (15:27 +0200)] 
clk: stm32mp25: Add clock driver support

Add clock driver support for STM32MP25 SoCs.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoclk: scmi: add compatibility with clock protocol 2.0
Valentin Caron [Tue, 27 May 2025 13:27:43 +0000 (15:27 +0200)] 
clk: scmi: add compatibility with clock protocol 2.0

Since clock protocol 2.0, SCMI specification add an option field
"clock_enable_delay" to CLOCK_ATTRIBUTES command.

scmi_read_resp_from_smt() will return an error ("Buffer too small") as
the message length coming from the SCMI server is not the same as expected.

So implement a condition to SCMI clock protocol version to change the
length of the expected message.

Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 months agoMerge tag 'tpm-next-10062025' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 10 Jun 2025 22:31:30 +0000 (16:31 -0600)] 
Merge tag 'tpm-next-10062025' 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/26601

Updates from Simon cleaning up some tests, with the intention of being used
in sandbox and actual hardware.

2 months agotest: tpm: Skip failing tests on coral
Simon Glass [Sat, 24 May 2025 13:06:37 +0000 (07:06 -0600)] 
test: tpm: Skip failing tests on coral

These tests have been failing for some months. Disable them so that a CI
run can pass on coral. Further work will be needed to see how to make
them pass.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agotpm: Drop unwanted special cases for sandbox
Simon Glass [Sat, 24 May 2025 13:06:36 +0000 (07:06 -0600)] 
tpm: Drop unwanted special cases for sandbox

These don't seem to be needed.

Add a few notes about what to do next. Also mention parallel tests in
at the top of thefile.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agotpm: Convert sandbox-focussed tests to C
Simon Glass [Sat, 24 May 2025 13:06:35 +0000 (07:06 -0600)] 
tpm: Convert sandbox-focussed tests to C

Some of the Python tests are a pain because they don't reset the TPM
state before each test. Driver model tests do this, so convert the
tests to C.

This means that these tests won't run on real hardware, but we have
tests which do TPM init, so there is still enough coverage.

Rename and update the Python tpm_init test to use 'tpm autostart',
since this fully initializes the TPM and performs the self tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agotpm: sandbox: Support self-test continue in emulator
Simon Glass [Sat, 24 May 2025 13:06:34 +0000 (07:06 -0600)] 
tpm: sandbox: Support self-test continue in emulator

Add support for the self-test continue command in the TPM v1.2 emulator,
to match the functionality in the TPM v2 emulator.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoMerge tag 'v2025.07-rc4' into next
Tom Rini [Mon, 9 Jun 2025 22:28:28 +0000 (16:28 -0600)] 
Merge tag 'v2025.07-rc4' into next

Prepare v2025.07-rc4

2 months agoPrepare v2025.07-rc4 v2025.07-rc4
Tom Rini [Mon, 9 Jun 2025 21:54:18 +0000 (15:54 -0600)] 
Prepare v2025.07-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agopylibfdt: correct license information
Heinrich Schuchardt [Sat, 7 Jun 2025 11:32:17 +0000 (13:32 +0200)] 
pylibfdt: correct license information

Setuptools 78.1.1 shows warnings:

* Pattern 'GPL' did not match any files.
* Pattern 'BSD-2-Clause' did not match any files.
* SetuptoolsDeprecationWarning: License classifiers are deprecated.

Cf. https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agoRevert "caam: Fix CAAM error on startup"
Fabio Estevam [Thu, 5 Jun 2025 10:52:44 +0000 (07:52 -0300)] 
Revert "caam: Fix CAAM error on startup"

This reverts commit 159b6f0e119962ce5da645f548cefe9196c8778e.

Since commit 159b6f0e1199 ("caam: Fix CAAM error on startup") the following
regression was reported by Tim Harvey:

"I've found that this patch causes a regression on an imx8mm board
(imx8mm_venice_defconfig) where the first call to caam_rng_read fails
here in jr_dequeue but if you call it again it works. With some
debugging added:
SEC0:  RNG instantiated
...
Hit any key to stop autoboot:  0
u-boot=> rng list
RNG #0 - caam-rng
u-boot=> rng 0 10
caam_rng_read caam-rng len=16
run_descriptor_jr_idx idx=0
Error in SEC deq: -1
caam_rng_read_one run_descriptor_jr failed: -1
caam_rng_read caam-rng caam_rng_read_one failed: -5
Reading RNG failed
u-boot=> rng 0 10
caam_rng_read caam-rng len=16
run_descriptor_jr_idx idx=0
00000000: ad 2e ad c0 2a 12 27 c4 65 82 66 19 be ef f6 07  ....*.'.e.f.....

If I revert your patch caam_rng_read works initially and on subsequent
calls."

" I ran into this when I was testing
lwIP HTTPS as it causes anything that uses dm_rng to fail the first
time (such as HTTPS)."

Revert it for now to avoid the regression.

Reported-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2 months agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 9 Jun 2025 15:24:34 +0000 (09:24 -0600)] 
configs: Resync with savedefconfig

Resync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoMerge patch series "arm: armv7: fix a bug that prevents CONFIG_BLOBLIST and CONFIG_PO...
Tom Rini [Mon, 9 Jun 2025 15:18:26 +0000 (09:18 -0600)] 
Merge patch series "arm: armv7: fix a bug that prevents CONFIG_BLOBLIST and CONFIG_POSITION_INDEPENDENT to be enabled together"

Yang Xiwen <forbidden405@outlook.com> says:

This patchset also enables CONFIG_POSITION_INDEPENDENT for qemu boards
to avoid similar issues to happen again in the future.

Link: https://lore.kernel.org/r/20250531-pie_blob_fix-v1-0-7b4a37987dbc@outlook.com
2 months agoarm: qemu: Add imply CONFIG_POSITION_INDEPENDENT
Yang Xiwen [Sat, 31 May 2025 13:10:03 +0000 (21:10 +0800)] 
arm: qemu: Add imply CONFIG_POSITION_INDEPENDENT

Add 'imply CONFIG_POSITION_INDEPENTDENT' for QEMU arm arch. This allows
qemu arm boards to load u-boot.bin at any address. It is skipped by
default when u-boot is loaded by either --bios or --kernel.

To load u-boot.bin at a different address, one can use u-boot
chain-loading or qemu loader device[1].

[1] https://www.qemu.org/docs/master/system/generic-loader.html

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
2 months agoarm: armv7: restore section to .text after saved_args
Yang Xiwen [Sat, 31 May 2025 13:10:02 +0000 (21:10 +0800)] 
arm: armv7: restore section to .text after saved_args

when CONFIG_BLOBLIST is enabled, the section is switched to .data but is
not switched back to .text. It makes all the code below placed in .data
section, also breaks CONFIG_POSITION_INDEPENDENT.

Fix it by adding `.section .text` to switch the section back to .text.

Fixes: 5103e69344d6 ("arm: armv7: save boot arguments")
Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
2 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into...
Tom Rini [Mon, 9 Jun 2025 14:54:57 +0000 (08:54 -0600)] 
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into next

CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/26569

- SoC: add SPL support for licheepi4a
- RISC-V: raise SPL_SYS_MALLOC_SIZE to 8 MiB

2 months agoMAINTAINERS: riscv: cpu: th1520: Assign myself as maintainer
Yao Zi [Fri, 30 May 2025 10:56:22 +0000 (10:56 +0000)] 
MAINTAINERS: riscv: cpu: th1520: Assign myself as maintainer

Assign myself to develop U-Boot port of T-Head TH1520 SoC, and help
maintain related code and review patches.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agodoc: thead: lpi4a: Update for S-Mode proper U-Boot support
Yao Zi [Fri, 30 May 2025 09:48:51 +0000 (09:48 +0000)] 
doc: thead: lpi4a: Update for S-Mode proper U-Boot support

Proper U-Boot for Lichee Pi 4A now runs in S mode instead of M mode,
which means the extra firmware, OpenSBI, must be built and integrated
in the image, and the vendor U-Boot cannot chainload the result image
anymore as it runs in M mode.

Remove redundant information about chainloading and update build steps
to mention OpenSBI firmware.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoboard: thead: licheepi4a: Run proper U-Boot in S-Mode
Yao Zi [Fri, 30 May 2025 09:48:50 +0000 (09:48 +0000)] 
board: thead: licheepi4a: Run proper U-Boot in S-Mode

RISC-V software usually expects S mode when leaving the firmware, e.g.
UEFI applications could only run in S mode. Let's convert proper U-Boot
of Lichee Pi 4A port to run in S mode.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: th1520: Prepare binman configuration for loading OpenSBI
Yao Zi [Fri, 30 May 2025 09:48:49 +0000 (09:48 +0000)] 
riscv: dts: th1520: Prepare binman configuration for loading OpenSBI

Add an OpenSBI entry to the FIT image. As it expects an FDT to be
passed, corresponding FDT entry is generated with of-list as well.

As SPL now passes a full FDT for following stages, proper U-Boot image
is packed into u-boot-with-spl.bin without a devicetree copy included.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: cpu: th1520: Support cache enabling/disabling in M mode only
Yao Zi [Fri, 30 May 2025 09:48:48 +0000 (09:48 +0000)] 
riscv: cpu: th1520: Support cache enabling/disabling in M mode only

These operations rely on a customized M-mode CSR, MHCR, which isn't
available when running in S mode.

Let's fallback to the generic weak stub when running in S mode to avoid
illegal accesses.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: cpu: th1520: Build spl.c for SPL only
Yao Zi [Fri, 30 May 2025 09:48:47 +0000 (09:48 +0000)] 
riscv: cpu: th1520: Build spl.c for SPL only

Symbols in spl.c only function correctly in SPL stage. Build the file
for SPL only to avoid weak symbols in proper U-Boot being unexpectedly
reloaded.

Fixes: 5fe9ced3552 ("riscv: cpu: Add TH1520 CPU support")
Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoconfigs: raise SPL_SYS_MALLOC_SIZE to 8 MiB on RISC-V
Heinrich Schuchardt [Sun, 25 May 2025 10:42:48 +0000 (12:42 +0200)] 
configs: raise SPL_SYS_MALLOC_SIZE to 8 MiB on RISC-V

On several RISC-V boards we have seen that 1 MiB is a insufficient value
for CONFIG_SPL_SYS_MALLOC_SIZE.

For instance qemu-riscv32_spl_defconfig fails booting because u-boot.itb
exceeds 1 MiB.

8 MiB is a reasonable value that allows adding FPGA blobs or splash images
to main U-boot.

Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoMerge tag 'u-boot-rockchip-20250606' of https://source.denx.de/u-boot/custodians...
Tom Rini [Sun, 8 Jun 2025 15:24:08 +0000 (09:24 -0600)] 
Merge tag 'u-boot-rockchip-20250606' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/26117

- Allow to silent TPL/SPL debug console;
- enable exFAT support for Theobroma boards;
- Fix SD power initialization in SPL for rk3399-nanopi4

2 months agoMerge tag 'doc-2025-07-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 7 Jun 2025 14:18:54 +0000 (08:18 -0600)] 
Merge tag 'doc-2025-07-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request doc-2025-07-rc4

Documentation:

* fix typo in gcc.rst
* correct EFI_TCG2_PROTOCOL_MEASURE_DTB description
* Add missing reference to firmware for BB-AI64
* Tidy up the bootefi-command docs

2 months agodoc: build: fix typo in gcc.rst
BehradElmi [Mon, 2 Jun 2025 17:24:16 +0000 (20:54 +0330)] 
doc: build: fix typo in gcc.rst

Fix a typo error in gcc.rst, changing "out-out-tree" to
"out-of-tree" in the Out-of-tree section.

Signed-off-by: BehradElmi <behradelmi1@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agodoc: efi_loader: Tidy up the bootefi-command docs
Simon Glass [Sun, 1 Jun 2025 12:04:01 +0000 (06:04 -0600)] 
doc: efi_loader: Tidy up the bootefi-command docs

There are backslashes in some of the tags which seems to be unnecessary.
Remove then.

Change the word 'either' to 'any' since there are three options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 months agodoc: board: ti: Add missing firmware for BB-AI64
Peter Robinson [Sun, 25 May 2025 12:10:58 +0000 (13:10 +0100)] 
doc: board: ti: Add missing firmware for BB-AI64

The details of the sysfw.itb from the R5 build that
also needs to be copied as part of the target images
is missing, but is included in the image formats a
little further down, so add it to the instructions.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
2 months agoefi_loader: correct EFI_TCG2_PROTOCOL_MEASURE_DTB description
Heinrich Schuchardt [Sun, 18 May 2025 06:43:44 +0000 (08:43 +0200)] 
efi_loader: correct EFI_TCG2_PROTOCOL_MEASURE_DTB description

%s/data that change/data that changes/
%s/cannot be used has/cannot be used for/
%s/Otherwise/Otherwise,/
%s/allows better measurement/allows for better measurement/

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoMerge patch series "Remove as much arch/arm/dts/*.h as possible"
Tom Rini [Fri, 6 Jun 2025 16:51:52 +0000 (10:51 -0600)] 
Merge patch series "Remove as much arch/arm/dts/*.h as possible"

Tom Rini <trini@konsulko.com> says:

Taking inspiration from Heiko's patch[1] this series goes and cleans up
all of the arch/arm/dts/*.h files that can be easily removed. The big
challenge I ran in to here was that for some platforms that aren't using
OF_UPSTREAM were didn't have a sufficiently deep search path to find
files there rather than arch/arm/dts. This also showed that only ARM had
local header files to deal with.

[1]: https://lore.kernel.org/u-boot/20250528090536.765499-1-heiko.thiery@gmail.com/

Link: https://lore.kernel.org/r/20250528233050.3820722-1-trini@konsulko.com
2 months agonxp: Remove local arch/arm/dts/imx8mm-pinfunc.h
Tom Rini [Wed, 28 May 2025 23:27:10 +0000 (17:27 -0600)] 
nxp: Remove local arch/arm/dts/imx8mm-pinfunc.h

We have this file in both arch/arm/dts and
dts/upstream/src/arm64/freescale. This file is identical save for
changes which have been made upstream.  Remove our local copy to get in
sync with upstream now.

Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoatmel: Remove local arch/arm/dts/{sama5d2, sama7g5}-pinfunc.h
Tom Rini [Wed, 28 May 2025 23:27:09 +0000 (17:27 -0600)] 
atmel: Remove local arch/arm/dts/{sama5d2, sama7g5}-pinfunc.h

We have these files in both arch/arm/dts and
dts/upstream/src/arm/microchip. These files are identical save for
changes which have been made upstream.  Remove our local copy to get in
sync with upstream now.

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoarch/arm/dts: Remove strict subset header
Tom Rini [Wed, 28 May 2025 23:27:08 +0000 (17:27 -0600)] 
arch/arm/dts: Remove strict subset header

As part of moving to using OF_UPSTREAM and so the upstream DT related
header files we have a header that is under the arch/arm/dts directory
and differ in being a strict subset of what is found upstream. We can
remove this now to prevent future conflicts.

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoarch/arm/dts: Remove functionally identical headers
Tom Rini [Wed, 28 May 2025 23:27:07 +0000 (17:27 -0600)] 
arch/arm/dts: Remove functionally identical headers

As part of moving to using OF_UPSTREAM and so the upstream DT related
header files we have a number of these headers that are under the
arch/arm/dts directory and differ only in combinations of spacing
changes and/or switching to SPDX license tags. We can remove these now
to prevent future conflicts.

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoarch/arm/dts: Remove identical headers
Tom Rini [Wed, 28 May 2025 23:27:06 +0000 (17:27 -0600)] 
arch/arm/dts: Remove identical headers

As part of moving to using OF_UPSTREAM and so the upstream DT related
header files we have a number of these headers that are under the
arch/arm/dts directory and are currently identical to the versions in
dts/upstream.  We can remove these now to prevent future conflicts.

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoarch/arm/dts: Remove unused header
Tom Rini [Wed, 28 May 2025 23:27:05 +0000 (17:27 -0600)] 
arch/arm/dts: Remove unused header

As part of moving to using OF_UPSTREAM and so the upstream DT related
header files we have a header that is under the arch/arm/dts directory
and now unused. We can remove this now to prevent any future conflicts.

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoscripts/Makefile.lib: Rework upstream_dtsi_include to get subdirectories
Tom Rini [Wed, 28 May 2025 23:27:04 +0000 (17:27 -0600)] 
scripts/Makefile.lib: Rework upstream_dtsi_include to get subdirectories

A problem with the logic in upstream_dtsi_include currently is that it
does not list directories such as dts/upstream/src/arm/nxp/imx and so
will not findi "imx6ul-pinfunc.h" for example as it is normally and
correctly included without vendor sub-paths. Expand the current wildcard
glob to catch these directories too.

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoinclude/dt-bindings: Remove headers we can safely upgrade
Tom Rini [Wed, 28 May 2025 20:37:45 +0000 (14:37 -0600)] 
include/dt-bindings: Remove headers we can safely upgrade

As part of moving to using OF_UPSTREAM and so the upstream dt-bindings
headers we have a number of these headers that are in our include
directory and while they are not a strict subset of the upstream version
of the headers, all platforms build with the new headers as well. We can
remove the copies under include/dt-bindings now to prevent future
conflicts.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoinclude/dt-bindings/reset: Remove local version of bcm6318-reset.h
Tom Rini [Wed, 28 May 2025 00:03:01 +0000 (18:03 -0600)] 
include/dt-bindings/reset: Remove local version of bcm6318-reset.h

Aside from SPDX tags, the only difference between our version of this
header and upstream is that BCM6318_RST_HOSTMIPS was defined to 11 (the
same as BCM6318_RST_PHYMIPS) and is now defined to 12.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoinclude/dt-bindings: Remove strict subset headers
Tom Rini [Tue, 27 May 2025 23:50:38 +0000 (17:50 -0600)] 
include/dt-bindings: Remove strict subset headers

As part of moving to using OF_UPSTREAM and so the upstream dt-bindings
headers we have a number of these headers that are in our include
directory and differ in being a strict subset of what is found upstream.
We can safely remove the copies under include/dt-bindings now to prevent
future conflicts.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoinclude/dt-bindings: Remove functionally identical headers
Tom Rini [Tue, 27 May 2025 23:50:37 +0000 (17:50 -0600)] 
include/dt-bindings: Remove functionally identical headers

As part of moving to using OF_UPSTREAM and so the upstream dt-bindings
headers we have a number of these headers that are in our include
directory and differ only in combinations of spacing changes and/or
switching to SPDX license tags. We can safely remove the copies under
include/dt-bindings now to prevent future conflicts.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoinclude/dt-bindings: Remove identical headers
Tom Rini [Tue, 27 May 2025 22:18:34 +0000 (16:18 -0600)] 
include/dt-bindings: Remove identical headers

As part of moving to using OF_UPSTREAM and so the upstream dt-bindings
headers we have a number of these headers that are in our include
directory and are currently identical to the versions in dts/upstream.
We can remove these now to prevent future conflicts.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoinclude/dt-bindings: Remove unused headers
Tom Rini [Tue, 27 May 2025 22:18:33 +0000 (16:18 -0600)] 
include/dt-bindings: Remove unused headers

As part of moving to using OF_UPSTREAM and so the upstream dt-bindings
headers we have a number of these headers that are in our include
directory and not referenced by any code outside of dts/upstream. We can
remove these now to prevent future conflicts.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agopower: rk8xx: fix swapped mask and value in init registers for RK806
Quentin Schulz [Wed, 28 May 2025 12:07:27 +0000 (14:07 +0200)] 
power: rk8xx: fix swapped mask and value in init registers for RK806

The val (the bits to set) is the second member of the reg_data structure
and mask the third one. We obviously want to clear bits 6 and 7 in order
to only set bit 7 in there instead of only clearing bit 7 in order to
write bits 6 and 7 (which makes no sense).

Fortunately, according to the datasheet, bit 6 value doesn't matter when
bit 7 is set so this is essentially just a cosmetic change, no intended
change in behavior.

Fixes: f172575d92cd ("power: rk8xx: add support for RK806")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agorockchip: rk3399-nanopi-4: Enable IO-domain driver in SPL
Justin Klaassen [Fri, 23 May 2025 16:53:41 +0000 (16:53 +0000)] 
rockchip: rk3399-nanopi-4: Enable IO-domain driver in SPL

The NanoPi RK3399 boards support UHS-I (up to SDR104) SD cards, however
using any of these 1.8v modes results in a boot failure in SPL upon soft
reboot.

The issue is that the "vcc_sdio" regulator is left at 1.8v on reboot
and the corresponding GPIO defaults to 3.3v. This prevents the SD card
from being reinitialized and read successfully.

This change enables the RK8XX regulators and Rockchip IO-domain drivers
in SPL, which initializes "vcc_sdio" regulator to 3.0v and configures
the GPIO for the correct level on boot.

Signed-off-by: Justin Klaassen <justin@tidylabs.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agorockchip: rk3399-nanopi-4: Allow MMC driver to control SD regulators
Justin Klaassen [Fri, 23 May 2025 16:53:40 +0000 (16:53 +0000)] 
rockchip: rk3399-nanopi-4: Allow MMC driver to control SD regulators

This change removes the "regulator-always-on" property from the
"vcc3v0_sd" (vmmc-supply) and "vcc_sdio" (vqmmc-supply) regulators,
which otherwise prevents the MMC driver from being able to power cycle
the SD card as part of the initialization procedure.

It also removes the "regulator-boot-on" from the "vcc_sdio" regulator,
which could theoretically damage a SD card that is already initialized
in a low voltage mode.

Signed-off-by: Justin Klaassen <justin@tidylabs.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agoregulator: rk8xx: Add CONFIG_SPL_REGULATOR_RK8XX
Justin Klaassen [Fri, 23 May 2025 16:53:39 +0000 (16:53 +0000)] 
regulator: rk8xx: Add CONFIG_SPL_REGULATOR_RK8XX

Allows use of the regulator functions of the RK8XX PMIC in SPL, which is
necessary to support the functionality of the Rockchip IO-domain driver
on relevant platforms.

Signed-off-by: Justin Klaassen <justin@tidylabs.net>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agorockchip: io-domain: Add CONFIG_SPL_ROCKCHIP_IODOMAIN
Justin Klaassen [Fri, 23 May 2025 16:53:38 +0000 (16:53 +0000)] 
rockchip: io-domain: Add CONFIG_SPL_ROCKCHIP_IODOMAIN

Allows use of the Rockchip IO-domain driver in SPL to configure
the GPIO to match the voltage supplied by specific regulators
(e.g. "vcc_sdio").

Signed-off-by: Justin Klaassen <justin@tidylabs.net>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agorockchip: io-domain: Add debug logging for regulators during probe
Justin Klaassen [Fri, 23 May 2025 16:53:37 +0000 (16:53 +0000)] 
rockchip: io-domain: Add debug logging for regulators during probe

Log the value of the regulators during initialization of the IO-domain
driver to aid in debugging GPIO voltage configuration problems.

Signed-off-by: Justin Klaassen <justin@tidylabs.net>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agoconfigs: puma-rk3399: enable exFAT support
Quentin Schulz [Wed, 14 May 2025 16:18:16 +0000 (18:18 +0200)] 
configs: puma-rk3399: enable exFAT support

Our upcoming Mass Flasher solution will be storing boot artifacts on an
exFAT partition so enable its support.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agoconfigs: tiger-rk3588: enable exFAT support
Quentin Schulz [Wed, 14 May 2025 16:18:15 +0000 (18:18 +0200)] 
configs: tiger-rk3588: enable exFAT support

Our upcoming Mass Flasher solution will be storing boot artifacts on an
exFAT partition so enable its support.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agoconfigs: jaguar-rk3588: enable exFAT support
Quentin Schulz [Wed, 14 May 2025 16:18:14 +0000 (18:18 +0200)] 
configs: jaguar-rk3588: enable exFAT support

Our upcoming Mass Flasher solution will be storing boot artifacts on an
exFAT partition so enable its support.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agoconfigs: ringneck-px30: enable exFAT support
Quentin Schulz [Wed, 14 May 2025 16:18:13 +0000 (18:18 +0200)] 
configs: ringneck-px30: enable exFAT support

Our upcoming Mass Flasher solution will be storing boot artifacts on an
exFAT partition so enable its support.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agorockchip: px30: Fix hard dependency to DEBUG_UART_BOARD_INIT
Lukasz Czechowski [Tue, 20 May 2025 11:36:44 +0000 (13:36 +0200)] 
rockchip: px30: Fix hard dependency to DEBUG_UART_BOARD_INIT

Because DEBUG_UART_BOARD_INIT depends on DEBUG_UART, hard dependency
to DEBUG_UART_BOARD_INIT in ROCKCHIP_PX30 can cause warnings if
DEBUG_UART is disabled.
The DEBUG_UART_BOARD_INIT is already implied by ARCH_ROCKCHIP entry.
Remove hard dependency from ROCKCHIP_PX30, so that it will be
consistent with other rockchip boards.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agorockchip: px30: Weaken dependency TPL/SPL serial
Lukasz Czechowski [Tue, 20 May 2025 11:36:43 +0000 (13:36 +0200)] 
rockchip: px30: Weaken dependency TPL/SPL serial

Allow to disable serial console in TPL and SPL. Weak dependency
to SPL_SERIAL and TPL_SERIAL is also used in other Rockchip boards.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agodebug_uart: Replace debug functions with dummies if CONFIG_DEBUG_UART is not set
Lukasz Czechowski [Tue, 20 May 2025 11:36:42 +0000 (13:36 +0200)] 
debug_uart: Replace debug functions with dummies if CONFIG_DEBUG_UART is not set

In case DEBUG UART is not used, define dummy macros replacing
the actual function implementations that will not be available.
This allows to compile code and avoid linker errors.
Redefine the DEBUG_UART_FUNCS macro if DEBUG UART is not available,
to avoid compilation errors.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agoram: rockchip: Fix dependency of RAM_ROCKCHIP_DEBUG
Lukasz Czechowski [Tue, 20 May 2025 11:36:41 +0000 (13:36 +0200)] 
ram: rockchip: Fix dependency of RAM_ROCKCHIP_DEBUG

The RAM_ROCKCHIP_DEBUG can be used only if DEBUG_UART is
available.
The next commit introduces changes in definition of debug
uart functions, so that DEBUG_UART is required to be defined
in order to initialize uart and use print functions.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2 months agoefi: stub: Change _debug_uart_putc function to inline
Lukasz Czechowski [Tue, 20 May 2025 11:36:40 +0000 (13:36 +0200)] 
efi: stub: Change _debug_uart_putc function to inline

Update definition of _debug_uart_putc to static inline.
This will allow to avoid compilation warnings about unused code
after introduction of patch changing debug uart functions to
dummies if CONFIG_DEBUG_UART is not set.
This also matches the instructions in include/debug_uart.h and
provides consistency with implementations for other platforms.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agoarm: uniphier: Change _debug_uart_putc function to inline
Lukasz Czechowski [Tue, 20 May 2025 11:36:39 +0000 (13:36 +0200)] 
arm: uniphier: Change _debug_uart_putc function to inline

Update the definition of _debug_uart_putc to static inline.
This matches the instructions in include/debug_uart.h and
provides consistency with implementations for other platforms.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 months agoarm: dts: remove k3-serdes.h
Heiko Thiery [Wed, 28 May 2025 09:05:37 +0000 (11:05 +0200)] 
arm: dts: remove k3-serdes.h

This file is a duplicate and also comes with the sync of the linux
mainline dts files. By removing this the one from the dts folder should
be taken that is more up-to-date.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2 months agoarmv8: fix Clang warning on writing 32-bit variable to a 64-bit register
Raymond Mao [Tue, 27 May 2025 21:04:31 +0000 (14:04 -0700)] 
armv8: fix Clang warning on writing 32-bit variable to a 64-bit register

Clang is stricter than GCC when it comes to inline assembly and expects the
register to be written with explicitly same type of variable.

Fixes: c0e1775a867c ("armv8: Add arch-specific sysinfo platform driver")
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoscripts/setlocalversion: sync with linux v6.15
Tom Rini [Mon, 26 May 2025 13:35:10 +0000 (07:35 -0600)] 
scripts/setlocalversion: sync with linux v6.15

The changes upstream since the last sync at commit 5c02350fa03d
("scripts/setlocalversion: sync with linux v6.9") are

e2ff1219a554 setlocalversion: add -e option
523f3dbc187a setlocalversion: work around "git describe" performance

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agocmd: bootmenu: permit to select bootmenu entry with a shortcut
Christian Marangi [Sun, 25 May 2025 13:43:58 +0000 (15:43 +0200)] 
cmd: bootmenu: permit to select bootmenu entry with a shortcut

Permit to select a bootmenu entry with a key shortcut. This is
especially useful in production or testing scenario to automate flashing
procedure or testing procedure.

The boot entry are changed to append the shortcut key to it.

Example:
      1. Run default boot command.
      2. Boot system via TFTP.
      3. Boot production system from NAND.
      4. Boot recovery system from NAND.
      5. Load production system via TFTP then write to NAND.
      6. Load recovery system via TFTP then write to NAND.
      7. Load BL31+U-Boot FIP via TFTP then write to NAND.
      8. Load BL2 preloader via TFTP then write to NAND.
      9. Reboot.
      a. Reset all settings to factory defaults.
      0. Exit

0 is always reserved for Exit to console.
On pressing the keyboard key 2, the bootmenu entry 2 is selected and
executed.

Up to 34 key shortcut (0 excluded as reserved) are supported from 1-9
and a-z.
If a shortcut key not present in the bootmenu list is pressed, it is
simply ignored and eventually the autoboot is interrupted.

Capital A-Z are converted to lower a-z and the related option is
selected.

Suggested-by: Weijie Gao <weijie.gao@mediatek.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Petr Štetiar <ynezz@true.cz>
2 months agoMerge patch series "Add baudrate accuracy compensation for MediaTek UART driver"
Tom Rini [Thu, 5 Jun 2025 20:31:02 +0000 (14:31 -0600)] 
Merge patch series "Add baudrate accuracy compensation for MediaTek UART driver"

Weijie Gao <weijie.gao@mediatek.com> says:

This patch series adds baudrate accuracy compensation for MediaTek UART
driver in high-speed mode 3.

Link: https://lore.kernel.org/r/cover.1747991898.git.weijie.gao@mediatek.com
2 months agoserial: mediatek: enable baudrate accuracy compensation
Weijie Gao [Fri, 23 May 2025 09:26:02 +0000 (17:26 +0800)] 
serial: mediatek: enable baudrate accuracy compensation

The high-speed UART from MediaTek supports baudrate accuracy
compensation when using high-speed mode 3.

This is done by calculating the first digit of the fraction part of
sample count value. The fraction value will be then used as the
reference to insert 0 to 10 sample cycle(s) to one frame (assume
that frame format is 8n1, i.e. 10 bits per frame).

The fracdiv_[l/m] registers are used to determine whether a bit in one frame
should be inserted with one sample cycle.

With typical 40MHz source clock, the actual baudrates with/without
accuracy compensation are:

Ideal    w/o compensation w/ compensation
======== ================ ===============
9600     9603             9600
115200   114942           115207
921600   930232           921659
3000000  3076923          3007519

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 months agoserial: mediatek: fix register names and offsets
Weijie Gao [Fri, 23 May 2025 09:25:55 +0000 (17:25 +0800)] 
serial: mediatek: fix register names and offsets

Fix UART register names and offsets according to the programming
guide to allow implementing some enhanced features.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>