diff options
author | Thomas Heijligen <thomas.heijligen@secunet.com> | 2019-01-10 19:45:47 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2019-02-05 11:03:08 +0000 |
commit | 8d010db58e5cd9d26ff7c5c7d4dd93a6df0fcbb7 (patch) | |
tree | cb7187dfee9227a5cdc91da8545c708e52d7e5df /src/mainboard/emulation/qemu-i440fx | |
parent | 0065b6974fb311a1fa3448253f63e7d4cec0250e (diff) | |
download | coreboot-8d010db58e5cd9d26ff7c5c7d4dd93a6df0fcbb7.tar.xz |
mb/emulation/qemu-i440fx: use e820 in romstage
Use memory map from fw_cfg e820 map to find cbmem_top in romstage to
avoid conflicts with CMOS option table. Keep qemu_gwt_memory_size() as
fallback.
Change-Id: I6465085020125fc790257f09eb157030c6ceabcb
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/30850
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/mainboard/emulation/qemu-i440fx')
-rw-r--r-- | src/mainboard/emulation/qemu-i440fx/Makefile.inc | 1 | ||||
-rw-r--r-- | src/mainboard/emulation/qemu-i440fx/memory.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/Makefile.inc b/src/mainboard/emulation/qemu-i440fx/Makefile.inc index 9e2880a6a0..8c19afc128 100644 --- a/src/mainboard/emulation/qemu-i440fx/Makefile.inc +++ b/src/mainboard/emulation/qemu-i440fx/Makefile.inc @@ -1,4 +1,5 @@ ramstage-y += northbridge.c ramstage-y += fw_cfg.c +romstage-y += fw_cfg.c romstage-y += memory.c ramstage-y += memory.c diff --git a/src/mainboard/emulation/qemu-i440fx/memory.c b/src/mainboard/emulation/qemu-i440fx/memory.c index dea96f275d..aa1ceba410 100644 --- a/src/mainboard/emulation/qemu-i440fx/memory.c +++ b/src/mainboard/emulation/qemu-i440fx/memory.c @@ -16,6 +16,7 @@ #include <cbmem.h> #include <arch/io.h> #include "memory.h" +#include "fw_cfg.h" #define CMOS_ADDR_PORT 0x70 #define CMOS_DATA_PORT 0x71 @@ -52,5 +53,11 @@ unsigned long qemu_get_memory_size(void) void *cbmem_top(void) { - return (void *) (qemu_get_memory_size() * 1024); + uintptr_t top = 0; + + top = fw_cfg_tolud(); + if (!top) + top = (uintptr_t)qemu_get_memory_size() * 1024; + + return (void *)top; } |