Message ID | b1cd196cf1395a602c7a08a4f858e69e50c446a1.1635550060.git.balaton@eik.bme.hu |
---|---|
State | New |
Headers | show |
Series | None | expand |
On 10/30/21 01:27, BALATON Zoltan wrote: > The timer unit only has registers that fit in a region 0x30 bytes > long. No need to have the timer region larger than that. > > Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> > --- > hw/timer/sh_timer.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c > index 250ad41b48..587fa9414a 100644 > --- a/hw/timer/sh_timer.c > +++ b/hw/timer/sh_timer.c > @@ -350,15 +350,14 @@ void tmu012_init(MemoryRegion *sysmem, hwaddr base, int feat, uint32_t freq, > ch2_irq0); /* ch2_irq1 not supported */ > } > > - memory_region_init_io(&s->iomem, NULL, &tmu012_ops, s, > - "timer", 0x100000000ULL); > + memory_region_init_io(&s->iomem, NULL, &tmu012_ops, s, "timer", 0x30); > > memory_region_init_alias(&s->iomem_p4, NULL, "timer-p4", > - &s->iomem, 0, 0x1000); > + &s->iomem, 0, memory_region_size(&s->iomem)); > memory_region_add_subregion(sysmem, P4ADDR(base), &s->iomem_p4); > > memory_region_init_alias(&s->iomem_a7, NULL, "timer-a7", > - &s->iomem, 0, 0x1000); > + &s->iomem, 0, memory_region_size(&s->iomem)); > memory_region_add_subregion(sysmem, A7ADDR(base), &s->iomem_a7); > /* ??? Save/restore. */ > } > Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c index 250ad41b48..587fa9414a 100644 --- a/hw/timer/sh_timer.c +++ b/hw/timer/sh_timer.c @@ -350,15 +350,14 @@ void tmu012_init(MemoryRegion *sysmem, hwaddr base, int feat, uint32_t freq, ch2_irq0); /* ch2_irq1 not supported */ } - memory_region_init_io(&s->iomem, NULL, &tmu012_ops, s, - "timer", 0x100000000ULL); + memory_region_init_io(&s->iomem, NULL, &tmu012_ops, s, "timer", 0x30); memory_region_init_alias(&s->iomem_p4, NULL, "timer-p4", - &s->iomem, 0, 0x1000); + &s->iomem, 0, memory_region_size(&s->iomem)); memory_region_add_subregion(sysmem, P4ADDR(base), &s->iomem_p4); memory_region_init_alias(&s->iomem_a7, NULL, "timer-a7", - &s->iomem, 0, 0x1000); + &s->iomem, 0, memory_region_size(&s->iomem)); memory_region_add_subregion(sysmem, A7ADDR(base), &s->iomem_a7); /* ??? Save/restore. */ }
The timer unit only has registers that fit in a region 0x30 bytes long. No need to have the timer region larger than that. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> --- hw/timer/sh_timer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)