This patch adds some macros for initialization of GICv3 Distributor, cpu 
interface
and Redistributor components, plus a Distributor data strucure update according 
to
the ACPI 6.0 spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dennis Chen <[email protected]>
---
 EmbeddedPkg/Include/Library/AcpiLib.h    | 20 ++++++++++++++++++++
 MdePkg/Include/IndustryStandard/Acpi60.h |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/EmbeddedPkg/Include/Library/AcpiLib.h 
b/EmbeddedPkg/Include/Library/AcpiLib.h
index 42710fd..e88e57f 100644
--- a/EmbeddedPkg/Include/Library/AcpiLib.h
+++ b/EmbeddedPkg/Include/Library/AcpiLib.h
@@ -38,6 +38,12 @@
     GicDistHwId, GicDistBase, GicDistVector, EFI_ACPI_RESERVED_DWORD \
   }
 
+#define EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, 
GicDistVector, GicVersion) \
+  { \
+    EFI_ACPI_6_0_GICD, sizeof (EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE), 
EFI_ACPI_RESERVED_WORD, \
+    GicDistHwId, GicDistBase, GicDistVector, GicVersion \
+  }
+
 // Note the parking protocol is configured by UEFI if required
 #define EFI_ACPI_5_0_GIC_STRUCTURE_INIT(GicId, AcpiCpuId, Flags, PmuIrq, 
GicBase) \
   { \
@@ -54,12 +60,26 @@
     GsivId, GicRBase, Mpidr                                                    
      \
   }
 
+// Note the parking protocol is configured by UEFI if required
+#define EFI_ACPI_6_0_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, 
PmuIrq,    \
+    GicBase, GicVBase, GicHBase, GsivId, GicRBase)                             
      \
+  {                                                                            
      \
+    EFI_ACPI_6_0_GIC, sizeof (EFI_ACPI_6_0_GIC_STRUCTURE), 
EFI_ACPI_RESERVED_WORD,   \
+    GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase,       
      \
+    GsivId, GicRBase, Mpidr                                                    
      \
+  }
+
 #define EFI_ACPI_6_0_GIC_MSI_FRAME_INIT(GicMsiFrameId, PhysicalBaseAddress, 
Flags, SPICount, SPIBase) \
   { \
     EFI_ACPI_6_0_GIC_MSI_FRAME, sizeof (EFI_ACPI_6_0_GIC_MSI_FRAME_STRUCTURE), 
EFI_ACPI_RESERVED_WORD, \
     GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase \
   }
 
+#define EFI_ACPI_6_0_GIC_REDISTRIBUTOR_INIT(RedisRegionAddr, RedisDiscLength) \
+  { \
+    EFI_ACPI_6_0_GICR, sizeof (EFI_ACPI_6_0_GICR_STRUCTURE), 0, 
RedisRegionAddr, RedisDiscLength \
+  }
+
 //
 // SBSA Generic Watchdog
 //
diff --git a/MdePkg/Include/IndustryStandard/Acpi60.h 
b/MdePkg/Include/IndustryStandard/Acpi60.h
index 3dac316..b58574e 100644
--- a/MdePkg/Include/IndustryStandard/Acpi60.h
+++ b/MdePkg/Include/IndustryStandard/Acpi60.h
@@ -532,7 +532,8 @@ typedef struct {
   UINT32  GicId;
   UINT64  PhysicalBaseAddress;
   UINT32  SystemVectorBase;
-  UINT32  Reserved2;
+  UINT8   GicVersion;
+  UINT8   Reserved2[3];
 } EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE;
 
 ///
-- 
1.9.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to