• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*++
2 
3 Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
4 
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution.  The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9 
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 Module Name:
14 
15   ArmGicDxe.c
16 
17 Abstract:
18 
19   Driver implementing the GIC interrupt controller protocol
20 
21 --*/
22 
23 #include <PiDxe.h>
24 
25 #include "ArmGicDxe.h"
26 
27 /**
28   Initialize the state information for the CPU Architectural Protocol
29 
30   @param  ImageHandle   of the loaded driver
31   @param  SystemTable   Pointer to the System Table
32 
33   @retval EFI_SUCCESS           Protocol registered
34   @retval EFI_OUT_OF_RESOURCES  Cannot allocate protocol data structure
35   @retval EFI_DEVICE_ERROR      Hardware problems
36   @retval EFI_UNSUPPORTED       GIC version not supported
37 
38 **/
39 EFI_STATUS
InterruptDxeInitialize(IN EFI_HANDLE ImageHandle,IN EFI_SYSTEM_TABLE * SystemTable)40 InterruptDxeInitialize (
41   IN EFI_HANDLE         ImageHandle,
42   IN EFI_SYSTEM_TABLE   *SystemTable
43   )
44 {
45   EFI_STATUS            Status;
46   ARM_GIC_ARCH_REVISION Revision;
47 
48   Revision = ArmGicGetSupportedArchRevision ();
49 
50   if (Revision == ARM_GIC_ARCH_REVISION_2) {
51     Status = GicV2DxeInitialize (ImageHandle, SystemTable);
52   } else if (Revision == ARM_GIC_ARCH_REVISION_3) {
53     Status = GicV3DxeInitialize (ImageHandle, SystemTable);
54   } else {
55     Status = EFI_UNSUPPORTED;
56   }
57 
58   return Status;
59 }
60