summaryrefslogtreecommitdiff
path: root/src/mainboard/emulation/qemu-riscv/cbmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/emulation/qemu-riscv/cbmem.c')
-rw-r--r--src/mainboard/emulation/qemu-riscv/cbmem.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mainboard/emulation/qemu-riscv/cbmem.c b/src/mainboard/emulation/qemu-riscv/cbmem.c
index 3e114159b6..ff3f5db3fc 100644
--- a/src/mainboard/emulation/qemu-riscv/cbmem.c
+++ b/src/mainboard/emulation/qemu-riscv/cbmem.c
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <assert.h>
#include <cbmem.h>
#include <symbols.h>
#include <ramdetect.h>
@@ -11,9 +12,7 @@ uintptr_t cbmem_top_chipset(void)
uint64_t top;
top = fdt_get_memory_top((void *)HLS()->fdt);
- if (top)
- return MIN(top, (uint64_t)4 * GiB - 1);
+ ASSERT_MSG(top, "Failed reading memory range from FDT");
- size_t dram_mb_detected = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
- return (uintptr_t)_dram + dram_mb_detected * MiB;
+ return MIN(top, (uint64_t)4 * GiB - 1);
}