Skip to contentSkip to conversation

arm: snapdragon: Add snagboot support for Lemans-EVK

PATCH In review Balaji Selvanathan 2 participants 11 messages Jun 19 – Jul 6

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v4 cover 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]>
#1 lore raw

PATCH v4 1/8 arm: snapdragon: Add CONFIG_QCOM_SNAGBOOT_MODE option

Add CONFIG_QCOM_SNAGBOOT_MODE to enable snagboot mode on Qualcomm platforms. This config automatically selects the required dependencies.

Add QCOM_BOOT0_SNAGBOOT_MODE as boot0.h config for automatic selection by QCOM_SNAGBOOT_MODE. Document the platform-specific requirements and configs that must be disabled in snagboot mode.

---
Changes in v4:
- Renamed QCOM_SNAGBOOT_SUPPORT to QCOM_SNAGBOOT_MODE
- Added QCOM_BOOT0_SNAGBOOT_MODE for boot0.h which gets selected by QCOM_SNAGBOOT_MODE
- Document the platform-specific requirements and configs that must be disabled in snagboot mode.

Changes in v3:
- Newly introduced in v3

---
 arch/arm/mach-snapdragon/Kconfig | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm/mach-snapdragon/Kconfig +28 -0
index 931d25c1023..5c7dbe0dcc4 100644
@@ -65,4 +65,32 @@ config QCOM_EL2_GUNYAH_EXIT_SUPPORT
 	  run properly at EL2.
 endchoice
 
+config QCOM_BOOT0_SNAGBOOT_MODE
+	bool "boot0.h initialization for Snagboot mode"
+	help
+	  Enable boot0.h early initialization required when U-Boot
+	  is loaded in Snagboot mode by XBL.
+
+config QCOM_SNAGBOOT_MODE
+	bool "Build U-Boot for Snagboot mode loading"
+	select QCOM_BOOT0_SNAGBOOT_MODE
+	select ENABLE_ARM_SOC_BOOT0_HOOK
+	select SKIP_RELOCATE
+	help
+	  Build U-Boot to be loaded in Snagboot mode on Qualcomm platforms
+	  for device/factory provisioning using fastboot.
+
+	  Snagboot mode requires disabling several configs in your defconfig:
+	  - PSCI_RESET: Not available in Snagboot mode
+	  - IOMMU: Not initialized by XBL in Snagboot mode
+	  - SAVE_PREV_BL_INITRAMFS_START_ADDR: Previous bootloader context
+	    is not preserved in snagboot mode
+	  - REBOOT_MODE_ENV_UPDATE: Not applicable in device/factory provisioning mode
+
+	  Additionally, use CONFIG_ENV_IS_NOWHERE to ensure recovery works
+	  even with corrupted environment storage.
+
+	  Platform-specific requirements:
+	  - Set CONFIG_COUNTER_FREQUENCY to match your platform's timer
+	  - Configure CONFIG_TEXT_BASE for U-Boot load address
 endif
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v4 1/8] arm: snapdragon: Add CONFIG_QCOM_SNAGBOOT_MODE option

Hi Balaji,

Quoted 27 lines · Balaji Selvanathan

Add CONFIG_QCOM_SNAGBOOT_MODE to enable snagboot mode on Qualcomm platforms. This config automatically selects the required dependencies.

Add QCOM_BOOT0_SNAGBOOT_MODE as boot0.h config for automatic selection by QCOM_SNAGBOOT_MODE. Document the platform-specific requirements and configs that must be disabled in snagboot mode.

---
Changes in v4:
- Renamed QCOM_SNAGBOOT_SUPPORT to QCOM_SNAGBOOT_MODE
- Added QCOM_BOOT0_SNAGBOOT_MODE for boot0.h which gets selected by QCOM_SNAGBOOT_MODE
- Document the platform-specific requirements and configs that must be disabled in snagboot mode.

Changes in v3:
- Newly introduced in v3

---
  arch/arm/mach-snapdragon/Kconfig | 28 ++++++++++++++++++++++++++++
  1 file changed, 28 insertions(+)
arch/arm/mach-snapdragon/Kconfig +0 -0
index 931d25c1023..5c7dbe0dcc4 100644

arch/arm/mach-snapdragon/Kconfig config QCOM_EL2_GUNYAH_EXIT_SUPPORT · line 69

Quoted 5 lines
arch/arm/mach-snapdragon/Kconfig +2 -0
@@ -65,4 +65,32 @@ config QCOM_EL2_GUNYAH_EXIT_SUPPORT
  	  run properly at EL2.
  endchoice
 
+config QCOM_BOOT0_SNAGBOOT_MODE
+	bool "boot0.h initialization for Snagboot mode"

I don't think this should be visible in menuconfig, it should be internal.

The config should be inside the choice block though I think? not sure if that's possible if it's not selectable> + help

Quoted 8 lines
arch/arm/mach-snapdragon/Kconfig +7 -0
+	  Enable boot0.h early initialization required when U-Boot
+	  is loaded in Snagboot mode by XBL.> +
+config QCOM_SNAGBOOT_MODE
+	bool "Build U-Boot for Snagboot mode loading"
+	select QCOM_BOOT0_SNAGBOOT_MODE
+	select ENABLE_ARM_SOC_BOOT0_HOOK
 
+	select SKIP_RELOCATE

arch/arm/mach-snapdragon/Kconfig config QCOM_EL2_GUNYAH_EXIT_SUPPORT · line 88

Quoted 10 lines
arch/arm/mach-snapdragon/Kconfig +10 -0
+	help
+	  Build U-Boot to be loaded in Snagboot mode on Qualcomm platforms
+	  for device/factory provisioning using fastboot.
+
+	  Snagboot mode requires disabling several configs in your defconfig:
+	  - PSCI_RESET: Not available in Snagboot mode
+	  - IOMMU: Not initialized by XBL in Snagboot mode
+	  - SAVE_PREV_BL_INITRAMFS_START_ADDR: Previous bootloader context
+	    is not preserved in snagboot mode
+	  - REBOOT_MODE_ENV_UPDATE: Not applicable in device/factory provisioning mode

this isn't how kconfig works, use depends> +

arch/arm/mach-snapdragon/Kconfig config QCOM_EL2_GUNYAH_EXIT_SUPPORT · line 91

Quoted 2 lines
arch/arm/mach-snapdragon/Kconfig +2 -0
+	  Additionally, use CONFIG_ENV_IS_NOWHERE to ensure recovery works
+	  even with corrupted environment storage.

select ENV_IS_NOWHERE
depends on !ENV_IS_IN_SCSI

arch/arm/mach-snapdragon/Kconfig config QCOM_EL2_GUNYAH_EXIT_SUPPORT · line 95

Quoted 4 lines
arch/arm/mach-snapdragon/Kconfig +4 -0
+
+	  Platform-specific requirements:
+	  - Set CONFIG_COUNTER_FREQUENCY to match your platform's timer
+	  - Configure CONFIG_TEXT_BASE for U-Boot load address

you can probably depend on these being non-zero too

Thanks,
// Casey

Quoted 2 lines

endif

#3 lore raw

PATCH v4 2/8 arm: snapdragon: Make SYSRESET_PSCI optional

In reply to Balaji Selvanathan

In snagboot mode, there is no PSCI firmware and U-Boot will crash if it attempts to make PSCI calls so disable it in this case.

---
Changes in v4:
- Make SYSRESET_PSCI dependent on QCOM_SNAGBOOT_MODE

Changes in v3:
- No changes

Changes in v2:
- Newly introduced in v2

---
 arch/arm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/Kconfig +1 -1
index 850768282ce..bcb3cde9405 100644
@@ -1149,7 +1149,7 @@ config ARCH_SNAPDRAGON
 	select SAVE_PREV_BL_FDT_ADDR if !ENABLE_ARM_SOC_BOOT0_HOOK
 	select LINUX_KERNEL_IMAGE_HEADER if !ENABLE_ARM_SOC_BOOT0_HOOK
 	select SYSRESET
-	select SYSRESET_PSCI
+	select SYSRESET_PSCI if !QCOM_SNAGBOOT_MODE
 	select ANDROID_BOOT_IMAGE_IGNORE_BLOB_ADDR
 	select MMU_PGPROT
 	imply OF_UPSTREAM
Signature · 1 line
2.34.1
#4 lore raw

PATCH v4 3/8 arm: snapdragon: Guard PSCI functions with CONFIG_ARM_SMCCC

In reply to Balaji Selvanathan

In snagboot mode, U-Boot is loaded directly by XBL without PSCI firmware support. The functions show_psci_version() and qcom_psci_fixup() call arm_smccc_smc() which is unavailable when CONFIG_ARM_SMCCC is disabled, causing build failures.

Hence, added CONFIG_ARM_SMCCC guards to both functions.

---
Changes in v4:
- No changes

Changes in v3:
- Added CONFIG_ARM_SMCCC guards

Changes in v2:
- Newly introduced in v2

---
 arch/arm/mach-snapdragon/board.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-snapdragon/board.c +6 -0
index 4ef046942d8..6ad05998758 100644
@@ -50,6 +50,9 @@ static void show_psci_version(void)
 {
 	struct arm_smccc_res res;
 
+	if (!IS_ENABLED(CONFIG_ARM_SMCCC))
+		return;
+
 	arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
 
 	/* Some older SoCs like MSM8916 don't always support PSCI */
@@ -73,6 +76,9 @@ static void qcom_psci_fixup(void *fdt)
 	int offset, ret;
 	struct arm_smccc_res res;
 
+	if (!IS_ENABLED(CONFIG_ARM_SMCCC))
+		return;
+
 	arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
 
 	if ((int)res.a0 != PSCI_RET_NOT_SUPPORTED)
Signature · 1 line
2.34.1
#5 lore raw

PATCH v4 4/8 arm: snapdragon: Disable MMU early before U-Boot reset vector

In reply to Balaji Selvanathan

When U-Boot is loaded by XBL in Snagboot mode, XBL leaves the MMU enabled with its own page tables. This causes stale TLB entries and incorrect memory mappings when U-Boot initializes its own MMU.

Disable the MMU and invalidate TLBs before branching to the reset vector. This ensures a clean MMU state for U-Boot initialization in Snagboot mode.

---
Changes iv v4:
- Remove handling for EL1 or EL2 entry as for Snagboot we would only enter U-Boot in EL3 from previous bootloader

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

Changes in v2:
- Newly introduced in v2

---
 arch/arm/mach-snapdragon/include/mach/boot0.h      |  2 ++
 .../mach-snapdragon/include/mach/snagboot_boot0.h  | 26 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)
arch/arm/mach-snapdragon/include/mach/boot0.h +2 -0
index 032a9fbdb12..99ab9788155 100644
@@ -7,6 +7,8 @@
 #include "msm8916_boot0.h"
 #elif defined(CONFIG_QCOM_EL2_GUNYAH_EXIT_SUPPORT)
 #include "gunyah_exit_boot0.h"
+#elif defined(CONFIG_QCOM_BOOT0_SNAGBOOT_MODE)
+#include "snagboot_boot0.h"
 #else
 	b	reset
 #endif
arch/arm/mach-snapdragon/include/mach/snagboot_boot0.h new file +26 -0
new file mode 100644
index 00000000000..6f7bf7eea7f
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Early MMU Disable for Snagboot Mode
+ *
+ * Disable MMU at the earliest possible point for EL3 entry.
+ * Snagboot mode always enters U-Boot at EL3.
+ *
+ * After disabling MMU, invalidate TLB to clear any stale entries that might
+ * cause issues when MMU is re-enabled later.
+ */
+
+	mrs	x0, CurrentEL
+	cmp	x0, #(3 << 2)	/* Verify EL3 entry */
+	b.ne	reset		/* Unexpected: not at EL3 */
+
+	/* Disable MMU at EL3 */
+	mrs	x0, sctlr_el3
+	bic	x0, x0, #1	/* Clear M bit (MMU enable) */
+	bic	x0, x0, #(1 << 19)  /* Clear WXN bit (Write XOR Execute) */
+	msr	sctlr_el3, x0
+	isb
+	/* Invalidate entire TLB for all ELs */
+	tlbi	alle3
+	dsb	sy
+	isb
+	b	reset
\ No newline at end of file
Signature · 1 line
2.34.1
#6 lore raw

PATCH v4 5/8 soc: qcom: cmd-db: Allow boot without CMD DB data

In reply to Balaji Selvanathan

In snagboot mode, XBL loads U-Boot directly without populating CMD DB. The cmd-db driver fails to bind when CMD DB magic is invalid, blocking boot even when CMD DB is not strictly required.

Use QCOM_SNAGBOOT_MODE config to allow the driver to bind successfully when CMD DB data is absent. When QCOM_SNAGBOOT_MODE is enabled and CMD DB data is present, we log a warning.

---
Changes in v4:
- Removed QCOM_COMMAND_DB_OPTIONAL as now we use CONFIG_QCOM_SNAGBOOT_MODE
- Drop these warnings if snagboot mode is enabled since that's the expected case
- Log a warning if snagboot is enabled and we do have a valid cmd-db, since that isn't an expected usecase

Changes in v3:
- Used "if (IS_ENABLED(CONFIG_QCOM_COMMAND_DB_OPTIONAL))" instead of #ifdef

Changes in v2:
- No changes

---
 drivers/soc/qcom/Kconfig  | 18 ++++++++++++++++++
 drivers/soc/qcom/cmd-db.c | 15 +++++++++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)
drivers/soc/qcom/Kconfig +18 -0
index cdd9e30f43e..987719bb925 100644
@@ -18,6 +18,24 @@ config QCOM_COMMAND_DB
 	  resource on a RPM-hardened platform must use this database to get
 	  SoC specific identifier and information for the shared resources.
 
+config QCOM_COMMAND_DB_OPTIONAL
+	bool "Allow operation without Command DB data"
+	depends on QCOM_COMMAND_DB
+	help
+	  Allow the Command DB driver to bind successfully even when CMD DB
+	  data is not populated or has an invalid magic number.
+
+	  This is useful for platforms where CMD DB is not populated by the
+	  previous bootloader (e.g., snagboot mode where XBL loads U-Boot
+	  directly without initializing CMD DB).
+
+	  When enabled, missing CMD DB will generate warnings but allow boot
+	  to continue. Consumer drivers must handle cmd_db API failures
+	  gracefully by checking return values.
+
+	  If unsure, say N. Most production Qualcomm platforms require
+	  valid CMD DB data.
+
 config QCOM_RPMH
 	bool "Qualcomm RPMh support"
 	depends on QCOM_COMMAND_DB
drivers/soc/qcom/cmd-db.c +13 -2
index d0a6047b8a6..c94a90a2903 100644
@@ -252,8 +252,19 @@ static int cmd_db_bind(struct udevice *dev)
 
 	cmd_db_header = base;
 	if (!cmd_db_magic_matches(cmd_db_header)) {
-		log_err("%s: Invalid Command DB Magic\n", __func__);
-		return -EINVAL;
+		if (IS_ENABLED(CONFIG_QCOM_SNAGBOOT_MODE)) {
+			/* Missing CMD DB is expected in snagboot mode */
+			cmd_db_header = NULL;
+			return 0;
+		} else {
+			log_err("%s: Invalid Command DB Magic\n", __func__);
+			return -EINVAL;
+		}
+	}
+
+	if (IS_ENABLED(CONFIG_QCOM_SNAGBOOT_MODE)) {
+		log_warning("%s: CMD DB found in snagboot mode - this is unexpected\n",
+			    __func__);
 	}
 
 	return 0;
Signature · 1 line
2.34.1
#7 lore raw

Re: [PATCH v4 5/8] soc: qcom: cmd-db: Allow boot without CMD DB data

Quoted 3 lines

Changes in v4:
- Removed QCOM_COMMAND_DB_OPTIONAL as now we use

...

drivers/soc/qcom/Kconfig +0 -0
index cdd9e30f43e..987719bb925 100644
Quoted 2 lines
(quoted diff) +2 -0
+config QCOM_COMMAND_DB_OPTIONAL
+	bool "Allow operation without Command DB data"
#8 lore raw

PATCH v4 6/8 arch: arm: dts: remove Lemans EVK override DTS

In reply to Balaji Selvanathan

Remove Lemans EVK override dtsi: arch/arm/dts/lemans-evk-u-boot.dtsi provided the following SMEM modernize series is picked:
https://lore.kernel.org/u-boot/[email protected]/

Memory node is not required as we can read the memory info from SMEM.

---
Changes in v4:
- Newly added in v4

---
 arch/arm/dts/lemans-evk-u-boot.dtsi | 19 -------------------
 1 file changed, 19 deletions(-)
arch/arm/dts/lemans-evk-u-boot.dtsi deleted +0 -19
deleted file mode 100644
index cdd3d32f61a..00000000000
@@ -1,19 +0,0 @@
-// SPDX-License-Identifier: BSD-3-Clause
-/*
- * Copyright (c) 2026, Qualcomm Innovation Center, Inc. All rights reserved.
- */
-
-/ {
-	/* Will be removed when bootloader updates later */
-	memory@80000000 {
-		device_type = "memory";
-		reg = <0x0 0x80000000 0x0 0x3ee00000>,
-		      <0x0 0xc0000000 0x0 0x0fd00000>,
-		      <0xD 0x00000000 0x2 0x54100000>,
-		      <0xA 0x80000000 0x1 0x80000000>,
-		      <0x9 0x00000000 0x1 0x80000000>,
-		      <0x1 0x00000000 0x3 0x00000000>,
-		      <0x0 0xd0000000 0x0 0x01900000>,
-		      <0x0 0xd3500000 0x0 0x2cb00000>;
-	};
-};
Signature · 1 line
2.34.1
#9 lore raw

PATCH v4 7/8 configs: add qcom_lemans_snagboot_defconfig for Lemans-EVK

In reply to Balaji Selvanathan

Add defconfig for booting U-Boot in Snagboot mode on Lemans-EVK. In this mode, XBL loads U-Boot directly into DDR and U-Boot enters fastboot over USB for device provisioning.

Create a reusable config fragment at configs/qcom-snagboot.config with common snagboot settings. Platform-specific defconfigs should include this fragment along with their own settings.

---
Changes in v4:
- Use CONFIG_ENV_IS_NOWHERE
- Place Snagboot related configs in seperate config fragment called configs/qcom-snagboot.config
- Include above config fragment in configs/qcom_lemans_snagboot_defconfig

Changes in v3:
- 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

Changes in v2:
- Newly introduced in v2

---
 configs/qcom-snagboot.config           | 33 +++++++++++++++++++++++++++++++++
 configs/qcom_lemans_snagboot_defconfig | 18 ++++++++++++++++++
 2 files changed, 51 insertions(+)
configs/qcom-snagboot.config new file +33 -0
new file mode 100644
index 00000000000..d19ad453029
@@ -0,0 +1,33 @@
+# Common configuration fragment for Qualcomm snagboot mode
+# Include this in platform-specific snagboot defconfigs
+
+CONFIG_QCOM_SNAGBOOT_MODE=y
+
+# Disable configs that conflict with snagboot mode
+# CONFIG_PSCI_RESET is not set
+# CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR is not set
+# CONFIG_IOMMU is not set
+# CONFIG_REBOOT_MODE_ENV_UPDATE is not set
+
+# Use default environment instead of loading from storage
+# This ensures snagboot mode works even with corrupted environment
+# CONFIG_ENV_IS_IN_SCSI is not set
+# CONFIG_ENV_IS_IN_MMC is not set
+# CONFIG_ENV_IS_IN_FLASH is not set
+# CONFIG_ENV_IS_IN_NAND is not set
+CONFIG_ENV_IS_NOWHERE=y
+
+# Disable default env file to use CONFIG_BOOTCOMMAND instead
+# CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE is not set
+
+# Auto-enter fastboot mode for snagboot
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND="fastboot -l $fastboot_addr_r usb 0"
+CONFIG_BOOTDELAY=0
+
+# Fastboot configuration for partition flashing
+CONFIG_FASTBOOT_FLASH_BLOCK=y
+CONFIG_FASTBOOT_FLASH_BLOCK_INTERFACE_NAME="scsi"
+CONFIG_FASTBOOT_FLASH_BLOCK_DEVICE_ID=4
+CONFIG_FASTBOOT_GPT_NAME="gpt"
+CONFIG_FASTBOOT_MBR_NAME="mbr"
configs/qcom_lemans_snagboot_defconfig new file +18 -0
new file mode 100644
index 00000000000..d6906c1e501
@@ -0,0 +1,18 @@
+# Configuration for building U-Boot for snagboot/recovery mode
+# on Lemans-EVK dev boards.
+#
+# For normal production boot, use qcom_lemans_defconfig instead.
+
+#include "qcom_defconfig"
+#include "qcom-snagboot.config"
+
+# Platform-specific settings for Lemans-EVK
+
+# Address where U-Boot will be loaded
+CONFIG_TEXT_BASE=0x1c100000
+CONFIG_REMAKE_ELF=y
+CONFIG_FASTBOOT_BUF_ADDR=0xdb300000
+CONFIG_DEFAULT_DEVICE_TREE="qcom/lemans-evk"
+
+# Timer frequency for Lemans platform
+CONFIG_COUNTER_FREQUENCY=19200000
\ No newline at end of file
Signature · 1 line
2.34.1
#10 lore raw

PATCH v4 8/8 doc: qualcomm: Add snagboot mode documentation

In reply to Balaji Selvanathan

Add documentation for snagboot mode support on Qualcomm platforms. This covers the architecture, execution flow, and board enablement requirements.

---
Changes in v4:
- Newly added in v4

---
 doc/board/qualcomm/index.rst    |   1 +
 doc/board/qualcomm/snagboot.rst | 184 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 185 insertions(+)
doc/board/qualcomm/index.rst +1 -0
index 3238a68e859..ee2bc9e29e3 100644
@@ -14,3 +14,4 @@ Qualcomm
    iq8
    phones
    rdp
+   snagboot
doc/board/qualcomm/snagboot.rst new file +184 -0

184 lines not on this page · raw message

Signature · 1 line
2.34.1