[PATCH] dts: qcom: remove hardcoded memory maps
Varadarajan Narayanan
varadarajan.narayanan at oss.qualcomm.com
Thu Jul 2 13:25:00 CEST 2026
On Thu, Jul 02, 2026 at 04:50:46PM +0530, Varadarajan Narayanan wrote:
> On Wed, Jul 01, 2026 at 12:19:33PM +0200, Casey Connolly wrote:
> > Qualcomm boards have traditionally relied on a prior bootloader stage
> > to populate the memory map in devicetree, and when that wasn't available
> > the memory map would instead be hardcoded.
> >
> > With proper support for SMEM in U-Boot the memory map can now
> > dynamically be read out of the SMEM database which is populated on boot
> > by the preloader (sbl1).
> >
> > Switch over all the boards that previously relied on hardcoded memory
> > maps to use SMEM instead. This has been tested on the Rubik Pi 3 and
> > db410c however other platforms still need testing (see below).
> >
> > This affects the following boards:
> >
> > * IPQ5424 RDP466
> > * IPQ9574 RDP433
> > * QCS615 Ride
> > * QCS6490 RB3 Gen 2
> > * QCS8300 Ride
> > * QCS9100 Ride
> >
> > Signed-off-by: Casey Connolly <casey.connolly at linaro.org>
> > ---
> > This patch is based on the qcom-next branch found on the Qualcomm U-Boot
> > Custodian repository [1]. For testing please check out that branch,
> > apply this patch and then build/boot U-Boot. Ensure that you have
> > CONFIG_LOGLEVEL set to >=6 and look for the "Memory map loaded from"
> > message during boot, it should say SMEM.
> >
> > If nothing is broken in U-Boot and Linux then please send your Tested-by
> > indicating which board(s) you tried as a "#" comment after your email.
> >
> > [1]: https://source.denx.de/u-boot/custodians/u-boot-snapdragon
> >
> > Cc: u-boot-qcom at groups.io
> > Cc: Neil Armstrong <neil.armstrong at linaro.org>
> > Cc: Sumit Garg <sumit.garg at kernel.org>
> > Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
>
> This fails to boot on both IPQ5424 RDP466 and IPQ9574 RDP433.
>
> IPQ SoCs have the following node in their DTs under reserved-memory.
>
> $ grep bootloader@ dts/upstream/src/arm64/qcom/*
> dts/upstream/src/arm64/qcom/ipq5018.dtsi: bootloader at 4a800000 {
> dts/upstream/src/arm64/qcom/ipq5332.dtsi: bootloader at 4a100000 {
> dts/upstream/src/arm64/qcom/ipq5424.dtsi: bootloader at 8a200000 {
> dts/upstream/src/arm64/qcom/ipq6018.dtsi: bootloader at 4a100000 {
> dts/upstream/src/arm64/qcom/ipq8074.dtsi: bootloader at 4a600000 {
> dts/upstream/src/arm64/qcom/ipq9574.dtsi: bootloader at 4a100000 {
>
> While booting, initr_caches -> enable_caches -> configure_reserved_memory
> unmaps the above 'bootloader' reserved-memory region. Eventually, when
> U-Boot looks for environment variables via env_get_f(), the 'env' pointer
> points inside the 'bootloader' region. Since it has been unmapped, it
> crashes.
Forgot to mention that it boots with the following change:
> diff --git a/arch/arm/mach-snapdragon/mem_map.c b/arch/arm/mach-snapdragon/mem_map.c
> index f64ec0c674e..d554537fbec 100644
> --- a/arch/arm/mach-snapdragon/mem_map.c
> +++ b/arch/arm/mach-snapdragon/mem_map.c
> @@ -112,6 +112,10 @@ static void configure_reserved_memory(void)
> fdt_for_each_subnode(rmem, gd->fdt_blob, parent) {
> const fdt32_t *ptr;
> attrs = PTE_TYPE_FAULT;
> +
> + if (!memcmp("bootloader@", fdt_get_name(gd->fdt_blob, rmem, NULL), 11))
> + continue;
> +
> /* If the no-map property isn't set then the region is valid */
> if (!fdt_getprop(gd->fdt_blob, rmem, "no-map", NULL))
> attrs = PTE_TYPE_VALID | PTE_BLOCK_MEMTYPE(MT_NORMAL);
Thanks
Varada
More information about the U-Boot
mailing list