[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 10/79] arm/aspeed: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH v6 10/79] arm/aspeed: use memdev for RAM |
Date: |
Wed, 19 Feb 2020 11:08:44 -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: Cédric Le Goater <address@hidden>
Acked-by: Joel Stanley <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
hw/arm/aspeed.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 805bebd0d0..a6a2102a93 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -35,7 +35,6 @@ static struct arm_boot_info aspeed_board_binfo = {
struct AspeedBoardState {
AspeedSoCState soc;
MemoryRegion ram_container;
- MemoryRegion ram;
MemoryRegion max_ram;
};
@@ -197,6 +196,7 @@ static void aspeed_machine_init(MachineState *machine)
memory_region_init(&bmc->ram_container, NULL, "aspeed-ram-container",
UINT32_MAX);
+ memory_region_add_subregion(&bmc->ram_container, 0, machine->ram);
object_initialize_child(OBJECT(machine), "soc", &bmc->soc,
(sizeof(bmc->soc)), amc->soc_name, &error_abort,
@@ -232,8 +232,6 @@ static void aspeed_machine_init(MachineState *machine)
object_property_set_bool(OBJECT(&bmc->soc), true, "realized",
&error_abort);
- memory_region_allocate_system_memory(&bmc->ram, NULL, "ram", ram_size);
- memory_region_add_subregion(&bmc->ram_container, 0, &bmc->ram);
memory_region_add_subregion(get_system_memory(),
sc->memmap[ASPEED_SDRAM],
&bmc->ram_container);
@@ -436,6 +434,7 @@ static void aspeed_machine_class_init(ObjectClass *oc, void
*data)
mc->no_floppy = 1;
mc->no_cdrom = 1;
mc->no_parallel = 1;
+ mc->default_ram_id = "ram";
aspeed_machine_class_props_init(oc);
}
--
2.18.1
- [PATCH v6 00/79] refactor main RAM allocation to use hostmem backend, Igor Mammedov, 2020/02/19
- [PATCH v6 01/79] numa: remove deprecated -mem-path fallback to anonymous RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 02/79] machine: introduce memory-backend property, Igor Mammedov, 2020/02/19
- [PATCH v6 06/79] vl.c: move -m parsing after memory backends has been processed, Igor Mammedov, 2020/02/19
- [PATCH v6 05/79] initialize MachineState::ram in NUMA case, Igor Mammedov, 2020/02/19
- [PATCH v6 08/79] alpha/dp264: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 03/79] machine: alias -mem-path and -mem-prealloc into memory-foo backend, Igor Mammedov, 2020/02/19
- [PATCH v6 04/79] machine: introduce convenience MachineState::ram, Igor Mammedov, 2020/02/19
- [PATCH v6 10/79] arm/aspeed: use memdev for RAM,
Igor Mammedov <=
- [PATCH v6 07/79] vl.c: ensure that ram_size matches size of machine.memory-backend, Igor Mammedov, 2020/02/19
- [PATCH v6 09/79] arm/aspeed: actually check RAM size, Igor Mammedov, 2020/02/19
- [PATCH v6 12/79] arm/cubieboard: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 13/79] arm/digic_boards: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 14/79] arm/highbank: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 16/79] arm/imx25_pdk: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 19/79] arm/kzm: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 17/79] arm/integratorcp: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 18/79] arm/kzm: drop RAM size fixup, Igor Mammedov, 2020/02/19
- [PATCH v6 15/79] arm/imx25_pdk: drop RAM size fixup, Igor Mammedov, 2020/02/19