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.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mainboard/emulation/qemu-riscv/cbmem.c b/src/mainboard/emulation/qemu-riscv/cbmem.c
new file mode 100644
index 0000000000..10ca2cd87f
--- /dev/null
+++ b/src/mainboard/emulation/qemu-riscv/cbmem.c
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <cbmem.h>
+#include <symbols.h>
+#include <ramdetect.h>
+#include <console/console.h>
+
+uintptr_t cbmem_top_chipset(void)
+{
+ //TODO get memory range from QEMUs FDT
+ size_t dram_mb_detected = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
+ return (uintptr_t)_dram + dram_mb_detected * MiB;
+}