summaryrefslogtreecommitdiff
path: root/src/mainboard/emulation/qemu-power9/cbmem.c
diff options
context:
space:
mode:
authorYaroslav Kurlaev <yaroslav.kurlaev@3mdeb.com>2021-07-06 22:30:28 +0700
committerFelix Held <felix-coreboot@felixheld.de>2022-02-11 20:16:44 +0000
commitbcbcdf73943d8bc81f2e35c4a67eebcbde716eda (patch)
tree9958c911919286264c3662bfcb964823b45edc1c /src/mainboard/emulation/qemu-power9/cbmem.c
parente985d211fb1d975bbb5bee0ed2597c24ee05bd1e (diff)
src/mainboard/emulation/qemu-power9: add RAM detection
Change-Id: Ie333294c7a311f6d47bdfbd1fc3cec0128cf63e7 Signed-off-by: Yaroslav Kurlaev <yaroslav.kurlaev@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57081 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Diffstat (limited to 'src/mainboard/emulation/qemu-power9/cbmem.c')
-rw-r--r--src/mainboard/emulation/qemu-power9/cbmem.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mainboard/emulation/qemu-power9/cbmem.c b/src/mainboard/emulation/qemu-power9/cbmem.c
index c1c5e94c5c..1b7b690883 100644
--- a/src/mainboard/emulation/qemu-power9/cbmem.c
+++ b/src/mainboard/emulation/qemu-power9/cbmem.c
@@ -1,11 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <cbmem.h>
+#include <ramdetect.h>
void *cbmem_top_chipset(void)
{
- /* Top of cbmem is at lowest usable DRAM address below 4GiB. */
- /* For now, last 1M of 4G */
- void *ptr = (void *) (4ULL * GiB - 1 * MiB);
- return ptr;
+ return (void *)(probe_ramsize(0, CONFIG_DRAM_SIZE_MB) * MiB);
}