How to configure the hardware watchdog for the NXP i.MX8X 5.4 kernel?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to configure the hardware watchdog for the NXP i.MX8X 5.4 kernel?

5,856 Views
Gandalf-kern
Contributor IV

How does one configure the hardware watchdog on the NXP i.MX8X?  This is not the systemd software watchdog, speaking specifically about the hardware watchdog.

0 Kudos
10 Replies

5,845 Views
Gandalf-kern
Contributor IV

Igor, according to the IMX8DQXPRM Rev. 0, 5/20202, all of this is already configured as part of the SCFW.  So, what I need to understand is how to configure the hardware Watchdog to enable and test the hardware watchdog.

Do you have a list of any defconfig options or other configuration options to set the hardware watchdog? 

I'm not attempting to write my own WD nor trying to use an external watchdog.  Just wanting to use the NXP i.MX8X hardware watchdog and enable and test it.  And the systemd watchdog works fine, but it is a software and not the hardware WD.

 

0 Kudos

5,837 Views
Gandalf-kern
Contributor IV

The SCU firmware watchdog is already configured.  If this is the hardware WDT for Linux, it may just be that I need to test that it is functioning properly.  

CONFIG_IMX2_WDT=y
CONFIG_IMX_SC_WDT=y

CONFIG_HAVE_ARM_SMCCC=y

CONFIG_IMX_SCU=y

CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_CORE=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y
CONFIG_WATCHDOG_OPEN_TIMEOUT=0

config IMX_SC_WDT
tristate "IMX SC Watchdog"
depends on HAVE_ARM_SMCCC
depends on IMX_SCU
select WATCHDOG_CORE

This is the driver for the system controller watchdog
on the NXP i.MX SoCs with system controller inside, the
watchdog driver will call ARM SMC API and trap into
ARM-Trusted-Firmware for operations, ARM-Trusted-Firmware
will request system controller to execute the operations.
If you have one of these processors and wish to have
watchdog support enabled, say Y, otherwise say N.

To compile this driver as a module, choose M here: the
module will be called imx_sc_wdt.

Also, the software WD is not set.  

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set

If I do an echo >> /dev/watchdog and hit enter twice after killing the watchdog process there is a hard reset.  This may be testing the hardware watchdog timer, is that the case and how can I be sure this is testing the hardware watchdog timer?

With this kernel configuration, is the Linux hardware watchdog the same as the NXP i.MX8X SCU watchdog?

0 Kudos

5,832 Views
igorpadykov
NXP Employee
NXP Employee

right, SCU watchdog is i.MX8X hardware watchdog.

 

Best regards
igor

5,820 Views
Gandalf-kern
Contributor IV
0 Kudos

5,814 Views
igorpadykov
NXP Employee
NXP Employee

for enabling wdog in linux one can refer to sect.2.11.7 Menu Configuration Options  i.MX Linux Reference Manual​ 

regarding uboot, wdog can be configured in scfw codes (board.c file)  SCFW Porting Kit​ 1.9.0

 

Best regards
igor

0 Kudos

5,803 Views
Gandalf-kern
Contributor IV

Please ignore my last posts. After looking at this further and running menuconfig for uboot, I see the following that can be configured for uboot to enable the WD following the hardware reference manual. i have five related questions for clarification.

# CONFIG_SYSRESET_WATCHDOG is not set
CONFIG_WATCHDOG=y
CONFIG_HW_WATCHDOG=y
CONFIG_IMX_WATCHDOG=y
CONFIG_WDT=y

1) Which of these, if any, enable the SCU watchdog for the IMX8X?

2) Is the IMX8X SCU watchdog configured only in SCFW boot.c and not currently configured from a uboot defconfig by NXP?

3) If these are configured, will they allow the uboot watchdog to be serviced from uboot independent of the SCFW watchdog? 

4) If these are configured in the uboot defconfig, should the watchdog be serviced from uboot properly even in secure boot or must WD be configured in SCFW for secure boot? 

5) To enable the watchdog in uboot, do I still have to modify the SCFW board.c if these are configured?

0 Kudos

5,807 Views
Gandalf-kern
Contributor IV

Let me ask, board.c configures watchdog for both u-boot and kernel? If the SCU hardware watchdog is working in the kernel on IMX8X, does this mean it is already configured in the SCU for u-boot on IMX8X?

0 Kudos

5,810 Views
Gandalf-kern
Contributor IV

Thank you. I looked at the menu config options. It was sparse and difficult to tell if it was only for i.MX8 or the entire family including i.MX8X?

2.11.7 Menu Configuration Options In menu configuration enable the following module: Device Drivers > Watchdog Timer Support > IMX2+ Watchdog

Device Drivers > Watchdog Timer Support > IMX7ULP Watchdog

Device Drivers > Watchdog Timer Support > IMX8 Watchdog

For U-boot, I was hoping NXP already configured the WD in the SCFW board.c in the 5.4 kernel since for i.MX8X the SCU controls the hardware WD.  And there would just be a u-boot menu config option to enable it.  So, this is not the case?

0 Kudos

5,829 Views
Gandalf-kern
Contributor IV

We can close this, but  want to confirm, these settings are all that is required to enable the SCU WD?  No other configuration is needed outside of the normal systemd configuration for the watchdog?

 

 

0 Kudos

5,852 Views
igorpadykov
NXP Employee
NXP Employee

Hi Tracy

 

for i.MX8X wdog one can look at

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/System-Controller-Firmware-101-Timer-ser...

Wdog APIs description can be found in SCFW documentation SCFW Porting Kit​ 1.9.0

 

Best regards
igor

0 Kudos