diff options
Diffstat (limited to 'src/mainboard/emulation/qemu-aarch64/cbmem.c')
-rw-r--r-- | src/mainboard/emulation/qemu-aarch64/cbmem.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mainboard/emulation/qemu-aarch64/cbmem.c b/src/mainboard/emulation/qemu-aarch64/cbmem.c index 389ff4ead0..4cdd44f993 100644 --- a/src/mainboard/emulation/qemu-aarch64/cbmem.c +++ b/src/mainboard/emulation/qemu-aarch64/cbmem.c @@ -3,8 +3,16 @@ #include <cbmem.h> #include <ramdetect.h> #include <symbols.h> +#include <device_tree.h> +DECLARE_REGION(fdt) uintptr_t cbmem_top_chipset(void) { + uint64_t top; + + top = fdt_get_memory_top((void *)_fdt); + if (top) + return MIN(top, (uint64_t)4 * GiB - 1); + return (uintptr_t)_dram + (probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB) * MiB); } |