armv8m: fix up_secure_irq failed for NVIC_IRQ_BUSFAULT

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2023-05-18 23:25:23 +08:00 committed by Xiang Xiao
parent 7a0ef1d0ca
commit b445029cf2

View File

@ -49,6 +49,8 @@
void up_secure_irq(int irq, bool secure)
{
uint32_t keymask = 0;
uint32_t keyval = 0;
uint32_t regaddr;
uint32_t regval;
uint32_t regbit;
@ -60,6 +62,8 @@ void up_secure_irq(int irq, bool secure)
case NVIC_IRQ_BUSFAULT:
regaddr = NVIC_AIRCR;
regbit = NVIC_AIRCR_BFHFNMINS;
keymask = NVIC_AIRCR_VECTKEY_MASK;
keyval = NVIC_AIRCR_VECTKEY;
break;
case NVIC_IRQ_DBGMONITOR:
@ -85,6 +89,7 @@ void up_secure_irq(int irq, bool secure)
regval |= regbit;
}
regval = (regval & ~keymask) | keyval;
putreg32(regval, regaddr);
}