ArmPkg/PL390Gic: Do not try to clear spurious interrupts.

If we have a pending spurious interrupt we should not try to clear it,
just ignore.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14265 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
oliviermartin 2013-04-14 09:27:33 +00:00
parent 5ab765a7ad
commit 81742bb085
1 changed files with 7 additions and 6 deletions

View File

@ -39,14 +39,15 @@ ArmGicSetupNonSecure (
// Set priority Mask so that no interrupts get through to CPU // Set priority Mask so that no interrupts get through to CPU
MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCPMR, 0); MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCPMR, 0);
// Check if there are any pending interrupts InterruptId = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);
//TODO: could be extended to take Peripheral interrupts into consideration, but at the moment only SGI's are taken into consideration.
while(0 != (MmioRead32 (GicDistributorBase + ARM_GIC_ICDICPR) & 0xF)) {
// Some of the SGI's are still pending, read Ack register and send End of Interrupt Signal
InterruptId = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);
// Write to End of interrupt signal // Only try to clear valid interrupts. Ignore spurious interrupts.
while ((InterruptId & 0x3FF) < ArmGicGetMaxNumInterrupts (GicDistributorBase)) {
// Some of the SGI's are still pending, read Ack register and send End of Interrupt Signal
MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCEIOR, InterruptId); MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCEIOR, InterruptId);
// Next
InterruptId = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);
} }
// Only the primary core should set the Non Secure bit to the SPIs (Shared Peripheral Interrupt). // Only the primary core should set the Non Secure bit to the SPIs (Shared Peripheral Interrupt).