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.web11.6165.1585650921915110329 for ; Tue, 31 Mar 2020 03:35:22 -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 8BB5930E for ; Tue, 31 Mar 2020 03:35:21 -0700 (PDT) Received: from mail-wr1-f46.google.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5D9FC3F52E for ; Tue, 31 Mar 2020 03:35:21 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id m17so25196668wrw.11 for ; Tue, 31 Mar 2020 03:35:21 -0700 (PDT) X-Gm-Message-State: ANhLgQ04oPv9Ngdf4TlIMEyGQ7Bupl2vph6IWvelbAQipPw7JC7kxhhQ yGQcNjBPwwNlh8znIIOzX6aCubYD6ea1akR1HQ6gvw== X-Google-Smtp-Source: ADFU+vuGKXCb6MrW/Rfsays4MeZyHIsLRHJRLZze1UZRiM3tAMb3pNqWXMiRi5UrDWIdO0FN+5MI6/epU8ARsU++Th8= X-Received: by 2002:adf:fdc6:: with SMTP id i6mr20094493wrs.252.1585650916127; Tue, 31 Mar 2020 03:35:16 -0700 (PDT) MIME-Version: 1.0 References: <20200325105252.13905-1-aditya.angadi@arm.com> <20200325105252.13905-3-aditya.angadi@arm.com> In-Reply-To: <20200325105252.13905-3-aditya.angadi@arm.com> From: "Ard Biesheuvel" Date: Tue, 31 Mar 2020 12:35:04 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-platforms][PATCH v3 2/9] Platform/ARM/SgiPkg: move the GIC To: Aditya Angadi Cc: edk2-devel-groups-io , Leif Lindholm Content-Type: text/plain; charset="UTF-8" On Wed, 25 Mar 2020 at 11:53, Aditya Angadi 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. > > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Signed-off-by: Aditya Angadi Reviewed-by: Ard Biesheuvel > --- > 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/Include/SgiAcpiHeader.h | 70 +++++++++++++++++++- > 4 files changed, 72 insertions(+), 191 deletions(-) > > diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc > index 48e7a61478e8..987254928535 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 > * > @@ -14,72 +14,6 @@ > #include > #include > > -// 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/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__ */ > -- > 2.17.1 >