diff options
author | Wealian Liao <whliao@nuvoton.corp-partner.google.com> | 2021-02-25 18:03:26 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-10 07:48:12 +0000 |
commit | 2bd3a70b0ca347cbb1359cbf19dc6395fa967b53 (patch) | |
tree | 7104f832dc18c2e961d99feb10d89a059a21503e /include | |
parent | 240ad7d638291d8c1ee24f0f68815fb001c2f014 (diff) | |
download | chrome-ec-2bd3a70b0ca347cbb1359cbf19dc6395fa967b53.tar.gz |
zephyr: npcx: add read & write reset flag function
This CL adds chip_save_reset_flags() & chip_read_reset_flags(). Also,
fulfill the system_reset()
BUG=b:176523207
BRANCH=None.
TEST=check 'reboot wait-ext' will wait 10s
Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Change-Id: Idb9c2e90e8ad5e8a989f33ac904c3b778b8f48e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2731179
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/system.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h index c50c44797b..ef86d821aa 100644 --- a/include/system.h +++ b/include/system.h @@ -17,6 +17,18 @@ #include "ec_commands.h" #include "timer.h" +#ifdef CONFIG_ZEPHYR +#ifdef CONFIG_CPU_CORTEX_M +/* + * For cortex-m we cannot use irq_lock() for disabling all the interrupts + * because it leaves some (NMI and faults) still enabled. + */ +#define interrupt_disable_all() __asm__("cpsid i") +#endif +#else /* !CONFIG_ZEPHYR */ +#define interrupt_disable_all() interrupt_disable() +#endif /* CONFIG_ZEPHYR */ + /* Per chip implementation to save/read raw EC_RESET_FLAG_ flags. */ void chip_save_reset_flags(uint32_t flags); uint32_t chip_read_reset_flags(void); |