aboutsummaryrefslogtreecommitdiff
path: root/hw/ssi
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2021-10-22 09:52:17 +0200
committerCédric Le Goater <clg@kaod.org>2021-10-22 09:52:17 +0200
commitfc6642544eb86b520fed4e3b7792bd89e563de08 (patch)
tree9b5d18b7887a6ed305eea328e39b36fbaeeef6dd /hw/ssi
parent82b6a3f64d6d1ed0d5c455489a9294b59c8de65f (diff)
aspeed/smc: Use a container for the flash mmio address space
Because AddressSpaces must not be sysbus-mapped, commit e9c568dbc225 ("hw/arm/aspeed: Do not sysbus-map mmio flash region directly, use alias") introduced an alias for the flash mmio region. Using a container is cleaner. Cc: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com> Message-Id: <20211018132609.160008-5-clg@kaod.org> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw/ssi')
-rw-r--r--hw/ssi/aspeed_smc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 8a988c1676..ff154eb84f 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -1151,14 +1151,17 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp)
* window in which the flash modules are mapped. The size and
* address depends on the SoC model and controller type.
*/
+ memory_region_init(&s->mmio_flash_container, OBJECT(s),
+ TYPE_ASPEED_SMC ".container",
+ asc->flash_window_size);
+ sysbus_init_mmio(sbd, &s->mmio_flash_container);
+
memory_region_init_io(&s->mmio_flash, OBJECT(s),
&aspeed_smc_flash_default_ops, s,
TYPE_ASPEED_SMC ".flash",
asc->flash_window_size);
- memory_region_init_alias(&s->mmio_flash_alias, OBJECT(s),
- TYPE_ASPEED_SMC ".flash",
- &s->mmio_flash, 0, asc->flash_window_size);
- sysbus_init_mmio(sbd, &s->mmio_flash_alias);
+ memory_region_add_subregion(&s->mmio_flash_container, 0x0,
+ &s->mmio_flash);
/*
* Let's create a sub memory region for each possible peripheral. All