summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2018-12-22 08:31:12 +0300
committerAtish Patra <atish.patra@wdc.com>2018-12-22 09:11:21 +0300
commit8304ee9424cc7700f2b08ba17553c2e48e0bafa8 (patch)
tree3ff443a70d244c9667262777824650f1bae07991
parent88b173b33b0810fbeff91ee589073efb9099a904 (diff)
downloadopensbi-8304ee9424cc7700f2b08ba17553c2e48e0bafa8.tar.xz
Disable all interrupts during warm irqchip init.
M mode is not expected to recieve any interrupts. S mode interrupts shouldn't be enabled in M mode. Signed-off-by: Atish Patra <atish.patra@wdc.com>
-rw-r--r--platform/common/irqchip/plic.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/common/irqchip/plic.c b/platform/common/irqchip/plic.c
index ece86a7..61a6bd0 100644
--- a/platform/common/irqchip/plic.c
+++ b/platform/common/irqchip/plic.c
@@ -80,11 +80,16 @@ int plic_warm_irqchip_init(u32 target_hart,
if (plic_hart_count <= target_hart)
return -1;
+
+ if (m_cntx_id > -1) {
+ for (i = 0; i < ie_words; i++)
+ plic_set_ie(m_cntx_id, i, 0);
+ }
/* By default, enable all IRQs for S-mode of target HART */
if (s_cntx_id > -1) {
for (i = 0; i < ie_words; i++)
- plic_set_ie(s_cntx_id, i, -1);
+ plic_set_ie(s_cntx_id, i, 0);
}
/* By default, enable M-mode threshold */