On [2021 Oct 18] Mon 15:26:05, Cédric Le Goater wrote: > On the AST2600, the 2nd watchdog timer can be controlled through the > FMC controller to disable the alternate boot function. Next changes > will map the WDT2 registers in the AST2600 FMC memory region. Add a > container on top of the register region for this purpose. > > Signed-off-by: Cédric Le Goater <c...@kaod.org>
Reviewed-by: Francisco Iglesias <frasse.igles...@gmail.com> > --- > include/hw/watchdog/wdt_aspeed.h | 1 + > hw/watchdog/wdt_aspeed.c | 6 +++++- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/hw/watchdog/wdt_aspeed.h > b/include/hw/watchdog/wdt_aspeed.h > index f945cd6c5833..14e91acb1284 100644 > --- a/include/hw/watchdog/wdt_aspeed.h > +++ b/include/hw/watchdog/wdt_aspeed.h > @@ -28,6 +28,7 @@ struct AspeedWDTState { > QEMUTimer *timer; > > /*< public >*/ > + MemoryRegion iomem_container; > MemoryRegion iomem; > uint32_t regs[ASPEED_WDT_REGS_MAX]; > > diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c > index 146ffcd71301..803e861a9c61 100644 > --- a/hw/watchdog/wdt_aspeed.c > +++ b/hw/watchdog/wdt_aspeed.c > @@ -275,9 +275,13 @@ static void aspeed_wdt_realize(DeviceState *dev, Error > **errp) > */ > s->pclk_freq = PCLK_HZ; > > + memory_region_init(&s->iomem_container, OBJECT(s), > + TYPE_ASPEED_WDT ".container", ASPEED_WDT_REGS_MAX * > 4); > + sysbus_init_mmio(sbd, &s->iomem_container); > + > memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_wdt_ops, s, > TYPE_ASPEED_WDT, ASPEED_WDT_REGS_MAX * 4); > - sysbus_init_mmio(sbd, &s->iomem); > + memory_region_add_subregion(&s->iomem_container, 0x0, &s->iomem); > } > > static Property aspeed_wdt_properties[] = { > -- > 2.31.1 > >