[PATCH] i.MX: Fix inverted register bits in wdt code.

Roman Kapl posted 1 patch 4 years, 3 months ago
Test docker-quick@centos7 passed
Test FreeBSD passed
Test docker-mingw@fedora passed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200207095409.11227-1-rka@sysgo.com
hw/misc/imx2_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] i.MX: Fix inverted register bits in wdt code.
Posted by Roman Kapl 4 years, 3 months ago
Documentation says for WDA '0: Assert WDOG output.' and for SRS
'0: Assert system reset signal.'.

Signed-off-by: Roman Kapl <rka@sysgo.com>
---
 hw/misc/imx2_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/misc/imx2_wdt.c b/hw/misc/imx2_wdt.c
index e47e442592..c8944729c4 100644
--- a/hw/misc/imx2_wdt.c
+++ b/hw/misc/imx2_wdt.c
@@ -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();
     }
 }
-- 
2.22.0


Re: [PATCH] i.MX: Fix inverted register bits in wdt code.
Posted by Peter Maydell 4 years, 3 months ago
On Fri, 7 Feb 2020 at 09:55, Roman Kapl <rka@sysgo.com> wrote:
>
> Documentation says for WDA '0: Assert WDOG output.' and for SRS
> '0: Assert system reset signal.'.
>
> Signed-off-by: Roman Kapl <rka@sysgo.com>
> ---
>  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

Re: [PATCH] i.MX: Fix inverted register bits in wdt code.
Posted by Roman Kapl 4 years, 3 months ago
On 2/11/20 6:57 PM, Peter Maydell wrote:
> On Fri, 7 Feb 2020 at 09:55, Roman Kapl <rka@sysgo.com> wrote:
>>
>> Documentation says for WDA '0: Assert WDOG output.' and for SRS
>> '0: Assert system reset signal.'.
>>
>> Signed-off-by: Roman Kapl <rka@sysgo.com>
>> ---
>>   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...)

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

> 
> -- PMM
>