A customer wants to check the reset cause at kernel level to see if it was an expected shutdown or if it was the watchdog.
I believe this is easily accessible through U-boot, but couldn’t see it at kernel level in dmesg. Is there any file/register/kernel module where this is logged for easy check?
Or would the customer have to develop its own solution to read this from the SoC register?
Thanks and regards,
The Reset Cause is shown in U-Boot (Bsp 2.8), the customer would need to pass this to kernel. Unfortunately there is no driver which can do that.
Regarding reading the SoC Register, I don’t have Information about iMX6ULL, but some SOC has a read clear register, this means if the register containing Reset Cause is read, the content of the register is cleared. You would need to check this in Reference Manual.
Thanks @jaski.tx . That is what I feared. Do you know any reference example where we:
- Read a value in U-Boot (This is shown in the code)
- Pass this to the kernel
- Read at kernel level the passed value
With this I could let the customer know to build their own solution, but I don’t know this information myself. Thanks, Alvaro.
No, I don’t know an example but let me check on this and i will come back to you tomorrow.
I found a solution. This code will set a U-Boot variable and save the reset cause in hexadecimal number.
diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c
index b48d0df605..98e045cfb6 100644
@@ -10,6 +10,7 @@
static char tdx_serial_str;
@@ -87,6 +88,8 @@ int show_board_info(void)
+ setenv_hex("reset_cause", get_imx_reset_cause());
* Check if environment contains a valid MAC address,
* set the one from config block if not
To decode the hexadecimal number, you need to look in