From 378d04640d4e946be45952625c9f85efda9066ad Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Wed, 19 Jun 2013 08:30:33 +0200 Subject: qemu-i440fx: Make it compile with CONFIG_DYNAMIC_CBMEM. This commit was tested on qemu with and without CONFIG_DYNAMIC_CBMEM by running cmbmem -c once booted. The qemu command that was used was: qemu-system-i386 -bios ./build/coreboot.rom -serial stdio -hda ../virt/parabola.img Note that using CONFIG_RELOCATABLE_RAMSTAGE make it fails like that: Loading image. CBFS: Decompressing stage fallback/coreboot_ram @ 0x3ffbefc0 (184400 bytes) Loading module at 3ffbf000 with entry 3ffbf000. filesize: 0x18db8 memsize: 0x2c050 Processing 1703 relocs with adjust value of 0x3ffbe000 FATAL: Essential component is missing. However without CONFIG_RELOCATABLE_RAMSTAGE set it boots fine. Change-Id: I633a8c3832eee4e8bed244940fdc370b98dd26f0 Signed-off-by: Denis 'GNUtoo' Carikli Reviewed-on: http://review.coreboot.org/3504 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/mainboard/emulation/qemu-i440fx/memory.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mainboard/emulation/qemu-i440fx/memory.c') diff --git a/src/mainboard/emulation/qemu-i440fx/memory.c b/src/mainboard/emulation/qemu-i440fx/memory.c index 8245ca24dd..000a0f660d 100644 --- a/src/mainboard/emulation/qemu-i440fx/memory.c +++ b/src/mainboard/emulation/qemu-i440fx/memory.c @@ -46,7 +46,15 @@ unsigned long get_top_of_ram(void) return qemu_get_memory_size() * 1024; } +#if !CONFIG_DYNAMIC_CBMEM struct cbmem_entry *get_cbmem_toc(void) { return (struct cbmem_entry *)(get_top_of_ram() - HIGH_MEMORY_SIZE); } +#else +void *cbmem_top(void) +{ + /* Top of cbmem is at lowest usable DRAM address below 4GiB. */ + return (void *)get_top_of_ram(); +} +#endif -- cgit v1.2.3