[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH 15/19] aspeed: add a RAM memory region container
From: |
Cédric Le Goater |
Subject: |
[Qemu-arm] [PATCH 15/19] aspeed: add a RAM memory region container |
Date: |
Sat, 25 May 2019 17:12:37 +0200 |
The RAM memory region is defined after the SoC is realized when the
SDMC controller has cheched that the defined RAM size for the machine
is correct. This is problematic for controller models requiring a link
on the RAM region, for DMA support in the SMC controller for instance.
Introduce a container memory region for the RAM that we can link into
the controllers early, before the SoC is realized. It will be
populated with the RAM region after the checks have be done.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/arm/aspeed.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 228fdbcf65e2..ed5c8dd5133a 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -33,6 +33,7 @@ static struct arm_boot_info aspeed_board_binfo = {
struct AspeedBoardState {
AspeedSoCState soc;
+ MemoryRegion ram_container;
MemoryRegion ram;
MemoryRegion max_ram;
};
@@ -159,6 +160,10 @@ static void aspeed_board_init(MachineState *machine,
ram_addr_t max_ram_size;
bmc = g_new0(AspeedBoardState, 1);
+
+ memory_region_init(&bmc->ram_container, NULL, "aspeed-ram-container",
+ UINT32_MAX);
+
object_initialize_child(OBJECT(machine), "soc", &bmc->soc,
(sizeof(bmc->soc)), cfg->soc_name, &error_abort,
NULL);
@@ -191,16 +196,16 @@ static void aspeed_board_init(MachineState *machine,
&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->info->memmap[ASPEED_SDRAM], &bmc->ram);
+ sc->info->memmap[ASPEED_SDRAM],
+ &bmc->ram_container);
max_ram_size = object_property_get_uint(OBJECT(&bmc->soc), "max-ram-size",
&error_abort);
memory_region_init_io(&bmc->max_ram, NULL, &max_ram_ops, NULL,
"max_ram", max_ram_size - ram_size);
- memory_region_add_subregion(get_system_memory(),
- sc->info->memmap[ASPEED_SDRAM] + ram_size,
- &bmc->max_ram);
+ memory_region_add_subregion(&bmc->ram_container, ram_size, &bmc->max_ram);
aspeed_board_init_flashes(&bmc->soc.fmc, cfg->fmc_model, &error_abort);
aspeed_board_init_flashes(&bmc->soc.spi[0], cfg->spi_model, &error_abort);
--
2.20.1
- [Qemu-arm] [PATCH 07/19] aspeed: add support for multiple NICs, (continued)
- [Qemu-arm] [PATCH 07/19] aspeed: add support for multiple NICs, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 08/19] aspeed/timer: Fix behaviour running Linux, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 09/19] aspeed/timer: Status register contains reload for stopped timer, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 10/19] aspeed/timer: Fix match calculations, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 11/19] aspeed/timer: Provide back-pressure information for short periods, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 19/19] aspeed/smc: Calculate checksum on normal DMA, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 18/19] aspeed/smc: inject errors in DMA checksum, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 17/19] aspeed/smc: add DMA calibration settings, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 15/19] aspeed: add a RAM memory region container,
Cédric Le Goater <=
- [Qemu-arm] [PATCH 16/19] aspeed/smc: add support for DMAs, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 14/19] aspeed: remove the "ram" link, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 13/19] aspeed/smc: add a 'sdram_base' propertie, Cédric Le Goater, 2019/05/25
- [Qemu-arm] [PATCH 12/19] aspeed/timer: Ensure positive muldiv delta, Cédric Le Goater, 2019/05/25