[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 30/79] arm/sbsa-ref: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH v6 30/79] arm/sbsa-ref: use memdev for RAM |
Date: |
Wed, 19 Feb 2020 11:09:04 -0500 |
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.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
CC: address@hidden
CC: address@hidden
---
hw/arm/sbsa-ref.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 9b5bcb5634..1cba9fc302 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -593,7 +593,6 @@ static void sbsa_ref_init(MachineState *machine)
MachineClass *mc = MACHINE_GET_CLASS(machine);
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *secure_sysmem = g_new(MemoryRegion, 1);
- MemoryRegion *ram = g_new(MemoryRegion, 1);
bool firmware_loaded;
const CPUArchIdList *possible_cpus;
int n, sbsa_max_cpus;
@@ -685,9 +684,8 @@ static void sbsa_ref_init(MachineState *machine)
object_unref(cpuobj);
}
- memory_region_allocate_system_memory(ram, NULL, "sbsa-ref.ram",
- machine->ram_size);
- memory_region_add_subregion(sysmem, sbsa_ref_memmap[SBSA_MEM].base, ram);
+ memory_region_add_subregion(sysmem, sbsa_ref_memmap[SBSA_MEM].base,
+ machine->ram);
create_fdt(sms);
@@ -785,6 +783,7 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *data)
mc->block_default_type = IF_IDE;
mc->no_cdrom = 1;
mc->default_ram_size = 1 * GiB;
+ mc->default_ram_id = "sbsa-ref.ram";
mc->default_cpus = 4;
mc->possible_cpu_arch_ids = sbsa_ref_possible_cpu_arch_ids;
mc->cpu_index_to_instance_props = sbsa_ref_cpu_index_to_props;
--
2.18.1
- [PATCH v6 26/79] arm/omap_sx1: use memdev for RAM, (continued)
- [PATCH v6 26/79] arm/omap_sx1: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 28/79] arm/sabrelite: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 29/79] arm/raspi: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 31/79] arm/versatilepb: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 27/79] arm/palm: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 33/79] arm/virt: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 32/79] arm/vexpress: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 35/79] arm/xilinx_zynq: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 34/79] arm/xilinx_zynq: drop RAM size fixup, Igor Mammedov, 2020/02/19
- [PATCH v6 39/79] null-machine: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 30/79] arm/sbsa-ref: use memdev for RAM,
Igor Mammedov <=
- [PATCH v6 36/79] arm/xlnx-versal-virt: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 38/79] s390x/s390-virtio-ccw: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 11/79] arm/collie: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 37/79] arm/xlnx-zcu102: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 40/79] cris/axis_dev88: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 42/79] x86/microvm: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 43/79] x86/pc: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 46/79] m68k/an5206: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 45/79] lm32/milkymist: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 44/79] lm32/lm32_boards: use memdev for RAM, Igor Mammedov, 2020/02/19