iMX6ULL -- Watchdog 2 does not reset system on Linux 5.4

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

iMX6ULL -- Watchdog 2 does not reset system on Linux 5.4

4,652 次查看
astoehr
Contributor I

Hello,

I am running Linux 5.4 and attempting to use both Watchdog 1 and Watchdog 2 on the iMX6ULL for resetting the system under different circumstances.  Watchdog 1 successfully resets the system, but Watchdog 2 does not.  I have Watchdog 2 enabled in my devicetree:

&wdog2 {                                                                                                                                                                                                                                                                                                                                                                             
    status = "okay";
};

and both watchdogs do successfully initialize on boot:

[    0.439700] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
[    0.440656] imx2-wdt 20c0000.wdog: timeout 60 sec (nowayout=0)

and also both show up under /dev:

# ls -l /dev/watchdog*
crw-------    1 root     root       10, 130 Nov 13 15:46 /dev/watchdog
crw-------    1 root     root      247,   0 Nov 13 15:46 /dev/watchdog0
crw-------    1 root     root      247,   1 Nov 13 15:46 /dev/watchdog1

If I kill the application that is kicking Watchdog 1, I see this message in the logs and a minute later, the system resets:

watchdog: watchdog0: watchdog did not stop!

Watchdog 2 is inactive by default, but becomes active once it is kicked for the first time.  If I leave it without kicking it after setting it active, I see a similar log message, but no system reset ever occurs:

watchdog: watchdog1: watchdog did not stop!

In addition to these tests, I have made modifications to the driver to dump register values and have confirmed that both watchdogs are configured in the same manner, and I have also attempted to use Watchdog 3 rather than Watchdog 2 and had the same result.

Any ideas as to why this is the case?  Is there any extra configuration that needs to occur to allow Watchdog 2 to also reset the system alongside Watchdog 1?  From reading the reference manual, it does not seems like it should be necessary, but I may have missed something.

Any information or guidance would be much appreciated.

标签 (2)
标记 (2)
0 项奖励
回复
4 回复数

4,177 次查看
Embedded-world
Contributor IV

Hello @Manuel_Salas

In our case (Board Schematic), we haven't used any external pin for the watchdog. How can we trigger the watchdog automatically for a reset switch? Is there any different method available? Kindly suggest

Best Regards,
Ravikumar

0 项奖励
回复

4,505 次查看
astoehr
Contributor I

Hi Alejandro -- the devicetree configuration in your post configures the external reset pin, to be used with an external PMIC.  In our implementation, we do not have an external PMIC, and are hoping to use the second watchdog with the internal GIC and/or SRC to reset the system.  This works fine with wdog1, but I know wdog2 is connected to the SNVS and not directly to the SRC.  Is it possible to configure the SNVS to pass the reset through to the SRC by default?

renditionDownload.jpeg

0 项奖励
回复

4,489 次查看
fas3
Contributor I

Because watch dog 2 is trust zone watch dog.  You have to use hardware method. Configure  the LCD_VSYNC pin as WDOG_B. 

You can check the i.mx6q Sabresd  schematic.   

0 项奖励
回复

4,585 次查看
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @astoehr 

I hope you are doing well.

Please try:

&wdog1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_wdog>;
        fsl,ext-reset-output;
        status = "okay";
};
 
&wdog2 {
        pinctrl-0 = <&pinctrl_wdog>;
        fsl,ext-reset-output;
        status = "okay";
};
 
&wdog3 {
        pinctrl-0 = <&pinctrl_wdog>;
        fsl,ext-reset-output;
        status = "okay";
};
 

(This will enable all of 3 WDOGs)

and

pinctrl_wdog: wdoggrp {

fsl,pins = <

MX6UL_PAD_LCD_RESET__WDOG1_WDOG_ANY    0x30b0

>;

};

(Reset from any WDOG)

Then, you should be able to reset from any WDOG.

 

I made a little C program to test WDOG2 with 5 seconds of timeout, I will attach it.

 

To run the test:

Copy the WDOG2_Linux_Test.c file in your imx6 board.

Then compile it with:

$ gcc WDOG2_Linux_Test.c -o WDOG2_Linux_Test.out

And run the WDOG2_Linux_Test.out file

$ ./WDOG_test.out

 

If all it is correct, you will have logs like:

Alejandro_Salas_0-1700235246174.png

(I made with imx8mm but it should works for imx6 too).

 

I hope this can helps to you.

 

 

Best regards!

0 项奖励
回复