Sergii Dmytruk has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/57081 )
Change subject: src/mainboard/emulation/qemu-power9: add RAM detection ......................................................................
src/mainboard/emulation/qemu-power9: add RAM detection
Change-Id: Ie333294c7a311f6d47bdfbd1fc3cec0128cf63e7 Signed-off-by: Yaroslav Kurlaev yaroslav.kurlaev@3mdeb.com --- M src/mainboard/emulation/qemu-power9/cbmem.c M src/mainboard/emulation/qemu-power9/mainboard.c M src/mainboard/emulation/qemu-power9/memlayout.ld M src/mainboard/emulation/qemu-power9/romstage.c 4 files changed, 13 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/57081/1
diff --git a/src/mainboard/emulation/qemu-power9/cbmem.c b/src/mainboard/emulation/qemu-power9/cbmem.c index 15c20f8..1b7b690 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 *) ((1ULL << 32) - 1048576); - return ptr; + return (void *)(probe_ramsize(0, CONFIG_DRAM_SIZE_MB) * MiB); } diff --git a/src/mainboard/emulation/qemu-power9/mainboard.c b/src/mainboard/emulation/qemu-power9/mainboard.c index 60c3f8b..c74937c 100644 --- a/src/mainboard/emulation/qemu-power9/mainboard.c +++ b/src/mainboard/emulation/qemu-power9/mainboard.c @@ -6,10 +6,10 @@
static void mainboard_enable(struct device *dev) { - if (!dev) { die("No dev0; die\n"); } + ram_resource(dev, 0, 0, (unsigned long)cbmem_top() / KiB); }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/emulation/qemu-power9/memlayout.ld b/src/mainboard/emulation/qemu-power9/memlayout.ld index ebac3c4..42e3889 100644 --- a/src/mainboard/emulation/qemu-power9/memlayout.ld +++ b/src/mainboard/emulation/qemu-power9/memlayout.ld @@ -10,14 +10,14 @@
BOOTBLOCK(0, 32K)
- STACK(0x8000, 32K) + ROMSTAGE(0xf00000, 1M) + STACK(0x1000000, 32K) + RAMSTAGE(0x1008000, 1M)
- PRERAM_CBMEM_CONSOLE(0x10000, 128K) - FMAP_CACHE(0x30000, 4K) - CBFS_MCACHE(0x31000, 8K) - TIMESTAMP(0x33000, 4K) - CBFS_CACHE(0x34000, 512K) - ROMSTAGE(0x100000, 1M) + FMAP_CACHE(0x1108000, 4K) + CBFS_MCACHE(0x1109000, 8K) + TIMESTAMP(0x110b000, 4K) + CBFS_CACHE(0x110c000, 512K) + PRERAM_CBMEM_CONSOLE(0x118c000, 128K)
- RAMSTAGE(0x300000, 5M) } diff --git a/src/mainboard/emulation/qemu-power9/romstage.c b/src/mainboard/emulation/qemu-power9/romstage.c index c412315..4a3ed83 100644 --- a/src/mainboard/emulation/qemu-power9/romstage.c +++ b/src/mainboard/emulation/qemu-power9/romstage.c @@ -1,10 +1,12 @@ /* SPDX-License-Identifier: GPL-2.0-only */
+#include <cbmem.h> #include <console/console.h> #include <program_loading.h>
void main(void) { console_init(); + cbmem_initialize_empty(); run_ramstage(); }