mirror of
https://github.com/qemu/qemu.git
synced 2024-12-04 01:03:38 +08:00
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>
This commit is contained in:
parent
32c54bd0ed
commit
d0180a3ae4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user