Genio 510 and 700 need a way to provision blank eMMC and recover boards
with unusable boot firmware. Add RAM-based fastboot download agents that
can be loaded through the MediaTek BootROM download protocol without
relying on the installed bootloader.

Fastboot in U-Boot proper is preferred when the complete download agent
fits the platform's BootROM payload limit. It provides U-Boot's shell and
boot facilities as well as flashing. The SPL variant offers a smaller
executable payload when including BL31 and U-Boot proper would exceed
that limit. Both require an external DDR loader and run fastboot from
DRAM after DDR initialization.

The two paths start USB fastboot at different stages:

   Fastboot in SPL                   Fastboot in U-Boot proper
   ---------------                  -------------------------
   BootROM USB download             BootROM USB download
   (host -> SRAM)                   (host -> SRAM)
     |                                |
     v                                v
   DDR loader                       DDR loader
     | Initialize DRAM                | Initialize DRAM
     | Copy SPL to DRAM               | Copy SPL + FIT to DRAM
     v                                v
   SPL                              SPL
     | USB fastboot <-> host           | Load BL31 + U-Boot from RAM
     v                                v
   eMMC provisioning                BL31
                                      |
                                      v
                                    U-Boot proper
                                      | USB fastboot <-> host
                                      v
                                    eMMC provisioning

This series is based on upstream/next plus generic SPL fastboot V6,
now applied to u-boot-dfu-next [1]. Genio SPL support is already in
upstream/next.

[1] 
https://lore.kernel.org/all/[email protected]/

Signed-off-by: Carlo Caione <[email protected]>
---
Changes in v2:
- Rebase onto upstream/next, which now includes Genio SPL support.
- Align shared DA filenames with the mt8370 Genio naming.
- Use fixed USB peripheral mode instead of the private force-vbus DT
  property, with corresponding MTU3 driver support.
- Limit RAM boot to the U-Boot DA and use phase-specific MMC settings.
- Separate shared and per-agent configuration, and make DA and normal
  storage-image configurations mutually exclusive.
- Build the SPL DA entry only in SPL and simplify FIT key handling.
- Keep the SPL allocation limit large enough for sparse image writes.
- Select the eMMC user area when resuming boot with SPL fastboot continue.
- Explain the preferred U-Boot DA and the SPL alternative for tighter
  BootROM payload limits; clarify DT requirements and continue behavior.
- Link to v1: 
https://patch.msgid.link/20260914-ccaione-upstream-mt8390-da-v1-0-b76f9e30a...@baylibre.com

To: GSS_MTK_Uboot_upstream <[email protected]>
To: [email protected]
Cc: Tom Rini <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Ryder Lee <[email protected]>
Cc: Weijie Gao <[email protected]>
Cc: Chunfeng Yun <[email protected]>
Cc: Igor Belwon <[email protected]>
Cc: David Lechner <[email protected]>
Cc: Julien Stephan <[email protected]>
Cc: Julien Masson <[email protected]>
Cc: Johan Jonker <[email protected]>
Cc: Macpaul Lin <[email protected]>
Cc: Chris-QJ Chen <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Bastien Curutchet <[email protected]>
Cc: Alexey Charkov <[email protected]>
Cc: Vitor Sato Eschholz <[email protected]>
Cc: "Pablo Sun (孫毓翔)" <[email protected]>
Cc: Arnaud Ferraris <[email protected]>
Cc: Suhrid Subramaniam <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Carlo Caione <[email protected]>
Cc: Casey Connolly <[email protected]>
Cc: Michael Srba <[email protected]>

---
Carlo Caione (2):
      arm: mediatek: enable U-Boot fastboot DAs on Genio 510 and 700
      doc: board: mediatek: document Genio download agents

Julien Masson (1):
      arm: mediatek: enable SPL fastboot DAs on Genio 510 and 700

 arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi      |   8 ++
 arch/arm/dts/mt8370-genio-da-u-boot.dtsi           |  64 ++++++++++
 arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi      |   8 ++
 arch/arm/dts/mtk-genio-da-binman-u-boot.dtsi       |  17 +++
 arch/arm/dts/mtk-genio-da-fit-binman-u-boot.dtsi   |  62 ++++++++++
 .../dts/mtk-genio-loader-spl-binman-u-boot.dtsi    |   2 +-
 arch/arm/mach-mediatek/Kconfig                     |  58 +++++++++
 arch/arm/mach-mediatek/Makefile                    |   3 +
 arch/arm/mach-mediatek/spl.c                       |  22 ++--
 arch/arm/mach-mediatek/spl_fastboot.c              |  68 +++++++++++
 board/mediatek/MAINTAINERS                         |   8 ++
 common/spl/Kconfig                                 |   2 +-
 configs/mt8370-genio-da-spl-fastboot.config        |  21 ++++
 configs/mt8370-genio-da-uboot-fastboot.config      |  28 +++++
 configs/mt8370-genio-da.config                     |  12 ++
 configs/mt8370_genio_510_evk_da_spl_defconfig      |   2 +
 configs/mt8370_genio_510_evk_da_uboot_defconfig    |   2 +
 configs/mt8390_genio_700_evk_da_spl_defconfig      |   2 +
 configs/mt8390_genio_700_evk_da_uboot_defconfig    |   2 +
 doc/board/mediatek/mt8188-genio-evk.rst            | 135 +++++++++++++++++++++
 drivers/usb/mtu3/mtu3_core.c                       |   5 +-
 21 files changed, 518 insertions(+), 13 deletions(-)
---
base-commit: 9e002445cd0d47d3965312f12e97a18e1ed8bd53
change-id: 20260910-ccaione-upstream-mt8390-da-f2f8416ab2a8
prerequisite-message-id: 
20260913-ccaione-upstream-spl-fastboot-v6-0-dd3ba81a7...@baylibre.com
prerequisite-patch-id: ebe0842a87ef1a27c9882d7c45823b37ef84e5a8
prerequisite-patch-id: 7df6bdcd4e7a655d86db0447593b2bf36050b049
prerequisite-patch-id: e98c322def69bb8ecec30dd41c05aa62040b1008
prerequisite-patch-id: 553ddc59d4de9ff9f1949875939979cbeab2eaac
prerequisite-patch-id: 8d8c1917bfcee87fecf6077a117c8a11cc402cdd

Best regards,
--  
Carlo Caione <[email protected]>

Reply via email to