mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-17 18:41:22 +00:00
chip/npcx: Add support for chip_save_reset_flags
Add and export chip_save_reset_flags to allow boards to use this function when required. BUG=chrome-os-partner:61883 BRANCH=None TEST=Compiles successfully for poppy. Change-Id: I6f96bc61135fc4e3abb62a01d47c2cba8eb45b60 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/431191 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
b63404ba2d
commit
e4f2da5004
@@ -156,6 +156,11 @@ void system_set_rtc(uint32_t seconds)
|
||||
udelay(MTC_TTC_LOAD_DELAY_US);
|
||||
}
|
||||
|
||||
void chip_save_reset_flags(int flags)
|
||||
{
|
||||
bbram_data_write(BBRM_DATA_INDEX_SAVED_RESET_FLAGS, flags);
|
||||
}
|
||||
|
||||
/* Check reset cause */
|
||||
void system_check_reset_cause(void)
|
||||
{
|
||||
@@ -163,7 +168,7 @@ void system_check_reset_cause(void)
|
||||
uint32_t flags = bbram_data_read(BBRM_DATA_INDEX_SAVED_RESET_FLAGS);
|
||||
|
||||
/* Clear saved reset flags in bbram */
|
||||
bbram_data_write(BBRM_DATA_INDEX_SAVED_RESET_FLAGS, 0);
|
||||
chip_save_reset_flags(0);
|
||||
/* Clear saved hibernate wake flag in bbram , too */
|
||||
bbram_data_write(BBRM_DATA_INDEX_WAKE, 0);
|
||||
|
||||
@@ -601,7 +606,7 @@ void system_reset(int flags)
|
||||
save_flags |= RESET_FLAG_SOFT;
|
||||
|
||||
/* Store flags to battery backed RAM. */
|
||||
bbram_data_write(BBRM_DATA_INDEX_SAVED_RESET_FLAGS, save_flags);
|
||||
chip_save_reset_flags(save_flags);
|
||||
|
||||
/* Ask the watchdog to trigger a hard reboot */
|
||||
system_watchdog_reset();
|
||||
|
||||
Reference in New Issue
Block a user