blob: f3ae46a6d6b57da4497953914202c840f2cc95b6 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Beniamino Galvani38e1a602016-05-08 08:30:17 +02002/*
3 * (C) Copyright 2016 - Beniamino Galvani <b.galvani@gmail.com>
Beniamino Galvani38e1a602016-05-08 08:30:17 +02004 */
5
6#ifndef __MESON_SM_H__
7#define __MESON_SM_H__
8
9ssize_t meson_sm_read_efuse(uintptr_t offset, void *buffer, size_t size);
Neil Armstrongb4acf5a2019-06-12 11:49:07 +020010
11#define SM_SERIAL_SIZE 12
12
Neil Armstrong63f475c2019-06-12 11:49:06 +020013int meson_sm_get_serial(void *buffer, size_t size);
Beniamino Galvani38e1a602016-05-08 08:30:17 +020014
Neil Armstrong385309c2019-08-06 17:28:36 +020015enum {
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
31int meson_sm_get_reboot_reason(void);
32
Beniamino Galvani38e1a602016-05-08 08:30:17 +020033#endif /* __MESON_SM_H__ */