How to configure the uboot watchdog for NXP i.MX8X?

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

How to configure the uboot watchdog for NXP i.MX8X?

2,619 Views
Gandalf-kern
Contributor IV

How does one configure the U-boot watchdog on the NXP i.MX8X mek or eval board?  This is specific to U-boot.

2 Replies

2,606 Views
Gandalf-kern
Contributor IV

After looking at this further and running menuconfig for uboot, I see the following can be configured to enable the U-boot WD following the hardware reference manual. I have related questions for clarification for the NXP IMX8X community.

# 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, will the watchdog be serviced from uboot properly in secure boot or must WD be configured in SCFW or fused to enable the WD U-boot for secure boot? 

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

6) How would I set the WD timeout value for iMX8X? CONFIG_WATCHDOG_TIMEOUT_MSECS is not available for i.MX8X looking at https://github.com/siemens/u-boot/blob/master/doc/README.watchdog

7) If there is no config options to enable the WD, can the WD still be enabled from the bootcmd? And what registers should be written to enable the u-boot WD on IMX8X? Here is an example from iMX6. Looking at the HW Reference Manual, it is not clear what registers are needed to enable the WDT for IMX8X uboot.

"startwatchdog=\n" \
" echo Setting Watchdog for 5minutes...\n" \
" mw.l 0x80056050 0x00057e40 # set HW_RTC_WATCHDOG in millisecs (6 minutes)\n" \
" mw.l 0x80056064 0x00020000 # set bit HW_RTC_PERSISTENT0 -> AUTO_RESTARRT\n" \
" mw.l 0x80056004 0x00000018 # set bits HW_RTC_CTRL -> WATCHDOGEN, ONEMSEC_IRQ\n\0" \
"stopwatchdog=\n" \
" mw.l 0x80056008 0x00000018 # clear bits HW_RTC_CTRL -> WATCHDOGEN, ONEMSEC_IRQ\n" \
" echo Watchdog stopped\n\0"

 

0 Kudos
Reply

2,527 Views
Juan-Rodarte
NXP Employee
NXP Employee

Hi Gandalf,

 

1. To enable you need the command:
sc_err_tsc_timer_start_wdog (sc_ipc_tipc, bool lock)
2. Yes
3. - 4 As it is not practical to have physical watchdog timers for all execution environments, the SCFW uses a physical timer (Low Power Timer) to expose a "virtual" watchdog timer for all resource partitions.
6. sc_err_tsc_timer_set_wdog_timeout (sc_ipc_tipc, sc_timer_wdog_time_ttimeout)

Best Regards,

Diego

0 Kudos
Reply