boards: qemu_x86: use correct memory size

All x86 QEMU boards have a hard-coded memory size of 9MB which
does not corresponding with what is defined in device tree.
So make use of CONFIG_SRAM_SIZE to provide correct memory size.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2021-02-04 11:44:09 -08:00 committed by Anas Nashif
commit 9bd5860440

View file

@ -19,8 +19,15 @@ else()
set(QEMU_CPU_TYPE_${ARCH} qemu32,+nx,+pae)
endif()
if(CONFIG_XIP)
# Extra 4MB to emulate flash area
math(EXPR QEMU_MEMORY_SIZE_MB "${CONFIG_SRAM_SIZE} / 1024 + 4")
else()
math(EXPR QEMU_MEMORY_SIZE_MB "${CONFIG_SRAM_SIZE} / 1024")
endif()
set(QEMU_FLAGS_${ARCH}
-m 9
-m ${QEMU_MEMORY_SIZE_MB}
-cpu ${QEMU_CPU_TYPE_${ARCH}}
-device isa-debug-exit,iobase=0xf4,iosize=0x04
${REBOOT_FLAG}