All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/6] Add support for the STM32MP257F-EV1 board
@ 2026-10-22 15:13 Dario Binacchi
  2026-10-22 15:13 ` [Buildroot] [PATCH 1/6] package/uboot-tools: add host mkfwumdata support Dario Binacchi
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Dario Binacchi @ 2026-10-22 15:13 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, Dick Olsson, Sergey Matyukevich, Thomas Petazzoni,
	linux-amarula

This series adds a defconfig for the STMicroelectronics STM32MP257F
Evaluation board (EV1), built from upstream TF-A, U-Boot and Linux, with
TF-A configured for the FWU (Firmware Update) multi bank support, as in
the official STMicroelectronics Yocto layers.

Unfortunately, it was not possible to use upstream OP-TEE OS as well,
because it does not support yet, on STM32MP25, the STPMIC2 PMIC and the
SCMI voltage domains, which the mainline Linux device tree requires for
the microSD card supplies [1]. Until this is resolved, the
STMicroelectronics downstream version has to be used.

Patches 1-5 add what the defconfig needs:

- the mkfwumdata host tool, to generate the FWU metadata, and the
  fwumdata target tool, to inspect and modify it from Linux (1-2);
- the STM32MP2 DDR PHY firmware, required by upstream TF-A, and a fix
  for the TF-A build of host tools (3-5).

[1] https://github.com/OP-TEE/optee_os/issues/8027

Dario Binacchi (6):
  package/uboot-tools: add host mkfwumdata support
  package/uboot-tools: add fwumdata target tool
  boot/arm-trusted-firmware: pass HOSTLD
  boot/stm32-ddr-phy-binary: new package
  boot/arm-trusted-firmware: add stm32-ddr-phy-binary support
  configs/stm32mp257f_ev1_defconfig: new defconfig

 DEVELOPERS                                    |  3 +
 .../stm32mp257f-ev1/genimage.cfg              | 52 ++++++++++++++
 .../overlay/boot/extlinux/extlinux.conf       |  4 ++
 .../overlay/etc/fwumdata.config               |  4 ++
 .../arm-trusted-firmware.hash                 |  2 +
 ...-arm-smc-id-of-the-SMC-watchdog-on-s.patch | 53 ++++++++++++++
 .../stm32mp257f-ev1/patches/linux/linux.hash  |  2 +
 ...2mp25-rename-the-PCIe-bus-SCMI-clock.patch | 44 ++++++++++++
 .../patches/optee-os/optee-os.hash            |  2 +
 .../stm32mp257f-ev1/patches/uboot/uboot.hash  |  2 +
 .../stm32mp257f-ev1/post-image.sh             | 18 +++++
 .../stm32mp257f-ev1/readme.txt                | 72 +++++++++++++++++++
 boot/Config.in                                |  1 +
 .../arm-trusted-firmware.mk                   |  8 ++-
 boot/stm32-ddr-phy-binary/Config.in           |  9 +++
 .../stm32-ddr-phy-binary.hash                 |  3 +
 .../stm32-ddr-phy-binary.mk                   | 13 ++++
 configs/stm32mp257f_ev1_defconfig             | 66 +++++++++++++++++
 package/uboot-tools/Config.in                 | 14 ++++
 package/uboot-tools/Config.in.host            | 10 +++
 package/uboot-tools/uboot-tools.mk            | 20 ++++++
 21 files changed, 401 insertions(+), 1 deletion(-)
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/overlay/boot/extlinux/extlinux.conf
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/overlay/etc/fwumdata.config
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/arm-trusted-firmware/arm-trusted-firmware.hash
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/linux/0001-arm64-dts-st-fix-arm-smc-id-of-the-SMC-watchdog-on-s.patch
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/linux/linux.hash
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/0001-dts-stm32mp25-rename-the-PCIe-bus-SCMI-clock.patch
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/optee-os.hash
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/uboot/uboot.hash
 create mode 100755 board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/readme.txt
 create mode 100644 boot/stm32-ddr-phy-binary/Config.in
 create mode 100644 boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.hash
 create mode 100644 boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.mk
 create mode 100644 configs/stm32mp257f_ev1_defconfig

-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH 1/6] package/uboot-tools: add host mkfwumdata support
  2026-10-22 15:13 [Buildroot] [PATCH 0/6] Add support for the STM32MP257F-EV1 board Dario Binacchi
@ 2026-10-22 15:13 ` Dario Binacchi
  2026-10-23  9:18   ` Kory Maincent via buildroot
  2026-10-22 15:13 ` [Buildroot] [PATCH 2/6] package/uboot-tools: add fwumdata target tool Dario Binacchi
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Dario Binacchi @ 2026-10-22 15:13 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, Dick Olsson, Sergey Matyukevich, Thomas Petazzoni,
	linux-amarula

Add an option to build and install the mkfwumdata tool on the host.

mkfwumdata generates the raw image of the FWU (Firmware Update)
metadata, which is needed for the initial installation of the FWU
multi bank update on the board.

The tool is linked against libuuid, hence the dependency on
host-util-linux. To avoid adding this dependency to all the users of
host-uboot-tools, the tool is built only when explicitly selected.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 package/uboot-tools/Config.in.host | 10 ++++++++++
 package/uboot-tools/uboot-tools.mk |  9 +++++++++
 2 files changed, 19 insertions(+)

diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
index 622070405db7..e7251ca8bd54 100644
--- a/package/uboot-tools/Config.in.host
+++ b/package/uboot-tools/Config.in.host
@@ -39,6 +39,16 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 
 endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
 
+config BR2_PACKAGE_HOST_UBOOT_TOOLS_MKFWUMDATA
+	bool "mkfwumdata"
+	help
+	  Install the mkfwumdata tool on the host system
+
+	  The mkfwumdata tool from Das U-Boot bootloader, which allows
+	  generation of the raw image of the FWU (Firmware Update)
+	  metadata, for initial installation of the FWU multi bank
+	  update on the board.
+
 config BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE
 	bool "Environment image"
 	help
diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index 87b708ac5c8b..7c6ee0f3c467 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -157,6 +157,14 @@ define HOST_UBOOT_TOOLS_INSTALL_FIT_CHECK_SIGN
 endef
 endif
 
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_MKFWUMDATA),y)
+HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_TOOLS_MKFWUMDATA=y
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-util-linux
+define HOST_UBOOT_TOOLS_INSTALL_MKFWUMDATA
+	$(INSTALL) -m 0755 -D $(@D)/tools/mkfwumdata $(HOST_DIR)/bin/mkfwumdata
+endef
+endif
+
 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE),y)
 
 UBOOT_TOOLS_GENERATE_ENV_FILE = $(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE))
@@ -241,6 +249,7 @@ define HOST_UBOOT_TOOLS_INSTALL_CMDS
 	$(INSTALL) -m 0755 -D $(@D)/tools/mkenvimage $(HOST_DIR)/bin/mkenvimage
 	$(INSTALL) -m 0755 -D $(@D)/tools/dumpimage $(HOST_DIR)/bin/dumpimage
 	$(HOST_UBOOT_TOOLS_INSTALL_FIT_CHECK_SIGN)
+	$(HOST_UBOOT_TOOLS_INSTALL_MKFWUMDATA)
 	$(INSTALL) -m 0755 -D $(@D)/tools/env/fw_printenv $(HOST_DIR)/bin/fw_printenv
 	ln -sf fw_printenv $(HOST_DIR)/bin/fw_setenv
 	$(HOST_UBOOT_TOOLS_INSTALL_ENVIMAGE)
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH 2/6] package/uboot-tools: add fwumdata target tool
  2026-10-22 15:13 [Buildroot] [PATCH 0/6] Add support for the STM32MP257F-EV1 board Dario Binacchi
  2026-10-22 15:13 ` [Buildroot] [PATCH 1/6] package/uboot-tools: add host mkfwumdata support Dario Binacchi
@ 2026-10-22 15:13 ` Dario Binacchi
  2026-10-23  9:18   ` Kory Maincent via buildroot
  2026-10-22 15:13 ` [Buildroot] [PATCH 3/6] boot/arm-trusted-firmware: pass HOSTLD Dario Binacchi
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Dario Binacchi @ 2026-10-22 15:13 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, Dick Olsson, Sergey Matyukevich, Thomas Petazzoni,
	linux-amarula

Add an option to build and install the fwumdata tool on the target.

fwumdata allows to read, display and modify the FWU (Firmware Update)
metadata from Linux userspace, similarly to what fw_printenv/fw_setenv
do for the U-Boot environment. It can be used to change the
active/previous bank indices, the bank states or the image acceptance
flags, e.g. by an update agent after writing a new firmware bank.

The location of the metadata is read from /etc/fwumdata.config, which
is platform specific and is therefore not installed by the package: it
has to be provided, for example, by a rootfs overlay.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 package/uboot-tools/Config.in      | 14 ++++++++++++++
 package/uboot-tools/uboot-tools.mk | 11 +++++++++++
 2 files changed, 25 insertions(+)

diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
index b7fd6ff17da2..ac785261c523 100644
--- a/package/uboot-tools/Config.in
+++ b/package/uboot-tools/Config.in
@@ -104,6 +104,20 @@ config BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
 	  bootloader, which allows access to the U-Boot environment
 	  from Linux.
 
+config BR2_PACKAGE_UBOOT_TOOLS_FWUMDATA
+	bool "fwumdata"
+	help
+	  Install the fwumdata tool on the target system
+
+	  The fwumdata tool from Das U-Boot bootloader, which allows
+	  to read, display and modify the FWU (Firmware Update)
+	  metadata from Linux (e.g. change the active/previous bank
+	  indices, the bank states or the image acceptance flags).
+
+	  The location of the metadata is described by the
+	  /etc/fwumdata.config file, which must be provided (e.g. by a
+	  rootfs overlay).
+
 config BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE
 	bool "dumpimage"
 	help
diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index 7c6ee0f3c467..5849e07a990d 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -63,6 +63,10 @@ UBOOT_TOOLS_MAKE_OPTS += CONFIG_TOOLS_MKEFICAPSULE=y
 UBOOT_TOOLS_DEPENDENCIES += gnutls
 endif
 
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FWUMDATA),y)
+UBOOT_TOOLS_MAKE_OPTS += CONFIG_TOOLS_FWUMDATA=y
+endif
+
 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_CHECK_SIGN),y)
 define UBOOT_TOOLS_INSTALL_FIT_CHECK_SIGN
 	$(INSTALL) -m 0755 -D $(@D)/tools/fit_check_sign $(TARGET_DIR)/usr/bin/fit_check_sign
@@ -101,6 +105,12 @@ define UBOOT_TOOLS_INSTALL_FWPRINTENV
 endef
 endif
 
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FWUMDATA),y)
+define UBOOT_TOOLS_INSTALL_FWUMDATA
+	$(INSTALL) -m 0755 -D $(@D)/tools/fwumdata $(TARGET_DIR)/usr/sbin/fwumdata
+endef
+endif
+
 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE),y)
 define UBOOT_TOOLS_INSTALL_DUMPIMAGE
 	$(INSTALL) -m 0755 -D $(@D)/tools/dumpimage $(TARGET_DIR)/usr/sbin/dumpimage
@@ -117,6 +127,7 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
 	$(UBOOT_TOOLS_INSTALL_MKEFICAPSULE)
 	$(UBOOT_TOOLS_INSTALL_MKENVIMAGE)
 	$(UBOOT_TOOLS_INSTALL_FWPRINTENV)
+	$(UBOOT_TOOLS_INSTALL_FWUMDATA)
 	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
 	$(UBOOT_TOOLS_INSTALL_FIT_CHECK_SIGN)
 endef
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH 3/6] boot/arm-trusted-firmware: pass HOSTLD
  2026-10-22 15:13 [Buildroot] [PATCH 0/6] Add support for the STM32MP257F-EV1 board Dario Binacchi
  2026-10-22 15:13 ` [Buildroot] [PATCH 1/6] package/uboot-tools: add host mkfwumdata support Dario Binacchi
  2026-10-22 15:13 ` [Buildroot] [PATCH 2/6] package/uboot-tools: add fwumdata target tool Dario Binacchi
@ 2026-10-22 15:13 ` Dario Binacchi
  2026-10-23  9:20   ` Kory Maincent via buildroot
  2026-10-22 15:13 ` [Buildroot] [PATCH 4/6] boot/stm32-ddr-phy-binary: new package Dario Binacchi
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Dario Binacchi @ 2026-10-22 15:13 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, Dick Olsson, Sergey Matyukevich, Thomas Petazzoni,
	linux-amarula

Starting from v2.13, TF-A selects the host linker from the HOSTLD
variable, which Buildroot exports as the plain host ld. The host tools
are then linked without the C library, and the build fails, e.g. for
the stm32mp2 stm32image tool:

  /usr/bin/ld: stm32image.c:(.text.startup+0x999): undefined reference to `__stack_chk_fail'

Pass the host C compiler as HOSTLD, as already done for HOSTCC.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 798efd5a15ad..ebaaaeb38c4b 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -67,7 +67,8 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
 	$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES)) \
 	PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM) \
 	TARGET_BOARD=$(ARM_TRUSTED_FIRMWARE_TARGET_BOARD) \
-	HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)"
+	HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)" \
+	HOSTLD="$(HOSTCC) $(HOST_LDFLAGS)"
 
 ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP),y)
 ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH 4/6] boot/stm32-ddr-phy-binary: new package
  2026-10-22 15:13 [Buildroot] [PATCH 0/6] Add support for the STM32MP257F-EV1 board Dario Binacchi
                   ` (2 preceding siblings ...)
  2026-10-22 15:13 ` [Buildroot] [PATCH 3/6] boot/arm-trusted-firmware: pass HOSTLD Dario Binacchi
@ 2026-10-22 15:13 ` Dario Binacchi
  2026-10-23  9:35   ` Kory Maincent via buildroot
  2026-10-22 15:13 ` [Buildroot] [PATCH 5/6] boot/arm-trusted-firmware: add stm32-ddr-phy-binary support Dario Binacchi
  2026-10-22 15:13 ` [Buildroot] [PATCH 6/6] configs/stm32mp257f_ev1_defconfig: new defconfig Dario Binacchi
  5 siblings, 1 reply; 14+ messages in thread
From: Dario Binacchi @ 2026-10-22 15:13 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, Dick Olsson, Sergey Matyukevich, Thomas Petazzoni,
	linux-amarula

The DDR PHY firmware binaries of the STMicroelectronics STM32MP2 SoCs
are not part of the upstream TF-A sources: they must be retrieved from
a separate repository and are packed in the FIP by TF-A.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 DEVELOPERS                                          |  1 +
 boot/Config.in                                      |  1 +
 boot/stm32-ddr-phy-binary/Config.in                 |  9 +++++++++
 boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.hash |  3 +++
 boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.mk   | 13 +++++++++++++
 5 files changed, 27 insertions(+)
 create mode 100644 boot/stm32-ddr-phy-binary/Config.in
 create mode 100644 boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.hash
 create mode 100644 boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 4339b37f110d..c188cd301f2c 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -811,6 +811,7 @@ F:	board/bsh/
 F:	board/stmicroelectronics/stm32f746-disco/
 F:	board/stmicroelectronics/stm32f769-disco/
 F:	board/stmicroelectronics/stm32h747-disco/
+F:	boot/stm32-ddr-phy-binary/
 F:	boot/ti-k3-boot-firmware/
 F:	configs/imx6ulz_bsh_smm_m2_defconfig
 F:	configs/imx8mn_bsh_smm_s2_defconfig
diff --git a/boot/Config.in b/boot/Config.in
index d73d221431f9..95af63ab9af1 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -22,6 +22,7 @@ source "boot/optee-os/Config.in"
 source "boot/opensbi/Config.in"
 source "boot/palo/Config.in"
 source "boot/shim/Config.in"
+source "boot/stm32-ddr-phy-binary/Config.in"
 source "boot/syslinux/Config.in"
 source "boot/ti-k3-boot-firmware/Config.in"
 source "boot/ti-k3-r5-loader/Config.in"
diff --git a/boot/stm32-ddr-phy-binary/Config.in b/boot/stm32-ddr-phy-binary/Config.in
new file mode 100644
index 000000000000..1a8def0d22ff
--- /dev/null
+++ b/boot/stm32-ddr-phy-binary/Config.in
@@ -0,0 +1,9 @@
+config BR2_TARGET_STM32_DDR_PHY_BINARY
+	bool "stm32-ddr-phy-binary"
+	depends on BR2_aarch64
+	help
+	  DDR PHY firmware binaries for the STMicroelectronics STM32MP2
+	  SoCs. They are not built, they are needed as a dependency to
+	  build the TF-A firmware for these SoCs.
+
+	  https://github.com/STMicroelectronics/stm32-ddr-phy-binary
diff --git a/boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.hash b/boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.hash
new file mode 100644
index 000000000000..5826a483cbc9
--- /dev/null
+++ b/boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  519595ae24b44d70b0c0ac1e776bf1b871da00b615b9bffa83573e45b806eedc  stm32-ddr-phy-binary-1.0-stm32mp.tar.gz
+sha256  6b6a3968253466c776a660e916c67c7207c42fcd5bf02895e50215f923dae29d  LICENSE.md
diff --git a/boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.mk b/boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.mk
new file mode 100644
index 000000000000..d90980544a8c
--- /dev/null
+++ b/boot/stm32-ddr-phy-binary/stm32-ddr-phy-binary.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# stm32-ddr-phy-binary
+#
+################################################################################
+
+STM32_DDR_PHY_BINARY_VERSION = 1.0-stm32mp
+STM32_DDR_PHY_BINARY_SITE = $(call github,STMicroelectronics,stm32-ddr-phy-binary,v$(STM32_DDR_PHY_BINARY_VERSION))
+STM32_DDR_PHY_BINARY_LICENSE = SLA0044
+STM32_DDR_PHY_BINARY_LICENSE_FILES = LICENSE.md
+STM32_DDR_PHY_BINARY_INSTALL_TARGET = NO
+
+$(eval $(generic-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH 5/6] boot/arm-trusted-firmware: add stm32-ddr-phy-binary support
  2026-10-22 15:13 [Buildroot] [PATCH 0/6] Add support for the STM32MP257F-EV1 board Dario Binacchi
                   ` (3 preceding siblings ...)
  2026-10-22 15:13 ` [Buildroot] [PATCH 4/6] boot/stm32-ddr-phy-binary: new package Dario Binacchi
@ 2026-10-22 15:13 ` Dario Binacchi
  2026-10-23  9:35   ` Kory Maincent via buildroot
  2026-10-22 15:13 ` [Buildroot] [PATCH 6/6] configs/stm32mp257f_ev1_defconfig: new defconfig Dario Binacchi
  5 siblings, 1 reply; 14+ messages in thread
From: Dario Binacchi @ 2026-10-22 15:13 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, Dick Olsson, Sergey Matyukevich, Thomas Petazzoni,
	linux-amarula

When the stm32-ddr-phy-binary package is enabled, build TF-A after it
and point STM32MP_DDR_FW_PATH to its stm32mp2 firmware directory.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index ebaaaeb38c4b..7b1a43fca22b 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -157,6 +157,11 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR)
 ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell
 endif
 
+ifeq ($(BR2_TARGET_STM32_DDR_PHY_BINARY),y)
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += STM32MP_DDR_FW_PATH=$(STM32_DDR_PHY_BINARY_DIR)/stm32mp2
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += stm32-ddr-phy-binary
+endif
+
 ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all
 
 ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y)
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH 6/6] configs/stm32mp257f_ev1_defconfig: new defconfig
  2026-10-22 15:13 [Buildroot] [PATCH 0/6] Add support for the STM32MP257F-EV1 board Dario Binacchi
                   ` (4 preceding siblings ...)
  2026-10-22 15:13 ` [Buildroot] [PATCH 5/6] boot/arm-trusted-firmware: add stm32-ddr-phy-binary support Dario Binacchi
@ 2026-10-22 15:13 ` Dario Binacchi
  2026-10-23  9:46   ` Kory Maincent via buildroot
  5 siblings, 1 reply; 14+ messages in thread
From: Dario Binacchi @ 2026-10-22 15:13 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, Dick Olsson, Sergey Matyukevich, Thomas Petazzoni,
	linux-amarula

Add support for the STM32MP257F Evaluation board (EV1) [1].

The goal is an image built from upstream components:

- TF-A v2.15.0
- U-Boot 2026.10
- Linux 7.3

configured, where possible, with the same build options used by the
official STMicroelectronics OpenSTLinux Yocto layers [2].

This was not possible for OP-TEE OS. Indeed upstream OP-TEE OS does not
support yet, on STM32MP25, the STPMIC2 PMIC and the SCMI voltage
domains, which the mainline Linux device tree requires for the microSD
card supplies [3]. Until this is resolved, the STMicroelectronics
downstream version (4.0.0-stm32mp-r3) has to be used.

Host bmap-tools is enabled to speed up the flashing of the microSD
card, which is much faster than with dd.

[1] https://www.st.com/en/evaluation-tools/stm32mp257f-ev1.html
[2] https://github.com/STMicroelectronics/meta-st-stm32mp/tree/openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18
[3] https://github.com/OP-TEE/optee_os/issues/8027

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 DEVELOPERS                                    |  2 +
 .../stm32mp257f-ev1/genimage.cfg              | 52 ++++++++++++++
 .../overlay/boot/extlinux/extlinux.conf       |  4 ++
 .../overlay/etc/fwumdata.config               |  4 ++
 .../arm-trusted-firmware.hash                 |  2 +
 ...-arm-smc-id-of-the-SMC-watchdog-on-s.patch | 53 ++++++++++++++
 .../stm32mp257f-ev1/patches/linux/linux.hash  |  2 +
 ...2mp25-rename-the-PCIe-bus-SCMI-clock.patch | 44 ++++++++++++
 .../patches/optee-os/optee-os.hash            |  2 +
 .../stm32mp257f-ev1/patches/uboot/uboot.hash  |  2 +
 .../stm32mp257f-ev1/post-image.sh             | 18 +++++
 .../stm32mp257f-ev1/readme.txt                | 72 +++++++++++++++++++
 configs/stm32mp257f_ev1_defconfig             | 66 +++++++++++++++++
 13 files changed, 323 insertions(+)
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/overlay/boot/extlinux/extlinux.conf
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/overlay/etc/fwumdata.config
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/arm-trusted-firmware/arm-trusted-firmware.hash
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/linux/0001-arm64-dts-st-fix-arm-smc-id-of-the-SMC-watchdog-on-s.patch
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/linux/linux.hash
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/0001-dts-stm32mp25-rename-the-PCIe-bus-SCMI-clock.patch
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/optee-os.hash
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/uboot/uboot.hash
 create mode 100755 board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
 create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/readme.txt
 create mode 100644 configs/stm32mp257f_ev1_defconfig

diff --git a/DEVELOPERS b/DEVELOPERS
index c188cd301f2c..24ea83e428ec 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -811,6 +811,7 @@ F:	board/bsh/
 F:	board/stmicroelectronics/stm32f746-disco/
 F:	board/stmicroelectronics/stm32f769-disco/
 F:	board/stmicroelectronics/stm32h747-disco/
+F:	board/stmicroelectronics/stm32mp257f-ev1/
 F:	boot/stm32-ddr-phy-binary/
 F:	boot/ti-k3-boot-firmware/
 F:	configs/imx6ulz_bsh_smm_m2_defconfig
@@ -819,6 +820,7 @@ F:	configs/imx8mn_bsh_smm_s2_pro_defconfig
 F:	configs/stm32f746_disco_sd_defconfig
 F:	configs/stm32f769_disco_sd_defconfig
 F:	configs/stm32h747_disco_sd_defconfig
+F:	configs/stm32mp257f_ev1_defconfig
 F:	package/aespipe/
 F:	package/armadillo/
 F:	package/atf/
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg b/board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
new file mode 100644
index 000000000000..aec66cc7c490
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
@@ -0,0 +1,52 @@
+image sdcard.img {
+	hdimage {
+		partition-table-type = "gpt"
+	}
+
+	partition fsbla1 {
+		image = "tf-a-stm32mp257f-ev1.stm32"
+		size = 256K
+	}
+
+	partition fsbla2 {
+		image = "tf-a-stm32mp257f-ev1.stm32"
+		size = 256K
+	}
+
+	partition metadata1 {
+		image = "fwu-mdata.bin"
+		partition-type-uuid = "${FWU_MDATA_TYPE_UUID}"
+		size = 256K
+	}
+
+	partition metadata2 {
+		image = "fwu-mdata.bin"
+		partition-type-uuid = "${FWU_MDATA_TYPE_UUID}"
+		size = 256K
+	}
+
+	partition fip-a {
+		image = "fip.bin"
+		partition-type-uuid = "${FIP_TYPE_UUID}"
+		partition-uuid = "${FIP_A_UUID}"
+		size = 4M
+	}
+
+	partition fip-b {
+		image = "fip.bin"
+		partition-type-uuid = "${FIP_TYPE_UUID}"
+		partition-uuid = "${FIP_B_UUID}"
+		size = 4M
+	}
+
+	partition u-boot-env {
+		partition-type-uuid = "3de21764-95bd-54bd-a5c3-4abe786f38a8"
+		size = 512K
+	}
+
+	partition rootfs {
+		image = "rootfs.ext4"
+		partition-uuid = "e91c4e10-16e6-4c0e-bd0e-77becf4a3582"
+		bootable = "yes"
+	}
+}
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/overlay/boot/extlinux/extlinux.conf b/board/stmicroelectronics/stm32mp257f-ev1/overlay/boot/extlinux/extlinux.conf
new file mode 100644
index 000000000000..7871513cba0c
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/overlay/boot/extlinux/extlinux.conf
@@ -0,0 +1,4 @@
+label stm32mp257f-ev1-buildroot
+  kernel /boot/Image.gz
+  devicetree /boot/stm32mp257f-ev1.dtb
+  append root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait console=ttySTM0,115200 earlycon
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/overlay/etc/fwumdata.config b/board/stmicroelectronics/stm32mp257f-ev1/overlay/etc/fwumdata.config
new file mode 100644
index 000000000000..c172b26cb284
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/overlay/etc/fwumdata.config
@@ -0,0 +1,4 @@
+# FWU metadata location: <device> <offset> <metadata_size>
+# metadata1 and metadata2 partitions of the SD card (see genimage.cfg)
+/dev/mmcblk0p3	0x0	0x78
+/dev/mmcblk0p4	0x0	0x78
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/patches/arm-trusted-firmware/arm-trusted-firmware.hash b/board/stmicroelectronics/stm32mp257f-ev1/patches/arm-trusted-firmware/arm-trusted-firmware.hash
new file mode 100644
index 000000000000..2e24bcd0de5b
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/patches/arm-trusted-firmware/arm-trusted-firmware.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  b807d8bf190b7c46b4260729b4bbe2f7df83cd1086edcb181d66595ae6598d23  arm-trusted-firmware-v2.15.0-git4.tar.gz
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/patches/linux/0001-arm64-dts-st-fix-arm-smc-id-of-the-SMC-watchdog-on-s.patch b/board/stmicroelectronics/stm32mp257f-ev1/patches/linux/0001-arm64-dts-st-fix-arm-smc-id-of-the-SMC-watchdog-on-s.patch
new file mode 100644
index 000000000000..ba1324dc13e3
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/patches/linux/0001-arm64-dts-st-fix-arm-smc-id-of-the-SMC-watchdog-on-s.patch
@@ -0,0 +1,53 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mateusz Nowicki <mateusz.nowicki@posteo.net>
+Date: Mon, 7 Sep 2026 09:14:11 +0000
+Subject: [PATCH] arm64: dts: st: fix arm,smc-id of the SMC watchdog on
+ stm32mp2
+
+OP-TEE implements the STM32MP2 watchdog SMC service with function ID
+0xbc000000 (CFG_WDT_SM_HANDLER_ID), not 0xb200005a. With the current
+value the arm_smc_wdt probe fails with -EIO and the IWDG started by the
+bootloader is never refreshed.
+
+Fixes: 89fca38168c9 ("arm64: dts: st: add arm-wdt node for watchdog support on stm32mp251")
+Fixes: e9b03ef21386 ("arm64: dts: st: introduce stm32mp23 SoCs family")
+Signed-off-by: Mateusz Nowicki <mateusz.nowicki@posteo.net>
+Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com>
+Link: https://lore.kernel.org/r/20260907091400.55954-1-mateusz.nowicki@posteo.net
+Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
+Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ae4d08bbe3f4f5ec920dbdba26091adf0ae6ba71
+Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
+---
+ arch/arm64/boot/dts/st/stm32mp231.dtsi | 2 +-
+ arch/arm64/boot/dts/st/stm32mp251.dtsi | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/st/stm32mp231.dtsi b/arch/arm64/boot/dts/st/stm32mp231.dtsi
+index 0feb8943efae..1f297163fae2 100644
+--- a/arch/arm64/boot/dts/st/stm32mp231.dtsi
++++ b/arch/arm64/boot/dts/st/stm32mp231.dtsi
+@@ -35,7 +35,7 @@ arm-pmu {
+ 
+ 	arm_wdt: watchdog {
+ 		compatible = "arm,smc-wdt";
+-		arm,smc-id = <0xb200005a>;
++		arm,smc-id = <0xbc000000>;
+ 		status = "disabled";
+ 	};
+ 
+diff --git a/arch/arm64/boot/dts/st/stm32mp251.dtsi b/arch/arm64/boot/dts/st/stm32mp251.dtsi
+index 44938c036e30..ea1b04002b28 100644
+--- a/arch/arm64/boot/dts/st/stm32mp251.dtsi
++++ b/arch/arm64/boot/dts/st/stm32mp251.dtsi
+@@ -36,7 +36,7 @@ arm-pmu {
+ 
+ 	arm_wdt: watchdog {
+ 		compatible = "arm,smc-wdt";
+-		arm,smc-id = <0xb200005a>;
++		arm,smc-id = <0xbc000000>;
+ 		status = "disabled";
+ 	};
+ 
+-- 
+2.43.0
+
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/patches/linux/linux.hash b/board/stmicroelectronics/stm32mp257f-ev1/patches/linux/linux.hash
new file mode 100644
index 000000000000..a28e591f3694
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/patches/linux/linux.hash
@@ -0,0 +1,2 @@
+# From https://www.kernel.org/pub/linux/kernel/v7.x/sha256sums.asc
+sha256  87363c24f10e06321eb362765521094e94471f6bff8bce2d6b3e40f39f004953  linux-7.3.tar.xz
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/0001-dts-stm32mp25-rename-the-PCIe-bus-SCMI-clock.patch b/board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/0001-dts-stm32mp25-rename-the-PCIe-bus-SCMI-clock.patch
new file mode 100644
index 000000000000..3320ba0ba236
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/0001-dts-stm32mp25-rename-the-PCIe-bus-SCMI-clock.patch
@@ -0,0 +1,44 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
+Date: Tue, 20 Oct 2026 12:26:20 +0200
+Subject: [PATCH] dts: stm32mp25: rename the PCIe bus SCMI clock
+
+The PCIe bus clock is exposed to the Cortex-A35 agent through SCMI with
+the ck_icn_p_pcie domain name, which is also the name of the same clock
+in the mainline Linux stm32mp25 RCC driver. When the mainline kernel
+is used, the SCMI clock driver registers ck_icn_p_pcie first and the
+RCC driver fails to probe, leaving the system without clock tree,
+console and SD card:
+
+  stm32mp25_rcc 44200000.clock-controller: error -EEXIST: failed to register clk 'ck_icn_p_pcie' (ck_icn_p_pcie+0x8/0x38)
+  stm32mp25_rcc 44200000.clock-controller: probe with driver stm32mp25_rcc failed with error -17
+
+Mainline Linux does not use this SCMI clock: the PCIe nodes reference
+the RCC clock directly (<&rcc CK_BUS_PCIE>).
+
+Rename the SCMI clock domain to ck_scmi_icn_pcie. Only the name exposed
+through SCMI changes: the SCMI clock ID (CK_SCMI_ICN_PCIE) is unchanged,
+so device trees referencing this clock by its ID are not affected.
+
+Upstream: https://github.com/STMicroelectronics/optee_os/pull/5
+Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
+---
+ core/arch/arm/dts/stm32mp25-st-scmi-cfg.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/core/arch/arm/dts/stm32mp25-st-scmi-cfg.dtsi b/core/arch/arm/dts/stm32mp25-st-scmi-cfg.dtsi
+index f0c164ffdcf1..284e8208a8a8 100644
+--- a/core/arch/arm/dts/stm32mp25-st-scmi-cfg.dtsi
++++ b/core/arch/arm/dts/stm32mp25-st-scmi-cfg.dtsi
+@@ -857,7 +857,7 @@
+ 
+ 					clock@84 {
+ 						reg = <CK_SCMI_ICN_PCIE>;
+-						domain-name = "ck_icn_p_pcie";
++						domain-name = "ck_scmi_icn_pcie";
+ 						clocks = <&rcc CK_BUS_PCIE>;
+ 						flags = <SCMI_CLOCK_DEFAULT_ENABLED>;
+ 					};
+-- 
+2.43.0
+
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/optee-os.hash b/board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/optee-os.hash
new file mode 100644
index 000000000000..2003fe484ae0
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/optee-os.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  0fb0ef4c2d303bea8c2c7e2dfbab6e04bc92da631b778b1ba834ee320f869f03  optee-os-4.0.0-stm32mp-r3.tar.gz
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/patches/uboot/uboot.hash b/board/stmicroelectronics/stm32mp257f-ev1/patches/uboot/uboot.hash
new file mode 100644
index 000000000000..66c72d3afd51
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/patches/uboot/uboot.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  3f856da3cbbc93af51ff95fde18588a348b4a26723b01d9841e999d988481015  u-boot-2026.10.tar.bz2
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/post-image.sh b/board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
new file mode 100755
index 000000000000..c68774cdb814
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+BOARD_DIR="$(dirname "$0")"
+
+# GPT partition type and partition UUIDs, also used by genimage.cfg
+export FWU_MDATA_TYPE_UUID="8a7a84a0-8387-40f6-ab41-a8b9a5a60d23"
+export FIP_TYPE_UUID="19d5df83-11b0-457b-be2c-7559c13142a5"
+export FIP_A_UUID="4fd84c93-54ef-463f-a7ef-ae25ff887087"
+export FIP_B_UUID="09c54952-d5bf-45af-acee-335303766fb3"
+
+# FWU metadata (v2): 1 image (the FIP) per bank, 2 banks (fip-a, fip-b)
+"${HOST_DIR}/bin/mkfwumdata" -g -i 1 -b 2 -v 2 \
+	"${FWU_MDATA_TYPE_UUID},${FIP_TYPE_UUID},${FIP_A_UUID},${FIP_B_UUID}" \
+	"${BINARIES_DIR}/fwu-mdata.bin"
+
+support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg"
diff --git a/board/stmicroelectronics/stm32mp257f-ev1/readme.txt b/board/stmicroelectronics/stm32mp257f-ev1/readme.txt
new file mode 100644
index 000000000000..9c253c24be2d
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp257f-ev1/readme.txt
@@ -0,0 +1,72 @@
+STM32MP257F Evaluation board
+
+Intro
+=====
+
+This configuration supports the STM32MP257F Evaluation board (EV1)
+platform:
+
+  https://www.st.com/en/evaluation-tools/stm32mp257f-ev1.html
+
+It uses mainline Linux, U-Boot and TF-A, the STMicroelectronics
+downstream version of OP-TEE OS, and boots from the microSD card using
+the FWU (Firmware Update) multi bank layout of the TF-A FIP: two FIP
+banks (fip-a and fip-b) and two redundant copies of the FWU metadata
+(metadata1 and metadata2) selecting the active bank.
+
+The STMicroelectronics downstream OP-TEE OS is used because upstream
+OP-TEE OS does not support yet, on STM32MP25, the STPMIC2 PMIC, the PWR
+regulators and their exposure through the SCMI voltage domain protocol,
+which the mainline Linux device tree requires for the microSD card
+supplies. See the related upstream discussion:
+
+  https://github.com/OP-TEE/optee_os/issues/8027
+
+How to build
+============
+
+ $ make stm32mp257f_ev1_defconfig
+ $ make
+
+How to write the microSD card
+=============================
+
+Once the build process is finished you will have an image called
+"sdcard.img" in the output/images/ directory, together with its block
+map "sdcard.img.bmap".
+
+Copy the bootable "sdcard.img" onto a microSD card with "bmaptool",
+which only writes the blocks actually used by the image:
+
+  $ sudo bmaptool copy output/images/sdcard.img /dev/sdX
+
+Alternatively, with "dd":
+
+  $ sudo dd if=output/images/sdcard.img of=/dev/sdX
+
+Boot the board
+==============
+
+ (1) Set the boot switches to boot from the microSD card and insert
+     the microSD card.
+
+ (2) Plug a USB cable in the ST-LINK connector and run your serial
+     communication program on /dev/ttyACM0 (115200 8N1).
+
+ (3) Power-up the board.
+
+ (4) The system will start, with the console on UART.
+
+FWU metadata
+============
+
+The FWU metadata is generated at build time by the host mkfwumdata
+tool, with fip-a as active bank. It can be inspected and modified
+from Linux with the fwumdata tool, configured by /etc/fwumdata.config:
+
+  # fwumdata -l
+
+For example, to boot the FIP from the fip-b partition:
+
+  # fwumdata -a 1 -p 0
+  # reboot
diff --git a/configs/stm32mp257f_ev1_defconfig b/configs/stm32mp257f_ev1_defconfig
new file mode 100644
index 000000000000..ca434ee5dd6c
--- /dev/null
+++ b/configs/stm32mp257f_ev1_defconfig
@@ -0,0 +1,66 @@
+BR2_aarch64=y
+BR2_cortex_a35=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y
+BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32mp257f-ev1/patches"
+BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
+BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp257f-ev1/overlay"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/stm32mp257f-ev1/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="7.3"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_IMAGEGZ=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="st/stm32mp257f-ev1"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_UBOOT_TOOLS=y
+BR2_PACKAGE_UBOOT_TOOLS_FWUMDATA=y
+BR2_PACKAGE_OPTEE_CLIENT=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="256M"
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.15.0"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="stm32mp2"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_BL33_IMAGE="u-boot-nodtb.bin"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="STM32MP25=1 STM32MP_SDMMC=1 STM32MP_DDR4_TYPE=1 PSA_FWU_SUPPORT=1 STM32MP_BL33_EL1=0 PSCI_OS_INIT_MODE=1 DTB_FILE_NAME=stm32mp257f-ev1.dtb BL32_EXTRA2= BL33_CFG=$(BINARIES_DIR)/u-boot.dtb"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="fip.bin *.stm32"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
+BR2_TARGET_OPTEE_OS=y
+BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL=y
+BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION="$(call github,STMicroelectronics,optee_os,4.0.0-stm32mp-r3)/optee-os-4.0.0-stm32mp-r3.tar.gz"
+BR2_TARGET_OPTEE_OS_NEEDS_DTC=y
+BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY=y
+BR2_TARGET_OPTEE_OS_NEEDS_CMAKE=y
+# BR2_TARGET_OPTEE_OS_SDK is not set
+# BR2_TARGET_OPTEE_OS_SERVICES is not set
+BR2_TARGET_OPTEE_OS_PLATFORM="stm32mp2"
+BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="257F_EV1"
+BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES="CFG_WITH_TUI=n"
+BR2_TARGET_STM32_DDR_PHY_BINARY=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2026.10"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp25"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
+BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-nodtb.bin u-boot.dtb"
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=st/stm32mp257f-ev1"
+BR2_PACKAGE_HOST_BMAP_TOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_MKFWUMDATA=y
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH 1/6] package/uboot-tools: add host mkfwumdata support
  2026-10-22 15:13 ` [Buildroot] [PATCH 1/6] package/uboot-tools: add host mkfwumdata support Dario Binacchi
@ 2026-10-23  9:18   ` Kory Maincent via buildroot
  0 siblings, 0 replies; 14+ messages in thread
From: Kory Maincent via buildroot @ 2026-10-23  9:18 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: Dick Olsson, Sergey Matyukevich, Thomas Petazzoni, linux-amarula



On 10/22/26 17:13, Dario Binacchi wrote:
> Add an option to build and install the mkfwumdata tool on the host.
> 
> mkfwumdata generates the raw image of the FWU (Firmware Update)
> metadata, which is needed for the initial installation of the FWU
> multi bank update on the board.
> 
> The tool is linked against libuuid, hence the dependency on
> host-util-linux. To avoid adding this dependency to all the users of
> host-uboot-tools, the tool is built only when explicitly selected.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Thank you!
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH 2/6] package/uboot-tools: add fwumdata target tool
  2026-10-22 15:13 ` [Buildroot] [PATCH 2/6] package/uboot-tools: add fwumdata target tool Dario Binacchi
@ 2026-10-23  9:18   ` Kory Maincent via buildroot
  0 siblings, 0 replies; 14+ messages in thread
From: Kory Maincent via buildroot @ 2026-10-23  9:18 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: Dick Olsson, Sergey Matyukevich, Thomas Petazzoni, linux-amarula



On 10/22/26 17:13, Dario Binacchi wrote:
> Add an option to build and install the fwumdata tool on the target.
> 
> fwumdata allows to read, display and modify the FWU (Firmware Update)
> metadata from Linux userspace, similarly to what fw_printenv/fw_setenv
> do for the U-Boot environment. It can be used to change the
> active/previous bank indices, the bank states or the image acceptance
> flags, e.g. by an update agent after writing a new firmware bank.
> 
> The location of the metadata is read from /etc/fwumdata.config, which
> is platform specific and is therefore not installed by the package: it
> has to be provided, for example, by a rootfs overlay.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Thank you!
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH 3/6] boot/arm-trusted-firmware: pass HOSTLD
  2026-10-22 15:13 ` [Buildroot] [PATCH 3/6] boot/arm-trusted-firmware: pass HOSTLD Dario Binacchi
@ 2026-10-23  9:20   ` Kory Maincent via buildroot
  0 siblings, 0 replies; 14+ messages in thread
From: Kory Maincent via buildroot @ 2026-10-23  9:20 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: Dick Olsson, Sergey Matyukevich, Thomas Petazzoni, linux-amarula



On 10/22/26 17:13, Dario Binacchi wrote:
> Starting from v2.13, TF-A selects the host linker from the HOSTLD
> variable, which Buildroot exports as the plain host ld. The host tools
> are then linked without the C library, and the build fails, e.g. for
> the stm32mp2 stm32image tool:
> 
>    /usr/bin/ld: stm32image.c:(.text.startup+0x999): undefined reference to `__stack_chk_fail'
> 
> Pass the host C compiler as HOSTLD, as already done for HOSTCC.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Thank you!
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH 4/6] boot/stm32-ddr-phy-binary: new package
  2026-10-22 15:13 ` [Buildroot] [PATCH 4/6] boot/stm32-ddr-phy-binary: new package Dario Binacchi
@ 2026-10-23  9:35   ` Kory Maincent via buildroot
  0 siblings, 0 replies; 14+ messages in thread
From: Kory Maincent via buildroot @ 2026-10-23  9:35 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: Dick Olsson, Sergey Matyukevich, Thomas Petazzoni, linux-amarula



On 10/22/26 17:13, Dario Binacchi wrote:
> The DDR PHY firmware binaries of the STMicroelectronics STM32MP2 SoCs
> are not part of the upstream TF-A sources: they must be retrieved from
> a separate repository and are packed in the FIP by TF-A.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Thank you!
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH 5/6] boot/arm-trusted-firmware: add stm32-ddr-phy-binary support
  2026-10-22 15:13 ` [Buildroot] [PATCH 5/6] boot/arm-trusted-firmware: add stm32-ddr-phy-binary support Dario Binacchi
@ 2026-10-23  9:35   ` Kory Maincent via buildroot
  0 siblings, 0 replies; 14+ messages in thread
From: Kory Maincent via buildroot @ 2026-10-23  9:35 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: Dick Olsson, Sergey Matyukevich, Thomas Petazzoni, linux-amarula



On 10/22/26 17:13, Dario Binacchi wrote:
> When the stm32-ddr-phy-binary package is enabled, build TF-A after it
> and point STM32MP_DDR_FW_PATH to its stm32mp2 firmware directory.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Thank you!
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH 6/6] configs/stm32mp257f_ev1_defconfig: new defconfig
  2026-10-22 15:13 ` [Buildroot] [PATCH 6/6] configs/stm32mp257f_ev1_defconfig: new defconfig Dario Binacchi
@ 2026-10-23  9:46   ` Kory Maincent via buildroot
  2026-10-23 14:20     ` Dario Binacchi
  0 siblings, 1 reply; 14+ messages in thread
From: Kory Maincent via buildroot @ 2026-10-23  9:46 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: Dick Olsson, Sergey Matyukevich, Thomas Petazzoni, linux-amarula



On 10/22/26 17:13, Dario Binacchi wrote:
> Add support for the STM32MP257F Evaluation board (EV1) [1].
> 
> The goal is an image built from upstream components:
> 
> - TF-A v2.15.0
> - U-Boot 2026.10
> - Linux 7.3
> 
> configured, where possible, with the same build options used by the
> official STMicroelectronics OpenSTLinux Yocto layers [2].
> 
> This was not possible for OP-TEE OS. Indeed upstream OP-TEE OS does not
> support yet, on STM32MP25, the STPMIC2 PMIC and the SCMI voltage
> domains, which the mainline Linux device tree requires for the microSD
> card supplies [3]. Until this is resolved, the STMicroelectronics
> downstream version (4.0.0-stm32mp-r3) has to be used.
> 
> Host bmap-tools is enabled to speed up the flashing of the microSD
> card, which is much faster than with dd.
> 
> [1] https://www.st.com/en/evaluation-tools/stm32mp257f-ev1.html
> [2] https://github.com/STMicroelectronics/meta-st-stm32mp/tree/openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18
> [3] https://github.com/OP-TEE/optee_os/issues/8027
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>   DEVELOPERS                                    |  2 +
>   .../stm32mp257f-ev1/genimage.cfg              | 52 ++++++++++++++
>   .../overlay/boot/extlinux/extlinux.conf       |  4 ++
>   .../overlay/etc/fwumdata.config               |  4 ++
>   .../arm-trusted-firmware.hash                 |  2 +
>   ...-arm-smc-id-of-the-SMC-watchdog-on-s.patch | 53 ++++++++++++++
>   .../stm32mp257f-ev1/patches/linux/linux.hash  |  2 +
>   ...2mp25-rename-the-PCIe-bus-SCMI-clock.patch | 44 ++++++++++++
>   .../patches/optee-os/optee-os.hash            |  2 +
>   .../stm32mp257f-ev1/patches/uboot/uboot.hash  |  2 +
>   .../stm32mp257f-ev1/post-image.sh             | 18 +++++
>   .../stm32mp257f-ev1/readme.txt                | 72 +++++++++++++++++++
>   configs/stm32mp257f_ev1_defconfig             | 66 +++++++++++++++++
>   13 files changed, 323 insertions(+)
>   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
>   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/overlay/boot/extlinux/extlinux.conf
>   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/overlay/etc/fwumdata.config
>   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/arm-trusted-firmware/arm-trusted-firmware.hash
>   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/linux/0001-arm64-dts-st-fix-arm-smc-id-of-the-SMC-watchdog-on-s.patch
>   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/linux/linux.hash
>   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/0001-dts-stm32mp25-rename-the-PCIe-bus-SCMI-clock.patch
>   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/optee-os.hash
>   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/patches/uboot/uboot.hash
>   create mode 100755 board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
>   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/readme.txt
>   create mode 100644 configs/stm32mp257f_ev1_defconfig
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index c188cd301f2c..24ea83e428ec 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -811,6 +811,7 @@ F:	board/bsh/
>   F:	board/stmicroelectronics/stm32f746-disco/
>   F:	board/stmicroelectronics/stm32f769-disco/
>   F:	board/stmicroelectronics/stm32h747-disco/
> +F:	board/stmicroelectronics/stm32mp257f-ev1/
>   F:	boot/stm32-ddr-phy-binary/
>   F:	boot/ti-k3-boot-firmware/
>   F:	configs/imx6ulz_bsh_smm_m2_defconfig
> @@ -819,6 +820,7 @@ F:	configs/imx8mn_bsh_smm_s2_pro_defconfig
>   F:	configs/stm32f746_disco_sd_defconfig
>   F:	configs/stm32f769_disco_sd_defconfig
>   F:	configs/stm32h747_disco_sd_defconfig
> +F:	configs/stm32mp257f_ev1_defconfig
>   F:	package/aespipe/
>   F:	package/armadillo/
>   F:	package/atf/
> diff --git a/board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg b/board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
> new file mode 100644
> index 000000000000..aec66cc7c490
> --- /dev/null
> +++ b/board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
> @@ -0,0 +1,52 @@
> +image sdcard.img {
> +	hdimage {
> +		partition-table-type = "gpt"
> +	}
> +
> +	partition fsbla1 {
> +		image = "tf-a-stm32mp257f-ev1.stm32"
> +		size = 256K
> +	}
> +
> +	partition fsbla2 {
> +		image = "tf-a-stm32mp257f-ev1.stm32"
> +		size = 256K
> +	}
> +
> +	partition metadata1 {
> +		image = "fwu-mdata.bin"
> +		partition-type-uuid = "${FWU_MDATA_TYPE_UUID}"
> +		size = 256K
> +	}
> +
> +	partition metadata2 {
> +		image = "fwu-mdata.bin"
> +		partition-type-uuid = "${FWU_MDATA_TYPE_UUID}"
> +		size = 256K
> +	}
> +
> +	partition fip-a {
> +		image = "fip.bin"
> +		partition-type-uuid = "${FIP_TYPE_UUID}"
> +		partition-uuid = "${FIP_A_UUID}"
> +		size = 4M
> +	}
> +
> +	partition fip-b {
> +		image = "fip.bin"
> +		partition-type-uuid = "${FIP_TYPE_UUID}"
> +		partition-uuid = "${FIP_B_UUID}"
> +		size = 4M
> +	}
> +
> +	partition u-boot-env {
> +		partition-type-uuid = "3de21764-95bd-54bd-a5c3-4abe786f38a8"
> +		size = 512K
> +	}
> +
> +	partition rootfs {
> +		image = "rootfs.ext4"
> +		partition-uuid = "e91c4e10-16e6-4c0e-bd0e-77becf4a3582"
> +		bootable = "yes"
> +	}
> +}

I don't know the policy here, do we want to have this A/B complex boot 
redundancy in Buildroot upstream rather than a simple image partition 
layout?
The FWU metadata is also not a requirement to boot the board.

...

> diff --git a/board/stmicroelectronics/stm32mp257f-ev1/post-image.sh b/board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
> new file mode 100755
> index 000000000000..c68774cdb814
> --- /dev/null
> +++ b/board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
> @@ -0,0 +1,18 @@
> +#!/bin/sh
> +
> +set -e
> +
> +BOARD_DIR="$(dirname "$0")"
> +
> +# GPT partition type and partition UUIDs, also used by genimage.cfg
> +export FWU_MDATA_TYPE_UUID="8a7a84a0-8387-40f6-ab41-a8b9a5a60d23"
> +export FIP_TYPE_UUID="19d5df83-11b0-457b-be2c-7559c13142a5"
> +export FIP_A_UUID="4fd84c93-54ef-463f-a7ef-ae25ff887087"
> +export FIP_B_UUID="09c54952-d5bf-45af-acee-335303766fb3"
> +
> +# FWU metadata (v2): 1 image (the FIP) per bank, 2 banks (fip-a, fip-b)
> +"${HOST_DIR}/bin/mkfwumdata" -g -i 1 -b 2 -v 2 \
> +	"${FWU_MDATA_TYPE_UUID},${FIP_TYPE_UUID},${FIP_A_UUID},${FIP_B_UUID}" \
> +	"${BINARIES_DIR}/fwu-mdata.bin"
> +
> +support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg"

Same question here, do we want to use FWU metadata in the Buildroot 
upstream image?

-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Buildroot] [PATCH 6/6] configs/stm32mp257f_ev1_defconfig: new defconfig
  2026-10-23  9:46   ` Kory Maincent via buildroot
@ 2026-10-23 14:20     ` Dario Binacchi
  0 siblings, 0 replies; 14+ messages in thread
From: Dario Binacchi @ 2026-10-23 14:20 UTC (permalink / raw)
  To: Kory Maincent
  Cc: buildroot, Dick Olsson, Sergey Matyukevich, Thomas Petazzoni,
	linux-amarula


[-- Attachment #1.1: Type: text/plain, Size: 9010 bytes --]

Hi Kory,

On Fri, Oct 23, 2026 at 11:46 AM Kory Maincent <kory.maincent@bootlin.com>
wrote:

>
>
> On 10/22/26 17:13, Dario Binacchi wrote:
> > Add support for the STM32MP257F Evaluation board (EV1) [1].
> >
> > The goal is an image built from upstream components:
> >
> > - TF-A v2.15.0
> > - U-Boot 2026.10
> > - Linux 7.3
> >
> > configured, where possible, with the same build options used by the
> > official STMicroelectronics OpenSTLinux Yocto layers [2].
> >
> > This was not possible for OP-TEE OS. Indeed upstream OP-TEE OS does not
> > support yet, on STM32MP25, the STPMIC2 PMIC and the SCMI voltage
> > domains, which the mainline Linux device tree requires for the microSD
> > card supplies [3]. Until this is resolved, the STMicroelectronics
> > downstream version (4.0.0-stm32mp-r3) has to be used.
> >
> > Host bmap-tools is enabled to speed up the flashing of the microSD
> > card, which is much faster than with dd.
> >
> > [1] https://www.st.com/en/evaluation-tools/stm32mp257f-ev1.html
> > [2]
> https://github.com/STMicroelectronics/meta-st-stm32mp/tree/openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18
> > [3] https://github.com/OP-TEE/optee_os/issues/8027
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >   DEVELOPERS                                    |  2 +
> >   .../stm32mp257f-ev1/genimage.cfg              | 52 ++++++++++++++
> >   .../overlay/boot/extlinux/extlinux.conf       |  4 ++
> >   .../overlay/etc/fwumdata.config               |  4 ++
> >   .../arm-trusted-firmware.hash                 |  2 +
> >   ...-arm-smc-id-of-the-SMC-watchdog-on-s.patch | 53 ++++++++++++++
> >   .../stm32mp257f-ev1/patches/linux/linux.hash  |  2 +
> >   ...2mp25-rename-the-PCIe-bus-SCMI-clock.patch | 44 ++++++++++++
> >   .../patches/optee-os/optee-os.hash            |  2 +
> >   .../stm32mp257f-ev1/patches/uboot/uboot.hash  |  2 +
> >   .../stm32mp257f-ev1/post-image.sh             | 18 +++++
> >   .../stm32mp257f-ev1/readme.txt                | 72 +++++++++++++++++++
> >   configs/stm32mp257f_ev1_defconfig             | 66 +++++++++++++++++
> >   13 files changed, 323 insertions(+)
> >   create mode 100644
> board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
> >   create mode 100644
> board/stmicroelectronics/stm32mp257f-ev1/overlay/boot/extlinux/extlinux.conf
> >   create mode 100644
> board/stmicroelectronics/stm32mp257f-ev1/overlay/etc/fwumdata.config
> >   create mode 100644
> board/stmicroelectronics/stm32mp257f-ev1/patches/arm-trusted-firmware/arm-trusted-firmware.hash
> >   create mode 100644
> board/stmicroelectronics/stm32mp257f-ev1/patches/linux/0001-arm64-dts-st-fix-arm-smc-id-of-the-SMC-watchdog-on-s.patch
> >   create mode 100644
> board/stmicroelectronics/stm32mp257f-ev1/patches/linux/linux.hash
> >   create mode 100644
> board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/0001-dts-stm32mp25-rename-the-PCIe-bus-SCMI-clock.patch
> >   create mode 100644
> board/stmicroelectronics/stm32mp257f-ev1/patches/optee-os/optee-os.hash
> >   create mode 100644
> board/stmicroelectronics/stm32mp257f-ev1/patches/uboot/uboot.hash
> >   create mode 100755
> board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
> >   create mode 100644 board/stmicroelectronics/stm32mp257f-ev1/readme.txt
> >   create mode 100644 configs/stm32mp257f_ev1_defconfig
> >
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index c188cd301f2c..24ea83e428ec 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -811,6 +811,7 @@ F:        board/bsh/
> >   F:  board/stmicroelectronics/stm32f746-disco/
> >   F:  board/stmicroelectronics/stm32f769-disco/
> >   F:  board/stmicroelectronics/stm32h747-disco/
> > +F:   board/stmicroelectronics/stm32mp257f-ev1/
> >   F:  boot/stm32-ddr-phy-binary/
> >   F:  boot/ti-k3-boot-firmware/
> >   F:  configs/imx6ulz_bsh_smm_m2_defconfig
> > @@ -819,6 +820,7 @@ F:        configs/imx8mn_bsh_smm_s2_pro_defconfig
> >   F:  configs/stm32f746_disco_sd_defconfig
> >   F:  configs/stm32f769_disco_sd_defconfig
> >   F:  configs/stm32h747_disco_sd_defconfig
> > +F:   configs/stm32mp257f_ev1_defconfig
> >   F:  package/aespipe/
> >   F:  package/armadillo/
> >   F:  package/atf/
> > diff --git a/board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
> b/board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
> > new file mode 100644
> > index 000000000000..aec66cc7c490
> > --- /dev/null
> > +++ b/board/stmicroelectronics/stm32mp257f-ev1/genimage.cfg
> > @@ -0,0 +1,52 @@
> > +image sdcard.img {
> > +     hdimage {
> > +             partition-table-type = "gpt"
> > +     }
> > +
> > +     partition fsbla1 {
> > +             image = "tf-a-stm32mp257f-ev1.stm32"
> > +             size = 256K
> > +     }
> > +
> > +     partition fsbla2 {
> > +             image = "tf-a-stm32mp257f-ev1.stm32"
> > +             size = 256K
> > +     }
> > +
> > +     partition metadata1 {
> > +             image = "fwu-mdata.bin"
> > +             partition-type-uuid = "${FWU_MDATA_TYPE_UUID}"
> > +             size = 256K
> > +     }
> > +
> > +     partition metadata2 {
> > +             image = "fwu-mdata.bin"
> > +             partition-type-uuid = "${FWU_MDATA_TYPE_UUID}"
> > +             size = 256K
> > +     }
> > +
> > +     partition fip-a {
> > +             image = "fip.bin"
> > +             partition-type-uuid = "${FIP_TYPE_UUID}"
> > +             partition-uuid = "${FIP_A_UUID}"
> > +             size = 4M
> > +     }
> > +
> > +     partition fip-b {
> > +             image = "fip.bin"
> > +             partition-type-uuid = "${FIP_TYPE_UUID}"
> > +             partition-uuid = "${FIP_B_UUID}"
> > +             size = 4M
> > +     }
> > +
> > +     partition u-boot-env {
> > +             partition-type-uuid =
> "3de21764-95bd-54bd-a5c3-4abe786f38a8"
> > +             size = 512K
> > +     }
> > +
> > +     partition rootfs {
> > +             image = "rootfs.ext4"
> > +             partition-uuid = "e91c4e10-16e6-4c0e-bd0e-77becf4a3582"
> > +             bootable = "yes"
> > +     }
> > +}
>
> I don't know the policy here, do we want to have this A/B complex boot
> redundancy in Buildroot upstream rather than a simple image partition
> layout?
> The FWU metadata is also not a requirement to boot the board.
>

Hi Kory,

Thanks a lot for the review.

Indeed, the FWU metadata is needed only because TF-A is built with
PSA_FWU_SUPPORT=1.

My idea was to stay as close as possible to what STMicroelectronics
OpenSTLinux generates by default, which enables the "fw-update" machine
feature on all the STM32MP machines, building TF-A with PSA_FWU_SUPPORT=1
and using this partition layout. Since a lot of the downstream support
is not in mainline yet, a configuration aligned with theirs can help the
upstreaming work, making it easier to compare the two and to follow their
developments.

It also shows the FWU multi bank boot of the firmware, with TF-A loading
the FIP from the bank selected by the FWU metadata. In my experience, this
topic is not widely known, and the example helps to get familiar with the
FWU metadata and with the mkfwumdata and fwumdata tools added by
patches 1-2.

Of course, if this is not acceptable according to the Buildroot
policy, please let me know
how to proceed.

Thanks and regards,
Dario


> ...
>
> > diff --git a/board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
> b/board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
> > new file mode 100755
> > index 000000000000..c68774cdb814
> > --- /dev/null
> > +++ b/board/stmicroelectronics/stm32mp257f-ev1/post-image.sh
> > @@ -0,0 +1,18 @@
> > +#!/bin/sh
> > +
> > +set -e
> > +
> > +BOARD_DIR="$(dirname "$0")"
> > +
> > +# GPT partition type and partition UUIDs, also used by genimage.cfg
> > +export FWU_MDATA_TYPE_UUID="8a7a84a0-8387-40f6-ab41-a8b9a5a60d23"
> > +export FIP_TYPE_UUID="19d5df83-11b0-457b-be2c-7559c13142a5"
> > +export FIP_A_UUID="4fd84c93-54ef-463f-a7ef-ae25ff887087"
> > +export FIP_B_UUID="09c54952-d5bf-45af-acee-335303766fb3"
> > +
> > +# FWU metadata (v2): 1 image (the FIP) per bank, 2 banks (fip-a, fip-b)
> > +"${HOST_DIR}/bin/mkfwumdata" -g -i 1 -b 2 -v 2 \
> > +
>  "${FWU_MDATA_TYPE_UUID},${FIP_TYPE_UUID},${FIP_A_UUID},${FIP_B_UUID}" \
> > +     "${BINARIES_DIR}/fwu-mdata.bin"
> > +
> > +support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg"
>
> Same question here, do we want to use FWU metadata in the Buildroot
> upstream image?
>
> --
> Köry Maincent, Bootlin
> Embedded Linux and kernel engineering
> https://bootlin.com
>
>

-- 
*Dario Binacchi*
Senior Embedded Software Engineer
M. +39 328 0625246
dario.binacchi@amarulasolutions.com
―――――――――――――――
Amarula Solutions SRL
 Via Felice Cavallotti 25D, 41012 Carpi, MO, IT
info@amarulasolutions.com
www.amarulasolutions.com

[-- Attachment #1.2: Type: text/html, Size: 13034 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-10-23 14:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-22 15:13 [Buildroot] [PATCH 0/6] Add support for the STM32MP257F-EV1 board Dario Binacchi
2026-10-22 15:13 ` [Buildroot] [PATCH 1/6] package/uboot-tools: add host mkfwumdata support Dario Binacchi
2026-10-23  9:18   ` Kory Maincent via buildroot
2026-10-22 15:13 ` [Buildroot] [PATCH 2/6] package/uboot-tools: add fwumdata target tool Dario Binacchi
2026-10-23  9:18   ` Kory Maincent via buildroot
2026-10-22 15:13 ` [Buildroot] [PATCH 3/6] boot/arm-trusted-firmware: pass HOSTLD Dario Binacchi
2026-10-23  9:20   ` Kory Maincent via buildroot
2026-10-22 15:13 ` [Buildroot] [PATCH 4/6] boot/stm32-ddr-phy-binary: new package Dario Binacchi
2026-10-23  9:35   ` Kory Maincent via buildroot
2026-10-22 15:13 ` [Buildroot] [PATCH 5/6] boot/arm-trusted-firmware: add stm32-ddr-phy-binary support Dario Binacchi
2026-10-23  9:35   ` Kory Maincent via buildroot
2026-10-22 15:13 ` [Buildroot] [PATCH 6/6] configs/stm32mp257f_ev1_defconfig: new defconfig Dario Binacchi
2026-10-23  9:46   ` Kory Maincent via buildroot
2026-10-23 14:20     ` Dario Binacchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.