[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH qemu.git v3 4/8] hw/timer/imx_epit: update interrupt state on CR
From: |
~axelheider |
Subject: |
[PATCH qemu.git v3 4/8] hw/timer/imx_epit: update interrupt state on CR write access |
Date: |
Thu, 01 Dec 2022 15:42:04 -0000 |
From: Axel Heider <axel.heider@hensoldt.net>
The interrupt state can change due to:
- reset clears both SR.OCIF and CR.OCIE
- write to CR.EN or CR.OCIE
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
---
hw/timer/imx_epit.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c
index f148868b8c..7af3a8b10e 100644
--- a/hw/timer/imx_epit.c
+++ b/hw/timer/imx_epit.c
@@ -206,12 +206,20 @@ static void imx_epit_write(void *opaque, hwaddr offset,
uint64_t value,
if (s->cr & CR_SWR) {
/* handle the reset */
imx_epit_reset(DEVICE(s));
- /*
- * TODO: could we 'break' here? following operations appear
- * to duplicate the work imx_epit_reset() already did.
- */
}
+ /*
+ * The interrupt state can change due to:
+ * - reset clears both SR.OCIF and CR.OCIE
+ * - write to CR.EN or CR.OCIE
+ */
+ imx_epit_update_int(s);
+
+ /*
+ * TODO: could we 'break' here for reset? following operations appear
+ * to duplicate the work imx_epit_reset() already did.
+ */
+
ptimer_transaction_begin(s->timer_cmp);
ptimer_transaction_begin(s->timer_reload);
--
2.34.5
- [PATCH qemu.git v3 0/8] hw/timer/imx_epit: improve and fix EPIT compare timer, ~axelheider, 2022/12/01
- [PATCH qemu.git v3 4/8] hw/timer/imx_epit: update interrupt state on CR write access,
~axelheider <=
- [PATCH qemu.git v3 3/8] hw/timer/imx_epit: define SR_OCIF, ~axelheider, 2022/12/01
- [PATCH qemu.git v3 8/8] hw/timer/imx_epit: fix compare timer handling, ~axelheider, 2022/12/01
- [PATCH qemu.git v3 5/8] hw/timer/imx_epit: hard reset initializes CR with 0, ~axelheider, 2022/12/01
- [PATCH qemu.git v3 6/8] hw/timer/imx_epit: factor out register write handlers, ~axelheider, 2022/12/01
- [PATCH qemu.git v3 2/8] hw/timer/imx_epit: cleanup CR defines, ~axelheider, 2022/12/01
- [PATCH qemu.git v3 1/8] hw/timer/imx_epit: improve comments, ~axelheider, 2022/12/01
- [PATCH qemu.git v3 7/8] hw/timer/imx_epit: remove explicit fields cnt and freq, ~axelheider, 2022/12/01