mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
ArmPkg/ArmGic: Disentangle ArmGicEnableDistributor () versions
Split ArmGicEnableDistributor () into GICv2 and v3 specific versions, and move them into their single respective callers, so that the original can be dropped from ArmGicLib altogether. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
4e874fcf09
commit
2ab362f313
@ -15,7 +15,6 @@
|
||||
|
||||
[Sources]
|
||||
ArmGicLib.c
|
||||
ArmGicNonSecLib.c
|
||||
|
||||
GicV2/ArmGicV2Lib.c
|
||||
GicV2/ArmGicV2NonSecLib.c
|
||||
|
@ -1,37 +0,0 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011-2023, Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*
|
||||
**/
|
||||
|
||||
#include <Uefi.h>
|
||||
#include <Library/IoLib.h>
|
||||
#include <Library/ArmGicLib.h>
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicEnableDistributor (
|
||||
IN UINTN GicDistributorBase
|
||||
)
|
||||
{
|
||||
ARM_GIC_ARCH_REVISION Revision;
|
||||
UINT32 GicDistributorCtl;
|
||||
|
||||
/*
|
||||
* Enable GIC distributor in Non-Secure world.
|
||||
* Note: The ICDDCR register is banked when Security extensions are implemented
|
||||
*/
|
||||
Revision = ArmGicGetSupportedArchRevision ();
|
||||
if (Revision == ARM_GIC_ARCH_REVISION_2) {
|
||||
MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
||||
} else {
|
||||
GicDistributorCtl = MmioRead32 (GicDistributorBase + ARM_GIC_ICDDCR);
|
||||
if ((GicDistributorCtl & ARM_GIC_ICDDCR_ARE) != 0) {
|
||||
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x2);
|
||||
} else {
|
||||
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
||||
}
|
||||
}
|
||||
}
|
@ -389,6 +389,15 @@ GicV2SetTriggerType (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
STATIC
|
||||
VOID
|
||||
ArmGicEnableDistributor (
|
||||
IN UINTN GicDistributorBase
|
||||
)
|
||||
{
|
||||
MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
||||
}
|
||||
|
||||
EFI_HARDWARE_INTERRUPT2_PROTOCOL gHardwareInterrupt2V2Protocol = {
|
||||
(HARDWARE_INTERRUPT2_REGISTER)RegisterInterruptSource,
|
||||
(HARDWARE_INTERRUPT2_ENABLE)GicV2EnableInterruptSource,
|
||||
|
@ -551,6 +551,22 @@ GicV3SetTriggerType (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
STATIC
|
||||
VOID
|
||||
ArmGicEnableDistributor (
|
||||
IN UINTN GicDistributorBase
|
||||
)
|
||||
{
|
||||
UINT32 GicDistributorCtl;
|
||||
|
||||
GicDistributorCtl = MmioRead32 (GicDistributorBase + ARM_GIC_ICDDCR);
|
||||
if ((GicDistributorCtl & ARM_GIC_ICDDCR_ARE) != 0) {
|
||||
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x2);
|
||||
} else {
|
||||
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
||||
}
|
||||
}
|
||||
|
||||
EFI_HARDWARE_INTERRUPT2_PROTOCOL gHardwareInterrupt2V3Protocol = {
|
||||
(HARDWARE_INTERRUPT2_REGISTER)RegisterInterruptSource,
|
||||
(HARDWARE_INTERRUPT2_ENABLE)GicV3EnableInterruptSource,
|
||||
|
@ -133,12 +133,6 @@ ArmGicSetSecureInterrupts (
|
||||
IN UINTN GicSecureInterruptMaskSize
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicEnableDistributor (
|
||||
IN UINTN GicDistributorBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicDisableDistributor (
|
||||
|
Loading…
x
Reference in New Issue
Block a user