Hi all,
Ii'm working on an imx6 powered board (openrex project), i'm integrating two system:
- OTA update system (Mender)
- Hard Reset (hand-made)
To develop the Hard reset, i need the information on the last reset cause (POR, WDOG etc..).
I'm able to write this information in a u-boot env variable.
The problem is the lack of information about the "real cause of the reboot". Following the function that return the reset cause.
I need to isolate the reset cause and POR is excessively generic.
I need unambiguous return value, specific for the reboot occurring pressing the reset button (only one on the board).
Where can i found a complete list of possible value (&src_regs->srsr)??
Thanks!!!!!!
static char *get_reset_cause(void)
{
u32 cause;
struct src *src_regs = (struct src *)SRC_BASE_ADDR;
cause = readl(&src_regs->srsr);
writel(cause, &src_regs->srsr);
reset_cause = cause;
switch (cause) {
case 0x00001:
case 0x00011:
return "POR";
case 0x00004:
return "CSU";
case 0x00008:
return "IPP USER";
case 0x00010:
return "WDOG";
case 0x00020:
return "JTAG HIGH-Z";
case 0x00040:
return "JTAG SW";
case 0x00080:
return "WDOG3";
case 0x00100:
return "TEMPSENSE";
case 0x10000:
return "WARM BOOT";
default:
return "unknown reset";
}
}
Ok, after modify the kernel i was able to catch the reset cause in a uboot variabile. This has not helped me cause the reset button's return code (POR) can occour with a Power off too. So my solution for the device factory reset Is changed, now i'm using an user button checked by uboot (3 seconds loop).
Thanks for all
Hi Antonio
this may be posted on uboot mail list as implementation may differ depending on board vendor
In particular nxp reference boards use reset option when all board power is
resetting, in such case only indicating reset cause as "POR ".
Just for reference below nxp uboot link:
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------