diff options
-rw-r--r-- | chip/mec1322/system.c | 7 | ||||
-rw-r--r-- | include/system.h | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/chip/mec1322/system.c b/chip/mec1322/system.c index d68456777e..398b5262eb 100644 --- a/chip/mec1322/system.c +++ b/chip/mec1322/system.c @@ -91,6 +91,11 @@ void system_pre_init(void) spi_enable(CONFIG_SPI_FLASH_PORT, 1); } +void chip_save_reset_flags(int flags) +{ + MEC1322_VBAT_RAM(HIBDATA_INDEX_SAVED_RESET_FLAGS) = flags; +} + void _system_reset(int flags, int wake_from_hibernate) { uint32_t save_flags = 0; @@ -112,7 +117,7 @@ void _system_reset(int flags, int wake_from_hibernate) else save_flags |= RESET_FLAG_SOFT; - MEC1322_VBAT_RAM(HIBDATA_INDEX_SAVED_RESET_FLAGS) = save_flags; + chip_save_reset_flags(save_flags); /* Trigger watchdog in 1ms */ MEC1322_WDG_LOAD = 1; diff --git a/include/system.h b/include/system.h index 320410b160..e1bb43da93 100644 --- a/include/system.h +++ b/include/system.h @@ -29,6 +29,9 @@ #define RESET_FLAG_PRESERVED (1 << 13) /* Some reset flags preserved from * previous boot */ +/* Per chip implementation to save raw RESET_FLAG_ flags. */ +void chip_save_reset_flags(int flags); + /* System images */ enum system_image_copy_t { SYSTEM_IMAGE_UNKNOWN = 0, |