This is just a bunch of boilerplate code that extends the protocol HardwareInterrupt to HardwareInterrupt2, and adds some hooks that allow protocol clients to configure the interrupt type.
Patch #1 and patch #3 are complete afaict. Patch #2 needs to actual GIC manipulation code to be inserted, but I am sure someone else will be able to do this much more quickly.
Ard Biesheuvel (3): EmbeddedPkg: introduce HardwareInterrupt2 protocol ArmPkg/ArmGicDxe: expose HardwareInterrupt2 protocol ArmPkg/GenericWatchdogDxe: use HardwareInterrupt2 protocol to set interrupt type
ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c | 4 +- ArmPkg/Drivers/ArmGic/ArmGicDxe.h | 2 + ArmPkg/Drivers/ArmGic/ArmGicDxe.inf | 1 + ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 37 +++- ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 37 +++- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 26 +-- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 4 +- EmbeddedPkg/EmbeddedPkg.dec | 1 + EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h | 181 ++++++++++++++++++++ 9 files changed, 278 insertions(+), 15 deletions(-) create mode 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
The existing HardwareInterrupt protocol lacks the method to configure the level/edge and polarity properties of an interrupt. So introduce a new protocol HardwareInterrupt2, and add some new members that allow the manipulation of those properties.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- EmbeddedPkg/EmbeddedPkg.dec | 1 + EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h | 181 ++++++++++++++++++++ 2 files changed, 182 insertions(+)
diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 775d863c5f64..4c4099b38799 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -58,6 +58,7 @@ [Guids.common]
[Protocols.common] gHardwareInterruptProtocolGuid = { 0x2890B3EA, 0x053D, 0x1643, { 0xAD, 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } } + gHardwareInterrupt2ProtocolGuid = { 0x32898322, 0x2da1, 0x474a, { 0xba, 0xaa, 0xf3, 0xf7, 0xcf, 0x56, 0x94, 0x70 } } gEfiDebugSupportPeriodicCallbackProtocolGuid = { 0x9546e07c, 0x2cbb, 0x4c88, { 0x98, 0x6c, 0xcd, 0x34, 0x10, 0x86, 0xf0, 0x44 } } gEfiEblAddCommandProtocolGuid = { 0xaeda2428, 0x9a22, 0x4637, { 0x9b, 0x21, 0x54, 0x5e, 0x28, 0xfb, 0xb8, 0x29 } } gEmbeddedDeviceGuid = { 0xbf4b9d10, 0x13ec, 0x43dd, { 0x88, 0x80, 0xe9, 0xb, 0x71, 0x8f, 0x27, 0xde } } diff --git a/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h b/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h new file mode 100644 index 000000000000..61acdaac4341 --- /dev/null +++ b/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h @@ -0,0 +1,181 @@ +/** @file + + Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR> + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __HARDWARE_INTERRUPT2_H__ +#define __HARDWARE_INTERRUPT2_H__ + +#include <Protocol/HardwareInterrupt.h> + +// 22838932-1a2d-4a47-aaba-f3f7cf569470 + +#define EFI_HARDWARE_INTERRUPT2_PROTOCOL_GUID \ + { 0x32898322, 0x2da1, 0x474a, { 0xba, 0xaa, 0xf3, 0xf7, 0xcf, 0x56, 0x94, 0x70 } } + +typedef enum { + EFI_HARDWARE_INTERRUPT2_TRIGGER_LEVEL_LOW, + EFI_HARDWARE_INTERRUPT2_TRIGGER_LEVEL_HIGH, + EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_FALLING, + EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING, +} EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE; + +typedef struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL EFI_HARDWARE_INTERRUPT2_PROTOCOL; + +/** + Register Handler for the specified interrupt source. + + @param This Instance pointer for this protocol + @param Source Hardware source of the interrupt + @param Handler Callback for interrupt. NULL to unregister + + @retval EFI_SUCCESS Source was updated to support Handler. + @retval EFI_DEVICE_ERROR Hardware could not be programmed. + +**/ +typedef +EFI_STATUS +(EFIAPI *HARDWARE_INTERRUPT2_REGISTER) ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source, + IN HARDWARE_INTERRUPT_HANDLER Handler + ); + + +/** + Enable interrupt source Source. + + @param This Instance pointer for this protocol + @param Source Hardware source of the interrupt + + @retval EFI_SUCCESS Source interrupt enabled. + @retval EFI_DEVICE_ERROR Hardware could not be programmed. + +**/ +typedef +EFI_STATUS +(EFIAPI *HARDWARE_INTERRUPT2_ENABLE) ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source + ); + + + +/** + Disable interrupt source Source. + + @param This Instance pointer for this protocol + @param Source Hardware source of the interrupt + + @retval EFI_SUCCESS Source interrupt disabled. + @retval EFI_DEVICE_ERROR Hardware could not be programmed. + +**/ +typedef +EFI_STATUS +(EFIAPI *HARDWARE_INTERRUPT2_DISABLE) ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source + ); + + +/** + Return current state of interrupt source Source. + + @param This Instance pointer for this protocol + @param Source Hardware source of the interrupt + @param InterruptState TRUE: source enabled, FALSE: source disabled. + + @retval EFI_SUCCESS InterruptState is valid + @retval EFI_DEVICE_ERROR InterruptState is not valid + +**/ +typedef +EFI_STATUS +(EFIAPI *HARDWARE_INTERRUPT2_INTERRUPT_STATE) ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source, + IN BOOLEAN *InterruptState + ); + +/** + 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. + +**/ +typedef +EFI_STATUS +(EFIAPI *HARDWARE_INTERRUPT2_END_OF_INTERRUPT) ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source + ); + +/** + Return the configured trigger type for an interrupt source + + @param This Instance pointer for this protocol + @param Source Hardware source of the interrupt + @param TriggerType The configured trigger type + + @retval EFI_SUCCESS Operation successful + @retval EFI_DEVICE_ERROR Information could not be returned + +**/ +typedef +EFI_STATUS +(EFIAPI *HARDWARE_INTERRUPT2_GET_TRIGGER_TYPE) ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source, + OUT EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE *TriggerType + ); + + +/** + Configure the trigger type for an interrupt source + + @param This Instance pointer for this protocol + @param Source Hardware source of the interrupt + @param TriggerType The trigger type to configure + + @retval EFI_SUCCESS Operation successful + @retval EFI_DEVICE_ERROR Hardware could not be programmed. + +**/ +typedef +EFI_STATUS +(EFIAPI *HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE) ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source, + IN EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE TriggerType + ); + +struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL { + HARDWARE_INTERRUPT2_REGISTER RegisterInterruptSource; + HARDWARE_INTERRUPT2_ENABLE EnableInterruptSource; + HARDWARE_INTERRUPT2_DISABLE DisableInterruptSource; + HARDWARE_INTERRUPT2_INTERRUPT_STATE GetInterruptSourceState; + HARDWARE_INTERRUPT2_END_OF_INTERRUPT EndOfInterrupt; + + // v2 members + HARDWARE_INTERRUPT2_GET_TRIGGER_TYPE GetTriggerType; + HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE SetTriggerType; +}; + +extern EFI_GUID gHardwareInterrupt2ProtocolGuid; + +#endif
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c | 4 ++- ArmPkg/Drivers/ArmGic/ArmGicDxe.h | 2 ++ ArmPkg/Drivers/ArmGic/ArmGicDxe.inf | 1 + ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 37 +++++++++++++++++++- ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 37 +++++++++++++++++++- 5 files changed, 78 insertions(+), 3 deletions(-)
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c b/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c index be77b8361c5a..88056fa8cb5c 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c @@ -88,6 +88,7 @@ RegisterInterruptSource ( EFI_STATUS InstallAndRegisterInterruptService ( IN EFI_HARDWARE_INTERRUPT_PROTOCOL *InterruptProtocol, + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *Interrupt2Protocol, IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler, IN EFI_EVENT_NOTIFY ExitBootServicesEvent ) @@ -103,7 +104,8 @@ InstallAndRegisterInterruptService (
Status = gBS->InstallMultipleProtocolInterfaces ( &gHardwareInterruptHandle, - &gHardwareInterruptProtocolGuid, InterruptProtocol, + &gHardwareInterruptProtocolGuid, InterruptProtocol, + &gHardwareInterrupt2ProtocolGuid, Interrupt2Protocol, NULL ); if (EFI_ERROR (Status)) { diff --git a/ArmPkg/Drivers/ArmGic/ArmGicDxe.h b/ArmPkg/Drivers/ArmGic/ArmGicDxe.h index af33aa90b00c..2633e1ea194f 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicDxe.h +++ b/ArmPkg/Drivers/ArmGic/ArmGicDxe.h @@ -24,6 +24,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/Cpu.h> #include <Protocol/HardwareInterrupt.h> +#include <Protocol/HardwareInterrupt2.h>
extern UINTN mGicNumInterrupts; extern HARDWARE_INTERRUPT_HANDLER *gRegisteredInterruptHandlers; @@ -34,6 +35,7 @@ extern HARDWARE_INTERRUPT_HANDLER *gRegisteredInterruptHandlers; EFI_STATUS InstallAndRegisterInterruptService ( IN EFI_HARDWARE_INTERRUPT_PROTOCOL *InterruptProtocol, + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *Interrupt2Protocol, IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler, IN EFI_EVENT_NOTIFY ExitBootServicesEvent ); diff --git a/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf b/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf index e554301c4b28..69390638a9af 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf +++ b/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf @@ -48,6 +48,7 @@ [LibraryClasses]
[Protocols] gHardwareInterruptProtocolGuid + gHardwareInterrupt2ProtocolGuid gEfiCpuArchProtocolGuid
[Pcd.common] diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c index 34d4be386764..7bbdb044ce8d 100644 --- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c +++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c @@ -193,6 +193,40 @@ EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptV2Protocol = { GicV2EndOfInterrupt };
+STATIC +EFI_STATUS +EFIAPI +GicV2GetTriggerType ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source, + OUT EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE *TriggerType + ) +{ + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +EFIAPI +GicV2SetTriggerType ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source, + IN EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE TriggerType + ) +{ + return EFI_SUCCESS; +} + +STATIC EFI_HARDWARE_INTERRUPT2_PROTOCOL gHardwareInterrupt2V2Protocol = { + (HARDWARE_INTERRUPT2_REGISTER)RegisterInterruptSource, + (HARDWARE_INTERRUPT2_ENABLE)GicV2EnableInterruptSource, + (HARDWARE_INTERRUPT2_DISABLE)GicV2DisableInterruptSource, + (HARDWARE_INTERRUPT2_INTERRUPT_STATE)GicV2GetInterruptSourceState, + (HARDWARE_INTERRUPT2_END_OF_INTERRUPT)GicV2EndOfInterrupt, + GicV2GetTriggerType, + GicV2SetTriggerType +}; + /** Shutdown our hardware
@@ -311,7 +345,8 @@ GicV2DxeInitialize ( ArmGicEnableDistributor (mGicDistributorBase);
Status = InstallAndRegisterInterruptService ( - &gHardwareInterruptV2Protocol, GicV2IrqInterruptHandler, GicV2ExitBootServicesEvent); + &gHardwareInterruptV2Protocol, &gHardwareInterrupt2V2Protocol, + GicV2IrqInterruptHandler, GicV2ExitBootServicesEvent);
return Status; } diff --git a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c index 983936f3738a..ad845d54c355 100644 --- a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c +++ b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c @@ -184,6 +184,40 @@ EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptV3Protocol = { GicV3EndOfInterrupt };
+STATIC +EFI_STATUS +EFIAPI +GicV3GetTriggerType ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source, + OUT EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE *TriggerType + ) +{ + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +EFIAPI +GicV3SetTriggerType ( + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source, + IN EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE TriggerType + ) +{ + return EFI_SUCCESS; +} + +STATIC EFI_HARDWARE_INTERRUPT2_PROTOCOL gHardwareInterrupt2V3Protocol = { + (HARDWARE_INTERRUPT2_REGISTER)RegisterInterruptSource, + (HARDWARE_INTERRUPT2_ENABLE)GicV3EnableInterruptSource, + (HARDWARE_INTERRUPT2_DISABLE)GicV3DisableInterruptSource, + (HARDWARE_INTERRUPT2_INTERRUPT_STATE)GicV3GetInterruptSourceState, + (HARDWARE_INTERRUPT2_END_OF_INTERRUPT)GicV3EndOfInterrupt, + GicV3GetTriggerType, + GicV3SetTriggerType +}; + /** Shutdown our hardware
@@ -331,7 +365,8 @@ GicV3DxeInitialize ( ArmGicEnableDistributor (mGicDistributorBase);
Status = InstallAndRegisterInterruptService ( - &gHardwareInterruptV3Protocol, GicV3IrqInterruptHandler, GicV3ExitBootServicesEvent); + &gHardwareInterruptV3Protocol, &gHardwareInterrupt2V3Protocol, + GicV3IrqInterruptHandler, GicV3ExitBootServicesEvent);
return Status; }
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 26 ++++++++++++-------- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 4 +-- 2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c index 54a1625a3213..1b4679c7eb40 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c @@ -25,7 +25,7 @@ #include <Library/ArmGenericTimerCounterLib.h>
#include <Protocol/WatchdogTimer.h> -#include <Protocol/HardwareInterrupt.h> +#include <Protocol/HardwareInterrupt2.h>
#include "GenericWatchdog.h"
@@ -41,7 +41,7 @@ UINTN mTimerFrequencyHz = 0; // It is therefore stored here. 0 means the timer is not running. UINT64 mNumTimerTicks = 0;
-EFI_HARDWARE_INTERRUPT_PROTOCOL *mInterruptProtocol; +EFI_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol;
EFI_STATUS WatchdogWriteOffsetRegister ( @@ -320,7 +320,7 @@ GenericWatchdogEntry ( if (!EFI_ERROR (Status)) { // Install interrupt handler Status = gBS->LocateProtocol ( - &gHardwareInterruptProtocolGuid, + &gHardwareInterrupt2ProtocolGuid, NULL, (VOID **)&mInterruptProtocol ); @@ -331,13 +331,19 @@ GenericWatchdogEntry ( WatchdogInterruptHandler ); if (!EFI_ERROR (Status)) { - // Install the Timer Architectural Protocol onto a new handle - Handle = NULL; - Status = gBS->InstallMultipleProtocolInterfaces ( - &Handle, - &gEfiWatchdogTimerArchProtocolGuid, &gWatchdogTimer, - NULL - ); + Status = mInterruptProtocol->SetTriggerType ( + mInterruptProtocol, + FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum), + EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING); + if (!EFI_ERROR (Status)) { + // Install the Timer Architectural Protocol onto a new handle + Handle = NULL; + Status = gBS->InstallMultipleProtocolInterfaces ( + &Handle, + &gEfiWatchdogTimerArchProtocolGuid, &gWatchdogTimer, + NULL + ); + } } } } diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf index fece14cc1831..51d5c0042d84 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf @@ -47,7 +47,7 @@ [Pcd.common]
[Protocols] gEfiWatchdogTimerArchProtocolGuid - gHardwareInterruptProtocolGuid + gHardwareInterrupt2ProtocolGuid
[Depex] - gHardwareInterruptProtocolGuid + gHardwareInterrupt2ProtocolGuid
Hi Ard. Thank you very much for that astonishingly prompt and effective reaction to our problem. We'll get on with using it to implement our fixes, but in our more mortal timescale.
Regards, Evan
-----Original Message----- From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] Sent: 01 September 2016 17:22 To: linaro-uefi@lists.linaro.org; ryan.harkin@linaro.org; Evan Lloyd; leif.lindholm@linaro.org; Charles Garcia-Tobin Cc: ard.biesheuvel@linaro.org Subject: [PATCH 0/3] ArmPkg: add support for configuring interrupt types
This is just a bunch of boilerplate code that extends the protocol HardwareInterrupt to HardwareInterrupt2, and adds some hooks that allow protocol clients to configure the interrupt type.
Patch #1 and patch #3 are complete afaict. Patch #2 needs to actual GIC manipulation code to be inserted, but I am sure someone else will be able to do this much more quickly.
Ard Biesheuvel (3): EmbeddedPkg: introduce HardwareInterrupt2 protocol ArmPkg/ArmGicDxe: expose HardwareInterrupt2 protocol ArmPkg/GenericWatchdogDxe: use HardwareInterrupt2 protocol to set interrupt type
ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c | 4 +- ArmPkg/Drivers/ArmGic/ArmGicDxe.h | 2 + ArmPkg/Drivers/ArmGic/ArmGicDxe.inf | 1 + ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 37 +++- ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 37 +++- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 26 +-- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 4 +- EmbeddedPkg/EmbeddedPkg.dec | 1 + EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h | 181 ++++++++++++++++++++ 9 files changed, 278 insertions(+), 15 deletions(-) create mode 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
-- 2.7.4
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
On 1 September 2016 at 18:12, Evan Lloyd Evan.Lloyd@arm.com wrote:
Hi Ard. Thank you very much for that astonishingly prompt and effective reaction to our problem. We'll get on with using it to implement our fixes, but in our more mortal timescale.
Regards, Evan
-----Original Message----- From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] Sent: 01 September 2016 17:22 To: linaro-uefi@lists.linaro.org; ryan.harkin@linaro.org; Evan Lloyd; leif.lindholm@linaro.org; Charles Garcia-Tobin Cc: ard.biesheuvel@linaro.org Subject: [PATCH 0/3] ArmPkg: add support for configuring interrupt types
This is just a bunch of boilerplate code that extends the protocol HardwareInterrupt to HardwareInterrupt2, and adds some hooks that allow protocol clients to configure the interrupt type.
Patch #1 and patch #3 are complete afaict. Patch #2 needs to actual GIC manipulation code to be inserted, but I am sure someone else will be able to do this much more quickly.
Ard Biesheuvel (3): EmbeddedPkg: introduce HardwareInterrupt2 protocol ArmPkg/ArmGicDxe: expose HardwareInterrupt2 protocol ArmPkg/GenericWatchdogDxe: use HardwareInterrupt2 protocol to set interrupt type
ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c | 4 +- ArmPkg/Drivers/ArmGic/ArmGicDxe.h | 2 + ArmPkg/Drivers/ArmGic/ArmGicDxe.inf | 1 + ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 37 +++- ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 37 +++- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 26 +-- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 4 +- EmbeddedPkg/EmbeddedPkg.dec | 1 + EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h | 181 ++++++++++++++++++++ 9 files changed, 278 insertions(+), 15 deletions(-) create mode 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
I'm not sure if this patchset is going anywhere, but I tested it anyway and it works fine on Juno R0/1/2, TC2 and FVP Foundation and AEMv8 models.
Tested-by: Ryan Harkin ryan.harkin@linaro.org
-- 2.7.4
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
On 12 October 2016 at 08:47, Ryan Harkin ryan.harkin@linaro.org wrote:
On 1 September 2016 at 18:12, Evan Lloyd Evan.Lloyd@arm.com wrote:
Hi Ard. Thank you very much for that astonishingly prompt and effective reaction to our problem. We'll get on with using it to implement our fixes, but in our more mortal timescale.
Regards, Evan
-----Original Message----- From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] Sent: 01 September 2016 17:22 To: linaro-uefi@lists.linaro.org; ryan.harkin@linaro.org; Evan Lloyd; leif.lindholm@linaro.org; Charles Garcia-Tobin Cc: ard.biesheuvel@linaro.org Subject: [PATCH 0/3] ArmPkg: add support for configuring interrupt types
This is just a bunch of boilerplate code that extends the protocol HardwareInterrupt to HardwareInterrupt2, and adds some hooks that allow protocol clients to configure the interrupt type.
Patch #1 and patch #3 are complete afaict. Patch #2 needs to actual GIC manipulation code to be inserted, but I am sure someone else will be able to do this much more quickly.
Ard Biesheuvel (3): EmbeddedPkg: introduce HardwareInterrupt2 protocol ArmPkg/ArmGicDxe: expose HardwareInterrupt2 protocol ArmPkg/GenericWatchdogDxe: use HardwareInterrupt2 protocol to set interrupt type
ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c | 4 +- ArmPkg/Drivers/ArmGic/ArmGicDxe.h | 2 + ArmPkg/Drivers/ArmGic/ArmGicDxe.inf | 1 + ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 37 +++- ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 37 +++- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 26 +-- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 4 +- EmbeddedPkg/EmbeddedPkg.dec | 1 + EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h | 181 ++++++++++++++++++++ 9 files changed, 278 insertions(+), 15 deletions(-) create mode 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
I'm not sure if this patchset is going anywhere, but I tested it anyway and it works fine on Juno R0/1/2, TC2 and FVP Foundation and AEMv8 models.
Tested-by: Ryan Harkin ryan.harkin@linaro.org
Thanks for this, but given that this code is not wired up in any platform, I would be very surprised if it affected either of these platforms at build time or at runtime.
On 12 October 2016 at 09:34, Ard Biesheuvel ard.biesheuvel@linaro.org wrote:
On 12 October 2016 at 08:47, Ryan Harkin ryan.harkin@linaro.org wrote:
On 1 September 2016 at 18:12, Evan Lloyd Evan.Lloyd@arm.com wrote:
Hi Ard. Thank you very much for that astonishingly prompt and effective reaction to our problem. We'll get on with using it to implement our fixes, but in our more mortal timescale.
Regards, Evan
-----Original Message----- From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] Sent: 01 September 2016 17:22 To: linaro-uefi@lists.linaro.org; ryan.harkin@linaro.org; Evan Lloyd; leif.lindholm@linaro.org; Charles Garcia-Tobin Cc: ard.biesheuvel@linaro.org Subject: [PATCH 0/3] ArmPkg: add support for configuring interrupt types
This is just a bunch of boilerplate code that extends the protocol HardwareInterrupt to HardwareInterrupt2, and adds some hooks that allow protocol clients to configure the interrupt type.
Patch #1 and patch #3 are complete afaict. Patch #2 needs to actual GIC manipulation code to be inserted, but I am sure someone else will be able to do this much more quickly.
Ard Biesheuvel (3): EmbeddedPkg: introduce HardwareInterrupt2 protocol ArmPkg/ArmGicDxe: expose HardwareInterrupt2 protocol ArmPkg/GenericWatchdogDxe: use HardwareInterrupt2 protocol to set interrupt type
ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c | 4 +- ArmPkg/Drivers/ArmGic/ArmGicDxe.h | 2 + ArmPkg/Drivers/ArmGic/ArmGicDxe.inf | 1 + ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 37 +++- ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 37 +++- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 26 +-- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 4 +- EmbeddedPkg/EmbeddedPkg.dec | 1 + EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h | 181 ++++++++++++++++++++ 9 files changed, 278 insertions(+), 15 deletions(-) create mode 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
I'm not sure if this patchset is going anywhere, but I tested it anyway and it works fine on Juno R0/1/2, TC2 and FVP Foundation and AEMv8 models.
Tested-by: Ryan Harkin ryan.harkin@linaro.org
Thanks for this, but given that this code is not wired up in any platform, I would be very surprised if it affected either of these platforms at build time or at runtime.
Of course. But most important to me: it didn't break anything! :-)
Are you waiting for Evan to come up with a user before pushing it out?
On 12 October 2016 at 09:49, Ryan Harkin ryan.harkin@linaro.org wrote:
On 12 October 2016 at 09:34, Ard Biesheuvel ard.biesheuvel@linaro.org wrote:
[...]
Thanks for this, but given that this code is not wired up in any platform, I would be very surprised if it affected either of these platforms at build time or at runtime.
Of course. But most important to me: it didn't break anything! :-)
Are you waiting for Evan to come up with a user before pushing it out?
Yes. This is just boilerplate, the code does not actually do anything, so Evan needs to share his version if he ends up taking this approach.