mirror of https://github.com/acidanthera/audk.git
ArmVirtPkg: Convert ArmVirtGicArchLib to NULL class library
Before retiring ArmGicArchLib entirely, convert the existing implementation in ArmVirtPkg into a NULL class library and inject it into ArmGicDxe on all ARM virtual platforms. This ensures that the PCDs describing the GIC are intialized correctly before ArmGicDxe is dispatched. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
8edd5fd6d3
commit
e663b79f74
|
@ -105,7 +105,6 @@
|
|||
CpuExceptionHandlerLib|ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.inf
|
||||
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
|
||||
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
||||
ArmGicArchLib|ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
|
||||
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
||||
ArmHvcLib|ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
|
||||
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.inf
|
||||
|
|
|
@ -279,7 +279,10 @@
|
|||
|
||||
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
|
||||
|
||||
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
|
||||
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
|
||||
}
|
||||
ArmPkg/Drivers/TimerDxe/TimerDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
|
||||
|
|
|
@ -299,7 +299,10 @@
|
|||
|
||||
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
|
||||
|
||||
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
|
||||
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
|
||||
}
|
||||
ArmPkg/Drivers/TimerDxe/TimerDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
|
||||
|
|
|
@ -428,7 +428,10 @@
|
|||
|
||||
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
|
||||
|
||||
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
|
||||
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
|
||||
}
|
||||
ArmPkg/Drivers/TimerDxe/TimerDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
|
||||
|
|
|
@ -338,7 +338,10 @@
|
|||
|
||||
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
|
||||
|
||||
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
|
||||
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
|
||||
}
|
||||
ArmPkg/Drivers/TimerDxe/TimerDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
|
||||
|
|
|
@ -192,7 +192,10 @@
|
|||
|
||||
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
|
||||
|
||||
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
|
||||
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf
|
||||
}
|
||||
ArmPkg/Drivers/TimerDxe/TimerDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/** @file
|
||||
ArmGicArchLib library class implementation for DT based virt platforms
|
||||
NULL library class implementation to discover the GIC for DT based virt platforms
|
||||
|
||||
Copyright (c) 2015 - 2016, Linaro Ltd. All rights reserved.<BR>
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
|||
#include <Uefi.h>
|
||||
|
||||
#include <Library/ArmGicLib.h>
|
||||
#include <Library/ArmGicArchLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
|
@ -19,15 +18,12 @@
|
|||
|
||||
#include <Protocol/FdtClient.h>
|
||||
|
||||
STATIC ARM_GIC_ARCH_REVISION mGicArchRevision;
|
||||
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
ArmVirtGicArchLibConstructor (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT32 IccSre;
|
||||
FDT_CLIENT_PROTOCOL *FdtClient;
|
||||
CONST UINT64 *Reg;
|
||||
UINT32 RegSize;
|
||||
|
@ -105,25 +101,6 @@ ArmVirtGicArchLibConstructor (
|
|||
RedistBase
|
||||
));
|
||||
|
||||
//
|
||||
// The default implementation of ArmGicArchLib is responsible for enabling
|
||||
// the system register interface on the GICv3 if one is found. So let's do
|
||||
// the same here.
|
||||
//
|
||||
IccSre = ArmGicV3GetControlSystemRegisterEnable ();
|
||||
if (!(IccSre & ICC_SRE_EL2_SRE)) {
|
||||
ArmGicV3SetControlSystemRegisterEnable (IccSre | ICC_SRE_EL2_SRE);
|
||||
IccSre = ArmGicV3GetControlSystemRegisterEnable ();
|
||||
}
|
||||
|
||||
//
|
||||
// Unlike the default implementation, there is no fall through to GICv2
|
||||
// mode if this GICv3 cannot be driven in native mode due to the fact
|
||||
// that the System Register interface is unavailable.
|
||||
//
|
||||
ASSERT (IccSre & ICC_SRE_EL2_SRE);
|
||||
|
||||
mGicArchRevision = ARM_GIC_ARCH_REVISION_3;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
@ -146,7 +123,6 @@ ArmVirtGicArchLibConstructor (
|
|||
|
||||
DEBUG ((DEBUG_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase));
|
||||
|
||||
mGicArchRevision = ARM_GIC_ARCH_REVISION_2;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -156,12 +132,3 @@ ArmVirtGicArchLibConstructor (
|
|||
|
||||
return RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
ARM_GIC_ARCH_REVISION
|
||||
EFIAPI
|
||||
ArmGicGetSupportedArchRevision (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return mGicArchRevision;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
FILE_GUID = 87b0dc84-4661-4deb-a789-97977ff636ed
|
||||
MODULE_TYPE = BASE
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = ArmGicArchLib|DXE_DRIVER UEFI_DRIVER UEFI_APPLICATION
|
||||
LIBRARY_CLASS = NULL|DXE_DRIVER UEFI_DRIVER UEFI_APPLICATION
|
||||
CONSTRUCTOR = ArmVirtGicArchLibConstructor
|
||||
|
||||
[Sources]
|
||||
|
|
Loading…
Reference in New Issue