[edk2-devel] [PATCH v5][edk2-platforms 08/17] Platform/ARM/SgiPkg: Update SGI-575 MADT table to ACPI 6.2

Aditya Angadi posted 17 patches 5 years, 9 months ago
[edk2-devel] [PATCH v5][edk2-platforms 08/17] Platform/ARM/SgiPkg: Update SGI-575 MADT table to ACPI 6.2
Posted by Aditya Angadi 5 years, 9 months ago
Let the SGI-575 platform's MADT table be aligned with the MADT
table of the other RD platforms supported in the SgiPkg.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
---
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc | 130 +++++---------------
 1 file changed, 31 insertions(+), 99 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc
index dedabaaecdf4..f04b77929d71 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc
@@ -17,147 +17,79 @@
 #define CORES   (FixedPcdGet32 (PcdClusterCount) * \
                  FixedPcdGet32 (PcdCoreCount))
 
-// EFI_ACPI_6_1_GIC_STRUCTURE
-#define EFI_ACPI_6_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags,      \
-  PmuIrq, GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency)           \
-  {                                                                            \
-    EFI_ACPI_6_1_GIC,                     /* Type */                           \
-    sizeof (EFI_ACPI_6_1_GIC_STRUCTURE),  /* Length */                         \
-    EFI_ACPI_RESERVED_WORD,               /* Reserved */                       \
-    GicId,                                /* CPUInterfaceNumber */             \
-    AcpiCpuUid,                           /* AcpiProcessorUid */               \
-    Flags,                                /* Flags */                          \
-    0,                                    /* ParkingProtocolVersion */         \
-    PmuIrq,                               /* PerformanceInterruptGsiv */       \
-    0,                                    /* ParkedAddress */                  \
-    GicBase,                              /* PhysicalBaseAddress */            \
-    GicVBase,                             /* GICV */                           \
-    GicHBase,                             /* GICH */                           \
-    GsivId,                               /* VGICMaintenanceInterrupt */       \
-    GicRBase,                             /* GICRBaseAddress */                \
-    Mpidr,                                /* MPIDR */                          \
-    Efficiency,                           /* ProcessorPowerEfficiencyClass */  \
-    {                                                                          \
-      EFI_ACPI_RESERVED_BYTE,             /* Reserved2[0] */                   \
-      EFI_ACPI_RESERVED_BYTE,             /* Reserved2[1] */                   \
-      EFI_ACPI_RESERVED_BYTE              /* Reserved2[2] */                   \
-    }                                                                          \
-  }
-
-// EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE
-#define EFI_ACPI_6_1_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase,            \
-  GicDistVector, GicVersion)                                                   \
-  {                                                                            \
-    EFI_ACPI_6_1_GICD,                    /* Type */                           \
-    sizeof (EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE),                           \
-    EFI_ACPI_RESERVED_WORD,               /* Reserved1 */                      \
-    GicDistHwId,                          /* GicId */                          \
-    GicDistBase,                          /* PhysicalBaseAddress */            \
-    GicDistVector,                        /* SystemVectorBase */               \
-    GicVersion,                           /* GicVersion */                     \
-    {                                                                          \
-      EFI_ACPI_RESERVED_BYTE,             /* Reserved2[0] */                   \
-      EFI_ACPI_RESERVED_BYTE,             /* Reserved2[1] */                   \
-      EFI_ACPI_RESERVED_BYTE,             /* Reserved2[2] */                   \
-    }                                                                          \
-  }
-
-// EFI_ACPI_6_1_GICR_STRUCTURE
-#define EFI_ACPI_6_1_GIC_REDISTRIBUTOR_INIT(RedisRegionAddr, RedisDiscLength)  \
-  {                                                                            \
-    EFI_ACPI_6_1_GICR,                    /* Type */                           \
-    sizeof (EFI_ACPI_6_1_GICR_STRUCTURE), /* Length */                         \
-    EFI_ACPI_RESERVED_WORD,               /* Reserved */                       \
-    RedisRegionAddr,                      /* DiscoveryRangeBaseAddress */      \
-    RedisDiscLength                       /* DiscoveryRangeLength */           \
-  }
-
-// EFI_ACPI_6_1_GIC_ITS_STRUCTURE
-#define EFI_ACPI_6_1_GIC_ITS_INIT(GicItsId, GicItsBase)                        \
-  {                                                                            \
-    EFI_ACPI_6_1_GIC_ITS,                 /* Type */                           \
-    sizeof (EFI_ACPI_6_1_GIC_ITS_STRUCTURE),                                   \
-    EFI_ACPI_RESERVED_WORD,               /* Reserved */                       \
-    GicItsId,                             /* GicItsId */                       \
-    GicItsBase,                           /* PhysicalBaseAddress */            \
-    EFI_ACPI_RESERVED_DWORD,              /* DiscoveryRangeLength */           \
-  }
-
-//
 // Multiple APIC Description Table
-//
 #pragma pack (1)
 
 typedef struct {
-  EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER   Header;
-  EFI_ACPI_6_1_GIC_STRUCTURE                            GicInterfaces[CORES];
-  EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE                GicDistributor;
-  EFI_ACPI_6_1_GICR_STRUCTURE                           GicRedistributor;
-  EFI_ACPI_6_1_GIC_ITS_STRUCTURE                        GicIts;
-} EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE;
+  EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER   Header;
+  EFI_ACPI_6_2_GIC_STRUCTURE                            GicInterfaces[CORES];
+  EFI_ACPI_6_2_GIC_DISTRIBUTOR_STRUCTURE                GicDistributor;
+  EFI_ACPI_6_2_GICR_STRUCTURE                           GicRedistributor;
+  EFI_ACPI_6_2_GIC_ITS_STRUCTURE                        GicIts;
+} EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE;
 
 #pragma pack ()
 
-STATIC EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
+STATIC EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
   {
     ARM_ACPI_HEADER (
-      EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,
-      EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE,
-      EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION
+      EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,
+      EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE,
+      EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION
     ),
     // MADT specific fields
     0, // LocalApicAddress
     0, // Flags
   },
   {
-    // Format: EFI_ACPI_6_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags,
+    // Format: EFI_ACPI_6_2_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags,
     //                                          PmuIrq, GicBase, GicVBase,
     //                                          GicHBase, GsivId, GicRBase,
     //                                          Efficiency)
     // Note: The GIC Structure of the primary CPU must be the first entry
-    // (see note in 5.2.12.14 GICC Structure of ACPI v6.1).
-    EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-0
-      0, 0, GET_MPID(0x0, 0x0), EFI_ACPI_6_1_GIC_ENABLED, 23,
+    // (see note in 5.2.12.14 GICC Structure of ACPI v6.2).
+    EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // A75-0
+      0, 0, GET_MPID(0x0, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
-    EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-1
-      0, 1, GET_MPID(0x0, 0x100), EFI_ACPI_6_1_GIC_ENABLED, 23,
+    EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // A75-1
+      0, 1, GET_MPID(0x0, 0x100), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
-    EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-2
-      0, 2, GET_MPID(0x0, 0x200), EFI_ACPI_6_1_GIC_ENABLED, 23,
+    EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // A75-2
+      0, 2, GET_MPID(0x0, 0x200), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
-    EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-3
-      0, 3, GET_MPID(0x0, 0x300), EFI_ACPI_6_1_GIC_ENABLED, 23,
+    EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // A75-3
+      0, 3, GET_MPID(0x0, 0x300), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
 
-    EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-4
-      0, 4, GET_MPID(0x100, 0x00), EFI_ACPI_6_1_GIC_ENABLED, 23,
+    EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // A75-4
+      0, 4, GET_MPID(0x100, 0x00), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
-    EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-5
-      0, 5, GET_MPID(0x100, 0x100), EFI_ACPI_6_1_GIC_ENABLED, 23,
+    EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // A75-5
+      0, 5, GET_MPID(0x100, 0x100), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
-    EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-6
-      0, 6, GET_MPID(0x100, 0x200), EFI_ACPI_6_1_GIC_ENABLED, 23,
+    EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // A75-6
+      0, 6, GET_MPID(0x100, 0x200), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
-    EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-7
-      0, 7, GET_MPID(0x100, 0x300), EFI_ACPI_6_1_GIC_ENABLED, 23,
+    EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // A75-7
+      0, 7, GET_MPID(0x100, 0x300), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
   },
   // GIC Distributor Entry
-  EFI_ACPI_6_1_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet32 (PcdGicDistributorBase),
+  EFI_ACPI_6_2_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet32 (PcdGicDistributorBase),
                                     0, 3),
   // GIC Redistributor
-  EFI_ACPI_6_1_GIC_REDISTRIBUTOR_INIT(FixedPcdGet32 (PcdGicRedistributorsBase),
+  EFI_ACPI_6_2_GIC_REDISTRIBUTOR_INIT(FixedPcdGet32 (PcdGicRedistributorsBase),
                                       SIZE_1MB),
   // GIC ITS
-  EFI_ACPI_6_1_GIC_ITS_INIT(0, 0x30040000),
+  EFI_ACPI_6_2_GIC_ITS_INIT(0, 0x30040000),
 };
 
 //
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58617): https://edk2.groups.io/g/devel/message/58617
Mute This Topic: https://groups.io/mt/73997069/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-