OSDN Git Service

lm32/milkymist: use memdev for RAM
authorIgor Mammedov <imammedo@redhat.com>
Wed, 19 Feb 2020 16:09:19 +0000 (11:09 -0500)
committerPatchew Importer <importer@patchew.org>
Wed, 19 Feb 2020 16:49:58 +0000 (16:49 +0000)
commitdc8953c6be147853f0e4598211e3d8827199283f
tree2926b692522445e7f30cb192662ed3eb8010a239
parent6047c08fd71434976a087ac7d6a7a90156960b99
lm32/milkymist: use memdev for RAM

memory_region_allocate_system_memory() API is going away, so
replace it with memdev allocated MemoryRegion. The later is
initialized by generic code, so board only needs to opt in
to memdev scheme by providing
  MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing
RAM memory region.

PS:
 while at it add check for user supplied RAM size and error
 out if it mismatches board expected value.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200219160953.13771-46-imammedo@redhat.com>
hw/lm32/milkymist.c