diff options
author | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-24 22:38:46 +0000 |
---|---|---|
committer | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-24 22:38:46 +0000 |
commit | 026c3d34ee83b4df623cc80761450a53e9f7622b (patch) | |
tree | 093ad41be275694e4a107bc0775853afcc59dc70 /Omap35xxPkg/InterruptDxe | |
parent | 14e00c13be4ead51d9fd38e07af661af63ca2359 (diff) | |
download | edk2-platforms-026c3d34ee83b4df623cc80761450a53e9f7622b.tar.xz |
Updated Hardware Interrupt protocol to add an EOI member. Added ARM Data/Instruction syncronization barrier support to the ARM lib.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10063 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Omap35xxPkg/InterruptDxe')
-rw-r--r-- | Omap35xxPkg/InterruptDxe/HardwareInterrupt.c | 46 | ||||
-rw-r--r-- | Omap35xxPkg/InterruptDxe/InterruptDxe.inf | 2 |
2 files changed, 38 insertions, 10 deletions
diff --git a/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c b/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c index 6e30eb7e67..eae92067d6 100644 --- a/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c +++ b/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c @@ -1,7 +1,7 @@ /** @file
- Template for Metronome Architecture Protocol driver of the ARM flavor
+ Handle OMAP35xx interrupt controller
- Copyright (c) 2008-2009, Apple Inc. All rights reserved.
+ Copyright (c) 2008-2010, Apple Inc. All rights reserved.
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -21,6 +21,7 @@ #include <Library/UefiLib.h>
#include <Library/PcdLib.h>
#include <Library/IoLib.h>
+#include <Library/ArmLib.h>
#include <Protocol/Cpu.h>
#include <Protocol/HardwareInterrupt.h>
@@ -143,7 +144,7 @@ EnableInterruptSource ( **/
EFI_STATUS
EFIAPI
-DisableInterruptSource(
+DisableInterruptSource (
IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source
)
@@ -209,6 +210,28 @@ GetInterruptSourceState ( return EFI_SUCCESS;
}
+/**
+ Signal to the hardware that the End Of Intrrupt state
+ has been reached.
+
+ @param This Instance pointer for this protocol
+ @param Source Hardware source of the interrupt
+
+ @retval EFI_SUCCESS Source interrupt EOI'ed.
+ @retval EFI_DEVICE_ERROR Hardware could not be programmed.
+
+**/
+EFI_STATUS
+EFIAPI
+EndOfInterrupt (
+ IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
+ IN HARDWARE_INTERRUPT_SOURCE Source
+ )
+{
+ MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR);
+ ArmDataSyncronizationBarrier ();
+ return EFI_SUCCESS;
+}
/**
@@ -232,19 +255,21 @@ IrqInterruptHandler ( UINT32 Vector;
HARDWARE_INTERRUPT_HANDLER InterruptHandler;
- Vector = MmioRead32(INTCPS_SIR_IRQ) & INTCPS_SIR_IRQ_MASK;
+ Vector = MmioRead32 (INTCPS_SIR_IRQ) & INTCPS_SIR_IRQ_MASK;
// Needed to prevent infinite nesting when Time Driver lowers TPL
MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR);
-
+ ArmDataSyncronizationBarrier ();
+
InterruptHandler = gRegisteredInterruptHandlers[Vector];
if (InterruptHandler != NULL) {
// Call the registered interrupt handler.
- InterruptHandler(Vector, SystemContext);
+ InterruptHandler (Vector, SystemContext);
}
// Needed to clear after running the handler
MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR);
+ ArmDataSyncronizationBarrier ();
}
//
@@ -259,7 +284,8 @@ EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptProtocol = { RegisterInterruptSource,
EnableInterruptSource,
DisableInterruptSource,
- GetInterruptSourceState
+ GetInterruptSourceState,
+ EndOfInterrupt
};
//
@@ -277,19 +303,19 @@ CpuProtocolInstalledNotification ( //
// Get the cpu protocol that this driver requires.
//
- Status = gBS->LocateProtocol(&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu);
+ Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu);
ASSERT_EFI_ERROR(Status);
//
// Unregister the default exception handler.
//
- Status = Cpu->RegisterInterruptHandler(Cpu, EXCEPT_ARM_IRQ, NULL);
+ Status = Cpu->RegisterInterruptHandler (Cpu, EXCEPT_ARM_IRQ, NULL);
ASSERT_EFI_ERROR(Status);
//
// Register to receive interrupts
//
- Status = Cpu->RegisterInterruptHandler(Cpu, EXCEPT_ARM_IRQ, IrqInterruptHandler);
+ Status = Cpu->RegisterInterruptHandler (Cpu, EXCEPT_ARM_IRQ, IrqInterruptHandler);
ASSERT_EFI_ERROR(Status);
}
diff --git a/Omap35xxPkg/InterruptDxe/InterruptDxe.inf b/Omap35xxPkg/InterruptDxe/InterruptDxe.inf index 832e715b8a..533ca79af1 100644 --- a/Omap35xxPkg/InterruptDxe/InterruptDxe.inf +++ b/Omap35xxPkg/InterruptDxe/InterruptDxe.inf @@ -41,6 +41,7 @@ [Packages]
+ ArmPkg/ArmPkg.dec
Omap35xxPkg/Omap35xxPkg.dec
MdePkg/MdePkg.dec
EmbeddedPkg/EmbeddedPkg.dec
@@ -53,6 +54,7 @@ PrintLib
UefiDriverEntryPoint
IoLib
+ ArmLib
[Guids]
|