[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 31/79] arm/versatilepb: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH v6 31/79] arm/versatilepb: use memdev for RAM |
Date: |
Wed, 19 Feb 2020 11:09:05 -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>
---
hw/arm/versatilepb.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index e86af01537..f3c4a50b19 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -184,7 +184,6 @@ static void versatile_init(MachineState *machine, int
board_id)
Object *cpuobj;
ARMCPU *cpu;
MemoryRegion *sysmem = get_system_memory();
- MemoryRegion *ram = g_new(MemoryRegion, 1);
qemu_irq pic[32];
qemu_irq sic[32];
DeviceState *dev, *sysctl;
@@ -220,11 +219,9 @@ static void versatile_init(MachineState *machine, int
board_id)
cpu = ARM_CPU(cpuobj);
- memory_region_allocate_system_memory(ram, NULL, "versatile.ram",
- machine->ram_size);
/* ??? RAM should repeat to fill physical memory space. */
/* SDRAM at address zero. */
- memory_region_add_subregion(sysmem, 0, ram);
+ memory_region_add_subregion(sysmem, 0, machine->ram);
sysctl = qdev_create(NULL, "realview_sysctl");
qdev_prop_set_uint32(sysctl, "sys_id", 0x41007004);
@@ -398,6 +395,7 @@ static void versatilepb_class_init(ObjectClass *oc, void
*data)
mc->block_default_type = IF_SCSI;
mc->ignore_memory_transaction_failures = true;
mc->default_cpu_type = ARM_CPU_TYPE_NAME("arm926");
+ mc->default_ram_id = "versatile.ram";
}
static const TypeInfo versatilepb_type = {
@@ -415,6 +413,7 @@ static void versatileab_class_init(ObjectClass *oc, void
*data)
mc->block_default_type = IF_SCSI;
mc->ignore_memory_transaction_failures = true;
mc->default_cpu_type = ARM_CPU_TYPE_NAME("arm926");
+ mc->default_ram_id = "versatile.ram";
}
static const TypeInfo versatileab_type = {
--
2.18.1
- [PATCH v6 15/79] arm/imx25_pdk: drop RAM size fixup, (continued)
- [PATCH v6 15/79] arm/imx25_pdk: drop RAM size fixup, Igor Mammedov, 2020/02/19
- [PATCH v6 21/79] arm/mcimx7d-sabre: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 22/79] arm/mps2-tz: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 20/79] arm/mcimx6ul-evk: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 24/79] arm/musicpal: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 23/79] arm/mps2: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 25/79] arm/nseries: use memdev for RAM, Igor Mammedov, 2020/02/19
- [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 <=
- [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, 2020/02/19
- [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