diff options
author | Dino Li <dino.li@ite.com.tw> | 2015-08-20 05:54:40 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-20 01:37:56 +0000 |
commit | 911de4d175a2416370abc65b5dbc800a46c3fe3c (patch) | |
tree | 0f3d45d185731df7da52f3b6ae4d9e06ca1a9c8b /core/nds32/init.S | |
parent | 8c633e5af603687d178047930dc502c7deefe0ae (diff) | |
download | chrome-ec-911de4d175a2416370abc65b5dbc800a46c3fe3c.tar.gz |
nds32: use INT_MASK instead of GIE
When there is an interrupt event, N8 CPU will save PSW register to IPSW
register and clear GIE then jump to interrupt service routine. N8 will
restore PSW from IPSW after "iret" instruction (the above are purely
hardware mechanism).
Nested interrupt will occur if we set GIE again in interrupt context.
symptom:
power button pressed while LID open -> exception or unknown reset.
Signed-off-by: Dino Li <dino.li@ite.com.tw>
BRANCH=none
BUG=none
TEST=1. Manually pressed power button x200.
2. Console "eflash" erase and write eflash OK.
Change-Id: Ic04a23d473ebc6417dffea814a27583cb8d63a1f
Reviewed-on: https://chromium-review.googlesource.com/289437
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Diffstat (limited to 'core/nds32/init.S')
-rw-r--r-- | core/nds32/init.S | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/nds32/init.S b/core/nds32/init.S index 23483e59b0..a27fcd8d0e 100644 --- a/core/nds32/init.S +++ b/core/nds32/init.S @@ -85,6 +85,19 @@ eflash_sig: .global reset reset: + /* + * GIE (global interrupt) is always disabled here. the first + * "iret" instruction of syscall interrupt (triggered by __task_start) + * will restore PSW from IPSW, and will enable GIE. + * Firmware will not change GIE settings (set/clear) until the next + * reset, unless there's an interrupt event. + * When there is an interrupt event, N8 CPU will save PSW register to + * IPSW register and clear GIE then jump to interrupt service routine. + * N8 will restore PSW from IPSW after "iret" instruction. + */ + setgie.d + dsb + /* GP register is used to access .data and .bss */ la $gp, _SDA_BASE_ |