Skip to content

arm: snapdragon: Add snagboot support for Lemans-EVK

Balaji Selvanathan u-boot 3 versions – In review

Get series with b4
b4 am [email protected] change-id 20260608-snagboot-df4b6a79a086

Versions newest first · linked by author and title

  1. v4 Latest8 patches 2 repliesIn review
  2. v36 patches 14 repliesSuperseded
  3. v26 patches 6 repliesSuperseded

Changes in v4 from the cover letter

- Renamed QCOM_SNAGBOOT_SUPPORT to QCOM_SNAGBOOT_MODE
- Make SYSRESET_PSCI dependent on QCOM_SNAGBOOT_MODE
- Place Snagboot related configs in seperate config fragment
called configs/qcom-snagboot.config
- Include above config fragment in
configs/qcom_lemans_snagboot_defconfig
- Removed Lemans EVK override dtsi: arch/arm/dts/lemans-evk-u-boot.dtsi
- Removed QCOM_COMMAND_DB_OPTIONAL as now we use
CONFIG_QCOM_SNAGBOOT_MODE
- Added documentation on U-Boot for Snagboot
- Link to v3: https://lore.kernel.org/u-boot/[email protected]/

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8arm: snapdragon: Add CONFIG_QCOM_SNAGBOOT_MODE optionarch/arm/mach-snapdragon/Kconfig+28 -01 reply
2/8arm: snapdragon: Make SYSRESET_PSCI optionalarch/arm/Kconfig+1 -10 replies
3/8arm: snapdragon: Guard PSCI functions with CONFIG_ARM_SMCCCarch/arm/mach-snapdragon/board.c+6 -00 replies
4/8arm: snapdragon: Disable MMU early before U-Boot reset vectorarch/arm/mach-snapdragon/include/mach/boot0.h arch/arm/mach-snapdragon/include/mach/snagboot_boot0.h+28 -00 replies
5/8soc: qcom: cmd-db: Allow boot without CMD DB datadrivers/soc/qcom/Kconfig drivers/soc/qcom/cmd-db.c+31 -21 reply
6/8arch: arm: dts: remove Lemans EVK override DTSarch/arm/dts/lemans-evk-u-boot.dtsi+0 -190 replies
7/8configs: add qcom_lemans_snagboot_defconfig for Lemans-EVKconfigs/qcom-snagboot.config configs/qcom_lemans_snagboot_defconfig+51 -00 replies
8/8doc: qualcomm: Add snagboot mode documentationdoc/board/qualcomm/index.rst doc/board/qualcomm/snagboot.rst+185 -00 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchVaradarajan Narayanan
1/8
2/8R-b
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/8] arm: snapdragon: Add snagboot support for Lemans-EVK

This series adds support for running U-Boot in snagboot mode on Qualcomm Snapdragon platforms, targeting the Lemans-EVK board.

Snagboot is an open-source, scriptable flashing framework that provides an alternative to the proprietary Firehose protocol for device provisioning. Like the traditional EDL+Firehose flow, Snagboot uses the Qualcomm boot ROM EDL mode and Sahara protocol to download and execute bootloaders. However, instead of using the proprietary Firehose programmer, Snagboot loads U-Boot into DDR and uses the standard fastboot protocol for device flashing.

The framework consists of three modular components: snagrecover (downloads XBL/QCLib to initialize DDR and load U-Boot into RAM), snagflash (communicates with U-Boot over USB using fastboot to flash system images), and snagfactory (orchestrates parallel factory flashing tasks).

In the snagboot execution flow, ROM code in EDL mode loads snagrecover, which downloads XBL to internal memory. XBL executes and initializes DDR, then snagrecover downloads U-Boot into DDR and transfers control to it. At this point, XBL has left the MMU enabled with its own page tables and has not initialized PSCI firmware or populated the Command DB. U-Boot must handle this non-standard boot environment to enter fastboot mode for device flashing.

Support for Qualcomm Lemans-EVK SOC in Snagboot is now available in
https://github.com/qualcomm-linux/snagboot/tree/qcom-next
Soon these Snagboot changes will be upstreamed to https://github.com/bootlin/snagboot

When U-Boot executes in Snagboot flow, it has to deal with missing platform services such as TrustZone (TZ), Hypervisor and AOP (which populates CMD DB data).

This series addresses these issues by following patches:

Patch 1 adds CONFIG_QCOM_SNAGBOOT_MODE option to enable snagboot mode support on Qualcomm platforms.

Patch 2 changes SYSRESET_PSCI from 'select' to 'imply' so it can be disabled as PSCI firmware is unavailable in Snagboot mode.

Patch 3 guards show_psci_version() and qcom_psci_fixup() with CONFIG_ARM_SMCCC to prevent build failures when SMCCC is disabled.

Patch 4 disables the MMU and invalidates TLBs at the earliest entry point to clear stale page tables left by previous bootloader before U-Boot sets up its own MMU.

Patch 5 allows the CMD DB driver to bind successfully when CMD DB data is not populated by XBL, logging a warning instead of failing.

Patch 6 removes Lemans EVK override DTS

Patch 7 adds qcom_lemans_snagboot_defconfig for Lemans-EVK, based on qcom_defconfig with snagboot-specific settings.

Patch 8 adds documentation for U-Boot snagboot mode support on Qualcomm platforms.

This series depends on the following patches/series:
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/u-boot/[email protected]/
https://lore.kernel.org/u-boot/[email protected]/
https://lore.kernel.org/u-boot/[email protected]/ (already picked in u-boot/next as of 19th June 2026)

---
Changes in v4:
- Renamed QCOM_SNAGBOOT_SUPPORT to QCOM_SNAGBOOT_MODE
- Make SYSRESET_PSCI dependent on QCOM_SNAGBOOT_MODE
- Place Snagboot related configs in seperate config fragment
called configs/qcom-snagboot.config
- Include above config fragment in
configs/qcom_lemans_snagboot_defconfig
- Removed Lemans EVK override dtsi: arch/arm/dts/lemans-evk-u-boot.dtsi
- Removed QCOM_COMMAND_DB_OPTIONAL as now we use
CONFIG_QCOM_SNAGBOOT_MODE
- Added documentation on U-Boot for Snagboot
- Link to v3: https://lore.kernel.org/u-boot/[email protected]/

Changes in v3:
- Brought the MMU disable logic under CONFIG_QCOM_SNAGBOOT_SUPPORT
ifdef condition
- Moved the MMU disable codes to a new seperate file
- Used "if (IS_ENABLED(CONFIG_QCOM_COMMAND_DB_OPTIONAL))" instead
of #ifdef
- Removed enabling QCOM_COMMAND_DB_OPTIONAL, ENABLE_ARM_SOC_BOOT0_HOOK
and SKIP_RELOCATE as they are now automatically enabled by
QCOM_SNAGBOOT_SUPPORT selection
- Removed updating MAINTAINERS as the defconfig file is picked up by
the "N: qcom" line
- Link to v2: https://lore.kernel.org/u-boot/[email protected]/

Changes in v2:
- Changed SYSRESET_PSCI from 'select' to 'imply'
- Guard show_psci_version() and qcom_psci_fixup() with CONFIG_ARM_SMCCC
- Disables the MMU and invalidates TLBs at the earliest entry point
- Add qcom_lemans_snagboot_defconfig for Lemans-EVK
- Link to v1: https://lore.kernel.org/u-boot/[email protected]/

---
Balaji Selvanathan (8):
arm: snapdragon: Add CONFIG_QCOM_SNAGBOOT_MODE option
arm: snapdragon: Make SYSRESET_PSCI optional
arm: snapdragon: Guard PSCI functions with CONFIG_ARM_SMCCC
arm: snapdragon: Disable MMU early before U-Boot reset vector
soc: qcom: cmd-db: Allow boot without CMD DB data
arch: arm: dts: remove Lemans EVK override DTS
configs: add qcom_lemans_snagboot_defconfig for Lemans-EVK
doc: qualcomm: Add snagboot mode documentation

 arch/arm/Kconfig                                   |   2 +-
 arch/arm/dts/lemans-evk-u-boot.dtsi                |  19 ---
 arch/arm/mach-snapdragon/Kconfig                   |  28 ++++
 arch/arm/mach-snapdragon/board.c                   |   6 +
 arch/arm/mach-snapdragon/include/mach/boot0.h      |   2 +
 .../mach-snapdragon/include/mach/snagboot_boot0.h  |  26 +++
 configs/qcom-snagboot.config                       |  33 ++++
 configs/qcom_lemans_snagboot_defconfig             |  18 ++
 doc/board/qualcomm/index.rst                       |   1 +
 doc/board/qualcomm/snagboot.rst                    | 184 +++++++++++++++++++++
 drivers/soc/qcom/Kconfig                           |  18 ++
 drivers/soc/qcom/cmd-db.c                          |  15 +-
 12 files changed, 330 insertions(+), 22 deletions(-)

---
base-commit: ff70c8fdcf2fe81acba632b606af16d5a041631f
change-id: 20260619-snagboot-625d778c59fc

Best regards,

Signature · 1 line
Balaji Selvanathan <[email protected]>