2013-01-25 12:28:06 +01:00
|
|
|
/*++
|
|
|
|
|
2014-07-04 16:38:14 +02:00
|
|
|
Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
|
2013-01-25 12:28:06 +01:00
|
|
|
|
2014-07-04 13:16:48 +02:00
|
|
|
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.
|
2013-01-25 12:28:06 +01:00
|
|
|
|
|
|
|
Module Name:
|
|
|
|
|
2014-07-04 13:16:48 +02:00
|
|
|
ArmGicDxe.c
|
2013-01-25 12:28:06 +01:00
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
|
|
Driver implementing the GIC interrupt controller protocol
|
|
|
|
|
|
|
|
--*/
|
|
|
|
|
|
|
|
#include <PiDxe.h>
|
|
|
|
|
2014-07-04 13:25:29 +02:00
|
|
|
#include "ArmGicDxe.h"
|
2013-01-25 12:28:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
Initialize the state information for the CPU Architectural Protocol
|
|
|
|
|
|
|
|
@param ImageHandle of the loaded driver
|
|
|
|
@param SystemTable Pointer to the System Table
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Protocol registered
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Cannot allocate protocol data structure
|
|
|
|
@retval EFI_DEVICE_ERROR Hardware problems
|
2014-10-27 11:27:27 +01:00
|
|
|
@retval EFI_UNSUPPORTED GIC version not supported
|
2013-01-25 12:28:06 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
InterruptDxeInitialize (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
)
|
|
|
|
{
|
2014-10-27 11:27:27 +01:00
|
|
|
EFI_STATUS Status;
|
|
|
|
ARM_GIC_ARCH_REVISION Revision;
|
2014-07-04 13:16:48 +02:00
|
|
|
|
2014-10-27 11:27:27 +01:00
|
|
|
Revision = ArmGicGetSupportedArchRevision ();
|
|
|
|
|
|
|
|
if (Revision == ARM_GIC_ARCH_REVISION_2) {
|
|
|
|
Status = GicV2DxeInitialize (ImageHandle, SystemTable);
|
2014-10-27 11:30:53 +01:00
|
|
|
} else if (Revision == ARM_GIC_ARCH_REVISION_3) {
|
|
|
|
Status = GicV3DxeInitialize (ImageHandle, SystemTable);
|
2014-10-27 11:27:27 +01:00
|
|
|
} else {
|
|
|
|
Status = EFI_UNSUPPORTED;
|
|
|
|
}
|
2013-01-25 12:28:06 +01:00
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|