summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
Diffstat (limited to 'chip')
-rw-r--r--chip/it83xx/irq.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/chip/it83xx/irq.c b/chip/it83xx/irq.c
index 945f1909de..c2564c05a3 100644
--- a/chip/it83xx/irq.c
+++ b/chip/it83xx/irq.c
@@ -107,7 +107,11 @@ void chip_enable_irq(int irq)
int group = irq / 8;
int bit = irq % 8;
- IT83XX_INTC_REG(irq_groups[group].ier_off) |= BIT(bit);
+ /* SOC's interrupts share CPU machine-mode external interrupt */
+ if (IS_ENABLED(CHIP_CORE_RISCV))
+ IT83XX_INTC_REG(irq_groups[group].ier_off) |= BIT(bit);
+
+ /* SOC's interrupts use CPU HW interrupt 2 ~ 15 */
if (IS_ENABLED(CHIP_CORE_NDS32))
IT83XX_INTC_REG(IT83XX_INTC_EXT_IER_OFF(group)) |= BIT(bit);
}
@@ -117,7 +121,11 @@ void chip_disable_irq(int irq)
int group = irq / 8;
int bit = irq % 8;
- IT83XX_INTC_REG(irq_groups[group].ier_off) &= ~BIT(bit);
+ /* SOC's interrupts share CPU machine-mode external interrupt */
+ if (IS_ENABLED(CHIP_CORE_RISCV))
+ IT83XX_INTC_REG(irq_groups[group].ier_off) &= ~BIT(bit);
+
+ /* SOC's interrupts use CPU HW interrupt 2 ~ 15 */
if (IS_ENABLED(CHIP_CORE_NDS32))
IT83XX_INTC_REG(IT83XX_INTC_EXT_IER_OFF(group)) &= ~BIT(bit);
}