* [PATCH v5 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL
2026-08-27 7:34 [PATCH v5 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
@ 2026-08-27 7:34 ` Carlo Caione
2026-08-27 7:34 ` [PATCH v5 2/6] configs: mt8188: enable eMMC FIT boot from SPL Carlo Caione
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Carlo Caione @ 2026-08-27 7:34 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 | 2 +-
arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi | 2 +-
arch/arm/dts/mt8390-genio-common-u-boot.dtsi | 94 +++++++++++++++++++++++++++
board/mediatek/MAINTAINERS | 1 +
4 files changed, 97 insertions(+), 2 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..1a5f45cba6b 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,4 @@
* 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..1a5f45cba6b 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,4 @@
* 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..87ebc64e6f6
--- /dev/null
+++ b/arch/arm/dts/mt8390-genio-common-u-boot.dtsi
@@ -0,0 +1,94 @@
+// SPDX-License-Identifier: (GPL-2.0 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 {
+ 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 {
+ 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] 8+ messages in thread* [PATCH v5 2/6] configs: mt8188: enable eMMC FIT boot from SPL
2026-08-27 7:34 [PATCH v5 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
2026-08-27 7:34 ` [PATCH v5 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL Carlo Caione
@ 2026-08-27 7:34 ` Carlo Caione
2026-08-27 7:35 ` [PATCH v5 3/6] arm: mediatek: build Genio 510 and 700 boot images with binman Carlo Caione
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Carlo Caione @ 2026-08-27 7:34 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 Genio 510 and Genio 700 SPL path entered by the external
DDR loader at 0x40000000. Bound SPL to the 0xaf000-byte loader copy
window and retain the non-overlapping malloc region.
Place BSS at 0x400bb800 (0x40000000 + 0xbb800), the end of the SPL
reservation used by the downstream flow. This leaves a 0xc800-byte
guard between the copied SPL window and BSS.
Use generic SPL MMC, GPT, FIT and Arm Trusted Firmware support to load
the firmware FIT from eMMC partition 1. Keep U-Boot proper at the shared
MT8188 CONFIG_TEXT_BASE of 0x4c000000.
The MediaTek BL31 used on these boards stalls when passed the runtime
devicetree as its platform parameter. Enable SPL_ATF_NO_PLATFORM_PARAM
so SPL can still use the tree to locate OP-TEE and U-Boot while passing
NULL as the separate BL31 platform parameter.
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 | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/configs/mt8188.config b/configs/mt8188.config
index 29e2b3db878..a84e617e30f 100644
--- a/configs/mt8188.config
+++ b/configs/mt8188.config
@@ -28,3 +28,30 @@ CONFIG_MTK_SERIAL=y
CONFIG_WDT=y
CONFIG_WDT_MTK=y
# CONFIG_RANDOM_UUID is not set
+CONFIG_SPL=y
+CONFIG_SPL_TEXT_BASE=0x40000000
+CONFIG_SPL_MAX_SIZE=0xaf000
+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
+CONFIG_SPL_BSS_START_ADDR=0x400bb800
+CONFIG_SPL_BSS_LIMIT=y
+CONFIG_SPL_BSS_MAX_SIZE=0x100000
+CONFIG_SPL_SYS_MALLOC=y
+CONFIG_SPL_HAS_CUSTOM_MALLOC_START=y
+CONFIG_SPL_CUSTOM_SYS_MALLOC_ADDR=0x5c000000
+CONFIG_SPL_SYS_MALLOC_SIZE=0x9000000
+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] 8+ messages in thread* [PATCH v5 3/6] arm: mediatek: build Genio 510 and 700 boot images with binman
2026-08-27 7:34 [PATCH v5 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
2026-08-27 7:34 ` [PATCH v5 1/6] arm: dts: mediatek: prepare Genio 510 and 700 devices for SPL Carlo Caione
2026-08-27 7:34 ` [PATCH v5 2/6] configs: mt8188: enable eMMC FIT boot from SPL Carlo Caione
@ 2026-08-27 7:35 ` Carlo Caione
2026-08-27 7:35 ` [PATCH v5 4/6] arm: dts: mediatek: support signed Genio 510 and 700 bootloader FIT Carlo Caione
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Carlo Caione @ 2026-08-27 7:35 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 U-Boot SPL,
then load the remaining firmware from a FIT. Add shared binman
descriptions for both images so integration builds can assemble the
complete boot chain.
Keep packaging optional because the required platform firmware is built
outside U-Boot.
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 | 97 ++++++++++++++++++++++
.../dts/mtk-genio-loader-spl-binman-u-boot.dtsi | 16 ++++
arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi | 26 ++++++
arch/arm/mach-mediatek/Kconfig | 38 ++++++++-
board/mediatek/MAINTAINERS | 2 +
common/spl/Kconfig | 1 +
9 files changed, 209 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 1a5f45cba6b..726e060f281 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 1a5f45cba6b..09cab1d2721 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..7e718ddf8da
--- /dev/null
+++ b/arch/arm/dts/mtk-genio-binman-u-boot.dtsi
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: (GPL-2.0 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..ce492790aee
--- /dev/null
+++ b/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
@@ -0,0 +1,97 @@
+// SPDX-License-Identifier: (GPL-2.0 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>;
+
+ 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;
+ firmware = "atf";
+ loadables = "uboot", "optee-1";
+ 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..e49ad5c471f
--- /dev/null
+++ b/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (c) 2026 BayLibre, SAS.
+ * Author: Julien Stephan <jstephan@baylibre.com>
+ * Author: Carlo Caione <ccaione@baylibre.com>
+ */
+
+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..8fdafbd750d
--- /dev/null
+++ b/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0 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..0bece6b1b3e 100644
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -207,9 +207,45 @@ 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 loader's SPL_OFFSET value.
+
+config MTK_GENIO_BL31_LOAD_ADDR
+ hex "BL31 load and entry address"
+ default 0x54601000 if TARGET_MT8188
+
+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] 8+ messages in thread* [PATCH v5 4/6] arm: dts: mediatek: support signed Genio 510 and 700 bootloader FIT
2026-08-27 7:34 [PATCH v5 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
` (2 preceding siblings ...)
2026-08-27 7:35 ` [PATCH v5 3/6] arm: mediatek: build Genio 510 and 700 boot images with binman Carlo Caione
@ 2026-08-27 7:35 ` Carlo Caione
2026-08-27 7:35 ` [PATCH v5 5/6] arm: dts: mediatek: emit the Genio 510 and 700 BootROM payload Carlo Caione
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Carlo Caione @ 2026-08-27 7:35 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 ce492790aee..c5e6da7c58a 100644
--- a/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
+++ b/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
@@ -12,6 +12,9 @@
fit {
description = MTK_BOOTLOADERS_DESCRIPTION;
#address-cells = <1>;
+#ifdef CONFIG_SPL_FIT_SIGNATURE
+ fit,sign;
+#endif
images {
uboot {
@@ -90,6 +93,14 @@
firmware = "atf";
loadables = "uboot", "optee-1";
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 e49ad5c471f..30de2ec621c 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
@@ -11,6 +11,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] 8+ messages in thread* [PATCH v5 5/6] arm: dts: mediatek: emit the Genio 510 and 700 BootROM payload
2026-08-27 7:34 [PATCH v5 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
` (3 preceding siblings ...)
2026-08-27 7:35 ` [PATCH v5 4/6] arm: dts: mediatek: support signed Genio 510 and 700 bootloader FIT Carlo Caione
@ 2026-08-27 7:35 ` Carlo Caione
2026-08-27 7:35 ` [PATCH v5 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot Carlo Caione
2026-09-06 8:04 ` [PATCH v5 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
6 siblings, 0 replies; 8+ messages in thread
From: Carlo Caione @ 2026-08-27 7:35 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 8fdafbd750d..1d51210ec7d 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] 8+ messages in thread* [PATCH v5 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot
2026-08-27 7:34 [PATCH v5 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
` (4 preceding siblings ...)
2026-08-27 7:35 ` [PATCH v5 5/6] arm: dts: mediatek: emit the Genio 510 and 700 BootROM payload Carlo Caione
@ 2026-08-27 7:35 ` Carlo Caione
2026-09-06 8:04 ` [PATCH v5 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
6 siblings, 0 replies; 8+ messages in thread
From: Carlo Caione @ 2026-08-27 7:35 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 | 266 ++++++++++++++++++++++++++++++++
3 files changed, 268 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..864cc996c42
--- /dev/null
+++ b/doc/board/mediatek/mt8188-genio-evk.rst
@@ -0,0 +1,266 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. 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 at
+``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.
+Individual FIT payloads may use compression supported by SPL. 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 at
+``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. 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.
+
+Complete firmware images
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enable ``CONFIG_MTK_GENIO_BOOT_IMAGES`` to assemble the complete firmware
+images.
+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 RSA_VERIFY \
+ --enable SHA256 \
+ --enable SPL_FIT_SIGNATURE \
+ --enable SPL_RSA \
+ --enable SPL_RSA_VERIFY \
+ --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] 8+ messages in thread* Re: [PATCH v5 0/6] Add Genio 510 and Genio 700 SPL boot support
2026-08-27 7:34 [PATCH v5 0/6] Add Genio 510 and Genio 700 SPL boot support Carlo Caione
` (5 preceding siblings ...)
2026-08-27 7:35 ` [PATCH v5 6/6] doc: board: mediatek: document Genio 510 and 700 SPL boot Carlo Caione
@ 2026-09-06 8:04 ` Carlo Caione
6 siblings, 0 replies; 8+ messages in thread
From: Carlo Caione @ 2026-09-06 8:04 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, Vitor Sato Eschholz,
Johan Jonker, Bastien Curutchet, Neil Armstrong, Alexey Charkov,
Suhrid Subramaniam, Arnaud Ferraris,
Pablo Sun (孫毓翔)
On Thu, Aug 27, 2026 at 09:34:57 +0100, Carlo Caione wrote:
> 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.
Do not review this. I received some off-list suggestions that I'm going
to implement in V6.
Cheers,
--
Carlo Caione
^ permalink raw reply [flat|nested] 8+ messages in thread