Commit 9bd58604 authored by Daniel Leung's avatar Daniel Leung Committed by Anas Nashif
Browse files

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: default avatarDaniel Leung <daniel.leung@intel.com>
parent 8ed9fecb
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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}