Skip to contentSkip to conversation

i.MX: Fix inverted register bits in wdt code.

PATCH Applied Roman Kapl 3 participants 3 messages Feb 7, 2020 – Feb 12, 2020 Arm i.MX and Layerscape

lore
Share & tools
lore

Roman Kapl

author
#0 lore raw

PATCH 1/1 i.MX: Fix inverted register bits in wdt code.

Documentation says for WDA '0: Assert WDOG output.' and for SRS '0: Assert system reset signal.'.

---
 hw/misc/imx2_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/imx2_wdt.c +1 -1
index e47e442592..c8944729c4 100644
@@ -28,7 +28,7 @@ static void imx2_wdt_write(void *opaque, hwaddr addr,
                            uint64_t value, unsigned int size)
 {
     if (addr == IMX2_WDT_WCR &&
-        (value & (IMX2_WDT_WCR_WDA | IMX2_WDT_WCR_SRS))) {
+        (~value & (IMX2_WDT_WCR_WDA | IMX2_WDT_WCR_SRS))) {
         watchdog_perform_action();
     }
 }
Signature · 1 line
2.22.0
#1 lore raw
Quoted 8 lines · Roman Kapl

Documentation says for WDA '0: Assert WDOG output.' and for SRS '0: Assert system reset signal.'.

---
 hw/misc/imx2_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to target-arm.next, thanks.

(It looks like we're missing a lot of the watchdog functionality in our model, ie the actual watchdog timer parts, enable bits, etc etc...)

-- PMM

#2 lore raw
Quoted 10 lines · Peter Maydell
Quoted 8 lines · Roman Kapl

Documentation says for WDA '0: Assert WDOG output.' and for SRS '0: Assert system reset signal.'.

---
  hw/misc/imx2_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 5 lines

Applied to target-arm.next, thanks.

(It looks like we're missing a lot of the watchdog functionality in our model, ie the actual watchdog timer parts, enable bits, etc etc...)

Yes, but the target restart functionality is the most important one. If I've read the i.MX forums correctly it is the easiest way to restart the board correctly.

Best regards, Roman Kapl

Quoted 3 lines

-- PMM