1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2016 - Beniamino Galvani <b.galvani@gmail.com>
4  */
5 
6 #ifndef __MESON_SM_H__
7 #define __MESON_SM_H__
8 
9 ssize_t meson_sm_read_efuse(uintptr_t offset, void *buffer, size_t size);
10 
11 #define SM_SERIAL_SIZE	12
12 
13 int meson_sm_get_serial(void *buffer, size_t size);
14 
15 enum {
16 	REBOOT_REASON_COLD = 0,
17 	REBOOT_REASON_NORMAL = 1,
18 	REBOOT_REASON_RECOVERY = 2,
19 	REBOOT_REASON_UPDATE = 3,
20 	REBOOT_REASON_FASTBOOT = 4,
21 	REBOOT_REASON_SUSPEND_OFF = 5,
22 	REBOOT_REASON_HIBERNATE = 6,
23 	REBOOT_REASON_BOOTLOADER = 7,
24 	REBOOT_REASON_SHUTDOWN_REBOOT = 8,
25 	REBOOT_REASON_RPMBP = 9,
26 	REBOOT_REASON_CRASH_DUMP = 11,
27 	REBOOT_REASON_KERNEL_PANIC = 12,
28 	REBOOT_REASON_WATCHDOG_REBOOT = 13,
29 };
30 
31 int meson_sm_get_reboot_reason(void);
32 
33 #endif /* __MESON_SM_H__ */
34