[edk2-devel] [edk2-platforms][PATCH 2/8] Platform/ARM/SgiPkg: move the GIC related ACPI helper macros
Thomas Abraham
thomas.abraham at arm.com
Mon Mar 16 17:17:19 UTC 2020
On Thu, Mar 12, 2020 at 8:05 PM Aditya Angadi <aditya.angadi at arm.com> 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 at arm.com>
Reviewed-by: Thomas Abraham <thomas.abraham at arm.com>
> ---
> .../ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc | 68 +-----------------
> .../ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc | 68 +-----------------
> .../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 48e7a61478..9872549285 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 <Library/PcdLib.h>
> #include <IndustryStandard/Acpi.h>
>
> -// 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 6312743a47..05eb78c561 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 d4538233d7..47368931e3 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 5083dde15d..ecb0d4eccf 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__ */
> --
> 2.17.1
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#55894): https://edk2.groups.io/g/devel/message/55894
Mute This Topic: https://groups.io/mt/71903343/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list