hw/watchdog/cmsdk_apb_watchdog: Fix INTEN issues
authorRoque Arcudia Hernandez <roqueh@google.com>
Tue, 19 Nov 2024 13:02:05 +0000 (13:02 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 19 Nov 2024 13:02:05 +0000 (13:02 +0000)
commiteff9dc5660fad3a610171c56a5ec3fada245e519
tree036c7f18f8ecdc4caae130667d299f19a0a968b0
parent3bf7dcd47a3da0e86a9347ce5b2b5d5a1dcb5857
hw/watchdog/cmsdk_apb_watchdog: Fix INTEN issues

Current watchdog is free running out of reset, this combined with the
fact that current implementation also ensures the counter is running
when programing WDOGLOAD creates issues when the firmware defer the
programing of WDOGCONTROL.INTEN much later after WDOGLOAD. Arm
Programmer's Model documentation states that INTEN is also the
counter enable:

> INTEN
>
> Enable the interrupt event, WDOGINT. Set HIGH to enable the counter
> and the interrupt, or LOW to disable the counter and interrupt.
> Reloads the counter from the value in WDOGLOAD when the interrupt
> is enabled, after previously being disabled.

Source of the time of writing:

https://developer.arm.com/documentation/ddi0479/d/apb-components/apb-watchdog/programmers-model

Signed-off-by: Roque Arcudia Hernandez <roqueh@google.com>
Reviewed-by: Stephen Longfield <slongfield@google.com>
Reviewed-by: Joe Komlodi <komlodi@google.com>
Message-id: 20241115160328.1650269-3-roqueh@google.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/watchdog/cmsdk-apb-watchdog.c