aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2021-10-12 08:20:08 +0200
committerCédric Le Goater <clg@kaod.org>2021-10-12 08:20:08 +0200
commitd0180a3ae48f71d4cb5b9cea89b49451e2dc9a47 (patch)
treedb37f17d52d7391e25ceb79e3340c7ae0ea8854b /hw
parent32c54bd0ed622bbd1614ca9d1f5f108823f5cc11 (diff)
aspeed/smc: Stop using the model name for the memory regions
There is no real reason to use this name. It's simply nice to have in the monitor output but it's a burden for the following patch which removes the AspeedSMCController structure describing the controller. Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/ssi/aspeed_smc.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index def1cb4c74..612040493c 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -1392,20 +1392,15 @@ static const MemoryRegionOps aspeed_smc_ops = {
*/
static void aspeed_smc_dma_setup(AspeedSMCState *s, Error **errp)
{
- char *name;
-
if (!s->dram_mr) {
error_setg(errp, TYPE_ASPEED_SMC ": 'dram' link not set");
return;
}
- name = g_strdup_printf("%s-dma-flash", s->ctrl->name);
- address_space_init(&s->flash_as, &s->mmio_flash, name);
- g_free(name);
-
- name = g_strdup_printf("%s-dma-dram", s->ctrl->name);
- address_space_init(&s->dram_as, s->dram_mr, name);
- g_free(name);
+ address_space_init(&s->flash_as, &s->mmio_flash,
+ TYPE_ASPEED_SMC ".dma-flash");
+ address_space_init(&s->dram_as, s->dram_mr,
+ TYPE_ASPEED_SMC ".dma-dram");
}
static void aspeed_smc_realize(DeviceState *dev, Error **errp)
@@ -1446,7 +1441,7 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp)
/* The memory region for the controller registers */
memory_region_init_io(&s->mmio, OBJECT(s), &aspeed_smc_ops, s,
- s->ctrl->name, s->ctrl->nregs * 4);
+ TYPE_ASPEED_SMC, s->ctrl->nregs * 4);
sysbus_init_mmio(sbd, &s->mmio);
/*
@@ -1454,12 +1449,12 @@ 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.
*/
- snprintf(name, sizeof(name), "%s.flash", s->ctrl->name);
-
memory_region_init_io(&s->mmio_flash, OBJECT(s),
- &aspeed_smc_flash_default_ops, s, name,
+ &aspeed_smc_flash_default_ops, s,
+ TYPE_ASPEED_SMC ".flash",
s->ctrl->flash_window_size);
- memory_region_init_alias(&s->mmio_flash_alias, OBJECT(s), name,
+ memory_region_init_alias(&s->mmio_flash_alias, OBJECT(s),
+ TYPE_ASPEED_SMC ".flash",
&s->mmio_flash, 0, s->ctrl->flash_window_size);
sysbus_init_mmio(sbd, &s->mmio_flash_alias);
@@ -1475,7 +1470,7 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp)
for (i = 0; i < s->ctrl->max_peripherals; ++i) {
AspeedSMCFlash *fl = &s->flashes[i];
- snprintf(name, sizeof(name), "%s.%d", s->ctrl->name, i);
+ snprintf(name, sizeof(name), TYPE_ASPEED_SMC ".flash.%d", i);
fl->id = i;
fl->controller = s;