Skip to content

[TOPIC] Add reserved memory regions and EFI memory mapping#12

Open
aswinm94 wants to merge 1 commit intoqualcomm-linux:u-boot-mainline-1.0from
aswinm94:efi-res-mem
Open

[TOPIC] Add reserved memory regions and EFI memory mapping#12
aswinm94 wants to merge 1 commit intoqualcomm-linux:u-boot-mainline-1.0from
aswinm94:efi-res-mem

Conversation

@aswinm94
Copy link
Copy Markdown

@aswinm94 aswinm94 commented Apr 9, 2026

Add reserved-memory nodes to QCS615 and QCS6490 device trees to
define platform-specific memory regions that should not be used by
the operating system.

Implement efi_add_known_memory() function in board.c code to
parse reserved-memory nodes from device tree and register them with
the EFI memory map. This ensures proper memory protection during EFI
boot and prevents conflicts with firmware-reserved regions.

Note: This reserved memory region are expected to be up streamed as part of linux DTS

upstream link: https://lore.kernel.org/u-boot/20260113090621.3402096-1-balaji.selvanathan@oss.qualcomm.com/

Comment on lines +14 to 70

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

hyp_mem: hyp@80000000 {
reg = <0x0 0x80000000 0x0 0x600000>;
no-map;
};

xbl_boot_mem: xbl-boot@85d00000 {
reg = <0x0 0x85d00000 0x0 0x200000>;
no-map;
};

aop_mem: aop@85f00000 {
reg = <0x0 0x85f00000 0x0 0x20000>;
no-map;
};

xbl_dt_mem: xbl-dt@85f40000 {
reg = <0x0 0x85f40000 0x0 0x30000>;
no-map;
};

tz_stat_mem: tz-stat@86200000 {
reg = <0x0 0x86200000 0x0 0x100000>;
no-map;
};

tags_mem: tags@86300000 {
reg = <0x0 0x86300000 0x0 0x1200000>;
no-map;
};

tz_mem: tz@87500000 {
reg = <0x0 0x87500000 0x0 0x500000>;
no-map;
};

tzapps_mem: tzapps@87a00000 {
reg = <0x0 0x87a00000 0x0 0x1c00000>;
no-map;
};

pil_mem: pil@8ab00000 {
reg = <0x0 0x8ab00000 0x0 0xcc17000>;
no-map;
};

secure_dsp_mem: secure-dsp@a0000000 {
reg = <0x0 0xa0000000 0x0 0x1600000>;
no-map;
};
};
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream won't accept this. They will ask to push this in Linux DT

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are following up with Linux team regarding adding this to Linux DTS. Meanwhile, having this overrides in uboot dts.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we need an upstream DTS patch accompanying the U-Boot dtsi changes.

Comment on lines +18 to +43

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

axon_dma_mem: axon-dma@80600000 {
reg = <0x0 0x80600000 0x0 0x100000>;
no-map;
};

xbl_dt_mem: xbl-dt@80894000 {
reg = <0x0 0x80894000 0x0 0x40000>;
no-map;
};

pil_reserved_mem: pil-reserved@84300000 {
reg = <0x0 0x84300000 0x0 0x16b00000>;
no-map;
};

display_mem: display@e1000000 {
reg = <0x0 0xe1000000 0x0 0x2400000>;
no-map;
};
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are following up with Linux team regarding adding this to Linux DTS. Meanwhile, having this overrides in uboot dts.

log_debug("Reserved %s: 0x%llx-0x%llx (%llu KB)\n",
name ? name : "unknown",
(unsigned long long)addr,
(unsigned long long)(addr + size),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addr + size - 1

Copy link
Copy Markdown

@varada-qcom varada-qcom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

* For Qualcomm platforms, this parses the reserved-memory nodes from the
* device tree and adds them to the EFI memory map.
*/
void efi_add_known_memory(void)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reserved memory nodes should be automatically added by the generic EFI code. Why this is Qcom specific?

@b49020 b49020 changed the title Add reserved memory regions and EFI memory mapping [TOPIC] Add reserved memory regions and EFI memory mapping Apr 10, 2026
Add reserved-memory nodes to QCS615 and QCS6490 device trees to
define platform-specific memory regions that should not be used by
the operating system.

Implement efi_add_known_memory() function in board.c code to
parse reserved-memory nodes from device tree and register them with
the EFI memory map. This ensures proper memory protection during EFI
boot and prevents conflicts with firmware-reserved regions.

Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants