How to get boot reason on Xavier NX?

Hello!

I’m wondering if there is any way of reading the boot reason from Linux? E.g. power-on, soft-reset, watchdog reset. The watchdog reset being the boot reason we are most interested in being able to detect, though the others would also be useful.

I haven’t been able to find any information in the TRM to this effect.
Thanks in advance.

Check the last command like.
last reboot
last shutdown

Nice idea, but sadly that won’t help as the expected shutdown is via loss of power, so even if we were keeping last logs it wouldn’t differentiate for us.

I’m used to having a hardware register that can be read to determine the boot reason. Is there anything like that on the Xavier? I’m hoping I just haven’t found the right terminology to search for in the TRM.

there is a sysfs node

cat /sys/kernel/debug/pmc-reset
or
cat /sys/devices/platform/c360000.pmc/reset_reason

Ah, you’re a legend! That’s just what I needed! Thank you!

And for the benefit of others, here is what you’ll get under various circumstances from pmc-reset:

power-on:
### PMC reset source: TEGRA_POWER_ON_RESET
### PMC reset level: TEGRA_RESET_LEVEL_L0

reset-pin:
### PMC reset source: TEGRA_POWER_ON_RESET
### PMC reset level: TEGRA_RESET_LEVEL_L0

reboot:
### PMC reset source: TEGRA_SOFTWARE_RESET
### PMC reset level: TEGRA_RESET_LEVEL_L1

watchdog:
### PMC reset source: TEGRA_BCCPLEX_WATCHDOG
### PMC reset level: TEGRA_RESET_LEVEL_L1

Also worth noting is that I did not have a c360000.pmc entry, but seeing as I get all the necessary information via the debugfs entry I won’t spend any time investigating that.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.