[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 68/79] ppc/virtex_ml507: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH v6 68/79] ppc/virtex_ml507: use memdev for RAM |
Date: |
Wed, 19 Feb 2020 11:09:42 -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>
Acked-by: David Gibson <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
hw/ppc/virtex_ml507.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index 91dd00ee91..b6f4507dcf 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -193,7 +193,6 @@ static int xilinx_load_device_tree(hwaddr addr,
static void virtex_init(MachineState *machine)
{
- ram_addr_t ram_size = machine->ram_size;
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
hwaddr initrd_base = 0;
@@ -204,7 +203,6 @@ static void virtex_init(MachineState *machine)
CPUPPCState *env;
hwaddr ram_base = 0;
DriveInfo *dinfo;
- MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
qemu_irq irq[32], *cpu_irq;
int kernel_size;
int i;
@@ -221,8 +219,7 @@ static void virtex_init(MachineState *machine)
qemu_register_reset(main_cpu_reset, cpu);
- memory_region_allocate_system_memory(phys_ram, NULL, "ram", ram_size);
- memory_region_add_subregion(address_space_mem, ram_base, phys_ram);
+ memory_region_add_subregion(address_space_mem, ram_base, machine->ram);
dinfo = drive_get(IF_PFLASH, 0, 0);
pflash_cfi01_register(PFLASH_BASEADDR, "virtex.flash", FLASH_SIZE,
@@ -265,7 +262,7 @@ static void virtex_init(MachineState *machine)
/* If we failed loading ELF's try a raw image. */
kernel_size = load_image_targphys(kernel_filename,
boot_offset,
- ram_size);
+ machine->ram_size);
boot_info.bootstrap_pc = boot_offset;
high = boot_info.bootstrap_pc + kernel_size + 8192;
}
@@ -276,7 +273,7 @@ static void virtex_init(MachineState *machine)
if (machine->initrd_filename) {
initrd_base = high = ROUND_UP(high, 4);
initrd_size = load_image_targphys(machine->initrd_filename,
- high, ram_size - high);
+ high, machine->ram_size - high);
if (initrd_size < 0) {
error_report("couldn't load ram disk '%s'",
@@ -290,7 +287,7 @@ static void virtex_init(MachineState *machine)
boot_info.fdt = high + (8192 * 2);
boot_info.fdt &= ~8191;
- xilinx_load_device_tree(boot_info.fdt, ram_size,
+ xilinx_load_device_tree(boot_info.fdt, machine->ram_size,
initrd_base, initrd_size,
kernel_cmdline);
}
@@ -302,6 +299,7 @@ static void virtex_machine_init(MachineClass *mc)
mc->desc = "Xilinx Virtex ML507 reference design";
mc->init = virtex_init;
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("440-xilinx");
+ mc->default_ram_id = "ram";
}
DEFINE_MACHINE("virtex-ml507", virtex_machine_init)
--
2.18.1
- [PATCH v6 61/79] ppc/mac_oldworld: use memdev for RAM, (continued)
- [PATCH v6 61/79] ppc/mac_oldworld: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 57/79] mips/mips_r4k: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 58/79] ppc/e500: drop RAM size fixup, Igor Mammedov, 2020/02/19
- [PATCH v6 52/79] mips/mips_fulong2e: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 63/79] ppc/ppc405_boards: add RAM size checks, Igor Mammedov, 2020/02/19
- [PATCH v6 67/79] ppc/spapr: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 65/79] ppc/{ppc440_bamboo, sam460ex}: drop RAM size fixup, Igor Mammedov, 2020/02/19
- [PATCH v6 66/79] ppc/{ppc440_bamboo, sam460ex}: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 60/79] ppc/mac_newworld: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 69/79] sparc/leon3: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 68/79] ppc/virtex_ml507: use memdev for RAM,
Igor Mammedov <=
- [PATCH v6 71/79] sparc/niagara: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 62/79] ppc/pnv: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 64/79] ppc/ppc405_boards: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 70/79] sparc/sun4m: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 72/79] remove no longer used memory_region_allocate_system_memory(), Igor Mammedov, 2020/02/19
- [PATCH v6 73/79] exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize(), Igor Mammedov, 2020/02/19
- [PATCH v6 75/79] make mem_path local variable, Igor Mammedov, 2020/02/19
- [PATCH v6 76/79] hostmem: introduce "prealloc-threads" property, Igor Mammedov, 2020/02/19
- [PATCH v6 74/79] exec: drop bogus mem_path from qemu_ram_alloc_from_fd(), Igor Mammedov, 2020/02/19
- [PATCH v6 79/79] tests:numa-test: use explicit memdev to specify node RAM, Igor Mammedov, 2020/02/19