All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/6] Add Genio 510 and Genio 700 SPL boot support
@ 2026-09-06 15:30 Carlo Caione
  2026-09-06 15:30 ` [PATCH v6 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL Carlo Caione
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Carlo Caione @ 2026-09-06 15:30 UTC (permalink / raw)
  To: GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
	Macpaul Lin, Tom Rini, Ilias Apalodimas, Carlo Caione,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

The Genio 510 and Genio 700 boot chains use a platform DDR loader built
separately from U-Boot to initialize DRAM before entering U-Boot SPL. Add
the shared SPL devicetree and configuration needed to initialize the debug
UART, watchdog, pinctrl and eMMC, then load a conventional FIT from the
bootloaders GPT partition.

Add an opt-in binman description that generates the images consumed by
the MediaTek flashing flow:

  mtk-boot.bin
    MediaTek BootROM wrapper containing the platform DDR loader and SPL

  mtk-boot-payload.bin
    Raw DDR-loader and SPL payload for external MediaTek signing tools

  bootloaders.img
    FIT containing BL31, OP-TEE, U-Boot proper, and its control DT

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
Changes in v6:
- Bound BSS below the initial stack and use a measured normal-SPL heap.
- Generate the complete OP-TEE loadables list with binman.
- Explain image-layout choices, AArch64 entry and firmware prerequisites.
- Update SPDX identifiers and simplify the signed-build instructions.
- Link to v5: https://patch.msgid.link/20260827-ccaione-upstream-mt8390-spl-v5-0-81d04e3ab785@baylibre.com

Changes in v5:
- Explain the SPL BSS placement and guard area.
- Use the OP-TEE v1 header for its load and entry addresses.
- Use MTK_BROM_HEADER_INFO for the BootROM image properties.
- Rename the binman includes with the U-Boot devicetree suffix.
- Scope the SPL binman-symbol default to Genio image packaging.
- Link to v4: https://patch.msgid.link/20260814-ccaione-upstream-mt8390-spl-v4-0-f4f92978a79e@baylibre.com

Changes in v4:
- Express the DDR-loader/SPL handoff and firmware load addresses through a
  reusable Kconfig image contract.
- Split the binman layout into shared includes and rename the packaging option
  to CONFIG_MTK_GENIO_BOOT_IMAGES.
- Require bootloaders.img to be a directly parseable FIT.
- Link to v3: https://patch.msgid.link/20260730-ccaione-upstream-mt8390-spl-v3-0-82fb3bca27a4@baylibre.com

Changes in v3:
- Add Genio 510 support using the shared MT8188-family SPL configuration,
  pre-RAM devicetree annotations and binman layout.
- Make complete image packaging opt-in through CONFIG_MTK_BOOT_IMAGES.
- Keep the binman image description in a separate optional include.
- Leave SPL binman symbols disabled by default on MT8188.
- Add optional RSA-3072 signing for the bootloader FIT.
- Emit the raw BootROM payload required by external MediaTek signing tools.
- Document component-only, unsigned, and signed build procedures.
- Link to v2: https://patch.msgid.link/20260722-ccaione-upstream-mt8390-spl-v2-0-7aa005345711@baylibre.com

Changes in v2:
- Clarify that the platform DDR loader is built separately from U-Boot.
- Fix the SPL copy-window wording in patch 2.
- Keep the SPL annotations board-scoped and drop the unused pericfg_ao tag.
- Normalize the firmware-stage names in the board documentation.
- Simplify the documented build commands.
- Remove the redundant MediaTek documentation maintainer pattern.
- Add links to Genio Tools and prebuilt images.
- Link to v1: https://patch.msgid.link/20260718-ccaione-upstream-mt8390-spl-v1-0-1256b6dfda3f@baylibre.com

---
Carlo Caione (6):
      arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL
      configs: mt8188: enable eMMC FIT boot from SPL
      arm: mediatek: build Genio 510 and 700 boot images with binman
      arm: dts: mediatek: support signed Genio 510 and 700 bootloader FIT
      arm: dts: mediatek: emit the Genio 510 and 700 BootROM payload
      doc: board: mediatek: document Genio 510 and 700 SPL boot

 arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi      |  15 +-
 arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi      |  15 +-
 arch/arm/dts/mt8390-genio-common-u-boot.dtsi       |  96 ++++++++
 arch/arm/dts/mtk-genio-binman-u-boot.dtsi          |  12 +
 .../dts/mtk-genio-bootloaders-binman-u-boot.dtsi   | 109 ++++++++
 .../dts/mtk-genio-loader-spl-binman-u-boot.dtsi    |  33 +++
 arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi |  27 ++
 arch/arm/mach-mediatek/Kconfig                     |  41 ++-
 board/mediatek/MAINTAINERS                         |   4 +
 common/spl/Kconfig                                 |   1 +
 configs/mt8188.config                              |  33 +++
 doc/board/mediatek/index.rst                       |   1 +
 doc/board/mediatek/mt8188-genio-evk.rst            | 274 +++++++++++++++++++++
 13 files changed, 654 insertions(+), 7 deletions(-)
---
base-commit: 527115ef6783cec49e5610c523c124b399011361
change-id: 20260717-ccaione-upstream-mt8390-spl-7f64ca12dfbd

Best regards,
--  
Carlo Caione <ccaione@baylibre.com>


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

* [PATCH v6 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL
  2026-09-06 15:30 [PATCH v6 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
@ 2026-09-06 15:30 ` Carlo Caione
  2026-09-09 19:33   ` David Lechner
  2026-09-06 15:30 ` [PATCH v6 2/6] configs: mt8188: enable eMMC FIT boot from SPL Carlo Caione
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Carlo Caione @ 2026-09-06 15:30 UTC (permalink / raw)
  To: GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
	Macpaul Lin, Tom Rini, Ilias Apalodimas, Carlo Caione,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

The Genio 510 and Genio 700 boot flows enter U-Boot SPL after an
external DDR loader has initialized DRAM. SPL then needs the debug UART
and eMMC controller, together with their clock, syscon, pinctrl and
watchdog providers, to load the firmware FIT.

Both boards share this MT8188-family dependency chain, so keep the
pre-RAM annotations in a common include used by their board-specific
U-Boot devicetrees.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi |  6 +-
 arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi |  6 +-
 arch/arm/dts/mt8390-genio-common-u-boot.dtsi  | 96 +++++++++++++++++++++++++++
 board/mediatek/MAINTAINERS                    |  1 +
 4 files changed, 103 insertions(+), 6 deletions(-)

diff --git a/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi b/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
index 586d15bf72e..223f1371b9e 100644
--- a/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
@@ -1,7 +1,7 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
 /*
- * Copyright (c) 2026 BayLibre, SAS.
+ * Copyright (c) 2026 BayLibre SAS
  * Author: Julien Stephan <jstephan@baylibre.com>
  */
 
-#include "mt8188-u-boot.dtsi"
+#include "mt8390-genio-common-u-boot.dtsi"
diff --git a/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi b/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
index 586d15bf72e..223f1371b9e 100644
--- a/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
@@ -1,7 +1,7 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
 /*
- * Copyright (c) 2026 BayLibre, SAS.
+ * Copyright (c) 2026 BayLibre SAS
  * Author: Julien Stephan <jstephan@baylibre.com>
  */
 
-#include "mt8188-u-boot.dtsi"
+#include "mt8390-genio-common-u-boot.dtsi"
diff --git a/arch/arm/dts/mt8390-genio-common-u-boot.dtsi b/arch/arm/dts/mt8390-genio-common-u-boot.dtsi
new file mode 100644
index 00000000000..6371f7d5953
--- /dev/null
+++ b/arch/arm/dts/mt8390-genio-common-u-boot.dtsi
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+/*
+ * Copyright (c) 2026 BayLibre SAS
+ * Author: Julien Stephan <jstephan@baylibre.com>
+ * Author: Carlo Caione <ccaione@baylibre.com>
+ */
+
+#include "mt8188-u-boot.dtsi"
+
+&clk26m {
+	bootph-pre-ram;
+};
+
+&gic {
+	/* Retain the eMMC interrupt parent even though SPL uses polling. */
+	bootph-pre-ram;
+};
+
+&topckgen {
+	bootph-pre-ram;
+};
+
+&infracfg_ao {
+	bootph-pre-ram;
+};
+
+&pio {
+	bootph-pre-ram;
+};
+
+&watchdog {
+	bootph-pre-ram;
+};
+
+&apmixedsys {
+	bootph-pre-ram;
+};
+
+&uart0 {
+	bootph-pre-ram;
+};
+
+&mmc0 {
+	bootph-pre-ram;
+};
+
+/ {
+	memory@40000000 {
+		/* Preserve the board memory description; the loader initializes DRAM. */
+		bootph-pre-ram;
+	};
+};
+
+&mmc0_default_pins {
+	bootph-pre-ram;
+
+	pins-clk {
+		bootph-pre-ram;
+	};
+
+	pins-cmd-dat {
+		bootph-pre-ram;
+	};
+
+	pins-rst {
+		bootph-pre-ram;
+	};
+};
+
+&mmc0_uhs_pins {
+	bootph-pre-ram;
+
+	pins-clk {
+		bootph-pre-ram;
+	};
+
+	pins-cmd-dat {
+		bootph-pre-ram;
+	};
+
+	pins-ds {
+		bootph-pre-ram;
+	};
+
+	pins-rst {
+		bootph-pre-ram;
+	};
+};
+
+&uart0_pins {
+	bootph-pre-ram;
+
+	pins {
+		bootph-pre-ram;
+	};
+};
diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
index d99c6d708b2..d0d25b096e5 100644
--- a/board/mediatek/MAINTAINERS
+++ b/board/mediatek/MAINTAINERS
@@ -22,6 +22,7 @@ M:	Macpaul Lin <Macpaul.Lin@mediatek.com>
 M:	Julien Stephan <jstephan@baylibre.com>
 S:	Maintained
 F:	arch/arm/dts/mt8188-u-boot.dtsi
+F:	arch/arm/dts/mt8390-genio-common-u-boot.dtsi
 F:	arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
 F:	arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
 F:	configs/mt8188.config

-- 
2.55.0


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

* [PATCH v6 2/6] configs: mt8188: enable eMMC FIT boot from SPL
  2026-09-06 15:30 [PATCH v6 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
  2026-09-06 15:30 ` [PATCH v6 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL Carlo Caione
@ 2026-09-06 15:30 ` Carlo Caione
  2026-09-07  3:45   ` Macpaul Lin (林智斌)
  2026-09-09 19:35   ` David Lechner
  2026-09-06 15:30 ` [PATCH v6 3/6] arm: mediatek: build Genio 510 and 700 boot images with binman Carlo Caione
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 19+ messages in thread
From: Carlo Caione @ 2026-09-06 15:30 UTC (permalink / raw)
  To: GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
	Macpaul Lin, Tom Rini, Ilias Apalodimas, Carlo Caione,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

Enable the shared Genio 510/700 SPL path entered by the external DDR
loader. Keep BSS after the downstream SPL reservation, leaving a 0xc800
guard after the copy window and space for the initial stack and early
allocations. Use an 8 MiB heap for loading the firmware FIT.

Load BL31, OP-TEE and U-Boot from eMMC partition 1 using generic SPL
support. The MediaTek BL31 stalls when given a runtime devicetree as its
platform parameter, so pass NULL there while retaining the standard
firmware entry-point parameters.

Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 configs/mt8188.config | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/configs/mt8188.config b/configs/mt8188.config
index 29e2b3db878..a7a59940646 100644
--- a/configs/mt8188.config
+++ b/configs/mt8188.config
@@ -28,3 +28,36 @@ CONFIG_MTK_SERIAL=y
 CONFIG_WDT=y
 CONFIG_WDT_MTK=y
 # CONFIG_RANDOM_UUID is not set
+CONFIG_SPL=y
+# Fixed destination and copy window of the external DDR loader.
+CONFIG_SPL_TEXT_BASE=0x40000000
+CONFIG_SPL_MAX_SIZE=0xaf000
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
+# Preserve the downstream reservation, with a 0xc800-byte guard after SPL.
+CONFIG_SPL_BSS_START_ADDR=0x400bb800
+CONFIG_SPL_BSS_LIMIT=y
+CONFIG_SPL_BSS_MAX_SIZE=0x10000
+# Leave 448 KiB above the BSS limit for the stack, global data and early heap.
+CONFIG_SYS_INIT_SP_BSS_OFFSET=0x80000
+CONFIG_SPL_SYS_MALLOC=y
+CONFIG_SPL_HAS_CUSTOM_MALLOC_START=y
+# Keep the heap separate from the loaded firmware and its reserved memory.
+CONFIG_SPL_CUSTOM_SYS_MALLOC_ADDR=0x5c000000
+CONFIG_SPL_SYS_MALLOC_SIZE=0x800000
+CONFIG_SPL_SYSCON=y
+CONFIG_SPL_CLK=y
+CONFIG_SPL_SERIAL=y
+# CONFIG_SPL_USE_TINY_PRINTF is not set
+CONFIG_SPL_PINCTRL=y
+CONFIG_SPL_PINCONF=y
+CONFIG_SPL_WATCHDOG=y
+CONFIG_SPL_MMC=y
+CONFIG_SPL_LIBDISK_SUPPORT=y
+CONFIG_SPL_EFI_PARTITION=y
+CONFIG_SPL_SYS_MMCSD_RAW_MODE=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=1
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_ATF=y
+CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y

-- 
2.55.0


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

* [PATCH v6 3/6] arm: mediatek: build Genio 510 and 700 boot images with binman
  2026-09-06 15:30 [PATCH v6 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
  2026-09-06 15:30 ` [PATCH v6 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL Carlo Caione
  2026-09-06 15:30 ` [PATCH v6 2/6] configs: mt8188: enable eMMC FIT boot from SPL Carlo Caione
@ 2026-09-06 15:30 ` Carlo Caione
  2026-09-09 19:39   ` David Lechner
  2026-09-06 15:30 ` [PATCH v6 4/6] arm: dts: mediatek: support signed Genio 510 and 700 bootloader FIT Carlo Caione
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Carlo Caione @ 2026-09-06 15:30 UTC (permalink / raw)
  To: GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
	Macpaul Lin, Tom Rini, Ilias Apalodimas, Carlo Caione,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

Genio 510 and Genio 700 use an external DDR loader before SPL, then load
the remaining firmware from a FIT. Keep packaging optional because this
platform firmware is built outside U-Boot.

Separate the container, loader/SPL payload and firmware FIT descriptions
so their layouts can be reused independently. Generate the loadables list
to include every OP-TEE segment.

Request AArch64 BootROM entry for the DDR loader. Disable SPL binman
symbols since U-Boot proper lives in the separate FIT, not alongside SPL.

Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi      |  9 ++
 arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi      |  9 ++
 arch/arm/dts/mtk-genio-binman-u-boot.dtsi          | 12 +++
 .../dts/mtk-genio-bootloaders-binman-u-boot.dtsi   | 98 ++++++++++++++++++++++
 .../dts/mtk-genio-loader-spl-binman-u-boot.dtsi    | 17 ++++
 arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi | 26 ++++++
 arch/arm/mach-mediatek/Kconfig                     | 41 ++++++++-
 board/mediatek/MAINTAINERS                         |  2 +
 common/spl/Kconfig                                 |  1 +
 9 files changed, 214 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi b/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
index 223f1371b9e..10b9a142f37 100644
--- a/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
@@ -4,4 +4,13 @@
  * Author: Julien Stephan <jstephan@baylibre.com>
  */
 
+#include <config.h>
 #include "mt8390-genio-common-u-boot.dtsi"
+
+#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
+#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 510 bootloaders"
+#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 510 boot chain"
+#include "mtk-genio-binman-u-boot.dtsi"
+#include "mtk-genio-mtk-boot-binman-u-boot.dtsi"
+#include "mtk-genio-bootloaders-binman-u-boot.dtsi"
+#endif
diff --git a/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi b/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
index 223f1371b9e..6230b016ca0 100644
--- a/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
@@ -4,4 +4,13 @@
  * Author: Julien Stephan <jstephan@baylibre.com>
  */
 
+#include <config.h>
 #include "mt8390-genio-common-u-boot.dtsi"
+
+#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
+#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 700 bootloaders"
+#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 700 boot chain"
+#include "mtk-genio-binman-u-boot.dtsi"
+#include "mtk-genio-mtk-boot-binman-u-boot.dtsi"
+#include "mtk-genio-bootloaders-binman-u-boot.dtsi"
+#endif
diff --git a/arch/arm/dts/mtk-genio-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-binman-u-boot.dtsi
new file mode 100644
index 00000000000..ff4557e5072
--- /dev/null
+++ b/arch/arm/dts/mtk-genio-binman-u-boot.dtsi
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+/*
+ * Copyright (c) 2026 BayLibre SAS
+ * Author: Julien Stephan <jstephan@baylibre.com>
+ * Author: Carlo Caione <ccaione@baylibre.com>
+ */
+
+/ {
+	binman: binman {
+		multiple-images;
+	};
+};
diff --git a/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
new file mode 100644
index 00000000000..d8aea85f47e
--- /dev/null
+++ b/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
@@ -0,0 +1,98 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+/*
+ * Copyright (c) 2026 BayLibre SAS
+ * Author: Julien Stephan <jstephan@baylibre.com>
+ * Author: Carlo Caione <ccaione@baylibre.com>
+ */
+
+&binman {
+	bootloaders {
+		filename = "bootloaders.img";
+
+		fit {
+			description = MTK_BOOTLOADERS_DESCRIPTION;
+			#address-cells = <1>;
+			fit,fdt-list-val = "u-boot";
+
+			images {
+				uboot {
+					description = "U-Boot";
+					type = "firmware";
+					os = "u-boot";
+					arch = "arm64";
+					compression = "none";
+					load = <CONFIG_TEXT_BASE>;
+					entry = <CONFIG_TEXT_BASE>;
+
+					u-boot-nodtb {
+					};
+
+					hash {
+						algo = "sha256";
+					};
+				};
+
+				atf {
+					description = "ARM Trusted Firmware BL31";
+					type = "firmware";
+					os = "arm-trusted-firmware";
+					arch = "arm64";
+					compression = "none";
+					load = <CONFIG_MTK_GENIO_BL31_LOAD_ADDR>;
+					entry = <CONFIG_MTK_GENIO_BL31_LOAD_ADDR>;
+
+					atf-bl31 {
+					};
+
+					hash {
+						algo = "sha256";
+					};
+				};
+
+				@optee-SEQ {
+					fit,operation = "split-elf";
+					description = "OP-TEE";
+					type = "firmware";
+					os = "tee";
+					arch = "arm64";
+					compression = "none";
+					fit,load;
+					fit,entry;
+					fit,data;
+
+					tee-os {
+					};
+
+					hash {
+						algo = "sha256";
+					};
+				};
+
+				uboot-fdt {
+					description = "U-Boot control devicetree";
+					type = "flat_dt";
+					arch = "arm64";
+					compression = "none";
+
+					u-boot-dtb {
+					};
+
+					hash {
+						algo = "sha256";
+					};
+				};
+			};
+
+			configurations {
+				default = "conf";
+
+				@conf {
+					description = MTK_BOOT_CHAIN_DESCRIPTION;
+					fit,firmware = "atf", "uboot";
+					fit,loadables;
+					fdt = "uboot-fdt";
+				};
+			};
+		};
+	};
+};
diff --git a/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi
new file mode 100644
index 00000000000..c97797405b7
--- /dev/null
+++ b/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+/*
+ * Copyright (c) 2026 BayLibre SAS
+ * Author: Julien Stephan <jstephan@baylibre.com>
+ * Author: Carlo Caione <ccaione@baylibre.com>
+ */
+
+/* Include within a section: the loader and SPL form one contiguous payload. */
+ddr-loader {
+	type = "blob-ext";
+	filename = "ddr-loader.bin";
+	size = <CONFIG_MTK_GENIO_DDR_LOADER_SIZE>;
+};
+
+u-boot-spl {
+	size = <CONFIG_SPL_MAX_SIZE>;
+};
diff --git a/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi
new file mode 100644
index 00000000000..a7ee09feba0
--- /dev/null
+++ b/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+/*
+ * Copyright (c) 2026 BayLibre SAS
+ * Author: Julien Stephan <jstephan@baylibre.com>
+ * Author: Carlo Caione <ccaione@baylibre.com>
+ */
+
+#include <linux/stringify.h>
+
+&binman {
+	mtk-boot {
+		filename = "mtk-boot.bin";
+
+		mkimage {
+			args = "-T", "mtk_image",
+			       "-a", __stringify(CONFIG_MTK_GENIO_BROM_LOAD_ADDR),
+			       "-e", __stringify(CONFIG_MTK_GENIO_BROM_LOAD_ADDR),
+			       "-n", CONFIG_MTK_BROM_HEADER_INFO;
+
+			section {
+				pad-byte = <0>;
+#include "mtk-genio-loader-spl-binman-u-boot.dtsi"
+			};
+		};
+	};
+};
diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig
index 5e6c50ca64d..e572cfe8571 100644
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -207,9 +207,48 @@ config SYS_CONFIG_NAME
 config MTK_BROM_HEADER_INFO
 	string
 	default "media=nor" if TARGET_MT8518 || TARGET_MT8512 || TARGET_MT7629
-	default "media=emmc" if TARGET_MT8516 || TARGET_MT8365 || TARGET_MT8183 || TARGET_MT8188 || TARGET_MT8189 || TARGET_MT8195
+	default "media=emmc;arm64=1" if TARGET_MT8188
+	default "media=emmc" if TARGET_MT8516 || TARGET_MT8365 || TARGET_MT8183 || TARGET_MT8189 || TARGET_MT8195
 	default "lk=1" if TARGET_MT7623
 
+config MTK_GENIO_BOOT_IMAGES
+	bool "Build MediaTek firmware images"
+	depends on TARGET_MT8188 && SPL
+	select BINMAN
+	select MTK_GENIO_IMAGE_CONTRACT
+	help
+	  Enable binman to assemble the MediaTek BootROM image and firmware
+	  FIT from U-Boot and external platform firmware components.
+
+config MTK_GENIO_IMAGE_CONTRACT
+	bool
+
+if MTK_GENIO_IMAGE_CONTRACT
+
+config MTK_GENIO_BROM_LOAD_ADDR
+	hex "BootROM payload load address"
+	default 0x201000 if TARGET_MT8188
+	help
+	  Address at which the MediaTek BootROM loads and enters the external
+	  DDR loader.
+
+config MTK_GENIO_DDR_LOADER_SIZE
+	hex "DDR-loader image region size"
+	default 0x4b000 if TARGET_MT8188
+	help
+	  Size reserved for the external DDR loader at the start of the
+	  BootROM payload. This is also the offset of U-Boot SPL and must match
+	  the offset used by the loader when copying SPL to DRAM.
+
+config MTK_GENIO_BL31_LOAD_ADDR
+	hex "BL31 load and entry address"
+	default 0x54601000 if TARGET_MT8188
+	help
+	  Address at which SPL loads and enters BL31. This must match the
+	  platform firmware's link address and secure-memory layout.
+
+endif
+
 config MTK_TZ_MOVABLE
 	select ARCH_MISC_INIT
 	select OF_SYSTEM_SETUP
diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
index d0d25b096e5..57bb3095305 100644
--- a/board/mediatek/MAINTAINERS
+++ b/board/mediatek/MAINTAINERS
@@ -24,6 +24,8 @@ S:	Maintained
 F:	arch/arm/dts/mt8188-u-boot.dtsi
 F:	arch/arm/dts/mt8390-genio-common-u-boot.dtsi
 F:	arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
+F:	arch/arm/dts/mtk-genio-*-binman-u-boot.dtsi
+F:	arch/arm/dts/mtk-genio-binman-u-boot.dtsi
 F:	arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
 F:	configs/mt8188.config
 F:	configs/mt8370_genio_510_evk_defconfig
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 0618f42c941..f9b453df766 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -194,6 +194,7 @@ config SPL_SHOW_ERRORS
 config SPL_BINMAN_SYMBOLS
 	bool "Declare binman symbols in SPL"
 	depends on SPL_FRAMEWORK && BINMAN
+	default n if MTK_GENIO_BOOT_IMAGES
 	default y
 	help
 	  This enables use of symbols in SPL which refer to other entries in

-- 
2.55.0


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

* [PATCH v6 4/6] arm: dts: mediatek: support signed Genio 510 and 700 bootloader FIT
  2026-09-06 15:30 [PATCH v6 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
                   ` (2 preceding siblings ...)
  2026-09-06 15:30 ` [PATCH v6 3/6] arm: mediatek: build Genio 510 and 700 boot images with binman Carlo Caione
@ 2026-09-06 15:30 ` Carlo Caione
  2026-09-06 15:30 ` [PATCH v6 5/6] arm: dts: mediatek: emit the Genio 510 and 700 BootROM payload Carlo Caione
  2026-09-06 15:30 ` [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot Carlo Caione
  5 siblings, 0 replies; 19+ messages in thread
From: Carlo Caione @ 2026-09-06 15:30 UTC (permalink / raw)
  To: GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
	Macpaul Lin, Tom Rini, Ilias Apalodimas, Carlo Caione,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

The unsigned bootloader FIT only provides hashes, so SPL cannot establish
a chain of trust before loading BL31, OP-TEE and U-Boot.

When SPL FIT signature verification is enabled, sign the complete
configuration and require its public key in the SPL control devicetree.
The configuration signature covers the firmware, all loadables and
U-Boot's control devicetree.

Use binman's u-boot-spl-pubkey-dtb entry to inject the key while
preserving the fixed SPL region expected by the external DDR loader.
Unsigned builds keep using the existing image layout.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi | 11 +++++++++++
 arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi  | 16 ++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
index d8aea85f47e..cbf35b7a353 100644
--- a/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
+++ b/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
@@ -13,6 +13,9 @@
 			description = MTK_BOOTLOADERS_DESCRIPTION;
 			#address-cells = <1>;
 			fit,fdt-list-val = "u-boot";
+#ifdef CONFIG_SPL_FIT_SIGNATURE
+			fit,sign;
+#endif
 
 			images {
 				uboot {
@@ -91,6 +94,14 @@
 					fit,firmware = "atf", "uboot";
 					fit,loadables;
 					fdt = "uboot-fdt";
+#ifdef CONFIG_SPL_FIT_SIGNATURE
+
+					signature {
+						algo = "sha256,rsa3072";
+						key-name-hint = "bootloaders";
+						sign-images = "firmware", "loadables", "fdt";
+					};
+#endif
 				};
 			};
 		};
diff --git a/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi
index c97797405b7..2dd13d261a0 100644
--- a/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi
+++ b/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi
@@ -12,6 +12,22 @@ ddr-loader {
 	size = <CONFIG_MTK_GENIO_DDR_LOADER_SIZE>;
 };
 
+#ifdef CONFIG_SPL_FIT_SIGNATURE
+u-boot-spl {
+	type = "section";
+	size = <CONFIG_SPL_MAX_SIZE>;
+
+	u-boot-spl-nodtb {
+	};
+
+	u-boot-spl-pubkey-dtb {
+		algo = "sha256,rsa3072";
+		required = "conf";
+		key-name-hint = "bootloaders";
+	};
+};
+#else
 u-boot-spl {
 	size = <CONFIG_SPL_MAX_SIZE>;
 };
+#endif

-- 
2.55.0


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

* [PATCH v6 5/6] arm: dts: mediatek: emit the Genio 510 and 700 BootROM payload
  2026-09-06 15:30 [PATCH v6 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
                   ` (3 preceding siblings ...)
  2026-09-06 15:30 ` [PATCH v6 4/6] arm: dts: mediatek: support signed Genio 510 and 700 bootloader FIT Carlo Caione
@ 2026-09-06 15:30 ` Carlo Caione
  2026-09-06 15:30 ` [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot Carlo Caione
  5 siblings, 0 replies; 19+ messages in thread
From: Carlo Caione @ 2026-09-06 15:30 UTC (permalink / raw)
  To: GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
	Macpaul Lin, Tom Rini, Ilias Apalodimas, Carlo Caione,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

MediaTek secure-boot tooling signs the raw DDR-loader and SPL payload
before adding the BootROM headers. Signing mtk-boot.bin would instead
sign an image that already carries the unsigned headers.

Have binman emit the existing payload section as mtk-boot-payload.bin.
This keeps the fixed DDR-loader and SPL layout in one description and
does not change mtk-boot.bin.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi
index a7ee09feba0..af5cb96398b 100644
--- a/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi
+++ b/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi
@@ -18,6 +18,7 @@
 			       "-n", CONFIG_MTK_BROM_HEADER_INFO;
 
 			section {
+				filename = "mtk-boot-payload.bin";
 				pad-byte = <0>;
 #include "mtk-genio-loader-spl-binman-u-boot.dtsi"
 			};

-- 
2.55.0


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

* [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot
  2026-09-06 15:30 [PATCH v6 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
                   ` (4 preceding siblings ...)
  2026-09-06 15:30 ` [PATCH v6 5/6] arm: dts: mediatek: emit the Genio 510 and 700 BootROM payload Carlo Caione
@ 2026-09-06 15:30 ` Carlo Caione
  2026-09-07  3:48   ` Macpaul Lin (林智斌)
  2026-09-09 19:56   ` David Lechner
  5 siblings, 2 replies; 19+ messages in thread
From: Carlo Caione @ 2026-09-06 15:30 UTC (permalink / raw)
  To: GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
	Macpaul Lin, Tom Rini, Ilias Apalodimas, Carlo Caione,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

Document the common Genio 510 and Genio 700 eMMC boot chain,
board-specific external firmware prerequisites, binman build invocation
and generated images.

Define the binary layout and execution-state ABI between an external DDR
loader and SPL using the corresponding Kconfig symbols. Different loader
implementations remain compatible when they satisfy this contract. Also
require firmware handed to the RAM SPL loader to be a directly parseable
FIT rather than a compressed FIT container.

Describe FIT signing, storage mapping and installation with Genio Tools.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 board/mediatek/MAINTAINERS              |   1 +
 doc/board/mediatek/index.rst            |   1 +
 doc/board/mediatek/mt8188-genio-evk.rst | 274 ++++++++++++++++++++++++++++++++
 3 files changed, 276 insertions(+)

diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
index 57bb3095305..aa862a4e1ea 100644
--- a/board/mediatek/MAINTAINERS
+++ b/board/mediatek/MAINTAINERS
@@ -30,6 +30,7 @@ F:	arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
 F:	configs/mt8188.config
 F:	configs/mt8370_genio_510_evk_defconfig
 F:	configs/mt8390_genio_700_evk_defconfig
+F:	doc/board/mediatek/mt8188-genio-evk.rst
 
 MT8195/MT8395
 M:	Macpaul Lin <Macpaul.Lin@mediatek.com>
diff --git a/doc/board/mediatek/index.rst b/doc/board/mediatek/index.rst
index c55d5aeb5c4..7ca1bd9fde2 100644
--- a/doc/board/mediatek/index.rst
+++ b/doc/board/mediatek/index.rst
@@ -7,3 +7,4 @@ Mediatek
    :maxdepth: 2
 
    mt7621
+   mt8188-genio-evk
diff --git a/doc/board/mediatek/mt8188-genio-evk.rst b/doc/board/mediatek/mt8188-genio-evk.rst
new file mode 100644
index 00000000000..90bdd5cc3c8
--- /dev/null
+++ b/doc/board/mediatek/mt8188-genio-evk.rst
@@ -0,0 +1,274 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+.. Copyright (C) 2026 BayLibre SAS
+
+MediaTek Genio 510 and Genio 700 EVKs
+======================================
+
+The Genio 510 and Genio 700 EVKs use the same MT8188-family boot flow:
+
+================  ======  ====================================
+Board             SoC     Defconfig
+================  ======  ====================================
+Genio 510 EVK     MT8370  ``mt8370_genio_510_evk_defconfig``
+Genio 700 EVK     MT8390  ``mt8390_genio_700_evk_defconfig``
+================  ======  ====================================
+
+The configurations share their SPL addresses, size limits, drivers and
+firmware-image layout. Each board retains its own control devicetree, DRAM
+size and external platform firmware.
+
+Boot chain
+----------
+
+The normal eMMC boot chain is::
+
+   BootROM
+     -> platform DDR loader
+     -> U-Boot SPL
+     -> Arm Trusted Firmware-A (BL31)
+     -> OP-TEE (BL32)
+     -> U-Boot proper (BL33)
+
+The BootROM loads a MediaTek image from the eMMC boot0 hardware partition to
+``CONFIG_MTK_GENIO_BROM_LOAD_ADDR``. This image contains a platform DDR loader
+followed by U-Boot SPL. The DDR loader initializes DRAM, copies the fixed
+``CONFIG_SPL_MAX_SIZE`` byte SPL region from offset
+``CONFIG_MTK_GENIO_DDR_LOADER_SIZE`` to ``CONFIG_SPL_TEXT_BASE`` and enters
+SPL at EL3 with exceptions masked.
+
+SPL reads a FIT image from partition 1 of the eMMC user area. The FIT contains
+Arm Trusted Firmware-A (BL31), OP-TEE (BL32), U-Boot proper (BL33) and the
+U-Boot control devicetree. It is an ordinary, directly parseable FIT whose
+first word is the FDT magic; the complete FIT container must not be compressed.
+The supplied configurations use uncompressed FIT payloads; compressed payloads
+require the corresponding SPL decompression support. SPL uses the
+standard FIT and Arm Trusted Firmware support to hand off to BL31.
+
+The DDR loader is a platform firmware component built separately from U-Boot
+and supplied to binman as an external blob.
+
+DDR-loader handoff contract
+---------------------------
+
+The DDR loader and U-Boot SPL have no parameter-block or firmware-call
+interface. Their contract consists of a fixed image layout, initialized DRAM
+and the execution state at the SPL entry point. Different DDR-loader
+implementations may be used as long as they satisfy this contract for the
+selected board. The BootROM loads the eMMC boot0 payload to
+``CONFIG_MTK_GENIO_BROM_LOAD_ADDR``::
+
+   offset 0                                     +----------------------+
+                                                | DDR loader           |
+                                                |                      |
+   offset CONFIG_MTK_GENIO_DDR_LOADER_SIZE      +----------------------+
+                                                | U-Boot SPL           |
+                                                | CONFIG_SPL_MAX_SIZE  |
+   image end                                    +----------------------+
+
+The DDR loader then performs the following handoff::
+
+   initialize and train DRAM
+
+   copy:
+     source      = CONFIG_MTK_GENIO_BROM_LOAD_ADDR
+                   + CONFIG_MTK_GENIO_DDR_LOADER_SIZE
+     destination = CONFIG_SPL_TEXT_BASE
+     size        = CONFIG_SPL_MAX_SIZE
+
+   enter:
+     PC          = CONFIG_SPL_TEXT_BASE
+     state       = AArch64 EL3h
+     exceptions  = masked
+     x0..x7      = 0
+
+The loader must copy the complete fixed-size SPL window, make the copied image
+coherent, leave the MMU and caches disabled and enter SPL with no live
+dependency on its own runtime state. The MMU and caches must be disabled at
+entry, and all writes performed by the loader must be visible to the CPU.
+SPL does not consume DRAM geometry, a devicetree or boot-source information
+from registers.
+
+SPL obtains platform information from its embedded control devicetree and
+initializes the console, clocks, pinctrl, watchdog and eMMC through U-Boot
+drivers.
+
+There is no runtime negotiation of these values. A replacement DDR loader is
+compatible only if it initializes the selected board's DRAM and follows the
+same image-layout and entry-state contract. It may represent the corresponding
+addresses, offsets and sizes using any implementation-specific mechanism; the
+contract does not require particular variable or build-symbol names.
+
+Firmware image prerequisites
+----------------------------
+
+The following external binaries are required to assemble the complete
+firmware images:
+
+``ddr-loader.bin``
+   A MediaTek DDR loader built for the target board and configured to satisfy
+   the handoff contract above. The input may be shorter than the configured
+   loader region; binman pads it with zeroes to the offset reserved before
+   SPL.
+
+``BL31``
+   The U-Boot build variable naming the Arm Trusted Firmware-A BL31 binary
+   built for the MT8188 platform. It is loaded and entered at
+   ``CONFIG_MTK_GENIO_BL31_LOAD_ADDR``.
+
+``TEE``
+   The U-Boot build variable naming the OP-TEE binary. A standard OP-TEE v1
+   ``tee.bin`` image is supported. Binman removes its header and derives the
+   load and entry addresses from it when creating the FIT.
+
+These binaries must match the selected board, its memory layout and its
+firmware security policy. In particular, a common image layout does not make
+DDR-loader or OP-TEE binaries interchangeable between the two boards. BL31 and
+OP-TEE must agree on the secure-memory layout. SPL passes OP-TEE's entry point
+in the standard BL31 parameters; ``CONFIG_SPL_ATF_NO_PLATFORM_PARAM`` suppresses
+only the separate platform parameter. Place
+``ddr-loader.bin`` in a directory which can be passed to binman with
+``BINMAN_INDIRS``.
+
+Building
+--------
+
+Select the defconfig for the target board. For example, for Genio 700::
+
+   $ export CROSS_COMPILE=aarch64-linux-gnu-
+   $ export KBUILD_OUTPUT=build
+   $ make mt8390_genio_700_evk_defconfig
+   $ make
+
+Use ``mt8370_genio_510_evk_defconfig`` instead for Genio 510.
+
+The default configuration builds U-Boot proper and SPL without requiring
+external firmware.
+
+This produces ``build/u-boot.bin`` and ``build/spl/u-boot-spl.bin`` without
+building ``mtk-boot.bin`` or ``bootloaders.img``. The DDR loader and BL31 are
+not needed in this case.
+
+Enabling SPL also stops automatic generation of the standalone
+``u-boot-mtk.bin`` BootROM image. ``u-boot.bin`` remains available for use as
+BL33 in the legacy FIP flow.
+
+Complete firmware images
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enable ``CONFIG_MTK_GENIO_BOOT_IMAGES`` to assemble the complete firmware
+images.
+Packaging disables ``CONFIG_SPL_BINMAN_SYMBOLS``: U-Boot proper is in the
+separate firmware FIT, not adjacent to SPL in the BootROM payload.
+For example, with the DDR loader in
+``/path/to/firmware/ddr-loader.bin``::
+
+   $ export BL31=/path/to/bl31.bin
+   $ export TEE=/path/to/tee.bin
+   $ make mt8390_genio_700_evk_defconfig
+   $ scripts/config --file "${KBUILD_OUTPUT}/.config" \
+         --enable MTK_GENIO_BOOT_IMAGES
+   $ make olddefconfig
+   $ make BINMAN_INDIRS=/path/to/firmware
+
+``TEE`` must be set for both configuration and compilation. U-Boot uses its
+presence during configuration to enable the support needed to preserve the
+OP-TEE reserved-memory nodes in the devicetree passed to the operating system.
+Do not deploy images if binman reports that it used fake or missing external
+blobs.
+
+Binman produces two deployable images and one intermediate payload in the
+build directory:
+
+``mtk-boot.bin``
+   A MediaTek eMMC image with load and entry address
+   ``CONFIG_MTK_GENIO_BROM_LOAD_ADDR``. It contains the DDR loader, padded to
+   ``CONFIG_MTK_GENIO_DDR_LOADER_SIZE``, followed by U-Boot SPL padded to
+   ``CONFIG_SPL_MAX_SIZE``. The fixed regions make every byte copied by the
+   external loader part of the BootROM-loaded image.
+
+``mtk-boot-payload.bin``
+   The raw DDR-loader and SPL payload contained in ``mtk-boot.bin``, without
+   the MediaTek BootROM header. This is an intermediate input for external
+   MediaTek secure-boot tooling and must not be flashed directly.
+
+``bootloaders.img``
+   A FIT image containing BL31, U-Boot proper, OP-TEE and the U-Boot control
+   devicetree. Each component has a SHA-256 hash.
+
+Binman also creates ``mtk-boot.map`` and ``bootloaders.map``. These show the
+offset and size of every component. The FIT can be inspected with::
+
+   $ dumpimage -l build/bootloaders.img
+
+Signed bootloader FIT
+~~~~~~~~~~~~~~~~~~~~~
+
+The default ``bootloaders.img`` contains hashes but is not authenticated.
+Enable ``CONFIG_SPL_FIT_SIGNATURE`` and its RSA/SHA-256 dependencies to sign
+the FIT configuration and require verification by SPL. Binman expects an
+RSA-3072 private key and certificate named ``bootloaders.key`` and
+``bootloaders.crt`` in one of the directories passed through
+``BINMAN_INDIRS``.
+
+For example, after enabling ``CONFIG_MTK_GENIO_BOOT_IMAGES`` as above::
+
+   $ scripts/config --file "${KBUILD_OUTPUT}/.config" \
+         --enable FIT_SIGNATURE \
+         --enable RSA \
+         --enable SHA256 \
+         --enable SPL_FIT_SIGNATURE \
+         --enable SPL_RSA \
+         --enable SPL_SHA256
+   $ make olddefconfig
+   $ make BINMAN_INDIRS=/path/to/firmware-and-keys
+
+The configuration signature covers BL31, U-Boot proper, OP-TEE and the U-Boot
+control devicetree. Binman injects the corresponding public key into the SPL
+control devicetree and marks it as required for FIT configurations.
+
+This signs the firmware FIT loaded by SPL, not the BootROM payload. To build a
+BootROM-authenticated image, pass ``mtk-boot-payload.bin`` to the platform
+secure-boot tooling and let that tooling create the final MediaTek wrapper.
+Key provisioning, rollback protection and BootROM authentication policy are
+outside U-Boot.
+
+Installing
+----------
+
+Use the board provisioning tools to place the images as follows:
+
+===================  ================================================
+Image                Destination
+===================  ================================================
+``mtk-boot.bin``     Start of the eMMC boot0 hardware partition
+``bootloaders.img``  GPT partition 1 in the eMMC user area
+===================  ================================================
+
+The standard Genio 510 and Genio 700 partition layouts name GPT partition 1
+``bootloaders``. SPL selects the partition by number through
+``CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION``; it does not locate it by name.
+
+Writing an invalid image to eMMC boot0 can make the board unbootable. Preserve
+the platform recovery path and any backup bootloader partition while testing.
+Selection of a backup partition is not implemented by this SPL configuration.
+
+Using Genio Tools
+~~~~~~~~~~~~~~~~~
+
+Install `Genio Tools
+<https://genio.mediatek.com/doc/iot-yocto/latest/tools/genio-tools.html>`_ and
+obtain a `prebuilt Genio image
+<https://genio.mediatek.com/doc/iot-yocto/latest/sw/yocto/download.html>`_.
+The image must be compatible with the target board. ``genio-flash`` needs its
+extracted directory for partition metadata and the download bootstrap. To
+update only the primary boot chain while retaining the backup bootloader
+partition, run::
+
+   $ genio-flash -P /path/to/genio-image \
+         mmc0boot0:/absolute/path/to/build/mtk-boot.bin \
+         bootloaders:/absolute/path/to/build/bootloaders.img
+
+Genio Tools uses the default bootstrap from the image directory. Keep
+``bootloaders_b`` unchanged until the new images have been tested. Add
+``--dry-run`` to check the selected files and partitions without accessing the
+board.

-- 
2.55.0


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

* Re: [PATCH v6 2/6] configs: mt8188: enable eMMC FIT boot from SPL
  2026-09-06 15:30 ` [PATCH v6 2/6] configs: mt8188: enable eMMC FIT boot from SPL Carlo Caione
@ 2026-09-07  3:45   ` Macpaul Lin (林智斌)
  2026-09-09 19:35   ` David Lechner
  1 sibling, 0 replies; 19+ messages in thread
From: Macpaul Lin (林智斌) @ 2026-09-07  3:45 UTC (permalink / raw)
  To: Carlo Caione, GSS_MTK_Uboot_upstream,
	u-boot@lists.u-boot-project.org
  Cc: Pablo Sun (孫毓翔),
	Chris-qj Chen (陳奇進),
	Bear Wang (萩原惟德),
	Chunfeng Yun (云春峰), Julien Stephan,
	Vitor Sato Eschholz, marek.vasut+renesas@mailbox.org,
	igor.belwon@mentallysanemainliners.org, trini@konsulko.com,
	Julien Masson, Arnaud Ferraris, Ht Lin (林瀚宗),
	David Lechner, u-boot@0leil.net, jbx6244@gmail.com,
	ilias.apalodimas@linaro.org, bastien.curutchet@bootlin.com,
	Suhrid Subramaniam, alchark@gmail.com, neil.armstrong@linaro.org,
	Ryder Lee, Weijie Gao (高惟杰)

[-- Attachment #1: Type: text/plain, Size: 2540 bytes --]

On Sun, 2026-09-06 at 17:30 +0200, Carlo Caione wrote:
> Enable the shared Genio 510/700 SPL path entered by the external DDR
> loader. Keep BSS after the downstream SPL reservation, leaving a
> 0xc800
> guard after the copy window and space for the initial stack and early
> allocations. Use an 8 MiB heap for loading the firmware FIT.
> 
> Load BL31, OP-TEE and U-Boot from eMMC partition 1 using generic SPL
> support. The MediaTek BL31 stalls when given a runtime devicetree as
> its
> platform parameter, so pass NULL there while retaining the standard
> firmware entry-point parameters.
> 
> Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
> Signed-off-by: Julien Stephan <jstephan@baylibre.com>
> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
> ---
>  configs/mt8188.config | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/configs/mt8188.config b/configs/mt8188.config
> index 29e2b3db878..a7a59940646 100644
> --- a/configs/mt8188.config
> +++ b/configs/mt8188.config
> @@ -28,3 +28,36 @@ CONFIG_MTK_SERIAL=y
>  CONFIG_WDT=y
>  CONFIG_WDT_MTK=y
>  # CONFIG_RANDOM_UUID is not set
> +CONFIG_SPL=y
> +# Fixed destination and copy window of the external DDR loader.
> +CONFIG_SPL_TEXT_BASE=0x40000000
> +CONFIG_SPL_MAX_SIZE=0xaf000
> +CONFIG_SPL_SEPARATE_BSS=y
> +CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> +# Preserve the downstream reservation, with a 0xc800-byte guard
> after SPL.
> +CONFIG_SPL_BSS_START_ADDR=0x400bb800
> +CONFIG_SPL_BSS_LIMIT=y
> +CONFIG_SPL_BSS_MAX_SIZE=0x10000
> +# Leave 448 KiB above the BSS limit for the stack, global data and
> early heap.
> +CONFIG_SYS_INIT_SP_BSS_OFFSET=0x80000
> +CONFIG_SPL_SYS_MALLOC=y
> +CONFIG_SPL_HAS_CUSTOM_MALLOC_START=y
> +# Keep the heap separate from the loaded firmware and its reserved
> memory.
> +CONFIG_SPL_CUSTOM_SYS_MALLOC_ADDR=0x5c000000
> +CONFIG_SPL_SYS_MALLOC_SIZE=0x800000
> +CONFIG_SPL_SYSCON=y
> +CONFIG_SPL_CLK=y
> +CONFIG_SPL_SERIAL=y
> +# CONFIG_SPL_USE_TINY_PRINTF is not set
> +CONFIG_SPL_PINCTRL=y
> +CONFIG_SPL_PINCONF=y
> +CONFIG_SPL_WATCHDOG=y
> +CONFIG_SPL_MMC=y
> +CONFIG_SPL_LIBDISK_SUPPORT=y
> +CONFIG_SPL_EFI_PARTITION=y
> +CONFIG_SPL_SYS_MMCSD_RAW_MODE=y
> +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
> +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=1
> +CONFIG_SPL_LOAD_FIT=y
> +CONFIG_SPL_ATF=y
> +CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
> 
> 
Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>

Thanks!
Macpaul Lin

[-- Attachment #2: Type: text/html, Size: 4663 bytes --]

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

* Re: [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot
  2026-09-06 15:30 ` [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot Carlo Caione
@ 2026-09-07  3:48   ` Macpaul Lin (林智斌)
  2026-09-09 19:56   ` David Lechner
  1 sibling, 0 replies; 19+ messages in thread
From: Macpaul Lin (林智斌) @ 2026-09-07  3:48 UTC (permalink / raw)
  To: Carlo Caione, GSS_MTK_Uboot_upstream,
	u-boot@lists.u-boot-project.org
  Cc: Pablo Sun (孫毓翔),
	Chris-qj Chen (陳奇進),
	Bear Wang (萩原惟德),
	Chunfeng Yun (云春峰), Julien Stephan,
	Vitor Sato Eschholz, marek.vasut+renesas@mailbox.org,
	igor.belwon@mentallysanemainliners.org, trini@konsulko.com,
	Julien Masson, Arnaud Ferraris, Ht Lin (林瀚宗),
	David Lechner, u-boot@0leil.net, jbx6244@gmail.com,
	ilias.apalodimas@linaro.org, bastien.curutchet@bootlin.com,
	Suhrid Subramaniam, alchark@gmail.com, neil.armstrong@linaro.org,
	Ryder Lee, Weijie Gao (高惟杰)

[-- Attachment #1: Type: text/plain, Size: 2322 bytes --]

On Sun, 2026-09-06 at 17:30 +0200, Carlo Caione wrote:
> Document the common Genio 510 and Genio 700 eMMC boot chain,
> board-specific external firmware prerequisites, binman build
> invocation
> and generated images.
> 
> Define the binary layout and execution-state ABI between an external
> DDR
> loader and SPL using the corresponding Kconfig symbols. Different
> loader
> implementations remain compatible when they satisfy this contract.
> Also
> require firmware handed to the RAM SPL loader to be a directly
> parseable
> FIT rather than a compressed FIT container.
> 
> Describe FIT signing, storage mapping and installation with Genio
> Tools.
> 
> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
> ---
>  board/mediatek/MAINTAINERS              |   1 +
>  doc/board/mediatek/index.rst            |   1 +
>  doc/board/mediatek/mt8188-genio-evk.rst | 274
> ++++++++++++++++++++++++++++++++
>  3 files changed, 276 insertions(+)
> 
> diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
> index 57bb3095305..aa862a4e1ea 100644
> --- a/board/mediatek/MAINTAINERS
> +++ b/board/mediatek/MAINTAINERS
> @@ -30,6 +30,7 @@ F:	arch/arm/dts/mt8390-genio-700-evk-u-
> boot.dtsi
>  F:	configs/mt8188.config
>  F:	configs/mt8370_genio_510_evk_defconfig
>  F:	configs/mt8390_genio_700_evk_defconfig
> +F:	doc/board/mediatek/mt8188-genio-evk.rst
>  
>  MT8195/MT8395
>  M:	Macpaul Lin <Macpaul.Lin@mediatek.com>
> diff --git a/doc/board/mediatek/index.rst
> b/doc/board/mediatek/index.rst
> index c55d5aeb5c4..7ca1bd9fde2 100644
> --- a/doc/board/mediatek/index.rst
> +++ b/doc/board/mediatek/index.rst
> @@ -7,3 +7,4 @@ Mediatek
>     :maxdepth: 2
>  
>     mt7621
> +   mt8188-genio-evk
> diff --git a/doc/board/mediatek/mt8188-genio-evk.rst
> b/doc/board/mediatek/mt8188-genio-evk.rst
> new file mode 100644
> index 00000000000..90bdd5cc3c8
> --- /dev/null
> +++ b/doc/board/mediatek/mt8188-genio-evk.rst
> @@ -0,0 +1,274 @@
> +.. SPDX-License-Identifier: GPL-2.0-or-later
> +.. Copyright (C) 2026 BayLibre SAS
> +
> +MediaTek Genio 510 and Genio 700 EVKs
> +======================================
> 

[snip...]

Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>

Thanks!
Macpaul Lin


[-- Attachment #2: Type: text/html, Size: 4492 bytes --]

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

* Re: [PATCH v6 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL
  2026-09-06 15:30 ` [PATCH v6 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL Carlo Caione
@ 2026-09-09 19:33   ` David Lechner
  2026-09-09 20:36     ` Carlo Caione
  0 siblings, 1 reply; 19+ messages in thread
From: David Lechner @ 2026-09-09 19:33 UTC (permalink / raw)
  To: Carlo Caione, GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, Julien Stephan, Macpaul Lin, Tom Rini,
	Ilias Apalodimas, Vitor Sato Eschholz, Johan Jonker,
	Bastien Curutchet, Neil Armstrong, Alexey Charkov,
	Suhrid Subramaniam, Arnaud Ferraris,
	Pablo Sun (孫毓翔)

On 9/6/26 10:30 AM, Carlo Caione wrote:
> The Genio 510 and Genio 700 boot flows enter U-Boot SPL after an
> external DDR loader has initialized DRAM. SPL then needs the debug UART
> and eMMC controller, together with their clock, syscon, pinctrl and
> watchdog providers, to load the firmware FIT.
> 
> Both boards share this MT8188-family dependency chain, so keep the
> pre-RAM annotations in a common include used by their board-specific
> U-Boot devicetrees.
> 

...

> +/ {
> +	memory@40000000 {
> +		/* Preserve the board memory description; the loader initializes DRAM. */
> +		bootph-pre-ram;

Having this on memory seems a bit odd. Is it actually needed?

> +	};
> +};
> +

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

* Re: [PATCH v6 2/6] configs: mt8188: enable eMMC FIT boot from SPL
  2026-09-06 15:30 ` [PATCH v6 2/6] configs: mt8188: enable eMMC FIT boot from SPL Carlo Caione
  2026-09-07  3:45   ` Macpaul Lin (林智斌)
@ 2026-09-09 19:35   ` David Lechner
  2026-09-09 20:37     ` Carlo Caione
  1 sibling, 1 reply; 19+ messages in thread
From: David Lechner @ 2026-09-09 19:35 UTC (permalink / raw)
  To: Carlo Caione, GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, Julien Stephan, Macpaul Lin, Tom Rini,
	Ilias Apalodimas, Vitor Sato Eschholz, Johan Jonker,
	Bastien Curutchet, Neil Armstrong, Alexey Charkov,
	Suhrid Subramaniam, Arnaud Ferraris,
	Pablo Sun (孫毓翔)

On 9/6/26 10:30 AM, Carlo Caione wrote:
> Enable the shared Genio 510/700 SPL path entered by the external DDR
> loader. Keep BSS after the downstream SPL reservation, leaving a 0xc800
> guard after the copy window and space for the initial stack and early
> allocations. Use an 8 MiB heap for loading the firmware FIT.
> 
> Load BL31, OP-TEE and U-Boot from eMMC partition 1 using generic SPL
> support. The MediaTek BL31 stalls when given a runtime devicetree as its
> platform parameter, so pass NULL there while retaining the standard
> firmware entry-point parameters.
> 
> Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
> Signed-off-by: Julien Stephan <jstephan@baylibre.com>
> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
> ---
>  configs/mt8188.config | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/configs/mt8188.config b/configs/mt8188.config
> index 29e2b3db878..a7a59940646 100644
> --- a/configs/mt8188.config
> +++ b/configs/mt8188.config
> @@ -28,3 +28,36 @@ CONFIG_MTK_SERIAL=y
>  CONFIG_WDT=y
>  CONFIG_WDT_MTK=y
>  # CONFIG_RANDOM_UUID is not set
> +CONFIG_SPL=y
> +# Fixed destination and copy window of the external DDR loader.
> +CONFIG_SPL_TEXT_BASE=0x40000000
> +CONFIG_SPL_MAX_SIZE=0xaf000
> +CONFIG_SPL_SEPARATE_BSS=y
> +CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> +# Preserve the downstream reservation, with a 0xc800-byte guard after SPL.
> +CONFIG_SPL_BSS_START_ADDR=0x400bb800
> +CONFIG_SPL_BSS_LIMIT=y
> +CONFIG_SPL_BSS_MAX_SIZE=0x10000
> +# Leave 448 KiB above the BSS limit for the stack, global data and early heap.
> +CONFIG_SYS_INIT_SP_BSS_OFFSET=0x80000
> +CONFIG_SPL_SYS_MALLOC=y
> +CONFIG_SPL_HAS_CUSTOM_MALLOC_START=y
> +# Keep the heap separate from the loaded firmware and its reserved memory.
> +CONFIG_SPL_CUSTOM_SYS_MALLOC_ADDR=0x5c000000
> +CONFIG_SPL_SYS_MALLOC_SIZE=0x800000
> +CONFIG_SPL_SYSCON=y
> +CONFIG_SPL_CLK=y
> +CONFIG_SPL_SERIAL=y

> +# CONFIG_SPL_USE_TINY_PRINTF is not set

I guess this is for SPL fastboot support later?

> +CONFIG_SPL_PINCTRL=y
> +CONFIG_SPL_PINCONF=y
> +CONFIG_SPL_WATCHDOG=y
> +CONFIG_SPL_MMC=y
> +CONFIG_SPL_LIBDISK_SUPPORT=y
> +CONFIG_SPL_EFI_PARTITION=y
> +CONFIG_SPL_SYS_MMCSD_RAW_MODE=y
> +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
> +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=1
> +CONFIG_SPL_LOAD_FIT=y
> +CONFIG_SPL_ATF=y
> +CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
> 


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

* Re: [PATCH v6 3/6] arm: mediatek: build Genio 510 and 700 boot images with binman
  2026-09-06 15:30 ` [PATCH v6 3/6] arm: mediatek: build Genio 510 and 700 boot images with binman Carlo Caione
@ 2026-09-09 19:39   ` David Lechner
  2026-09-09 20:42     ` Carlo Caione
  0 siblings, 1 reply; 19+ messages in thread
From: David Lechner @ 2026-09-09 19:39 UTC (permalink / raw)
  To: Carlo Caione, GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, Julien Stephan, Macpaul Lin, Tom Rini,
	Ilias Apalodimas, Vitor Sato Eschholz, Johan Jonker,
	Bastien Curutchet, Neil Armstrong, Alexey Charkov,
	Suhrid Subramaniam, Arnaud Ferraris,
	Pablo Sun (孫毓翔)

On 9/6/26 10:30 AM, Carlo Caione wrote:
> Genio 510 and Genio 700 use an external DDR loader before SPL, then load
> the remaining firmware from a FIT. Keep packaging optional because this
> platform firmware is built outside U-Boot.
> 
> Separate the container, loader/SPL payload and firmware FIT descriptions
> so their layouts can be reused independently. Generate the loadables list
> to include every OP-TEE segment.
> 
> Request AArch64 BootROM entry for the DDR loader. Disable SPL binman
> symbols since U-Boot proper lives in the separate FIT, not alongside SPL.
> 
> Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
> Signed-off-by: Julien Stephan <jstephan@baylibre.com>
> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
> ---
>  arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi      |  9 ++
>  arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi      |  9 ++
>  arch/arm/dts/mtk-genio-binman-u-boot.dtsi          | 12 +++
>  .../dts/mtk-genio-bootloaders-binman-u-boot.dtsi   | 98 ++++++++++++++++++++++
>  .../dts/mtk-genio-loader-spl-binman-u-boot.dtsi    | 17 ++++
>  arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi | 26 ++++++
>  arch/arm/mach-mediatek/Kconfig                     | 41 ++++++++-
>  board/mediatek/MAINTAINERS                         |  2 +
>  common/spl/Kconfig                                 |  1 +
>  9 files changed, 214 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi b/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
> index 223f1371b9e..10b9a142f37 100644
> --- a/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
> +++ b/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
> @@ -4,4 +4,13 @@
>   * Author: Julien Stephan <jstephan@baylibre.com>
>   */
>  
> +#include <config.h>
>  #include "mt8390-genio-common-u-boot.dtsi"
> +
> +#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
> +#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 510 bootloaders"
> +#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 510 boot chain"
> +#include "mtk-genio-binman-u-boot.dtsi"
> +#include "mtk-genio-mtk-boot-binman-u-boot.dtsi"
> +#include "mtk-genio-bootloaders-binman-u-boot.dtsi"
> +#endif
> diff --git a/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi b/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
> index 223f1371b9e..6230b016ca0 100644
> --- a/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
> +++ b/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
> @@ -4,4 +4,13 @@
>   * Author: Julien Stephan <jstephan@baylibre.com>
>   */
>  
> +#include <config.h>
>  #include "mt8390-genio-common-u-boot.dtsi"
> +
> +#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
> +#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 700 bootloaders"
> +#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 700 boot chain"
> +#include "mtk-genio-binman-u-boot.dtsi"
> +#include "mtk-genio-mtk-boot-binman-u-boot.dtsi"
> +#include "mtk-genio-bootloaders-binman-u-boot.dtsi"
> +#endif
> diff --git a/arch/arm/dts/mtk-genio-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-binman-u-boot.dtsi
> new file mode 100644
> index 00000000000..ff4557e5072
> --- /dev/null
> +++ b/arch/arm/dts/mtk-genio-binman-u-boot.dtsi
> @@ -0,0 +1,12 @@
> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
> +/*
> + * Copyright (c) 2026 BayLibre SAS
> + * Author: Julien Stephan <jstephan@baylibre.com>
> + * Author: Carlo Caione <ccaione@baylibre.com>
> + */
> +
> +/ {
> +	binman: binman {
> +		multiple-images;
> +	};
> +};
> diff --git a/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
> new file mode 100644
> index 00000000000..d8aea85f47e
> --- /dev/null
> +++ b/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
> @@ -0,0 +1,98 @@
> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
> +/*
> + * Copyright (c) 2026 BayLibre SAS
> + * Author: Julien Stephan <jstephan@baylibre.com>
> + * Author: Carlo Caione <ccaione@baylibre.com>
> + */
> +
> +&binman {
> +	bootloaders {
> +		filename = "bootloaders.img";
> +
> +		fit {
> +			description = MTK_BOOTLOADERS_DESCRIPTION;
> +			#address-cells = <1>;
> +			fit,fdt-list-val = "u-boot";
> +
> +			images {
> +				uboot {
> +					description = "U-Boot";
> +					type = "firmware";
> +					os = "u-boot";
> +					arch = "arm64";
> +					compression = "none";
> +					load = <CONFIG_TEXT_BASE>;
> +					entry = <CONFIG_TEXT_BASE>;
> +
> +					u-boot-nodtb {
> +					};
> +
> +					hash {
> +						algo = "sha256";
> +					};
> +				};
> +
> +				atf {
> +					description = "ARM Trusted Firmware BL31";
> +					type = "firmware";
> +					os = "arm-trusted-firmware";
> +					arch = "arm64";
> +					compression = "none";
> +					load = <CONFIG_MTK_GENIO_BL31_LOAD_ADDR>;
> +					entry = <CONFIG_MTK_GENIO_BL31_LOAD_ADDR>;
> +
> +					atf-bl31 {
> +					};
> +
> +					hash {
> +						algo = "sha256";
> +					};
> +				};
> +
> +				@optee-SEQ {
> +					fit,operation = "split-elf";
> +					description = "OP-TEE";
> +					type = "firmware";
> +					os = "tee";
> +					arch = "arm64";
> +					compression = "none";
> +					fit,load;
> +					fit,entry;
> +					fit,data;
> +
> +					tee-os {
> +					};
> +
> +					hash {
> +						algo = "sha256";
> +					};
> +				};
> +
> +				uboot-fdt {
> +					description = "U-Boot control devicetree";
> +					type = "flat_dt";
> +					arch = "arm64";
> +					compression = "none";
> +
> +					u-boot-dtb {
> +					};
> +
> +					hash {
> +						algo = "sha256";
> +					};
> +				};
> +			};
> +
> +			configurations {
> +				default = "conf";
> +
> +				@conf {
> +					description = MTK_BOOT_CHAIN_DESCRIPTION;
> +					fit,firmware = "atf", "uboot";
> +					fit,loadables;
> +					fdt = "uboot-fdt";
> +				};
> +			};
> +		};
> +	};
> +};
> diff --git a/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi
> new file mode 100644
> index 00000000000..c97797405b7
> --- /dev/null
> +++ b/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi
> @@ -0,0 +1,17 @@
> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
> +/*
> + * Copyright (c) 2026 BayLibre SAS
> + * Author: Julien Stephan <jstephan@baylibre.com>
> + * Author: Carlo Caione <ccaione@baylibre.com>
> + */
> +
> +/* Include within a section: the loader and SPL form one contiguous payload. */
> +ddr-loader {
> +	type = "blob-ext";
> +	filename = "ddr-loader.bin";
> +	size = <CONFIG_MTK_GENIO_DDR_LOADER_SIZE>;
> +};
> +
> +u-boot-spl {
> +	size = <CONFIG_SPL_MAX_SIZE>;
> +};
> diff --git a/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi
> new file mode 100644
> index 00000000000..a7ee09feba0
> --- /dev/null
> +++ b/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi
> @@ -0,0 +1,26 @@
> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
> +/*
> + * Copyright (c) 2026 BayLibre SAS
> + * Author: Julien Stephan <jstephan@baylibre.com>
> + * Author: Carlo Caione <ccaione@baylibre.com>
> + */
> +
> +#include <linux/stringify.h>
> +
> +&binman {
> +	mtk-boot {
> +		filename = "mtk-boot.bin";
> +
> +		mkimage {
> +			args = "-T", "mtk_image",
> +			       "-a", __stringify(CONFIG_MTK_GENIO_BROM_LOAD_ADDR),
> +			       "-e", __stringify(CONFIG_MTK_GENIO_BROM_LOAD_ADDR),
> +			       "-n", CONFIG_MTK_BROM_HEADER_INFO;
> +
> +			section {
> +				pad-byte = <0>;
> +#include "mtk-genio-loader-spl-binman-u-boot.dtsi"
> +			};
> +		};
> +	};
> +};
> diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig
> index 5e6c50ca64d..e572cfe8571 100644
> --- a/arch/arm/mach-mediatek/Kconfig
> +++ b/arch/arm/mach-mediatek/Kconfig
> @@ -207,9 +207,48 @@ config SYS_CONFIG_NAME
>  config MTK_BROM_HEADER_INFO
>  	string
>  	default "media=nor" if TARGET_MT8518 || TARGET_MT8512 || TARGET_MT7629
> -	default "media=emmc" if TARGET_MT8516 || TARGET_MT8365 || TARGET_MT8183 || TARGET_MT8188 || TARGET_MT8189 || TARGET_MT8195
> +	default "media=emmc;arm64=1" if TARGET_MT8188
> +	default "media=emmc" if TARGET_MT8516 || TARGET_MT8365 || TARGET_MT8183 || TARGET_MT8189 || TARGET_MT8195
>  	default "lk=1" if TARGET_MT7623
>  
> +config MTK_GENIO_BOOT_IMAGES
> +	bool "Build MediaTek firmware images"
> +	depends on TARGET_MT8188 && SPL
> +	select BINMAN
> +	select MTK_GENIO_IMAGE_CONTRACT
> +	help
> +	  Enable binman to assemble the MediaTek BootROM image and firmware
> +	  FIT from U-Boot and external platform firmware components.
> +
> +config MTK_GENIO_IMAGE_CONTRACT
> +	bool

Do we actually need this separate option since only MTK_GENIO_BOOT_IMAGES
selects it? Seems like we could just use MTK_GENIO_BOOT_IMAGES instead.

> +
> +if MTK_GENIO_IMAGE_CONTRACT
> +
> +config MTK_GENIO_BROM_LOAD_ADDR
> +	hex "BootROM payload load address"
> +	default 0x201000 if TARGET_MT8188
> +	help
> +	  Address at which the MediaTek BootROM loads and enters the external
> +	  DDR loader.
> +
> +config MTK_GENIO_DDR_LOADER_SIZE
> +	hex "DDR-loader image region size"
> +	default 0x4b000 if TARGET_MT8188
> +	help
> +	  Size reserved for the external DDR loader at the start of the
> +	  BootROM payload. This is also the offset of U-Boot SPL and must match
> +	  the offset used by the loader when copying SPL to DRAM.
> +
> +config MTK_GENIO_BL31_LOAD_ADDR
> +	hex "BL31 load and entry address"
> +	default 0x54601000 if TARGET_MT8188
> +	help
> +	  Address at which SPL loads and enters BL31. This must match the
> +	  platform firmware's link address and secure-memory layout.
> +
> +endif
> +
>  config MTK_TZ_MOVABLE
>  	select ARCH_MISC_INIT
>  	select OF_SYSTEM_SETUP
> diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
> index d0d25b096e5..57bb3095305 100644
> --- a/board/mediatek/MAINTAINERS
> +++ b/board/mediatek/MAINTAINERS
> @@ -24,6 +24,8 @@ S:	Maintained
>  F:	arch/arm/dts/mt8188-u-boot.dtsi
>  F:	arch/arm/dts/mt8390-genio-common-u-boot.dtsi
>  F:	arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
> +F:	arch/arm/dts/mtk-genio-*-binman-u-boot.dtsi
> +F:	arch/arm/dts/mtk-genio-binman-u-boot.dtsi

These look out of order. I would go with a mechanical sort order here.

>  F:	arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
>  F:	configs/mt8188.config
>  F:	configs/mt8370_genio_510_evk_defconfig
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 0618f42c941..f9b453df766 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -194,6 +194,7 @@ config SPL_SHOW_ERRORS
>  config SPL_BINMAN_SYMBOLS
>  	bool "Declare binman symbols in SPL"
>  	depends on SPL_FRAMEWORK && BINMAN
> +	default n if MTK_GENIO_BOOT_IMAGES
>  	default y
>  	help
>  	  This enables use of symbols in SPL which refer to other entries in
> 


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

* Re: [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot
  2026-09-06 15:30 ` [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot Carlo Caione
  2026-09-07  3:48   ` Macpaul Lin (林智斌)
@ 2026-09-09 19:56   ` David Lechner
  2026-09-09 20:54     ` Carlo Caione
  1 sibling, 1 reply; 19+ messages in thread
From: David Lechner @ 2026-09-09 19:56 UTC (permalink / raw)
  To: Carlo Caione, GSS_MTK_Uboot_upstream, u-boot
  Cc: Julien Masson, Quentin Schulz, Marek Vasut, Ryder Lee, Weijie Gao,
	Chunfeng Yun, Igor Belwon, Julien Stephan, Macpaul Lin, Tom Rini,
	Ilias Apalodimas, Vitor Sato Eschholz, Johan Jonker,
	Bastien Curutchet, Neil Armstrong, Alexey Charkov,
	Suhrid Subramaniam, Arnaud Ferraris,
	Pablo Sun (孫毓翔)

On 9/6/26 10:30 AM, Carlo Caione wrote:
> Document the common Genio 510 and Genio 700 eMMC boot chain,
> board-specific external firmware prerequisites, binman build invocation
> and generated images.
> 

...

> +DDR-loader handoff contract
> +---------------------------
> +
> +The DDR loader and U-Boot SPL have no parameter-block or firmware-call
> +interface. Their contract consists of a fixed image layout, initialized DRAM
> +and the execution state at the SPL entry point. Different DDR-loader
> +implementations may be used as long as they satisfy this contract for the
> +selected board. The BootROM loads the eMMC boot0 payload to
> +``CONFIG_MTK_GENIO_BROM_LOAD_ADDR``::
> +
> +   offset 0                                     +----------------------+
> +                                                | DDR loader           |
> +                                                |                      |
> +   offset CONFIG_MTK_GENIO_DDR_LOADER_SIZE      +----------------------+
> +                                                | U-Boot SPL           |
> +                                                | CONFIG_SPL_MAX_SIZE  |
> +   image end                                    +----------------------+
> +
> +The DDR loader then performs the following handoff::
> +
> +   initialize and train DRAM
> +
> +   copy:
> +     source      = CONFIG_MTK_GENIO_BROM_LOAD_ADDR
> +                   + CONFIG_MTK_GENIO_DDR_LOADER_SIZE
> +     destination = CONFIG_SPL_TEXT_BASE
> +     size        = CONFIG_SPL_MAX_SIZE

Do CONFIG_MTK_GENIO_DDR_LOADER_SIZE and CONFIG_SPL_MAX_SIZE need to be the
same or just CONFIG_SPL_MAX_SIZE >= CONFIG_MTK_GENIO_DDR_LOADER_SIZE?

> +
> +   enter:
> +     PC          = CONFIG_SPL_TEXT_BASE
> +     state       = AArch64 EL3h
> +     exceptions  = masked
> +     x0..x7      = 0
> +
> +The loader must copy the complete fixed-size SPL window, make the copied image
> +coherent, leave the MMU and caches disabled and enter SPL with no live
> +dependency on its own runtime state. The MMU and caches must be disabled at
> +entry, and all writes performed by the loader must be visible to the CPU.
> +SPL does not consume DRAM geometry, a devicetree or boot-source information
> +from registers.
> +
> +SPL obtains platform information from its embedded control devicetree and
> +initializes the console, clocks, pinctrl, watchdog and eMMC through U-Boot
> +drivers.
> +
> +There is no runtime negotiation of these values. A replacement DDR loader is
> +compatible only if it initializes the selected board's DRAM and follows the
> +same image-layout and entry-state contract. It may represent the corresponding
> +addresses, offsets and sizes using any implementation-specific mechanism; the
> +contract does not require particular variable or build-symbol names.
> +
> +Firmware image prerequisites
> +----------------------------
> +
> +The following external binaries are required to assemble the complete
> +firmware images:
> +
> +``ddr-loader.bin``
> +   A MediaTek DDR loader built for the target board and configured to satisfy
> +   the handoff contract above. The input may be shorter than the configured
> +   loader region; binman pads it with zeroes to the offset reserved before

s/zeroes/zeros/

> +   SPL.
> +
> +``BL31``
> +   The U-Boot build variable naming the Arm Trusted Firmware-A BL31 binary
> +   built for the MT8188 platform. It is loaded and entered at
> +   ``CONFIG_MTK_GENIO_BL31_LOAD_ADDR``.
> +
> +``TEE``
> +   The U-Boot build variable naming the OP-TEE binary. A standard OP-TEE v1
> +   ``tee.bin`` image is supported. Binman removes its header and derives the
> +   load and entry addresses from it when creating the FIT.
> +
> +These binaries must match the selected board, its memory layout and its
> +firmware security policy. In particular, a common image layout does not make
> +DDR-loader or OP-TEE binaries interchangeable between the two boards. BL31 and
> +OP-TEE must agree on the secure-memory layout. SPL passes OP-TEE's entry point
> +in the standard BL31 parameters; ``CONFIG_SPL_ATF_NO_PLATFORM_PARAM`` suppresses

> +only the separate platform parameter. Place
> +``ddr-loader.bin`` in a directory which can be passed to binman with

Strange line wrap here.

> +``BINMAN_INDIRS``.
> +

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

* Re: [PATCH v6 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL
  2026-09-09 19:33   ` David Lechner
@ 2026-09-09 20:36     ` Carlo Caione
  0 siblings, 0 replies; 19+ messages in thread
From: Carlo Caione @ 2026-09-09 20:36 UTC (permalink / raw)
  To: David Lechner
  Cc: GSS_MTK_Uboot_upstream, u-boot, Julien Masson, Quentin Schulz,
	Marek Vasut, Ryder Lee, Weijie Gao, Chunfeng Yun, Igor Belwon,
	Julien Stephan, Macpaul Lin, Tom Rini, Ilias Apalodimas,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

On Wed, Sep 09, 2026 at 14:33:34 +0100, David Lechner wrote:
> On 9/6/26 10:30 AM, Carlo Caione wrote:
> > The Genio 510 and Genio 700 boot flows enter U-Boot SPL after an
> > external DDR loader has initialized DRAM. SPL then needs the debug UART
> > and eMMC controller, together with their clock, syscon, pinctrl and
> > watchdog providers, to load the firmware FIT.
> > 
> > Both boards share this MT8188-family dependency chain, so keep the
> > pre-RAM annotations in a common include used by their board-specific
> > U-Boot devicetrees.
> > 
> 
> ...
> 
> > +/ {
> > +	memory@40000000 {
> > +		/* Preserve the board memory description; the loader initializes DRAM. */
> > +		bootph-pre-ram;
> 
> Having this on memory seems a bit odd. Is it actually needed?

I thought it was but I was wrong. I'll remove it.

--
Carlo Caione

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

* Re: [PATCH v6 2/6] configs: mt8188: enable eMMC FIT boot from SPL
  2026-09-09 19:35   ` David Lechner
@ 2026-09-09 20:37     ` Carlo Caione
  0 siblings, 0 replies; 19+ messages in thread
From: Carlo Caione @ 2026-09-09 20:37 UTC (permalink / raw)
  To: David Lechner
  Cc: GSS_MTK_Uboot_upstream, u-boot, Julien Masson, Quentin Schulz,
	Marek Vasut, Ryder Lee, Weijie Gao, Chunfeng Yun, Igor Belwon,
	Julien Stephan, Macpaul Lin, Tom Rini, Ilias Apalodimas,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

On Wed, Sep 09, 2026 at 14:35:53 +0100, David Lechner wrote:
> On 9/6/26 10:30 AM, Carlo Caione wrote:
> > Enable the shared Genio 510/700 SPL path entered by the external DDR
> > loader. Keep BSS after the downstream SPL reservation, leaving a 0xc800
> > guard after the copy window and space for the initial stack and early
> > allocations. Use an 8 MiB heap for loading the firmware FIT.
> > 
> > Load BL31, OP-TEE and U-Boot from eMMC partition 1 using generic SPL
> > support. The MediaTek BL31 stalls when given a runtime devicetree as its
> > platform parameter, so pass NULL there while retaining the standard
> > firmware entry-point parameters.

[...] 
> > +# CONFIG_SPL_USE_TINY_PRINTF is not set
> 
> I guess this is for SPL fastboot support later?

Fastboot needs it too, but the current normal SPL configuration already
requires it: the MediaTek pinctrl driver's mtk_get_pin_muxing() and
mtk_pinconf_get() use scnprintf(), which tiny printf doesn't provide.

--
Carlo Caione

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

* Re: [PATCH v6 3/6] arm: mediatek: build Genio 510 and 700 boot images with binman
  2026-09-09 19:39   ` David Lechner
@ 2026-09-09 20:42     ` Carlo Caione
  0 siblings, 0 replies; 19+ messages in thread
From: Carlo Caione @ 2026-09-09 20:42 UTC (permalink / raw)
  To: David Lechner
  Cc: GSS_MTK_Uboot_upstream, u-boot, Julien Masson, Quentin Schulz,
	Marek Vasut, Ryder Lee, Weijie Gao, Chunfeng Yun, Igor Belwon,
	Julien Stephan, Macpaul Lin, Tom Rini, Ilias Apalodimas,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

On Wed, Sep 09, 2026 at 14:39:26 +0100, David Lechner wrote:
> On 9/6/26 10:30 AM, Carlo Caione wrote:
> > Genio 510 and Genio 700 use an external DDR loader before SPL, then load
> > the remaining firmware from a FIT. Keep packaging optional because this
> > platform firmware is built outside U-Boot.
> > 
> > Separate the container, loader/SPL payload and firmware FIT descriptions
> > so their layouts can be reused independently. Generate the loadables list
> > to include every OP-TEE segment.
> > 
> > Request AArch64 BootROM entry for the DDR loader. Disable SPL binman
> > symbols since U-Boot proper lives in the separate FIT, not alongside SPL.

[...]
> > +config MTK_GENIO_IMAGE_CONTRACT
> > +	bool
> 
> Do we actually need this separate option since only MTK_GENIO_BOOT_IMAGES
> selects it? Seems like we could just use MTK_GENIO_BOOT_IMAGES instead.

Yeah, we need this. There is only one selector in this series but
the other consumer is the follow-up MediaTek download-agent support:
MTK_BROM_DOWNLOAD_AGENT (will?) selects the same image-layout options
without enabling MTK_GENIO_BOOT_IMAGES.

--
Carlo Caione

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

* Re: [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot
  2026-09-09 19:56   ` David Lechner
@ 2026-09-09 20:54     ` Carlo Caione
  2026-09-09 20:58       ` Carlo Caione
  2026-09-09 21:00       ` David Lechner
  0 siblings, 2 replies; 19+ messages in thread
From: Carlo Caione @ 2026-09-09 20:54 UTC (permalink / raw)
  To: David Lechner
  Cc: GSS_MTK_Uboot_upstream, u-boot, Julien Masson, Quentin Schulz,
	Marek Vasut, Ryder Lee, Weijie Gao, Chunfeng Yun, Igor Belwon,
	Julien Stephan, Macpaul Lin, Tom Rini, Ilias Apalodimas,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

On Wed, Sep 09, 2026 at 14:56:02 +0100, David Lechner wrote:
> On 9/6/26 10:30 AM, Carlo Caione wrote:
> > Document the common Genio 510 and Genio 700 eMMC boot chain,
> > board-specific external firmware prerequisites, binman build invocation
> > and generated images.
> > 
> 
> ...
> 
> > +DDR-loader handoff contract
> > +---------------------------
> > +
> > +The DDR loader and U-Boot SPL have no parameter-block or firmware-call
> > +interface. Their contract consists of a fixed image layout, initialized DRAM
> > +and the execution state at the SPL entry point. Different DDR-loader
> > +implementations may be used as long as they satisfy this contract for the
> > +selected board. The BootROM loads the eMMC boot0 payload to
> > +``CONFIG_MTK_GENIO_BROM_LOAD_ADDR``::
> > +
> > +   offset 0                                     +----------------------+
> > +                                                | DDR loader           |
> > +                                                |                      |
> > +   offset CONFIG_MTK_GENIO_DDR_LOADER_SIZE      +----------------------+
> > +                                                | U-Boot SPL           |
> > +                                                | CONFIG_SPL_MAX_SIZE  |
> > +   image end                                    +----------------------+
> > +
> > +The DDR loader then performs the following handoff::
> > +
> > +   initialize and train DRAM
> > +
> > +   copy:
> > +     source      = CONFIG_MTK_GENIO_BROM_LOAD_ADDR
> > +                   + CONFIG_MTK_GENIO_DDR_LOADER_SIZE
> > +     destination = CONFIG_SPL_TEXT_BASE
> > +     size        = CONFIG_SPL_MAX_SIZE
> 
> Do CONFIG_MTK_GENIO_DDR_LOADER_SIZE and CONFIG_SPL_MAX_SIZE need to be the
> same or just CONFIG_SPL_MAX_SIZE >= CONFIG_MTK_GENIO_DDR_LOADER_SIZE?

They refer to two different things: CONFIG_MTK_GENIO_DDR_LOADER_SIZE
reserves space for the DDR loader while CONFIG_MTK_GENIO_DDR_LOADER_SIZE
is the size of the following SPL region which the loader copies to DRAM.

--
Carlo Caione

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

* Re: [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot
  2026-09-09 20:54     ` Carlo Caione
@ 2026-09-09 20:58       ` Carlo Caione
  2026-09-09 21:00       ` David Lechner
  1 sibling, 0 replies; 19+ messages in thread
From: Carlo Caione @ 2026-09-09 20:58 UTC (permalink / raw)
  To: David Lechner
  Cc: GSS_MTK_Uboot_upstream, u-boot, Julien Masson, Quentin Schulz,
	Marek Vasut, Ryder Lee, Weijie Gao, Chunfeng Yun, Igor Belwon,
	Julien Stephan, Macpaul Lin, Tom Rini, Ilias Apalodimas,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

On Wed, Sep 09, 2026 at 22:54:05 +0100, Carlo Caione wrote:
> On Wed, Sep 09, 2026 at 14:56:02 +0100, David Lechner wrote:
> > On 9/6/26 10:30 AM, Carlo Caione wrote:

[...]
> > Do CONFIG_MTK_GENIO_DDR_LOADER_SIZE and CONFIG_SPL_MAX_SIZE need to be the
> > same or just CONFIG_SPL_MAX_SIZE >= CONFIG_MTK_GENIO_DDR_LOADER_SIZE?
> 
> They refer to two different things: CONFIG_MTK_GENIO_DDR_LOADER_SIZE
> reserves space for the DDR loader while CONFIG_MTK_GENIO_DDR_LOADER_SIZE
> is the size of the following SPL region which the loader copies to DRAM.

Damn, of course the second one is CONFIG_SPL_MAX_SIZE.

--
Carlo Caione

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

* Re: [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot
  2026-09-09 20:54     ` Carlo Caione
  2026-09-09 20:58       ` Carlo Caione
@ 2026-09-09 21:00       ` David Lechner
  1 sibling, 0 replies; 19+ messages in thread
From: David Lechner @ 2026-09-09 21:00 UTC (permalink / raw)
  To: Carlo Caione
  Cc: GSS_MTK_Uboot_upstream, u-boot, Julien Masson, Quentin Schulz,
	Marek Vasut, Ryder Lee, Weijie Gao, Chunfeng Yun, Igor Belwon,
	Julien Stephan, Macpaul Lin, Tom Rini, Ilias Apalodimas,
	Vitor Sato Eschholz, Johan Jonker, Bastien Curutchet,
	Neil Armstrong, Alexey Charkov, Suhrid Subramaniam,
	Arnaud Ferraris, Pablo Sun (孫毓翔)

On 9/9/26 3:54 PM, Carlo Caione wrote:
> On Wed, Sep 09, 2026 at 14:56:02 +0100, David Lechner wrote:
>> On 9/6/26 10:30 AM, Carlo Caione wrote:
>>> Document the common Genio 510 and Genio 700 eMMC boot chain,
>>> board-specific external firmware prerequisites, binman build invocation
>>> and generated images.
>>>
>>
>> ...
>>
>>> +DDR-loader handoff contract
>>> +---------------------------
>>> +
>>> +The DDR loader and U-Boot SPL have no parameter-block or firmware-call
>>> +interface. Their contract consists of a fixed image layout, initialized DRAM
>>> +and the execution state at the SPL entry point. Different DDR-loader
>>> +implementations may be used as long as they satisfy this contract for the
>>> +selected board. The BootROM loads the eMMC boot0 payload to
>>> +``CONFIG_MTK_GENIO_BROM_LOAD_ADDR``::
>>> +
>>> +   offset 0                                     +----------------------+
>>> +                                                | DDR loader           |
>>> +                                                |                      |
>>> +   offset CONFIG_MTK_GENIO_DDR_LOADER_SIZE      +----------------------+
>>> +                                                | U-Boot SPL           |
>>> +                                                | CONFIG_SPL_MAX_SIZE  |
>>> +   image end                                    +----------------------+
>>> +
>>> +The DDR loader then performs the following handoff::
>>> +
>>> +   initialize and train DRAM
>>> +
>>> +   copy:
>>> +     source      = CONFIG_MTK_GENIO_BROM_LOAD_ADDR
>>> +                   + CONFIG_MTK_GENIO_DDR_LOADER_SIZE
>>> +     destination = CONFIG_SPL_TEXT_BASE
>>> +     size        = CONFIG_SPL_MAX_SIZE
>>
>> Do CONFIG_MTK_GENIO_DDR_LOADER_SIZE and CONFIG_SPL_MAX_SIZE need to be the
>> same or just CONFIG_SPL_MAX_SIZE >= CONFIG_MTK_GENIO_DDR_LOADER_SIZE?
> 
> They refer to two different things: CONFIG_MTK_GENIO_DDR_LOADER_SIZE
> reserves space for the DDR loader while CONFIG_MTK_GENIO_DDR_LOADER_SIZE
> is the size of the following SPL region which the loader copies to DRAM.
> 
> --
> Carlo Caione

Ah, makes sense now, the SPL source is appended right after the ddr loader.

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

end of thread, other threads:[~2026-09-09 21:00 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-06 15:30 [PATCH v6 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
2026-09-06 15:30 ` [PATCH v6 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL Carlo Caione
2026-09-09 19:33   ` David Lechner
2026-09-09 20:36     ` Carlo Caione
2026-09-06 15:30 ` [PATCH v6 2/6] configs: mt8188: enable eMMC FIT boot from SPL Carlo Caione
2026-09-07  3:45   ` Macpaul Lin (林智斌)
2026-09-09 19:35   ` David Lechner
2026-09-09 20:37     ` Carlo Caione
2026-09-06 15:30 ` [PATCH v6 3/6] arm: mediatek: build Genio 510 and 700 boot images with binman Carlo Caione
2026-09-09 19:39   ` David Lechner
2026-09-09 20:42     ` Carlo Caione
2026-09-06 15:30 ` [PATCH v6 4/6] arm: dts: mediatek: support signed Genio 510 and 700 bootloader FIT Carlo Caione
2026-09-06 15:30 ` [PATCH v6 5/6] arm: dts: mediatek: emit the Genio 510 and 700 BootROM payload Carlo Caione
2026-09-06 15:30 ` [PATCH v6 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot Carlo Caione
2026-09-07  3:48   ` Macpaul Lin (林智斌)
2026-09-09 19:56   ` David Lechner
2026-09-09 20:54     ` Carlo Caione
2026-09-09 20:58       ` Carlo Caione
2026-09-09 21:00       ` David Lechner

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.