[PATCH v2 13/15] mach-snapdragon: support parsing memory map from SMEM

Stephan Gerhold stephan.gerhold at linaro.org
Thu May 21 15:36:10 CEST 2026


On Mon, May 04, 2026 at 08:57:41PM +0200, Casey Connolly wrote:
> It is possible to derive the memory map for a Qualcomm platform from the
> SMEM shared memory region. The memory map is populated by the preloader.
> 
> Introduce support for parsing this data and using it to populate
> U-Boot's memory map. Since we aren't yet sure if this will work for
> every platform, it is not yet used in all cases, if U-Boot is booted
> with an internal FDT which has the memory map defined, this will
> be used instead.
> 
> If the FDT is internal FDT with no memory map defined, then U-Boot will
> try to use SMEM. This should remove the need to define the memory map
> statically in a U-Boot overlay for boards that don't chainload.
> 
> Signed-off-by: Casey Connolly <casey.connolly at linaro.org>

Thanks a lot for working on this!

On DragonBoard 410c with (qcom_)dragonboard410c_defconfig:

	$ make qcom_dragonboard410c_defconfig
	  HOSTCC  scripts/basic/fixdep
	  GEN     Makefile
	  HOSTCC  scripts/kconfig/conf.o
	  YACC    scripts/kconfig/zconf.tab.[ch]
	  LEX     scripts/kconfig/zconf.lex.c
	  HOSTCC  scripts/kconfig/zconf.tab.o
	  HOSTLD  scripts/kconfig/conf

	WARNING: unmet direct dependencies detected for QCOM_SMEM
	  Depends on [n]: SOC_QCOM [=n]
	  Selected by [y]:
	  - ARCH_SNAPDRAGON [=y] && <choice>

	WARNING: unmet direct dependencies detected for QCOM_SMEM
	  Depends on [n]: SOC_QCOM [=n]
	  Selected by [y]:
	  - ARCH_SNAPDRAGON [=y] && <choice>

I added CONFIG_SOC_QCOM=y in (qcom_)dragonboard410c_defconfig to
workaround this, but we probably should select SOC_QCOM for
ARCH_SNAPDRAGON to fix this properly.

Then:

	$ make
	aarch64-linux-gnu-ld: arch/arm/mach-snapdragon/dram.o: in function `qcom_configure_capsule_updates':
	arch/arm/mach-snapdragon/qcom-priv.h:38: multiple definition of `qcom_configure_capsule_updates';
	arch/arm/mach-snapdragon/board.o:arch/arm/mach-snapdragon/qcom-priv.h:38: first defined here

I added:

diff --git a/arch/arm/mach-snapdragon/qcom-priv.h b/arch/arm/mach-snapdragon/qcom-priv.h
index 39dc8fcc76a..27e5c54e512 100644
--- a/arch/arm/mach-snapdragon/qcom-priv.h
+++ b/arch/arm/mach-snapdragon/qcom-priv.h
@@ -35,7 +35,7 @@ extern enum qcom_memmap_source qcom_memmap_source;
 #if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
 void qcom_configure_capsule_updates(void);
 #else
-void qcom_configure_capsule_updates(void) {}
+static inline void qcom_configure_capsule_updates(void) {}
 #endif /* EFI_HAVE_CAPSULE_SUPPORT */

With that fixed:

U-Boot 2026.07-rc2-...
Qualcomm-DragonBoard 410C

DRAM:  1 GiB
...
U-Boot loaded from XBL
Memory map loaded from INTERNAL_FDT

Then I removed the /memory map in the internal FDT (delete
arch/arm/dts/apq8016-sbc-u-boot.dtsi), and it detects the correct 2 GiB
RAM on this board!

U-Boot 2026.07-rc2-...
Qualcomm-DragonBoard 410C

DRAM:  2 GiB
...
U-Boot loaded from XBL
Memory map loaded from SMEM

So feel free to add my Tested-by: # db410c if you fix the errors
mentioned above (also feel free to include a patch to delete
arch/arm/dts/apq8016-sbc-u-boot.dtsi, or I can do this myself later once
your series lands).

Thanks!
Stephan


More information about the U-Boot mailing list