[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 29/30] hw/timer/sh_timer: Fix timer memory region size
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 29/30] hw/timer/sh_timer: Fix timer memory region size |
Date: |
Sat, 30 Oct 2021 19:06:14 +0200 |
From: BALATON Zoltan <balaton@eik.bme.hu>
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>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id:
<b1cd196cf1395a602c7a08a4f858e69e50c446a1.1635550060.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
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 250ad41b487..587fa9414aa 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. */
}
--
2.31.1
- [PULL 19/30] hw/intc/sh_intc: Move sh_intc_register() closer to its only user, (continued)
- [PULL 19/30] hw/intc/sh_intc: Move sh_intc_register() closer to its only user, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 20/30] hw/intc/sh_intc: Remove excessive parenthesis, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 21/30] hw/intc/sh_intc: Use array index instead of pointer arithmetics, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 22/30] hw/intc/sh_intc: Inline and drop sh_intc_source() function, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 23/30] hw/intc/sh_intc: Replace abort() with g_assert_not_reached(), Philippe Mathieu-Daudé, 2021/10/30
- [PULL 24/30] hw/intc/sh_intc: Avoid using continue in loops, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 25/30] hw/intc/sh_intc: Simplify allocating sources array, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 26/30] hw/intc/sh_intc: Remove unneeded local variable initialisers, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 27/30] hw/timer/sh_timer: Rename sh_timer_state to SHTimerState, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 28/30] hw/timer/sh_timer: Do not wrap lines that are not too long, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 29/30] hw/timer/sh_timer: Fix timer memory region size,
Philippe Mathieu-Daudé <=
- [PULL 30/30] hw/timer/sh_timer: Remove use of hw_error, Philippe Mathieu-Daudé, 2021/10/30
- Re: [PULL 00/30] Renesas SH-4 patches for 2021-10-30, Richard Henderson, 2021/10/30