how to use IMX8 watchdog's set_pretimeout

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

how to use IMX8 watchdog's set_pretimeout

4,088 Views
ruodong_bai
Contributor II

hello,

This problem is from IMX8 watchdog.

What I need is that, do something before watchdog timeout.

I see there is set_pretimeout in watchdog driver, I donot know whether "set_pretimeout" can satisfy my need.

could you give some advice?how to use IMX8 watchdog's set_pretimeout?

BR

Tags (2)
0 Kudos
12 Replies

3,630 Views
ruodong_bai
Contributor II

Hi igorpadykov

As I test, linux kernel can touch the SCU watchdog in watchdog driver, which I found it in <i.MX_Reference_Manual> 

"On i.MX 8 and i.MX 8X, the software watchdog used in
system controller firmware (SCFW) and kernel call those
interfaces by virtual watchdog driver imx8_wdt.c. This is not
used for i.MX 8M."

but I donot know how to use "set_pretimeout" which you can find in linux watchdog driver, can this "set_pretimeout" satisfy my need?

BR

0 Kudos

3,630 Views
zhu_meng
Contributor I

hi,Ruodong,

"As I test, linux kernel can touch the SCU watchdog in watchdog driver,"

I was working on the imx8 watchdog recently and had the same problem.How did you test it?Will the scu be notified when the Acore  watchdog triggers?

I found that when m4 watchdog was triggered, it would send an event notification to scu, but the event notification of Acore was not found.

BR

0 Kudos

3,630 Views
ruodong_bai
Contributor II

hi meng zhu,

can you access aarch64-mx8-poky-linux/imx-test/1_7.0+AUTOINC+d32727a9d7-r0/git/test/wdog/, there is all test wdog methods.

Thanks

0 Kudos

3,630 Views
igorpadykov
NXP Employee
NXP Employee

may be useful to check MLK-20965: watchdog: imx8_wdt: remove watchdog action set
linux-imx - i.MX Linux kernel 

Best regards
igor

0 Kudos

3,630 Views
ruodong_bai
Contributor II

hello igorpadykov,

could you update it?

BR

0 Kudos

3,630 Views
igorpadykov
NXP Employee
NXP Employee

please recheck MLK-20965: watchdog: imx8_wdt: remove watchdog action set
linux-imx - i.MX Linux kernel 

no option for setting watchdog timeout.

Best regards
igor

0 Kudos

3,630 Views
ruodong_bai
Contributor II

hi igorpadykov,

MLK-20965 is only remove SC_TIMER_WDOG_ACTION_PARTITION

but keep the default code as below,

static int imx8_wdt_start(struct watchdog_device *wdog){ struct arm_smccc_res res;  /* no block */ arm_smccc_smc(FSL_SIP_SRTC, FSL_SIP_SRTC_START_WDOG, 0, 0, 0, 0, 0, 0,   &res); if (res.a0)  return res.a0;  return 0;}

 

BR

0 Kudos

3,630 Views
igorpadykov
NXP Employee
NXP Employee

scu wdog should not be touched as it is used internally by scu.

Best regards
igor

0 Kudos

3,630 Views
ruodong_bai
Contributor II

hi igorpadykov,

in <i.MX_Reference_Manual>, it is clear that kernel can touch SCU watchdog, and I test it works well.

"On i.MX 8 and i.MX 8X, the software watchdog used in
system controller firmware (SCFW) and kernel call those
interfaces by virtual watchdog driver imx8_wdt.c. This is not
used for i.MX 8M."

BR

0 Kudos

3,630 Views
igorpadykov
NXP Employee
NXP Employee

there are some wdog functions in scfw, one can try them:

../platformboard/mx8qm_mek/board.c

SCFW Porting Kit

Best regards
igor

0 Kudos

3,630 Views
ruodong_bai
Contributor II

Hi igorpadykov

seems MLK-20965 is not useful for me.

I want to print task list callstack before watchdog timeout, and I want design watchdog as "pretimeout 15s" "timeout 20s", so that I can do print task list callstack at 15s, and if reach to 20s, watchdog timeout will reset MCU directly.

my question is,

1.whether it is workable?

2.if it is workable, when reach to pretimeout 15s, is there an interrupt, signal or something else that I can do print task list callstack in interrupt handler or signal handler?

BR

0 Kudos

3,630 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ruodong

there is one wdog in scu and in M4 complexes as described in Figure 1. i.MX 8QuadMax System Block Diagram

i.MX 8QuadMax Automotive and Infotainment Applications Processors

Seems scu wdog should not be touched as it is used internally by scu. M4 wdog examples

can be found in SDK_MEK-MIMX8QM available on Welcome | MCUXpresso SDK Builder 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos