[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 35/79] arm/xilinx_zynq: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH v5 35/79] arm/xilinx_zynq: use memdev for RAM |
Date: |
Mon, 17 Feb 2020 12:34:08 -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: Alistair Francis <address@hidden>
---
hw/arm/xilinx_zynq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index df950fc400..0ef9688c5a 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -160,7 +160,6 @@ static void zynq_init(MachineState *machine)
{
ARMCPU *cpu;
MemoryRegion *address_space_mem = get_system_memory();
- MemoryRegion *ext_ram = g_new(MemoryRegion, 1);
MemoryRegion *ocm_ram = g_new(MemoryRegion, 1);
DeviceState *dev;
SysBusDevice *busdev;
@@ -190,9 +189,7 @@ static void zynq_init(MachineState *machine)
object_property_set_bool(OBJECT(cpu), true, "realized", &error_fatal);
/* DDR remapped to address zero. */
- memory_region_allocate_system_memory(ext_ram, NULL, "zynq.ext_ram",
- machine->ram_size);
- memory_region_add_subregion(address_space_mem, 0, ext_ram);
+ memory_region_add_subregion(address_space_mem, 0, machine->ram);
/* 256K of on-chip memory */
memory_region_init_ram(ocm_ram, NULL, "zynq.ocm_ram", 256 * KiB,
@@ -318,6 +315,7 @@ static void zynq_machine_init(MachineClass *mc)
mc->no_sdcard = 1;
mc->ignore_memory_transaction_failures = true;
mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a9");
+ mc->default_ram_id = "zynq.ext_ram";
}
DEFINE_MACHINE("xilinx-zynq-a9", zynq_machine_init)
--
2.18.1
- Re: [PATCH v5 32/79] arm/vexpress: use memdev for RAM, (continued)
- [PATCH v5 37/79] arm/xlnx-zcu102: use memdev for RAM, Igor Mammedov, 2020/02/17
- [PATCH v5 40/79] cris/axis_dev88: use memdev for RAM, Igor Mammedov, 2020/02/17
- [PATCH v5 41/79] hppa: use memdev for RAM, Igor Mammedov, 2020/02/17
- [PATCH v5 38/79] s390x/s390-virtio-ccw: use memdev for RAM, Igor Mammedov, 2020/02/17
- [PATCH v5 35/79] arm/xilinx_zynq: use memdev for RAM,
Igor Mammedov <=
- [PATCH v5 42/79] x86/microvm: use memdev for RAM, Igor Mammedov, 2020/02/17
- [PATCH v5 43/79] x86/pc: use memdev for RAM, Igor Mammedov, 2020/02/17
- [PATCH v5 44/79] lm32/lm32_boards: use memdev for RAM, Igor Mammedov, 2020/02/17
- [PATCH v5 47/79] m68k/q800: use memdev for RAM, Igor Mammedov, 2020/02/17