summaryrefslogtreecommitdiff
path: root/chip/npcx/system.c
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2015-09-28 10:56:46 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-29 21:11:40 -0700
commitdbef9a6fed88c78795a5060dead823978394cf6f (patch)
tree0726fc7f2db844ee2c4a650ba77dc15650c66e4b /chip/npcx/system.c
parent447e543ef62971394dcf9c98ebf23e6434a9a081 (diff)
downloadchrome-ec-dbef9a6fed88c78795a5060dead823978394cf6f.tar.gz
Rename gpio_is_reboot_warm() to system_is_reboot_warm()
BUG=chrome-os-partner:40788 TEST=make buildall -j BRANCH=none Change-Id: I4fb248da4656374e1218af98678cfb694f4c9176 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/302674 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
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 */