aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/arch-meson
diff options
context:
space:
mode:
authorNeil Armstrong <narmstrong@baylibre.com>2019-08-06 17:28:36 +0200
committerNeil Armstrong <narmstrong@baylibre.com>2019-08-12 10:02:30 +0200
commitb1dd7debeaf5b55f0d6091406ea4e767e4fdaaac (patch)
tree0d8532edf96c9cd03ba934fc0d377af1f823bab5 /arch/arm/include/asm/arch-meson
parent559e6256f855e61f987598a18ed4f2e20bc530e7 (diff)
downloadu-boot-b1dd7debeaf5b55f0d6091406ea4e767e4fdaaac.zip
u-boot-b1dd7debeaf5b55f0d6091406ea4e767e4fdaaac.tar.gz
u-boot-b1dd7debeaf5b55f0d6091406ea4e767e4fdaaac.tar.bz2
arm: meson: add sm command to retrieve the reboot reason
The Secure Monitor offers multiple services, like returning the SoC unique serial number, and can provide the "reboot reason" as set by the previous booted system. This extends the Amlogic specific "sm" cmd with a "reboot_reason" subcommand to print or set a specified environment variable with the reboot reason in human readable format. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'arch/arm/include/asm/arch-meson')
-rw-r--r--arch/arm/include/asm/arch-meson/sm.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-meson/sm.h b/arch/arm/include/asm/arch-meson/sm.h
index 60d04ae..f3ae46a 100644
--- a/arch/arm/include/asm/arch-meson/sm.h
+++ b/arch/arm/include/asm/arch-meson/sm.h
@@ -12,4 +12,22 @@ ssize_t meson_sm_read_efuse(uintptr_t offset, void *buffer, size_t size);
int meson_sm_get_serial(void *buffer, size_t size);
+enum {
+ REBOOT_REASON_COLD = 0,
+ REBOOT_REASON_NORMAL = 1,
+ REBOOT_REASON_RECOVERY = 2,
+ REBOOT_REASON_UPDATE = 3,
+ REBOOT_REASON_FASTBOOT = 4,
+ REBOOT_REASON_SUSPEND_OFF = 5,
+ REBOOT_REASON_HIBERNATE = 6,
+ REBOOT_REASON_BOOTLOADER = 7,
+ REBOOT_REASON_SHUTDOWN_REBOOT = 8,
+ REBOOT_REASON_RPMBP = 9,
+ REBOOT_REASON_CRASH_DUMP = 11,
+ REBOOT_REASON_KERNEL_PANIC = 12,
+ REBOOT_REASON_WATCHDOG_REBOOT = 13,
+};
+
+int meson_sm_get_reboot_reason(void);
+
#endif /* __MESON_SM_H__ */