public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ard.biesheuvel@arm.com>
To: devel@edk2.groups.io, aditya.angadi@arm.com
Cc: thomas.abraham@arm.com, leif@nuviainc.com
Subject: Re: [edk2-devel] [edk2-platforms][PATCH v4 2/9] Platform/ARM/Sgi: Move the GIC related ACPI helper macros
Date: Mon, 27 Apr 2020 13:04:17 +0200	[thread overview]
Message-ID: <22a39d98-99fc-beb2-bfa7-e8dfe4c32a1c@arm.com> (raw)
In-Reply-To: <20200414125208.2878-3-aditya.angadi@arm.com>

On 4/14/20 2:52 PM, Aditya Angadi via groups.io wrote:
> Move the ACPI helper macros defines related to GIC structure,
> distributor, redistributor and ITS to SgiAcpiHeader.h as these are
> common across ARM SGI/RD platforms.
> 
> Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>

What else are you changing in Sgi575? Can you split that off?

The easier it is to confirm that the patch does exactly what it says in 
the commit log, the least painful it is to review.


> ---
>   Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc   |  68 +---------
>   Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc   |  68 +---------
>   Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Madt.aslc |  57 +--------
>   Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc     | 130 +++++---------------
>   Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h         |  70 ++++++++++-
>   5 files changed, 103 insertions(+), 290 deletions(-)
> 
> diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc
> index 58378b570b12..cb70394bfe91 100644
> --- a/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc
> +++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc
> @@ -1,7 +1,7 @@
>   /** @file
>   *  Multiple APIC Description Table (MADT)
>   *
> -*  Copyright (c) 2018, ARM Limited. All rights reserved.
> +*  Copyright (c) 2018-2020, ARM Limited. All rights reserved.
>   *
>   *  SPDX-License-Identifier: BSD-2-Clause-Patent
>   *
> @@ -17,72 +17,6 @@
>   #define CORE_CNT   (FixedPcdGet32 (PcdClusterCount) * \
>                       FixedPcdGet32 (PcdCoreCount))
>   
> -// EFI_ACPI_6_2_GIC_STRUCTURE
> -#define EFI_ACPI_6_2_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags,      \
> -  PmuIrq, GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency)           \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GIC,                     /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_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_2_GIC_DISTRIBUTOR_STRUCTURE
> -#define EFI_ACPI_6_2_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase,            \
> -  GicDistVector, GicVersion)                                                   \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GICD,                    /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_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_2_GICR_STRUCTURE
> -#define EFI_ACPI_6_2_GIC_REDISTRIBUTOR_INIT(RedisRegionAddr, RedisDiscLength)  \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GICR,                    /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_GICR_STRUCTURE), /* Length */                         \
> -    EFI_ACPI_RESERVED_WORD,               /* Reserved */                       \
> -    RedisRegionAddr,                      /* DiscoveryRangeBaseAddress */      \
> -    RedisDiscLength                       /* DiscoveryRangeLength */           \
> -  }
> -
> -// EFI_ACPI_6_2_GIC_ITS_STRUCTURE
> -#define EFI_ACPI_6_2_GIC_ITS_INIT(GicItsId, GicItsBase)                        \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GIC_ITS,                 /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_GIC_ITS_STRUCTURE),                                   \
> -    EFI_ACPI_RESERVED_WORD,               /* Reserved */                       \
> -    GicItsId,                             /* GicItsId */                       \
> -    GicItsBase,                           /* PhysicalBaseAddress */            \
> -    EFI_ACPI_RESERVED_DWORD               /* DiscoveryRangeLength */           \
> -  }
> -
>   // Multiple APIC Description Table
>   #pragma pack (1)
>   
> diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc
> index 6312743a479c..05eb78c5616a 100644
> --- a/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc
> +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc
> @@ -1,7 +1,7 @@
>   /** @file
>   *  Multiple APIC Description Table (MADT)
>   *
> -*  Copyright (c) 2018, ARM Limited. All rights reserved.
> +*  Copyright (c) 2018-2020, ARM Limited. All rights reserved.
>   *
>   *  SPDX-License-Identifier: BSD-2-Clause-Patent
>   *
> @@ -17,72 +17,6 @@
>   #define CORE_CNT   (FixedPcdGet32 (PcdClusterCount) * \
>                       FixedPcdGet32 (PcdCoreCount))
>   
> -// EFI_ACPI_6_2_GIC_STRUCTURE
> -#define EFI_ACPI_6_2_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags,      \
> -  PmuIrq, GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency)           \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GIC,                     /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_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_2_GIC_DISTRIBUTOR_STRUCTURE
> -#define EFI_ACPI_6_2_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase,            \
> -  GicDistVector, GicVersion)                                                   \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GICD,                    /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_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_2_GICR_STRUCTURE
> -#define EFI_ACPI_6_2_GIC_REDISTRIBUTOR_INIT(RedisRegionAddr, RedisDiscLength)  \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GICR,                    /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_GICR_STRUCTURE), /* Length */                         \
> -    EFI_ACPI_RESERVED_WORD,               /* Reserved */                       \
> -    RedisRegionAddr,                      /* DiscoveryRangeBaseAddress */      \
> -    RedisDiscLength                       /* DiscoveryRangeLength */           \
> -  }
> -
> -// EFI_ACPI_6_2_GIC_ITS_STRUCTURE
> -#define EFI_ACPI_6_2_GIC_ITS_INIT(GicItsId, GicItsBase)                        \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GIC_ITS,                 /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_GIC_ITS_STRUCTURE),                                   \
> -    EFI_ACPI_RESERVED_WORD,               /* Reserved */                       \
> -    GicItsId,                             /* GicItsId */                       \
> -    GicItsBase,                           /* PhysicalBaseAddress */            \
> -    EFI_ACPI_RESERVED_DWORD               /* DiscoveryRangeLength */           \
> -  }
> -
>   // Multiple APIC Description Table
>   #pragma pack (1)
>   
> diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Madt.aslc
> index d4538233d760..47368931e367 100644
> --- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Madt.aslc
> +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Madt.aslc
> @@ -1,7 +1,7 @@
>   /** @file
>   *  Multiple APIC Description Table (MADT)
>   *
> -*  Copyright (c) 2019, ARM Limited. All rights reserved.
> +*  Copyright (c) 2019-2020, ARM Limited. All rights reserved.
>   *
>   *  SPDX-License-Identifier: BSD-2-Clause-Patent
>   *
> @@ -19,61 +19,6 @@
>   
>   #define CHIP_CNT   2
>   
> -// EFI_ACPI_6_2_GIC_STRUCTURE
> -#define EFI_ACPI_6_2_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags,      \
> -  PmuIrq, GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency)           \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GIC,                     /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_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_2_GIC_DISTRIBUTOR_STRUCTURE
> -#define EFI_ACPI_6_2_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase,            \
> -  GicDistVector, GicVersion)                                                   \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GICD,                    /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_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_2_GICR_STRUCTURE
> -#define EFI_ACPI_6_2_GIC_REDISTRIBUTOR_INIT(RedisRegionAddr, RedisDiscLength)  \
> -  {                                                                            \
> -    EFI_ACPI_6_2_GICR,                    /* Type */                           \
> -    sizeof (EFI_ACPI_6_2_GICR_STRUCTURE), /* Length */                         \
> -    EFI_ACPI_RESERVED_WORD,               /* Reserved */                       \
> -    RedisRegionAddr,                      /* DiscoveryRangeBaseAddress */      \
> -    RedisDiscLength                       /* DiscoveryRangeLength */           \
> -  }
> -
>   // Multiple APIC Description Table
>   #pragma pack (1)
>   
> 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),
>   };
>   
>   //
> diff --git a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h
> index 5083dde15dd5..ecb0d4eccf24 100644
> --- a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h
> +++ b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h
> @@ -1,6 +1,6 @@
>   /** @file
>   *
> -*  Copyright (c) 2018, ARM Limited. All rights reserved.
> +*  Copyright (c) 2018-2020, ARM Limited. All rights reserved.
>   *
>   *  SPDX-License-Identifier: BSD-2-Clause-Patent
>   *
> @@ -9,6 +9,8 @@
>   #ifndef __SGI_ACPI_HEADER__
>   #define __SGI_ACPI_HEADER__
>   
> +#include <IndustryStandard/Acpi.h>
> +
>   //
>   // ACPI table information used to initialize tables.
>   //
> @@ -32,4 +34,70 @@
>       EFI_ACPI_ARM_CREATOR_REVISION   /* UINT32  CreatorRevision */ \
>     }
>   
> +// EFI_ACPI_6_2_GIC_STRUCTURE
> +#define EFI_ACPI_6_2_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags,      \
> +  PmuIrq, GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency)           \
> +  {                                                                            \
> +    EFI_ACPI_6_2_GIC,                     /* Type */                           \
> +    sizeof (EFI_ACPI_6_2_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_2_GIC_DISTRIBUTOR_STRUCTURE
> +#define EFI_ACPI_6_2_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase,            \
> +  GicDistVector, GicVersion)                                                   \
> +  {                                                                            \
> +    EFI_ACPI_6_2_GICD,                    /* Type */                           \
> +    sizeof (EFI_ACPI_6_2_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_2_GICR_STRUCTURE
> +#define EFI_ACPI_6_2_GIC_REDISTRIBUTOR_INIT(RedisRegionAddr, RedisDiscLength)  \
> +  {                                                                            \
> +    EFI_ACPI_6_2_GICR,                    /* Type */                           \
> +    sizeof (EFI_ACPI_6_2_GICR_STRUCTURE), /* Length */                         \
> +    EFI_ACPI_RESERVED_WORD,               /* Reserved */                       \
> +    RedisRegionAddr,                      /* DiscoveryRangeBaseAddress */      \
> +    RedisDiscLength                       /* DiscoveryRangeLength */           \
> +  }
> +
> +// EFI_ACPI_6_2_GIC_ITS_STRUCTURE
> +#define EFI_ACPI_6_2_GIC_ITS_INIT(GicItsId, GicItsBase)                        \
> +  {                                                                            \
> +    EFI_ACPI_6_2_GIC_ITS,                 /* Type */                           \
> +    sizeof (EFI_ACPI_6_2_GIC_ITS_STRUCTURE),                                   \
> +    EFI_ACPI_RESERVED_WORD,               /* Reserved */                       \
> +    GicItsId,                             /* GicItsId */                       \
> +    GicItsBase,                           /* PhysicalBaseAddress */            \
> +    EFI_ACPI_RESERVED_DWORD               /* DiscoveryRangeLength */           \
> +  }
> +
>   #endif /* __SGI_ACPI_HEADER__ */
> 


  reply	other threads:[~2020-04-27 11:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 12:51 [edk2-platforms][PATCH v4 0/9]Platform/Arm/Sgi: Add platform support for RD-Daniel Aditya Angadi
2020-04-14 12:52 ` [edk2-platforms][PATCH v4 1/9] Platform/ARM/Sgi: Create individual Platform Description File Aditya Angadi
2020-04-27 11:01   ` [edk2-devel] " Ard Biesheuvel
2020-04-27 14:54     ` Aditya Angadi
2020-04-27 14:55       ` Ard Biesheuvel
2020-05-03  4:49         ` Aditya Angadi
2020-04-14 12:52 ` [edk2-platforms][PATCH v4 2/9] Platform/ARM/Sgi: Move the GIC related ACPI helper macros Aditya Angadi
2020-04-27 11:04   ` Ard Biesheuvel [this message]
2020-04-14 12:52 ` [edk2-platforms][PATCH v4 3/9] Platform/ARM/Sgi: Move common platform description to SSDT Aditya Angadi
2020-04-27 11:06   ` [edk2-devel] " Ard Biesheuvel
2020-04-14 12:52 ` [edk2-platforms][PATCH v4 4/9] Platform/ARM/Sgi: Add support for remote numa memory nodes Aditya Angadi
2020-04-28 12:28   ` [edk2-devel] " Ard Biesheuvel
2020-04-28 13:15     ` Aditya Angadi
2020-04-14 12:52 ` [edk2-platforms][PATCH v4 5/9] Platform/ARM/Sgi: Add ACPI tables for Rd-Daniel Config-M Aditya Angadi
2020-04-28 12:30   ` Ard Biesheuvel
2020-04-14 12:52 ` [edk2-platforms][PATCH v4 6/9] Platform/ARM/Sgi: Add initial support for RD-Daniel Config-M platform Aditya Angadi
2020-04-28 12:32   ` Ard Biesheuvel
2020-04-28 13:18     ` Aditya Angadi
2020-04-14 12:52 ` [edk2-platforms][PATCH v4 7/9] Platform/ARM/Sgi: Add ACPI tables for RD-Daniel Config-XLR Aditya Angadi
2020-04-14 12:52 ` [edk2-platforms][PATCH v4 8/9] Platform/ARM/Sgi: Add initial support for RD-Daniel Config-XLR platform Aditya Angadi
2020-04-14 12:52 ` [edk2-platforms][PATCH v4 9/9] Platform/ARM/Sgi: Add SRAT table for RdN1Edge dual-chip platform Aditya Angadi
2020-04-14 13:50 ` [edk2-devel] [edk2-platforms][PATCH v4 0/9]Platform/Arm/Sgi: Add platform support for RD-Daniel Ard Biesheuvel
2020-04-14 14:17   ` Aditya Angadi
2020-04-15  4:34 ` Thomas Abraham
2020-04-22 12:12   ` Aditya Angadi
     [not found]   ` <16082330BC63CB95.30042@groups.io>
2020-04-26 10:12     ` Aditya Angadi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22a39d98-99fc-beb2-bfa7-e8dfe4c32a1c@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox