diff mbox

[Linaro-uefi,RFC,4/7] Platforms/Styx: stop using the ArmMpCoreInfo configuration table

Message ID 1462196143-21998-5-git-send-email-ard.biesheuvel@linaro.org
State New
Headers show

Commit Message

Ard Biesheuvel May 2, 2016, 1:35 p.m. UTC
The ArmMpCoreInfo configuration table describes the secondary cores
that are penned up in PrePeiCore/PrePi and waiting for an SGI to
proceed with booting into the next pen. Since this approach is unsafe
under a PrePeiCore or PrePi that does not execute in place from flash,
move to the platform specific gAmdStyxMpCoreInfoGuid HOB that describes
the cores, but does not boot them until we are ready to move them straight
into the new pen that we will hand to the OS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Platforms/AMD/Styx/AcpiTables/Madt.c                       | 11 ++++-------
 Platforms/AMD/Styx/Drivers/FdtDxe/AArch64/BdsLinuxLoader.c |  7 ++-----
 2 files changed, 6 insertions(+), 12 deletions(-)
diff mbox

Patch

diff --git a/Platforms/AMD/Styx/AcpiTables/Madt.c b/Platforms/AMD/Styx/AcpiTables/Madt.c
index c9ee626d7472..ac98693d5f0f 100644
--- a/Platforms/AMD/Styx/AcpiTables/Madt.c
+++ b/Platforms/AMD/Styx/AcpiTables/Madt.c
@@ -271,18 +271,15 @@  MadtHeader (
   EFI_ACPI_5_1_GIC_STRUCTURE             *GicC;
   EFI_ACPI_5_1_GIC_DISTRIBUTOR_STRUCTURE *GicD;
   EFI_ACPI_5_1_GIC_MSI_FRAME_STRUCTURE   *GicM;
-  ARM_PROCESSOR_TABLE                    *ArmProcessorTable;
   ARM_CORE_INFO                          *ArmCoreInfoTable;
-  UINT32                                 CoreCount, CpuNum;
+  UINTN                                  CoreCount, CpuNum;
   EFI_STATUS                             Status;
 
-  // Get pointer to ARM processor table
-  ArmProcessorTable = AmdStyxGetArmProcessorTable();
-  ASSERT_EFI_ERROR (ArmProcessorTable == NULL);
-  ArmCoreInfoTable = ArmProcessorTable->ArmCpus;
+  // Get pointer to ARM core info table
+  ArmCoreInfoTable = AmdStyxGetArmCoreInfoTable (&CoreCount);
+  ASSERT (ArmCoreInfoTable != NULL);
 
   // Make sure SoC's core count does not exceed what we want to build
-  CoreCount = ArmProcessorTable->NumberOfEntries;
   ASSERT (CoreCount <= NUM_CORES);
   ASSERT (CoreCount <= PcdGet32(PcdSocCoreCount));
 
diff --git a/Platforms/AMD/Styx/Drivers/FdtDxe/AArch64/BdsLinuxLoader.c b/Platforms/AMD/Styx/Drivers/FdtDxe/AArch64/BdsLinuxLoader.c
index 9ec9e1d5061a..0fb2f4e47dd2 100644
--- a/Platforms/AMD/Styx/Drivers/FdtDxe/AArch64/BdsLinuxLoader.c
+++ b/Platforms/AMD/Styx/Drivers/FdtDxe/AArch64/BdsLinuxLoader.c
@@ -46,7 +46,6 @@  AmdStyxMoveParkedCores(
   EFI_PHYSICAL_ADDRESS     PenBase;
   UINTN                    PenSize;
   UINTN                    MailboxBase;
-  ARM_PROCESSOR_TABLE      *ArmProcessorTable;
   ARM_CORE_INFO            *ArmCoreInfoTable;
   UINTN                    ArmCoreCount;
   UINTN                    CoreNum;
@@ -54,10 +53,8 @@  AmdStyxMoveParkedCores(
   UINTN                    CoreParking;
 
   // Get core information
-  ArmProcessorTable = AmdStyxGetArmProcessorTable();
-  ASSERT_EFI_ERROR (ArmProcessorTable == NULL);
-  ArmCoreInfoTable = ArmProcessorTable->ArmCpus;
-  ArmCoreCount = ArmProcessorTable->NumberOfEntries;
+  ArmCoreInfoTable = AmdStyxGetArmCoreInfoTable (&ArmCoreCount);
+  ASSERT (ArmCoreInfoTable != NULL);
 
   // Get Parking area (4KB-aligned, 4KB per core)
   MpParkingBase = FixedPcdGet64 (PcdParkingProtocolBase);