[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/86] arm:aspeed: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH 12/86] arm:aspeed: use memdev for RAM |
Date: |
Tue, 31 Dec 2019 14:02:56 +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>
---
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 525c547..330254b 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;
};
@@ -184,6 +183,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,
@@ -215,8 +215,6 @@ static void aspeed_machine_init(MachineState *machine)
object_property_set_bool(OBJECT(&bmc->soc), true, "realized",
&error_fatal);
- 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);
@@ -393,6 +391,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";
}
static void aspeed_machine_palmetto_class_init(ObjectClass *oc, void *data)
--
2.7.4
- [PATCH 03/86] numa: remove deprecated -mem-path fallback to anonymous RAM, (continued)
- [PATCH 03/86] numa: remove deprecated -mem-path fallback to anonymous RAM, Igor Mammedov, 2019/12/31
- [PATCH 04/86] machine: introduce ram-memdev property, Igor Mammedov, 2019/12/31
- [PATCH 01/86] numa: remove not needed check, Igor Mammedov, 2019/12/31
- [PATCH 05/86] machine: alias -mem-path and -mem-prealloc into memory-foo backend, Igor Mammedov, 2019/12/31
- [PATCH 06/86] machine: introduce convenience MachineState::ram, Igor Mammedov, 2019/12/31
- [PATCH 07/86] initialize MachineState::ram in NUMA case, Igor Mammedov, 2019/12/31
- [PATCH 11/86] hw:aspeed: drop warning and bogus ram_size fixup, Igor Mammedov, 2019/12/31
- [PATCH 08/86] alpha:dp264: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 09/86] arm:aspeed: convert valid RAM sizes to data, Igor Mammedov, 2019/12/31
- [PATCH 10/86] arm:aspeed: actually check RAM size, Igor Mammedov, 2019/12/31
- [PATCH 12/86] arm:aspeed: use memdev for RAM,
Igor Mammedov <=
- [PATCH 15/86] arm:digic_boards: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 16/86] arm:highbank: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 18/86] arm:imx25_pdk: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 22/86] arm:mcimx6ul-evk: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 24/86] arm:mps2-tz: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 19/86] arm:integratorcp: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 20/86] arm:kzm: drop RAM size fixup, Igor Mammedov, 2019/12/31
- [PATCH 25/86] arm:mps2: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 14/86] arm:cubieboard: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 26/86] arm:musicpal: use memdev for RAM, Igor Mammedov, 2019/12/31