diff options
author | Tinghan Shen <tinghan.shen@mediatek.com> | 2021-12-15 19:28:04 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-26 09:43:25 +0000 |
commit | 982408e4d09c163370d68f7e8107a861a187c85d (patch) | |
tree | 2acc5c0e7f6e7d26fc0556897170d92a9b0beff4 /chip | |
parent | a4b86758b3c4998a16d3763a01af2e324565a83b (diff) | |
download | chrome-ec-982408e4d09c163370d68f7e8107a861a187c85d.tar.gz |
chip/mt_scp: rv32i: save unhandled interrupt group
Save the unhandled interrupt group to help debug unhandled interrupt
exception. Although the real interrupt source disappeared, we can
get the interrupt group to help narrowing down scope.
Set a magic bit in ec_int to distinguish unhandled interrupt group
from normal interrupt index.
BRANCH=None
BUG=b:189356151
BUG=b:202754468
TEST=make BOARD=cherry_scp
Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Change-Id: I5abb51e8c13129dcd981819baecd98527d4f8a7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3341358
Reviewed-by: Rong Chang <rongchang@chromium.org>
Commit-Queue: Rong Chang <rongchang@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/mt_scp/rv32i_common/intc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/chip/mt_scp/rv32i_common/intc.c b/chip/mt_scp/rv32i_common/intc.c index 1e4fd1cef4..606f487ed5 100644 --- a/chip/mt_scp/rv32i_common/intc.c +++ b/chip/mt_scp/rv32i_common/intc.c @@ -313,17 +313,20 @@ BUILD_ASSERT(ARRAY_SIZE(irqs) == SCP_INTC_IRQ_COUNT); * Lower group has higher priority. * Higher INT number has higher priority. */ +#define EC_INT_MAGIC_DUMP_GROUP BIT(15) int chip_get_ec_int(void) { extern volatile int ec_int; unsigned int group, sta; int word; - if (!SCP_CORE0_INTC_IRQ_OUT) - goto error; - group = read_csr(CSR_VIC_MICAUSE); + if (!SCP_CORE0_INTC_IRQ_OUT) { + ec_int = EC_INT_MAGIC_DUMP_GROUP | group; + goto error; + } + for (word = SCP_INTC_GRP_LEN - 1; word >= 0; --word) { sta = SCP_CORE0_INTC_IRQ_GRP_STA(group, word); if (sta) { |