From dbef9a6fed88c78795a5060dead823978394cf6f Mon Sep 17 00:00:00 2001 From: Vijay Hiremath Date: Mon, 28 Sep 2015 10:56:46 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/302674 Commit-Ready: Vijay P Hiremath Tested-by: Vijay P Hiremath Reviewed-by: Shawn N --- chip/npcx/system.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'chip/npcx/system.c') 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 */ -- cgit v1.2.1