[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 12/19] hw/timer/arm_timer: Use array of frequency in SP804Time
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 12/19] hw/timer/arm_timer: Use array of frequency in SP804Timer |
Date: |
Tue, 4 Jul 2023 16:50:05 +0200 |
SP804Timer use arrays for timers and IRQ levels. Be consistent
and use another one for the frequencies. This will allow to
simplify using for() loop statement in the next commit.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/timer/arm_timer.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c
index 2b5fb75577..0ad0e55df8 100644
--- a/hw/timer/arm_timer.c
+++ b/hw/timer/arm_timer.c
@@ -206,7 +206,7 @@ struct SP804Timer {
MemoryRegion iomem;
ArmTimer *timer[2];
- uint32_t freq0, freq1;
+ uint32_t freq[2];
int level[2];
qemu_irq irq;
};
@@ -310,15 +310,15 @@ static void sp804_realize(DeviceState *dev, Error **errp)
{
SP804Timer *s = SP804_TIMER(dev);
- s->timer[0] = arm_timer_new(s->freq0);
- s->timer[1] = arm_timer_new(s->freq1);
+ s->timer[0] = arm_timer_new(s->freq[0]);
+ s->timer[1] = arm_timer_new(s->freq[1]);
s->timer[0]->irq = qemu_allocate_irq(sp804_set_irq, s, 0);
s->timer[1]->irq = qemu_allocate_irq(sp804_set_irq, s, 1);
}
static Property sp804_properties[] = {
- DEFINE_PROP_UINT32("freq0", SP804Timer, freq0, 1000000),
- DEFINE_PROP_UINT32("freq1", SP804Timer, freq1, 1000000),
+ DEFINE_PROP_UINT32("freq0", SP804Timer, freq[0], 1000000),
+ DEFINE_PROP_UINT32("freq1", SP804Timer, freq[1], 1000000),
DEFINE_PROP_END_OF_LIST(),
};
--
2.38.1
- [PATCH v2 13/19] hw/timer/arm_timer: Iterate on timers using for() loop statement, (continued)
- [PATCH v2 13/19] hw/timer/arm_timer: Iterate on timers using for() loop statement, Philippe Mathieu-Daudé, 2023/07/04
- [PATCH v2 10/19] hw/timer/arm_timer: Rename arm_timer_init() -> arm_timer_new(), Philippe Mathieu-Daudé, 2023/07/04
- [PATCH v2 11/19] hw/timer/arm_timer: Convert ArmTimer::freq to uint32_t type, Philippe Mathieu-Daudé, 2023/07/04
- [PATCH v2 14/19] hw/timer/arm_timer: Pass timer output IRQ as parameter to arm_timer_new, Philippe Mathieu-Daudé, 2023/07/04
- [PATCH v2 15/19] hw/timer/arm_timer: Fix misuse of SysBus IRQ in IntegratorPIT, Philippe Mathieu-Daudé, 2023/07/04
- [PATCH v2 12/19] hw/timer/arm_timer: Use array of frequency in SP804Timer,
Philippe Mathieu-Daudé <=
- [PATCH v2 16/19] hw/timer/arm_timer: Extract icp_pit_realize() from icp_pit_init(), Philippe Mathieu-Daudé, 2023/07/04
- [PATCH v2 17/19] hw/timer/arm_timer: QDev'ify ARM_TIMER, Philippe Mathieu-Daudé, 2023/07/04
- [PATCH v2 18/19] hw/timer/arm_timer: Map ARM_TIMER MMIO regions into IntegratorPIT, Philippe Mathieu-Daudé, 2023/07/04
- [PATCH v2 19/19] hw/timer/arm_timer: Map ARM_TIMER MMIO regions into SP804Timer, Philippe Mathieu-Daudé, 2023/07/04
- Re: [PATCH v2 00/19] hw/timer/arm_timer: QOM'ify ARM_TIMER and correct sysbus/irq in ICP_PIT, Philippe Mathieu-Daudé, 2023/07/04