[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 52/86] mips:boston-cube: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH v2 52/86] mips:boston-cube: use memdev for RAM |
Date: |
Wed, 15 Jan 2020 16:07:07 +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/mips/boston.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/hw/mips/boston.c b/hw/mips/boston.c
index 0df3a77..98ecd25 100644
--- a/hw/mips/boston.c
+++ b/hw/mips/boston.c
@@ -427,7 +427,7 @@ static void boston_mach_init(MachineState *machine)
DeviceState *dev;
BostonState *s;
Error *err = NULL;
- MemoryRegion *flash, *ddr, *ddr_low_alias, *lcd, *platreg;
+ MemoryRegion *flash, *ddr_low_alias, *lcd, *platreg;
MemoryRegion *sys_mem = get_system_memory();
XilinxPCIEHost *pcie2;
PCIDevice *ahci;
@@ -473,14 +473,12 @@ static void boston_mach_init(MachineState *machine)
memory_region_init_rom(flash, NULL, "boston.flash", 128 * MiB, &err);
memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0);
- ddr = g_new(MemoryRegion, 1);
- memory_region_allocate_system_memory(ddr, NULL, "boston.ddr",
- machine->ram_size);
- memory_region_add_subregion_overlap(sys_mem, 0x80000000, ddr, 0);
+ memory_region_add_subregion_overlap(sys_mem, 0x80000000, machine->ram, 0);
ddr_low_alias = g_new(MemoryRegion, 1);
memory_region_init_alias(ddr_low_alias, NULL, "boston_low.ddr",
- ddr, 0, MIN(machine->ram_size, (256 * MiB)));
+ machine->ram, 0,
+ MIN(machine->ram_size, (256 * MiB)));
memory_region_add_subregion_overlap(sys_mem, 0, ddr_low_alias, 0);
xilinx_pcie_init(sys_mem, 0,
@@ -552,6 +550,7 @@ static void boston_mach_class_init(MachineClass *mc)
mc->init = boston_mach_init;
mc->block_default_type = IF_IDE;
mc->default_ram_size = 1 * GiB;
+ mc->default_ram_id = "boston.ddr";
mc->max_cpus = 16;
mc->default_cpu_type = MIPS_CPU_TYPE_NAME("I6400");
}
--
2.7.4
- Re: [PATCH v2 41/86] hw/hppa/machine: Correctly check the firmware is in PDC range, (continued)
[PATCH v2 46/86] x86:pc: use memdev for RAM, Igor Mammedov, 2020/01/15
[PATCH v2 47/86] lm32:lm32_boards: use memdev for RAM, Igor Mammedov, 2020/01/15
[PATCH v2 49/86] m68k:an5206: use memdev for RAM, Igor Mammedov, 2020/01/15
[PATCH v2 48/86] lm32:milkymist: use memdev for RAM, Igor Mammedov, 2020/01/15
[PATCH v2 50/86] m68k:mcf5208: use memdev for RAM, Igor Mammedov, 2020/01/15
[PATCH v2 51/86] m68k:next-cube: use memdev for RAM, Igor Mammedov, 2020/01/15
[PATCH v2 52/86] mips:boston-cube: use memdev for RAM,
Igor Mammedov <=
[PATCH v2 53/86] mips:mips_fulong2e: drop RAM size fixup, Igor Mammedov, 2020/01/15
[PATCH v2 55/86] mips:mips_jazz: use memdev for RAM, Igor Mammedov, 2020/01/15
[PATCH v2 54/86] mips:mips_fulong2e: use memdev for RAM, Igor Mammedov, 2020/01/15
[PATCH v2 56/86] mips:mips_malta: use memdev for RAM, Igor Mammedov, 2020/01/15
[PATCH v2 57/86] mips:mips_mipssim: use memdev for RAM, Igor Mammedov, 2020/01/15
[PATCH v2 59/86] ppc:e500: drop RAM size fixup, Igor Mammedov, 2020/01/15
[PATCH v2 58/86] mips:mips_r4k: use memdev for RAM, Igor Mammedov, 2020/01/15