From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.3402.1587985460404021517 for ; Mon, 27 Apr 2020 04:04:20 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1A8111FB; Mon, 27 Apr 2020 04:04:20 -0700 (PDT) Received: from [192.168.1.81] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 100BE3F73D; Mon, 27 Apr 2020 04:04:18 -0700 (PDT) Subject: Re: [edk2-devel] [edk2-platforms][PATCH v4 2/9] Platform/ARM/Sgi: Move the GIC related ACPI helper macros To: devel@edk2.groups.io, aditya.angadi@arm.com Cc: thomas.abraham@arm.com, leif@nuviainc.com References: <20200414125208.2878-1-aditya.angadi@arm.com> <20200414125208.2878-3-aditya.angadi@arm.com> From: "Ard Biesheuvel" Message-ID: <22a39d98-99fc-beb2-bfa7-e8dfe4c32a1c@arm.com> Date: Mon, 27 Apr 2020 13:04:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200414125208.2878-3-aditya.angadi@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 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 > + > // > // 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__ */ >