mirror of https://github.com/acidanthera/audk.git
ArmPkg ArmPlatformPkg ArmVirtPkg: ARM GICv2/v3 Base Address width fix-up
According to the ACPI 6.0/6.1 spec, the physical base address of GICC, GICD, GICR and GIC ITS is 64-bit. So change the type of the various GIC base address PCDs to 64-bit, and fix up all users. Contributed-under: TianoCore Contribution Agreement 1.0 Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Dennis Chen <dennis.chen@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
parent
d796d33f18
commit
8a1f2378d7
|
@ -97,7 +97,7 @@ StartLinux (
|
||||||
LINUX_KERNEL64 LinuxKernel = (LINUX_KERNEL64)LinuxImage;
|
LINUX_KERNEL64 LinuxKernel = (LINUX_KERNEL64)LinuxImage;
|
||||||
|
|
||||||
// Send msg to secondary cores to go to the kernel pen.
|
// Send msg to secondary cores to go to the kernel pen.
|
||||||
ArmGicSendSgiTo (PcdGet32 (PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));
|
ArmGicSendSgiTo (PcdGet64 (PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));
|
||||||
|
|
||||||
// Shut down UEFI boot services. ExitBootServices() will notify every driver that created an event on
|
// Shut down UEFI boot services. ExitBootServices() will notify every driver that created an event on
|
||||||
// ExitBootServices event. Example the Interrupt DXE driver will disable the interrupts on this event.
|
// ExitBootServices event. Example the Interrupt DXE driver will disable the interrupts on this event.
|
||||||
|
|
|
@ -251,10 +251,10 @@
|
||||||
#
|
#
|
||||||
# ARM Generic Interrupt Controller
|
# ARM Generic Interrupt Controller
|
||||||
#
|
#
|
||||||
gArmTokenSpaceGuid.PcdGicDistributorBase|0|UINT32|0x0000000C
|
gArmTokenSpaceGuid.PcdGicDistributorBase|0|UINT64|0x0000000C
|
||||||
# Base address for the GIC Redistributor region that contains the boot CPU
|
# Base address for the GIC Redistributor region that contains the boot CPU
|
||||||
gArmTokenSpaceGuid.PcdGicRedistributorsBase|0|UINT32|0x0000000E
|
gArmTokenSpaceGuid.PcdGicRedistributorsBase|0|UINT64|0x0000000E
|
||||||
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0|UINT32|0x0000000D
|
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0|UINT64|0x0000000D
|
||||||
gArmTokenSpaceGuid.PcdGicSgiIntId|0|UINT32|0x00000025
|
gArmTokenSpaceGuid.PcdGicSgiIntId|0|UINT32|0x00000025
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -259,8 +259,8 @@ GicV2DxeInitialize (
|
||||||
// Make sure the Interrupt Controller Protocol is not already installed in the system.
|
// Make sure the Interrupt Controller Protocol is not already installed in the system.
|
||||||
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
|
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
|
||||||
|
|
||||||
mGicInterruptInterfaceBase = PcdGet32 (PcdGicInterruptInterfaceBase);
|
mGicInterruptInterfaceBase = PcdGet64 (PcdGicInterruptInterfaceBase);
|
||||||
mGicDistributorBase = PcdGet32 (PcdGicDistributorBase);
|
mGicDistributorBase = PcdGet64 (PcdGicDistributorBase);
|
||||||
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
|
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
|
||||||
|
|
||||||
for (Index = 0; Index < mGicNumInterrupts; Index++) {
|
for (Index = 0; Index < mGicNumInterrupts; Index++) {
|
||||||
|
|
|
@ -245,8 +245,8 @@ GicV3DxeInitialize (
|
||||||
// Make sure the Interrupt Controller Protocol is not already installed in the system.
|
// Make sure the Interrupt Controller Protocol is not already installed in the system.
|
||||||
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
|
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
|
||||||
|
|
||||||
mGicDistributorBase = PcdGet32 (PcdGicDistributorBase);
|
mGicDistributorBase = PcdGet64 (PcdGicDistributorBase);
|
||||||
mGicRedistributorsBase = PcdGet32 (PcdGicRedistributorsBase);
|
mGicRedistributorsBase = PcdGet64 (PcdGicRedistributorsBase);
|
||||||
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
|
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -73,7 +73,7 @@ ArmPlatformSecInitialize (
|
||||||
MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER3_EN, SP810_SYS_CTRL_TIMER3_TIMCLK);
|
MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER3_EN, SP810_SYS_CTRL_TIMER3_TIMCLK);
|
||||||
|
|
||||||
// Read the GIC Identification Register
|
// Read the GIC Identification Register
|
||||||
Identification = ArmGicGetInterfaceIdentification (PcdGet32 (PcdGicInterruptInterfaceBase));
|
Identification = ArmGicGetInterfaceIdentification (PcdGet64 (PcdGicInterruptInterfaceBase));
|
||||||
|
|
||||||
// Check if we are GICv3
|
// Check if we are GICv3
|
||||||
if (ARM_GIC_ICCIIDR_GET_ARCH_VERSION(Identification) >= 0x3) {
|
if (ARM_GIC_ICCIIDR_GET_ARCH_VERSION(Identification) >= 0x3) {
|
||||||
|
|
|
@ -40,11 +40,11 @@ NonSecureWaitForFirmware (
|
||||||
ArmCallWFI ();
|
ArmCallWFI ();
|
||||||
|
|
||||||
// Acknowledge the interrupt and send End of Interrupt signal.
|
// Acknowledge the interrupt and send End of Interrupt signal.
|
||||||
AcknowledgeInterrupt = ArmGicAcknowledgeInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase), &InterruptId);
|
AcknowledgeInterrupt = ArmGicAcknowledgeInterrupt (PcdGet64 (PcdGicInterruptInterfaceBase), &InterruptId);
|
||||||
// Check if it is a valid interrupt ID
|
// Check if it is a valid interrupt ID
|
||||||
if (InterruptId < ArmGicGetMaxNumInterrupts (PcdGet32 (PcdGicDistributorBase))) {
|
if (InterruptId < ArmGicGetMaxNumInterrupts (PcdGet64 (PcdGicDistributorBase))) {
|
||||||
// Got a valid SGI number hence signal End of Interrupt
|
// Got a valid SGI number hence signal End of Interrupt
|
||||||
ArmGicEndOfInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase), AcknowledgeInterrupt);
|
ArmGicEndOfInterrupt (PcdGet64 (PcdGicInterruptInterfaceBase), AcknowledgeInterrupt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Jump to secondary core entry point.
|
// Jump to secondary core entry point.
|
||||||
|
@ -105,7 +105,7 @@ ArmPlatformSecExtraAction (
|
||||||
|
|
||||||
if (ArmPlatformIsPrimaryCore (MpId)) {
|
if (ArmPlatformIsPrimaryCore (MpId)) {
|
||||||
// Signal the secondary cores they can jump to PEI phase
|
// Signal the secondary cores they can jump to PEI phase
|
||||||
ArmGicSendSgiTo (PcdGet32 (PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));
|
ArmGicSendSgiTo (PcdGet64 (PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));
|
||||||
|
|
||||||
// To enter into Non Secure state, we need to make a return from exception
|
// To enter into Non Secure state, we need to make a return from exception
|
||||||
*JumpAddress = PcdGet64 (PcdFvBaseAddress);
|
*JumpAddress = PcdGet64 (PcdFvBaseAddress);
|
||||||
|
|
|
@ -89,11 +89,11 @@ SecondaryMain (
|
||||||
SecondaryEntryAddr = MmioRead32 (ArmCoreInfoTable[Index].MailboxGetAddress);
|
SecondaryEntryAddr = MmioRead32 (ArmCoreInfoTable[Index].MailboxGetAddress);
|
||||||
|
|
||||||
// Acknowledge the interrupt and send End of Interrupt signal.
|
// Acknowledge the interrupt and send End of Interrupt signal.
|
||||||
AcknowledgeInterrupt = ArmGicAcknowledgeInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase), &InterruptId);
|
AcknowledgeInterrupt = ArmGicAcknowledgeInterrupt (PcdGet64 (PcdGicInterruptInterfaceBase), &InterruptId);
|
||||||
// Check if it is a valid interrupt ID
|
// Check if it is a valid interrupt ID
|
||||||
if (InterruptId < ArmGicGetMaxNumInterrupts (PcdGet32 (PcdGicDistributorBase))) {
|
if (InterruptId < ArmGicGetMaxNumInterrupts (PcdGet64 (PcdGicDistributorBase))) {
|
||||||
// Got a valid SGI number hence signal End of Interrupt
|
// Got a valid SGI number hence signal End of Interrupt
|
||||||
ArmGicEndOfInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase), AcknowledgeInterrupt);
|
ArmGicEndOfInterrupt (PcdGet64 (PcdGicInterruptInterfaceBase), AcknowledgeInterrupt);
|
||||||
}
|
}
|
||||||
} while (SecondaryEntryAddr == 0);
|
} while (SecondaryEntryAddr == 0);
|
||||||
|
|
||||||
|
@ -120,12 +120,12 @@ PrimaryMain (
|
||||||
CreatePpiList (&PpiListSize, &PpiList);
|
CreatePpiList (&PpiListSize, &PpiList);
|
||||||
|
|
||||||
// Enable the GIC Distributor
|
// Enable the GIC Distributor
|
||||||
ArmGicEnableDistributor (PcdGet32(PcdGicDistributorBase));
|
ArmGicEnableDistributor (PcdGet64(PcdGicDistributorBase));
|
||||||
|
|
||||||
// If ArmVe has not been built as Standalone then we need to wake up the secondary cores
|
// If ArmVe has not been built as Standalone then we need to wake up the secondary cores
|
||||||
if (FeaturePcdGet (PcdSendSgiToBringUpSecondaryCores)) {
|
if (FeaturePcdGet (PcdSendSgiToBringUpSecondaryCores)) {
|
||||||
// Sending SGI to all the Secondary CPU interfaces
|
// Sending SGI to all the Secondary CPU interfaces
|
||||||
ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));
|
ArmGicSendSgiTo (PcdGet64(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adjust the Temporary Ram as the new Ppi List (Common + Platform Ppi Lists) is created at
|
// Adjust the Temporary Ram as the new Ppi List (Common + Platform Ppi Lists) is created at
|
||||||
|
|
|
@ -26,12 +26,12 @@ PrimaryMain (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Enable the GIC Distributor
|
// Enable the GIC Distributor
|
||||||
ArmGicEnableDistributor(PcdGet32(PcdGicDistributorBase));
|
ArmGicEnableDistributor(PcdGet64(PcdGicDistributorBase));
|
||||||
|
|
||||||
// In some cases, the secondary cores are waiting for an SGI from the next stage boot loader to resume their initialization
|
// In some cases, the secondary cores are waiting for an SGI from the next stage boot loader to resume their initialization
|
||||||
if (!FixedPcdGet32(PcdSendSgiToBringUpSecondaryCores)) {
|
if (!FixedPcdGet32(PcdSendSgiToBringUpSecondaryCores)) {
|
||||||
// Sending SGI to all the Secondary CPU interfaces
|
// Sending SGI to all the Secondary CPU interfaces
|
||||||
ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));
|
ArmGicSendSgiTo (PcdGet64(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));
|
||||||
}
|
}
|
||||||
|
|
||||||
PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);
|
PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);
|
||||||
|
@ -88,11 +88,11 @@ SecondaryMain (
|
||||||
SecondaryEntryAddr = MmioRead32 (ArmCoreInfoTable[Index].MailboxGetAddress);
|
SecondaryEntryAddr = MmioRead32 (ArmCoreInfoTable[Index].MailboxGetAddress);
|
||||||
|
|
||||||
// Acknowledge the interrupt and send End of Interrupt signal.
|
// Acknowledge the interrupt and send End of Interrupt signal.
|
||||||
AcknowledgeInterrupt = ArmGicAcknowledgeInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase), &InterruptId);
|
AcknowledgeInterrupt = ArmGicAcknowledgeInterrupt (PcdGet64 (PcdGicInterruptInterfaceBase), &InterruptId);
|
||||||
// Check if it is a valid interrupt ID
|
// Check if it is a valid interrupt ID
|
||||||
if (InterruptId < ArmGicGetMaxNumInterrupts (PcdGet32 (PcdGicDistributorBase))) {
|
if (InterruptId < ArmGicGetMaxNumInterrupts (PcdGet64 (PcdGicDistributorBase))) {
|
||||||
// Got a valid SGI number hence signal End of Interrupt
|
// Got a valid SGI number hence signal End of Interrupt
|
||||||
ArmGicEndOfInterrupt (PcdGet32 (PcdGicInterruptInterfaceBase), AcknowledgeInterrupt);
|
ArmGicEndOfInterrupt (PcdGet64 (PcdGicInterruptInterfaceBase), AcknowledgeInterrupt);
|
||||||
}
|
}
|
||||||
} while (SecondaryEntryAddr == 0);
|
} while (SecondaryEntryAddr == 0);
|
||||||
|
|
||||||
|
|
|
@ -82,8 +82,8 @@ ArmVirtGicArchLibConstructor (
|
||||||
RedistBase = SwapBytes64 (Reg[2]);
|
RedistBase = SwapBytes64 (Reg[2]);
|
||||||
ASSERT (RedistBase < MAX_UINT32);
|
ASSERT (RedistBase < MAX_UINT32);
|
||||||
|
|
||||||
PcdSet32 (PcdGicDistributorBase, (UINT32)DistBase);
|
PcdSet64 (PcdGicDistributorBase, DistBase);
|
||||||
PcdSet32 (PcdGicRedistributorsBase, (UINT32)RedistBase);
|
PcdSet64 (PcdGicRedistributorsBase, RedistBase);
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "Found GIC v3 (re)distributor @ 0x%Lx (0x%Lx)\n",
|
DEBUG ((EFI_D_INFO, "Found GIC v3 (re)distributor @ 0x%Lx (0x%Lx)\n",
|
||||||
DistBase, RedistBase));
|
DistBase, RedistBase));
|
||||||
|
@ -117,8 +117,8 @@ ArmVirtGicArchLibConstructor (
|
||||||
ASSERT (DistBase < MAX_UINT32);
|
ASSERT (DistBase < MAX_UINT32);
|
||||||
ASSERT (CpuBase < MAX_UINT32);
|
ASSERT (CpuBase < MAX_UINT32);
|
||||||
|
|
||||||
PcdSet32 (PcdGicDistributorBase, (UINT32)DistBase);
|
PcdSet64 (PcdGicDistributorBase, DistBase);
|
||||||
PcdSet32 (PcdGicInterruptInterfaceBase, (UINT32)CpuBase);
|
PcdSet64 (PcdGicInterruptInterfaceBase, CpuBase);
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase));
|
DEBUG ((EFI_D_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue