UEFI/Linux: How to change physical memory map?

Hi all,

I currently run Linux on the Hikey960 board.
cat /proc/iomem gives me the following physical memory map:

00000000-1abfffff : System RAM
  00080000-00ecffff : Kernel code
  01040000-01218fff : Kernel data
1ad88000-201fffff : System RAM
20400000-31ffffff : System RAM
32101000-3dffffff : System RAM
40000000-89b7ffff : System RAM
89cc0000-ba64ffff : System RAM
ba650000-ba88ffff : reserved
ba890000-ba897fff : System RAM
ba898000-ba89bfff : reserved
ba89c000-bf85ffff : System RAM
bf860000-bf89ffff : reserved
bf8a0000-bf8affff : System RAM
bf8b0000-bf8fffff : reserved
bf900000-bfffffff : System RAM

Now I would like to change the memory map and remove some of the memory from Linux. If I understand correctly, the Linux kernel reads this information from the device tree files which are populated by the UEFI beforehand. (ARM-UEFI)

My question is, where exactly in the UEFI code is the memory map created and which file is used to populated it? How can I change the memory map?

Best,
manu

Please check below file, AFAIK, all memory banks are defined in this file in UEFI:

Oh I see … the UEFI defines the ranges that are NOT available to Linux, this is why I couldn’t find the memory ranges.
Thank you for your help :slight_smile:

@manu, you are welcome!