Message ID | 166990932074.29941.8709118178538288040-4@git.sr.ht (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | hw/timer/imx_epit: improve and fix EPIT compare timer | expand |
On Thu, 1 Dec 2022 at 15:42, ~axelheider <axelheider@git.sr.ht> wrote: > > 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> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
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);