summaryrefslogtreecommitdiff
path: root/chip/npcx/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/npcx/system.c')
-rw-r--r--chip/npcx/system.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/chip/npcx/system.c b/chip/npcx/system.c
index b1ef8a62b0..a5b51c6609 100644
--- a/chip/npcx/system.c
+++ b/chip/npcx/system.c
@@ -601,6 +601,27 @@ uint32_t system_get_scratchpad(void)
return bbram_data_read(BBRM_DATA_INDEX_SCRATCHPAD);
}
+int system_is_reboot_warm(void)
+{
+ uint32_t reset_flags;
+
+ /*
+ * Check reset cause here,
+ * gpio_pre_init is executed faster than system_pre_init
+ */
+ system_check_reset_cause();
+ reset_flags = system_get_reset_flags();
+
+ if ((reset_flags & RESET_FLAG_RESET_PIN) ||
+ (reset_flags & RESET_FLAG_POWER_ON) ||
+ (reset_flags & RESET_FLAG_WATCHDOG) ||
+ (reset_flags & RESET_FLAG_HARD) ||
+ (reset_flags & RESET_FLAG_SOFT))
+ return 0;
+ else
+ return 1;
+}
+
/*****************************************************************************/
/* Console commands */