Our product needs to be queried Power-up reason value in uboot, How can i get it ?
The only place I know to get it is via serial console during the U-Boot stage as a boot message.
I cannot check now, but reset_cause is in the device tree read by uboot, so the info is there.
However I cannot tell how to read it from uboot. Someone else with better knowledge may tell.
I don’t know the interpretation, but using that information I see that the files in “/proc/device-tree/chosen/reset/” will likely be what is wanted. There are both “pmc-reset-reason” and “pmic-reset-reason”, but I don’t know the significance of the different categories. Perhaps “cd /proc/device-tree/chosen/reset/” and then explore.
Probably pcm-reset-reason would show the difference between power on and reboot.
For reference, below is an old diff from both cases. I’m not sure about the L4T version, but it is a R28.x.
diff -u extractedFromProcFs-4.4.38-test2-dt.coldboot.dts extractedFromProcFs-4.4.38-test2-dt.reboot.dts
--- extractedFromProcFs-4.4.38-test2-dt.coldboot.dts 2017-12-07 19:50:08.115078794 +0100
+++ extractedFromProcFs-4.4.38-test2-dt.reboot.dts 2017-12-07 20:07:41.173180393 +0100
@@ -3585,8 +3585,8 @@
reset {
pmc-reset-reason {
- reset-source = "SYS_RESET_N";
- reset-level = [30 00];
+ reset-source = "MAINSWRST";
+ reset-level = [31 00];
};
pmic-reset-reason {