Thomas Heijligen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30850
Change subject: mb/emulation/qemu-i440fx: use e820 in romstage ......................................................................
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 --- M src/mainboard/emulation/qemu-i440fx/Makefile.inc M src/mainboard/emulation/qemu-i440fx/memory.c 2 files changed, 18 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/30850/1
diff --git a/src/mainboard/emulation/qemu-i440fx/Makefile.inc b/src/mainboard/emulation/qemu-i440fx/Makefile.inc index 9e2880a..8c19afc 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 dea96f2..863d923 100644 --- a/src/mainboard/emulation/qemu-i440fx/memory.c +++ b/src/mainboard/emulation/qemu-i440fx/memory.c @@ -16,6 +16,8 @@ #include <cbmem.h> #include <arch/io.h> #include "memory.h" +#include "fw_cfg.h" +#include "fw_cfg_if.h"
#define CMOS_ADDR_PORT 0x70 #define CMOS_DATA_PORT 0x71 @@ -52,5 +54,19 @@
void *cbmem_top(void) { - return (void *) (qemu_get_memory_size() * 1024); + FwCfgE820Entry e; + uint64_t tom = 0; + + if (fw_cfg_e820_select()) { + while (!fw_cfg_e820_read(&e)) { + uint64_t limit = (uint64_t)e.address + e.length; + if (e.type == 1 && limit < 4ULL * GiB && limit > tom) + tom = limit; + } + } + + if (!tom) + tom = qemu_get_memory_size() * 1024; + + return (void *)((uint32_t)tom); }
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30850
to look at the new patch set (#3).
Change subject: mb/emulation/qemu-i440fx: use e820 in romstage ......................................................................
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 --- M src/mainboard/emulation/qemu-i440fx/Makefile.inc M src/mainboard/emulation/qemu-i440fx/memory.c 2 files changed, 10 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/30850/3
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30850
to look at the new patch set (#4).
Change subject: mb/emulation/qemu-i440fx: use e820 in romstage ......................................................................
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 --- M src/mainboard/emulation/qemu-i440fx/Makefile.inc M src/mainboard/emulation/qemu-i440fx/memory.c M src/mainboard/emulation/qemu-q35/Makefile.inc 3 files changed, 11 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/30850/4
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30850 )
Change subject: mb/emulation/qemu-i440fx: use e820 in romstage ......................................................................
Patch Set 5: Code-Review+1
(2 comments)
https://review.coreboot.org/#/c/30850/5/src/mainboard/emulation/qemu-i440fx/... File src/mainboard/emulation/qemu-i440fx/memory.c:
https://review.coreboot.org/#/c/30850/5/src/mainboard/emulation/qemu-i440fx/... PS5, Line 20: #include "fw_cfg_if.h" is fw_cfg_if.h needed here ? looks like fw_cfg.h already includes it.
https://review.coreboot.org/#/c/30850/5/src/mainboard/emulation/qemu-i440fx/... PS5, Line 57: unsigned long tom = 0; please use uintptr_t
Hello Patrick Rudolph, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30850
to look at the new patch set (#6).
Change subject: mb/emulation/qemu-i440fx: use e820 in romstage ......................................................................
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 --- M src/mainboard/emulation/qemu-i440fx/Makefile.inc M src/mainboard/emulation/qemu-i440fx/memory.c M src/mainboard/emulation/qemu-q35/Makefile.inc 3 files changed, 11 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/30850/6
Hello Patrick Rudolph, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30850
to look at the new patch set (#7).
Change subject: mb/emulation/qemu-i440fx: use e820 in romstage ......................................................................
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 --- M src/mainboard/emulation/qemu-i440fx/Makefile.inc M src/mainboard/emulation/qemu-i440fx/memory.c M src/mainboard/emulation/qemu-q35/Makefile.inc 3 files changed, 10 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/30850/7
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30850 )
Change subject: mb/emulation/qemu-i440fx: use e820 in romstage ......................................................................
Patch Set 7: Code-Review+2
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/30850 )
Change subject: mb/emulation/qemu-i440fx: use e820 in romstage ......................................................................
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 --- M src/mainboard/emulation/qemu-i440fx/Makefile.inc M src/mainboard/emulation/qemu-i440fx/memory.c M src/mainboard/emulation/qemu-q35/Makefile.inc 3 files changed, 10 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Patrick Rudolph: Looks good to me, approved
diff --git a/src/mainboard/emulation/qemu-i440fx/Makefile.inc b/src/mainboard/emulation/qemu-i440fx/Makefile.inc index 9e2880a..8c19afc 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 dea96f2..aa1ceba 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 @@
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; } diff --git a/src/mainboard/emulation/qemu-q35/Makefile.inc b/src/mainboard/emulation/qemu-q35/Makefile.inc index 1503220..a52aad4 100644 --- a/src/mainboard/emulation/qemu-q35/Makefile.inc +++ b/src/mainboard/emulation/qemu-q35/Makefile.inc @@ -2,4 +2,5 @@ ramstage-y += ../qemu-i440fx/memory.c ramstage-y += ../qemu-i440fx/fw_cfg.c romstage-y += ../qemu-i440fx/memory.c +romstage-y += ../qemu-i440fx/fw_cfg.c bootblock-y += bootblock.c