Read device memory regions from the FDT.
If provided, rather than mapping a large chunk of address space as
device memory, allow the specific ranges to be provided and only map
those. Fall back to mapping a large chunk and carving out normal memory
if no device memory regions are provided so QEMU tests continue to work.
These ranges continue to only be mapped to the primary VM for the time
being.
Change-Id: Ia3acf3bb206bf0399ebc3be33d4696cd0450539d
diff --git a/src/boot_flow/common.c b/src/boot_flow/common.c
index 597c421..dace9af 100644
--- a/src/boot_flow/common.c
+++ b/src/boot_flow/common.c
@@ -26,6 +26,7 @@
const struct fdt_node *fdt_root)
{
struct string memory = STRING_INIT("memory");
+ struct string device_memory = STRING_INIT("device-memory");
p->mem_ranges_count = 0;
p->kernel_arg = plat_boot_flow_get_kernel_arg();
@@ -34,7 +35,10 @@
&p->initrd_end) &&
fdt_find_cpus(fdt_root, p->cpu_ids, &p->cpu_count) &&
fdt_find_memory_ranges(fdt_root, &memory, p->mem_ranges,
- &p->mem_ranges_count, MAX_MEM_RANGES);
+ &p->mem_ranges_count, MAX_MEM_RANGES) &&
+ fdt_find_memory_ranges(
+ fdt_root, &device_memory, p->device_mem_ranges,
+ &p->device_mem_ranges_count, MAX_DEVICE_MEM_RANGES);
}
/**