[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 36/80] arm/xlnx-versal-virt: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH v4 36/80] arm/xlnx-versal-virt: use memdev for RAM |
Date: |
Fri, 31 Jan 2020 16:09:06 +0100 |
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>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/arm/xlnx-versal-virt.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c
index 462493c..c137ff4 100644
--- a/hw/arm/xlnx-versal-virt.c
+++ b/hw/arm/xlnx-versal-virt.c
@@ -30,7 +30,6 @@ typedef struct VersalVirt {
MachineState parent_obj;
Versal soc;
- MemoryRegion mr_ddr;
void *fdt;
int fdt_size;
@@ -414,12 +413,9 @@ static void versal_virt_init(MachineState *machine)
psci_conduit = QEMU_PSCI_CONDUIT_SMC;
}
- memory_region_allocate_system_memory(&s->mr_ddr, NULL, "ddr",
- machine->ram_size);
-
sysbus_init_child_obj(OBJECT(machine), "xlnx-ve", &s->soc,
sizeof(s->soc), TYPE_XLNX_VERSAL);
- object_property_set_link(OBJECT(&s->soc), OBJECT(&s->mr_ddr),
+ object_property_set_link(OBJECT(&s->soc), OBJECT(machine->ram),
"ddr", &error_abort);
object_property_set_int(OBJECT(&s->soc), psci_conduit,
"psci-conduit", &error_abort);
@@ -473,6 +469,7 @@ static void versal_virt_machine_class_init(ObjectClass *oc,
void *data)
mc->max_cpus = XLNX_VERSAL_NR_ACPUS;
mc->default_cpus = XLNX_VERSAL_NR_ACPUS;
mc->no_cdrom = true;
+ mc->default_ram_id = "ddr";
}
static const TypeInfo versal_virt_machine_init_typeinfo = {
--
2.7.4
- [PATCH v4 26/80] arm/omap_sx1: use memdev for RAM, (continued)
- [PATCH v4 26/80] arm/omap_sx1: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 27/80] arm/palm: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 21/80] arm/mcimx7d-sabre: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 24/80] arm/musicpal: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 28/80] arm/raspi: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 29/80] arm/sabrelite: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 22/80] arm/mps2-tz: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 32/80] arm/vexpress: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 30/80] arm/sbsa-ref: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 31/80] arm/versatilepb: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 36/80] arm/xlnx-versal-virt: use memdev for RAM,
Igor Mammedov <=
- [PATCH v4 35/80] arm/xilinx_zynq: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 37/80] arm/xlnx-zcu102: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 33/80] arm/virt: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 39/80] null-machine: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 34/80] arm/xilinx_zynq: drop RAM size fixup, Igor Mammedov, 2020/01/31
- [PATCH v4 38/80] s390x/s390-virtio-ccw: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 40/80] cris/axis_dev88: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 41/80] hppa: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 42/80] x86/microvm: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 43/80] x86/pc: use memdev for RAM, Igor Mammedov, 2020/01/31