:p
atchew
Login
This patch series provides the following updates: - The patches 1 & 2 add the new fields introduced in MADT (APIC table) by ACPI 6.5 and the patch 7/11 updates the Acpiview MADT parser accordingly. - The patches 3, 4 & 5 adds TRBE support to the MADT table generator in DynamicTablesPkg. - Patch 6/11 updates the FADT ACPI revision to 6.5. - The patches 8, 9 & 10 add support to generate ETE device nodes. - The last patch series fixes a bug wherein the CPC token was incorrectly referenced. The changes can be seen at: https://github.com/samimujawar/edk2/tree/2620_ete_dev_fvp_v1 Sami Mujawar (11): MdePkg: MADT: Add Online capable flag in GICC MdePkg: MADT: Add TRBE interrupt to GICC DynamicTablesPkg: Add TRBE interrupt to GICC object DynamicTablesPkg: Add TRBE interrupt to GICC object parser DynamicTablesPkg: Update MADT generator for ACPI 6.5 DynamicTablesPkg: Update FADT generator to ACPI 6.5 ShellPkg: Acpiview: Update MADT parser for TRBE interrupt DynamicTablesPkg: Add an ET info object to Arm namespace DynamicTablesPkg: Add an ET info object parser DynamicTablesPkg: Add ETE device to CPU node in AML DynamicTablesPkg: Fix referencing of CPC token DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 32 +++- DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c | 108 +++++------ DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 83 +++++---- DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c | 188 +++++++++++++++++++- DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h | 11 +- DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c | 11 +- MdePkg/Include/IndustryStandard/Acpi65.h | 4 +- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c | 48 ++++- 8 files changed, 386 insertions(+), 99 deletions(-) -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107239): https://edk2.groups.io/g/devel/message/107239 Mute This Topic: https://groups.io/mt/100347390/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
Bugzilla: 3706 'Code First - MADT GICC new flags' On ARM systems physical CPU hotplug is not supported. All CPUs are considered present and this is true throughout the system uptime. The ECR 2285 introduces a new 'online-capable' flag in the GICC structure flags in ACPI 6.5, to signal firmware policy (CPU is not enabled but it can be enabled and onlined). This enables OSPM to support virtual CPU hotplug (on virtual platforms for instance). This ECR also updates the MADT table revision to 6 to reflect the ACPI 6.5 changes. Therefore, update the MADT table revision to match the value as specified in ACPI 6.5. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- MdePkg/Include/IndustryStandard/Acpi65.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MdePkg/Include/IndustryStandard/Acpi65.h b/MdePkg/Include/IndustryStandard/Acpi65.h index XXXXXXX..XXXXXXX 100644 --- a/MdePkg/Include/IndustryStandard/Acpi65.h +++ b/MdePkg/Include/IndustryStandard/Acpi65.h @@ -XXX,XX +XXX,XX @@ ACPI 6.5 definitions from the ACPI Specification Revision 6.5 Aug, 2022. Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.<BR> - Copyright (c) 2019 - 2021, ARM Ltd. All rights reserved.<BR> + Copyright (c) 2019 - 2023, ARM Ltd. All rights reserved.<BR> Copyright (c) 2023, Loongson Technology Corporation Limited. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent @@ -XXX,XX +XXX,XX @@ typedef struct { #define EFI_ACPI_6_5_GIC_ENABLED BIT0 #define EFI_ACPI_6_5_PERFORMANCE_INTERRUPT_MODEL BIT1 #define EFI_ACPI_6_5_VGIC_MAINTENANCE_INTERRUPT_MODE_FLAGS BIT2 +#define EFI_ACPI_6_5_GIC_ONLINE_CAPABLE BIT3 /// /// GIC Distributor Structure -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107231): https://edk2.groups.io/g/devel/message/107231 Mute This Topic: https://groups.io/mt/100347373/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The ASWG ECR 2303 introduces a new field 'TRBE interrupt' to GICC structure in ACPI 6.5. The Trace Buffer Extension (TRBE) interrupt is a Processor Private interrupt (PPI) and is used to specify a platform-specific interrupt to signal TRBE events. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- MdePkg/Include/IndustryStandard/Acpi65.h | 1 + 1 file changed, 1 insertion(+) diff --git a/MdePkg/Include/IndustryStandard/Acpi65.h b/MdePkg/Include/IndustryStandard/Acpi65.h index XXXXXXX..XXXXXXX 100644 --- a/MdePkg/Include/IndustryStandard/Acpi65.h +++ b/MdePkg/Include/IndustryStandard/Acpi65.h @@ -XXX,XX +XXX,XX @@ typedef struct { UINT8 ProcessorPowerEfficiencyClass; UINT8 Reserved2; UINT16 SpeOverflowInterrupt; + UINT16 TrbeInterrupt; } EFI_ACPI_6_5_GIC_STRUCTURE; /// -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107228): https://edk2.groups.io/g/devel/message/107228 Mute This Topic: https://groups.io/mt/100347370/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
ACPI 6.5 introduces a new filed to the MADT GICC structure to specify the Trace Buffer Extension (TRBE) interrupt. The TRBE interrupt is a Processor Private interrupt (PPI) and is used to specify a platform-specific interrupt to signal TRBE events. Therefore, update the CM_ARM_GICC_INFO to reflect the addition of the TRBE interrupt field. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -XXX,XX +XXX,XX @@ typedef struct CmArmGicCInfo { i.e. a token referencing a CM_ARM_CPC_INFO object. */ CM_OBJECT_TOKEN CpcToken; + + /** Trace Buffer Extension interrupt GSIV. Zero if + unsupported by this processor. This field was introduced in + ACPI 6.5 (MADT revision 6) and is therefore ignored when + generating MADT revision 5 or lower. + */ + UINT16 TrbeInterrupt; } CM_ARM_GICC_INFO; /** A structure that describes the -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107235): https://edk2.groups.io/g/devel/message/107235 Mute This Topic: https://groups.io/mt/100347385/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
ACPI 6.5 introduces a new filed to the MADT GICC structure to specify the Trace Buffer Extension (TRBE) interrupt. The TRBE interrupt is a Processor Private interrupt (PPI) and is used to specify a platform-specific interrupt to signal TRBE events. This field has already been added to the CM_ARM_GICC_INFO structure in a previous patch. Therefore, update the Configuration Manager Object Parser to reflect the addition of the TRBE interrupt field. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c @@ -XXX,XX +XXX,XX @@ STATIC CONST CM_OBJ_PARSER CmArmGicCInfoParser[] = { { "ProximityDomain", 4, "0x%x", NULL }, { "ClockDomain", 4, "0x%x", NULL }, { "AffinityFlags", 4, "0x%x", NULL }, - { "CpcToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL } + { "CpcToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, + { "TRBEInterrupt", 2, "0x%x", NULL } }; /** A parser for EArmObjGicDInfo. -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107232): https://edk2.groups.io/g/devel/message/107232 Mute This Topic: https://groups.io/mt/100347374/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The ACPI 6.5 specification updates the MADT table to add a new field to GICC for specifying the TRBE interrupt and also adds support for Online Capable flag to the GICC flags. The Online Capable flags should be passed transparently through as specified in the CM_ARM_GICC_INFO.Flags field and only require the MADT table revision to be setup to 6 to reflect the ACPI 6.5 specification. The TRBE field needs to be appropriately setup in the GICC structure. Therefore, update the MADT generator to reflect the above updates required for supporting ACPI 6.5 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 83 +++++++++++--------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c @@ -XXX,XX +XXX,XX @@ /** @file MADT Table Generator - Copyright (c) 2017 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2017 - 2023, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): - - ACPI 6.3 Specification - January 2019 + - ACPI 6.5 Specification - Aug 29, 2022 **/ @@ -XXX,XX +XXX,XX @@ GET_OBJECT_LIST ( ); /** This function updates the GIC CPU Interface Information in the - EFI_ACPI_6_3_GIC_STRUCTURE structure. + EFI_ACPI_6_5_GIC_STRUCTURE structure. @param [in] Gicc Pointer to GIC CPU Interface structure. @param [in] GicCInfo Pointer to the GIC CPU Interface Information. @@ -XXX,XX +XXX,XX @@ GET_OBJECT_LIST ( STATIC VOID AddGICC ( - IN EFI_ACPI_6_3_GIC_STRUCTURE *CONST Gicc, + IN EFI_ACPI_6_5_GIC_STRUCTURE *CONST Gicc, IN CONST CM_ARM_GICC_INFO *CONST GicCInfo, IN CONST UINT8 MadtRev ) @@ -XXX,XX +XXX,XX @@ AddGICC ( ASSERT (GicCInfo != NULL); // UINT8 Type - Gicc->Type = EFI_ACPI_6_3_GIC; + Gicc->Type = EFI_ACPI_6_5_GIC; // UINT8 Length - Gicc->Length = sizeof (EFI_ACPI_6_3_GIC_STRUCTURE); + Gicc->Length = sizeof (EFI_ACPI_6_5_GIC_STRUCTURE); // UINT16 Reserved Gicc->Reserved = EFI_ACPI_RESERVED_WORD; @@ -XXX,XX +XXX,XX @@ AddGICC ( // in EFI_ACPI_6_2_GIC_STRUCTURE. Gicc->SpeOverflowInterrupt = 0; } + + // UINT16 TrbeInterrupt + if (MadtRev > EFI_ACPI_6_4_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) { + Gicc->TrbeInterrupt = GicCInfo->TrbeInterrupt; + } else { + // Setting TrbeInterrupt to 0 ensures backward compatibility with + // ACPI 6.4 + Gicc->SpeOverflowInterrupt = 0; + } } /** @@ -XXX,XX +XXX,XX @@ IsAcpiUidEqual ( STATIC EFI_STATUS AddGICCList ( - IN EFI_ACPI_6_3_GIC_STRUCTURE *Gicc, + IN EFI_ACPI_6_5_GIC_STRUCTURE *Gicc, IN CONST CM_ARM_GICC_INFO *GicCInfo, IN UINT32 GicCCount, IN CONST UINT8 MadtRev @@ -XXX,XX +XXX,XX @@ AddGICCList ( STATIC VOID AddGICD ( - EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE *CONST Gicd, + EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE *CONST Gicd, CONST CM_ARM_GICD_INFO *CONST GicDInfo ) { @@ -XXX,XX +XXX,XX @@ AddGICD ( ASSERT (GicDInfo != NULL); // UINT8 Type - Gicd->Type = EFI_ACPI_6_3_GICD; + Gicd->Type = EFI_ACPI_6_5_GICD; // UINT8 Length - Gicd->Length = sizeof (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE); + Gicd->Length = sizeof (EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE); // UINT16 Reserved Gicd->Reserved1 = EFI_ACPI_RESERVED_WORD; // UINT32 Identifier @@ -XXX,XX +XXX,XX @@ AddGICD ( STATIC VOID AddGICMsiFrame ( - IN EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE *CONST GicMsiFrame, + IN EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE *CONST GicMsiFrame, IN CONST CM_ARM_GIC_MSI_FRAME_INFO *CONST GicMsiFrameInfo ) { ASSERT (GicMsiFrame != NULL); ASSERT (GicMsiFrameInfo != NULL); - GicMsiFrame->Type = EFI_ACPI_6_3_GIC_MSI_FRAME; - GicMsiFrame->Length = sizeof (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE); + GicMsiFrame->Type = EFI_ACPI_6_5_GIC_MSI_FRAME; + GicMsiFrame->Length = sizeof (EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE); GicMsiFrame->Reserved1 = EFI_ACPI_RESERVED_WORD; GicMsiFrame->GicMsiFrameId = GicMsiFrameInfo->GicMsiFrameId; GicMsiFrame->PhysicalBaseAddress = GicMsiFrameInfo->PhysicalBaseAddress; @@ -XXX,XX +XXX,XX @@ AddGICMsiFrame ( STATIC VOID AddGICMsiFrameInfoList ( - IN EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE *GicMsiFrame, + IN EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE *GicMsiFrame, IN CONST CM_ARM_GIC_MSI_FRAME_INFO *GicMsiFrameInfo, IN UINT32 GicMsiFrameCount ) @@ -XXX,XX +XXX,XX @@ AddGICMsiFrameInfoList ( STATIC VOID AddGICRedistributor ( - IN EFI_ACPI_6_3_GICR_STRUCTURE *CONST Gicr, + IN EFI_ACPI_6_5_GICR_STRUCTURE *CONST Gicr, IN CONST CM_ARM_GIC_REDIST_INFO *CONST GicRedistributorInfo ) { ASSERT (Gicr != NULL); ASSERT (GicRedistributorInfo != NULL); - Gicr->Type = EFI_ACPI_6_3_GICR; - Gicr->Length = sizeof (EFI_ACPI_6_3_GICR_STRUCTURE); + Gicr->Type = EFI_ACPI_6_5_GICR; + Gicr->Length = sizeof (EFI_ACPI_6_5_GICR_STRUCTURE); Gicr->Reserved = EFI_ACPI_RESERVED_WORD; Gicr->DiscoveryRangeBaseAddress = GicRedistributorInfo->DiscoveryRangeBaseAddress; @@ -XXX,XX +XXX,XX @@ AddGICRedistributor ( STATIC VOID AddGICRedistributorList ( - IN EFI_ACPI_6_3_GICR_STRUCTURE *Gicr, + IN EFI_ACPI_6_5_GICR_STRUCTURE *Gicr, IN CONST CM_ARM_GIC_REDIST_INFO *GicRInfo, IN UINT32 GicRCount ) @@ -XXX,XX +XXX,XX @@ AddGICRedistributorList ( STATIC VOID AddGICInterruptTranslationService ( - IN EFI_ACPI_6_3_GIC_ITS_STRUCTURE *CONST GicIts, + IN EFI_ACPI_6_5_GIC_ITS_STRUCTURE *CONST GicIts, IN CONST CM_ARM_GIC_ITS_INFO *CONST GicItsInfo ) { ASSERT (GicIts != NULL); ASSERT (GicItsInfo != NULL); - GicIts->Type = EFI_ACPI_6_3_GIC_ITS; - GicIts->Length = sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE); + GicIts->Type = EFI_ACPI_6_5_GIC_ITS; + GicIts->Length = sizeof (EFI_ACPI_6_5_GIC_ITS_STRUCTURE); GicIts->Reserved = EFI_ACPI_RESERVED_WORD; GicIts->GicItsId = GicItsInfo->GicItsId; GicIts->PhysicalBaseAddress = GicItsInfo->PhysicalBaseAddress; @@ -XXX,XX +XXX,XX @@ AddGICInterruptTranslationService ( STATIC VOID AddGICItsList ( - IN EFI_ACPI_6_3_GIC_ITS_STRUCTURE *GicIts, + IN EFI_ACPI_6_5_GIC_ITS_STRUCTURE *GicIts, IN CONST CM_ARM_GIC_ITS_INFO *GicItsInfo, IN UINT32 GicItsCount ) @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( UINT32 GicRedistOffset; UINT32 GicItsOffset; - EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt; + EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt; ASSERT (This != NULL); ASSERT (AcpiTableInfo != NULL); @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( goto error_handler; } - TableSize = sizeof (EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER); + TableSize = sizeof (EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER); GicCOffset = TableSize; - TableSize += (sizeof (EFI_ACPI_6_3_GIC_STRUCTURE) * GicCCount); + TableSize += (sizeof (EFI_ACPI_6_5_GIC_STRUCTURE) * GicCCount); GicDOffset = TableSize; - TableSize += (sizeof (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE) * GicDCount); + TableSize += (sizeof (EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE) * GicDCount); GicMSIOffset = TableSize; - TableSize += (sizeof (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE) * GicMSICount); + TableSize += (sizeof (EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE) * GicMSICount); GicRedistOffset = TableSize; - TableSize += (sizeof (EFI_ACPI_6_3_GICR_STRUCTURE) * GicRedistCount); + TableSize += (sizeof (EFI_ACPI_6_5_GICR_STRUCTURE) * GicRedistCount); GicItsOffset = TableSize; - TableSize += (sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE) * GicItsCount); + TableSize += (sizeof (EFI_ACPI_6_5_GIC_ITS_STRUCTURE) * GicItsCount); // Allocate the Buffer for MADT table *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize); @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( goto error_handler; } - Madt = (EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *)*Table; + Madt = (EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *)*Table; DEBUG (( DEBUG_INFO, @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( } Status = AddGICCList ( - (EFI_ACPI_6_3_GIC_STRUCTURE *)((UINT8 *)Madt + GicCOffset), + (EFI_ACPI_6_5_GIC_STRUCTURE *)((UINT8 *)Madt + GicCOffset), GicCInfo, GicCCount, Madt->Header.Revision @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( } AddGICD ( - (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE *)((UINT8 *)Madt + GicDOffset), + (EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE *)((UINT8 *)Madt + GicDOffset), GicDInfo ); if (GicMSICount != 0) { AddGICMsiFrameInfoList ( - (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE *)((UINT8 *)Madt + GicMSIOffset), + (EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE *)((UINT8 *)Madt + GicMSIOffset), GicMSIInfo, GicMSICount ); @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( if (GicRedistCount != 0) { AddGICRedistributorList ( - (EFI_ACPI_6_3_GICR_STRUCTURE *)((UINT8 *)Madt + GicRedistOffset), + (EFI_ACPI_6_5_GICR_STRUCTURE *)((UINT8 *)Madt + GicRedistOffset), GicRedistInfo, GicRedistCount ); @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( if (GicItsCount != 0) { AddGICItsList ( - (EFI_ACPI_6_3_GIC_ITS_STRUCTURE *)((UINT8 *)Madt + GicItsOffset), + (EFI_ACPI_6_5_GIC_ITS_STRUCTURE *)((UINT8 *)Madt + GicItsOffset), GicItsInfo, GicItsCount ); @@ -XXX,XX +XXX,XX @@ ACPI_TABLE_GENERATOR MadtGenerator = { // Generator Description L"ACPI.STD.MADT.GENERATOR", // ACPI Table Signature - EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, // ACPI Table Revision supported by this Generator - EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, + EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, // Minimum supported ACPI Table Revision EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, // Creator ID -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107237): https://edk2.groups.io/g/devel/message/107237 Mute This Topic: https://groups.io/mt/100347387/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The ACPI 6.5 specification updates the minor revision of the FADT table to 5. Therefore, update the FADT generator to setup the minor revision for ACPI 6.5. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c | 108 ++++++++++---------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c @@ -XXX,XX +XXX,XX @@ /** @file FADT Table Generator - Copyright (c) 2017 - 2022, Arm Limited. All rights reserved. + Copyright (c) 2017 - 2023, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): - - ACPI 6.4 Specification, January 2021 + - ACPI 6.5 Specification, Aug 29, 2022 **/ @@ -XXX,XX +XXX,XX @@ Requirements: /** This macro defines the FADT flag options for ARM Platforms. */ -#define FADT_FLAGS (EFI_ACPI_6_4_HW_REDUCED_ACPI | \ - EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE) +#define FADT_FLAGS (EFI_ACPI_6_5_HW_REDUCED_ACPI | \ + EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE) /** This macro defines the valid mask for the FADT flag option if HW_REDUCED_ACPI flag in the table is set. @@ -XXX,XX +XXX,XX @@ Requirements: 22-31 (reserved). Valid bits are: - EFI_ACPI_6_4_WBINVD BIT0 - EFI_ACPI_6_4_PWR_BUTTON BIT4 - EFI_ACPI_6_4_SLP_BUTTON BIT5 - EFI_ACPI_6_4_FIX_RTC BIT6 - EFI_ACPI_6_4_DCK_CAP BIT9 - EFI_ACPI_6_4_RESET_REG_SUP BIT10 - EFI_ACPI_6_4_SEALED_CASE BIT11 - EFI_ACPI_6_4_HEADLESS BIT12 - EFI_ACPI_6_4_USE_PLATFORM_CLOCK BIT15 - EFI_ACPI_6_4_FORCE_APIC_CLUSTER_MODEL BIT18 - EFI_ACPI_6_4_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19 - EFI_ACPI_6_4_HW_REDUCED_ACPI BIT20 - EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE BIT21 + EFI_ACPI_6_5_WBINVD BIT0 + EFI_ACPI_6_5_PWR_BUTTON BIT4 + EFI_ACPI_6_5_SLP_BUTTON BIT5 + EFI_ACPI_6_5_FIX_RTC BIT6 + EFI_ACPI_6_5_DCK_CAP BIT9 + EFI_ACPI_6_5_RESET_REG_SUP BIT10 + EFI_ACPI_6_5_SEALED_CASE BIT11 + EFI_ACPI_6_5_HEADLESS BIT12 + EFI_ACPI_6_5_USE_PLATFORM_CLOCK BIT15 + EFI_ACPI_6_5_FORCE_APIC_CLUSTER_MODEL BIT18 + EFI_ACPI_6_5_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19 + EFI_ACPI_6_5_HW_REDUCED_ACPI BIT20 + EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE BIT21 */ #define VALID_HARDWARE_REDUCED_FLAG_MASK ( \ - EFI_ACPI_6_4_WBINVD | \ - EFI_ACPI_6_4_PWR_BUTTON | \ - EFI_ACPI_6_4_SLP_BUTTON | \ - EFI_ACPI_6_4_FIX_RTC | \ - EFI_ACPI_6_4_DCK_CAP | \ - EFI_ACPI_6_4_RESET_REG_SUP | \ - EFI_ACPI_6_4_SEALED_CASE | \ - EFI_ACPI_6_4_HEADLESS | \ - EFI_ACPI_6_4_USE_PLATFORM_CLOCK | \ - EFI_ACPI_6_4_FORCE_APIC_CLUSTER_MODEL | \ - EFI_ACPI_6_4_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \ - EFI_ACPI_6_4_HW_REDUCED_ACPI | \ - EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE) + EFI_ACPI_6_5_WBINVD | \ + EFI_ACPI_6_5_PWR_BUTTON | \ + EFI_ACPI_6_5_SLP_BUTTON | \ + EFI_ACPI_6_5_FIX_RTC | \ + EFI_ACPI_6_5_DCK_CAP | \ + EFI_ACPI_6_5_RESET_REG_SUP | \ + EFI_ACPI_6_5_SEALED_CASE | \ + EFI_ACPI_6_5_HEADLESS | \ + EFI_ACPI_6_5_USE_PLATFORM_CLOCK | \ + EFI_ACPI_6_5_FORCE_APIC_CLUSTER_MODEL | \ + EFI_ACPI_6_5_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \ + EFI_ACPI_6_5_HW_REDUCED_ACPI | \ + EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE) #pragma pack(1) -/** The AcpiFadt is a template EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE +/** The AcpiFadt is a template EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE structure used for generating the FADT Table. Note: fields marked with "{Template}" will be updated dynamically. */ STATIC -EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = { +EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = { ACPI_HEADER ( - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE, - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_REVISION + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE, + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_REVISION ), // UINT32 FirmwareCtrl 0, @@ -XXX,XX +XXX,XX @@ EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = { // UINT8 Reserved0 EFI_ACPI_RESERVED_BYTE, // UINT8 PreferredPmProfile - EFI_ACPI_6_4_PM_PROFILE_UNSPECIFIED, // {Template}: Power Management Profile + EFI_ACPI_6_5_PM_PROFILE_UNSPECIFIED, // {Template}: Power Management Profile // UINT16 SciInt 0, // UINT32 SmiCmd @@ -XXX,XX +XXX,XX @@ EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = { 0, // UINT32 Flags FADT_FLAGS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE ResetReg + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE ResetReg NULL_GAS, // UINT8 ResetValue 0, // UINT16 ArmBootArch - EFI_ACPI_6_4_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags + EFI_ACPI_6_5_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags // UINT8 MinorRevision - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, // {Template} + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, // {Template} // UINT64 XFirmwareCtrl 0, // UINT64 XDsdt 0, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XGpe0Blk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XGpe0Blk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XGpe1Blk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XGpe1Blk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE SleepControlReg + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE SleepControlReg NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE SleepStatusReg + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE SleepStatusReg NULL_GAS, // UINT64 HypervisorVendorIdentity EFI_ACPI_RESERVED_QWORD // {Template}: Hypervisor Vendor ID @@ -XXX,XX +XXX,XX @@ BuildFadtTable ( This, (EFI_ACPI_DESCRIPTION_HEADER *)&AcpiFadt, AcpiTableInfo, - sizeof (EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE) + sizeof (EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE) ); if (EFI_ERROR (Status)) { DEBUG (( @@ -XXX,XX +XXX,XX @@ BuildFadtTable ( if (((AcpiTableInfo->MinorRevision & 0xF) >= EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION) && ((AcpiTableInfo->MinorRevision & 0xF) <= - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION)) + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION)) { AcpiFadt.MinorVersion = AcpiTableInfo->MinorRevision; } else { @@ -XXX,XX +XXX,XX @@ BuildFadtTable ( "WARNING: FADT: Unsupported FADT Minor Revision 0x%x specified, " \ "defaulting to FADT Minor Revision 0x%x\n", AcpiTableInfo->MinorRevision, - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION )); } } @@ -XXX,XX +XXX,XX @@ ACPI_TABLE_GENERATOR FadtGenerator = { // Generator Description L"ACPI.STD.FADT.GENERATOR", // ACPI Table Signature - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, // ACPI Table Revision supported by this Generator - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, // Minimum supported ACPI Table Revision EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, // Creator ID -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107236): https://edk2.groups.io/g/devel/message/107236 Mute This Topic: https://groups.io/mt/100347386/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
ACPI 6.5 introduces a new filed to the MADT GICC structure to specify the TRBE interrupt. The TRBE interrupt is a Processor Private interrupt (PPI) and is used to specify a platform-specific interrupt to signal TRBE events. Therefore, update the MADT GICC structure parser to parse the new TRBE interrupt field. Also, add validations to check that the TRBE interrupt is within the PPI interrupt range. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c | 48 +++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c index XXXXXXX..XXXXXXX 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c @@ -XXX,XX +XXX,XX @@ /** @file MADT table parser - Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2023, ARM Limited. All rights reserved. Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -XXX,XX +XXX,XX @@ ValidateSpeOverflowInterrupt ( } } +/** + This function validates the TRBE Interrupt in the GICC. + + @param [in] Ptr Pointer to the start of the field data. + @param [in] Context Pointer to context specific information e.g. this + could be a pointer to the ACPI table header. +**/ +STATIC +VOID +EFIAPI +ValidateTrbeInterrupt ( + IN UINT8 *Ptr, + IN VOID *Context + ) +{ + UINT16 TrbeInterrupt; + + TrbeInterrupt = *(UINT16 *)Ptr; + + // SPE not supported by this processor + if (TrbeInterrupt == 0) { + return; + } + + if ((TrbeInterrupt < ARM_PPI_ID_MIN) || + ((TrbeInterrupt > ARM_PPI_ID_MAX) && + (TrbeInterrupt < ARM_PPI_ID_EXTENDED_MIN)) || + (TrbeInterrupt > ARM_PPI_ID_EXTENDED_MAX)) + { + IncrementErrorCount (); + Print ( + L"\nERROR: TRBE Interrupt ID of %d is not in the allowed PPI ID " + L"ranges of %d-%d or %d-%d (for GICv3.1 or later).", + TrbeInterrupt, + ARM_PPI_ID_MIN, + ARM_PPI_ID_MAX, + ARM_PPI_ID_EXTENDED_MIN, + ARM_PPI_ID_EXTENDED_MAX + ); + } +} + /** An ACPI_PARSER array describing the GICC Interrupt Controller Structure. **/ @@ -XXX,XX +XXX,XX @@ STATIC CONST ACPI_PARSER GicCParser[] = { NULL }, { L"Reserved", 1, 77, L"0x%x", NULL, NULL, NULL, NULL }, { L"SPE overflow Interrupt", 2, 78, L"0x%x", NULL, NULL, - ValidateSpeOverflowInterrupt, NULL } + ValidateSpeOverflowInterrupt, NULL }, + { L"TRBE Interrupt", 2, 80, L"0x%x", NULL, NULL, + ValidateTrbeInterrupt, NULL } }; /** -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107233): https://edk2.groups.io/g/devel/message/107233 Mute This Topic: https://groups.io/mt/100347375/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
Add an Embedded Trace (ET) info object that can be used to provide information about Embedded Trace Extension (ETE) or Embedded Trace Module (ETM) available on a platform. Although ETE and ETM share the same HID, ETE has a system register interfaces, unlike ETM which requires memory mapped registers. Since this patch aims to support ETE it does not describe any memory mapped registers. However, required support for ETM can be added in the future. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 25 +++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -XXX,XX +XXX,XX @@ /** @file - Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR> + Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent @@ -XXX,XX +XXX,XX @@ typedef enum ArmObjectID { EArmObjPccSubspaceType3Info, ///< 46 - Pcc Subspace Type 3 Info EArmObjPccSubspaceType4Info, ///< 47 - Pcc Subspace Type 4 Info EArmObjPccSubspaceType5Info, ///< 48 - Pcc Subspace Type 5 Info + EArmObjEtInfo, ///< 49 - Embedded Trace Extension/Module Info EArmObjMax } EARM_OBJECT_ID; @@ -XXX,XX +XXX,XX @@ typedef struct CmArmGicCInfo { generating MADT revision 5 or lower. */ UINT16 TrbeInterrupt; + + /** Optional field: Reference Token for the Embedded Trace device info for + this processing element. + i.e. a token referencing a CM_ARM_ET_INFO object. + */ + CM_OBJECT_TOKEN EtToken; } CM_ARM_GICC_INFO; /** A structure that describes the @@ -XXX,XX +XXX,XX @@ typedef struct CmArmPccSubspaceType5Info { PCC_MAILBOX_REGISTER_INFO ErrorStatusReg; } CM_ARM_PCC_SUBSPACE_TYPE5_INFO; +/** An enum describing the Arm Embedded Trace device type. +*/ +typedef enum ArmEtType { + ArmEtTypeEtm, ///< Embedded Trace module. + ArmEtTypeEte, ///< Embedded Trace Extension. + ArmEtTypeMax +} ARM_ET_TYPE; + +/** A structure that describes the Embedded Trace Extension/Module. + + ID: EArmObjEtInfo +*/ +typedef struct CmArmEtInfo { + ARM_ET_TYPE EtType; +} CM_ARM_ET_INFO; + #pragma pack() #endif // ARM_NAMESPACE_OBJECTS_H_ -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107230): https://edk2.groups.io/g/devel/message/107230 Mute This Topic: https://groups.io/mt/100347372/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
An Embedded Trace (ET) info object is used to provide information about an Embedded Trace Extension (ETE) or an Embedded Trace Module (ETM) available on a platform. The CM_ARM_ET_INFO object has already been added to the Arm namespace objects list by a previous patch. Therefore, update the CM Object parser to add support for parsing the CM_ARM_ET_INFO object. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c @@ -XXX,XX +XXX,XX @@ STATIC CONST CM_OBJ_PARSER CmArmPccSubspaceType5InfoParser[] = { ARRAY_SIZE (CmArmMailboxRegisterInfoParser) }, }; +/** A parser for EArmObjEtInfo. +*/ +STATIC CONST CM_OBJ_PARSER CmArmEtInfo[] = { + { "EtType", sizeof (ARM_ET_TYPE), "0x%x", NULL } +}; + /** A parser for Arm namespace objects. */ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = { @@ -XXX,XX +XXX,XX @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = { ARRAY_SIZE (CmArmPccSubspaceType34InfoParser) }, { "EArmObjPccSubspaceType5Info", CmArmPccSubspaceType5InfoParser, ARRAY_SIZE (CmArmPccSubspaceType5InfoParser) }, + { "EArmObjEtInfo", CmArmEtInfo, + ARRAY_SIZE (CmArmEtInfo) }, { "EArmObjMax", NULL, 0 }, }; -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107229): https://edk2.groups.io/g/devel/message/107229 Mute This Topic: https://groups.io/mt/100347371/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The Coresight Embedded Trace Extension (ETE) feature can be detected by the platform firmware by examining the debug feature register ID_AA64DFR0_EL1.TraceVer field. The platform configuration manager can then describe the ETE by creating CM_ARM_ET_INFO object(s) and referencing these in CM_ARM_GICC_INFO.EtToken. The 'Table 3: Compatible IDs for architected CoreSight components' in the 'ACPI for CoreSight 1.2 Platform Design Document' specifies the HID value for Coresight ETE and CoreSight Embedded Trace Macrocell (ETM) v4.x as ARMH C500. Therefore, update the SsdtCpuTopologyGenerator to add an ETE device to the CPU node in the AML CPU hierarchy so that an OS can utilise this information. Note: Although ETE and ETM share the same HID, ETE has a system register interfaces, unlike ETM which requires memory mapped registers. Since this patch aims to support ETE, the AML description does not describe any memory mapped registers. However, support for ETM can be added in the future. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c | 186 +++++++++++++++++++- DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h | 11 +- 2 files changed, 195 insertions(+), 2 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c @@ -XXX,XX +XXX,XX @@ /** @file SSDT Cpu Topology Table Generator. - Copyright (c) 2021, Arm Limited. All rights reserved.<BR> + Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): - ACPI 6.3 Specification - January 2019 - s8.4 Declaring Processors + - ACPI for CoreSight version 1.2 Platform Design Document + (https://developer.arm.com/documentation/den0067/a/?lang=en) + + @par Glossary: + - ETE - Embedded Trace Extension. + - ETM - Embedded Trace Macrocell. **/ #include <Library/AcpiLib.h> @@ -XXX,XX +XXX,XX @@ Requirements: - EArmObjProcHierarchyInfo (OPTIONAL) along with - EArmObjCmRef (OPTIONAL) - EArmObjLpiInfo (OPTIONAL) + - GetEArmObjEtInfo (OPTIONAL) */ /** This macro expands to a function that retrieves the GIC @@ -XXX,XX +XXX,XX @@ GET_OBJECT_LIST ( CM_ARM_CPC_INFO ); +/** + This macro expands to a function that retrieves the ET device + information from the Configuration Manager. +*/ +GET_OBJECT_LIST ( + EObjNameSpaceArm, + EArmObjEtInfo, + CM_ARM_ET_INFO + ); + /** Initialize the TokenTable. One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO @@ -XXX,XX +XXX,XX @@ CreateAmlCpcNode ( return Status; } +/** Create an embedded trace device and add it to the Cpu Node in the + AML namespace. + + This generates the following ASL code: + Device (E002) + { + Name (_UID, 2) + Name (_HID, "ARMHC500") + } + + Note: Currently we only support generating ETE nodes. Unlike ETM, + ETE has a system register interface and therefore does not need + the MMIO range to be described. + + @param [in] Generator The SSDT Cpu Topology generator. + @param [in] ParentNode Parent node to attach the Cpu node to. + @param [in] CpuName Value used to generate the node name. + @param [out] EtNodePtr If not NULL, return the created Cpu node. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +CreateAmlEtd ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN AML_NODE_HANDLE ParentNode, + IN UINT32 CpuName, + OUT AML_OBJECT_NODE_HANDLE *EtNodePtr OPTIONAL + ) +{ + EFI_STATUS Status; + AML_OBJECT_NODE_HANDLE EtNode; + CHAR8 AslName[AML_NAME_SEG_SIZE + 1]; + + ASSERT (Generator != NULL); + ASSERT (ParentNode != NULL); + + Status = WriteAslName ('E', CpuName, AslName); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status = AmlCodeGenDevice (AslName, ParentNode, &EtNode); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status = AmlCodeGenNameInteger ( + "_UID", + CpuName, + EtNode, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status = AmlCodeGenNameString ( + "_HID", + ACPI_HID_ET_DEVICE, + EtNode, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // If requested, return the handle to the EtNode. + if (EtNodePtr != NULL) { + *EtNodePtr = EtNode; + } + + return Status; +} + +/** Create and add an Embedded trace device to the Cpu Node. + + @param [in] Generator The SSDT Cpu Topology generator. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol Interface. + @param [in] GicCInfo Pointer to the CM_ARM_GICC_INFO object + describing the Cpu. + @param [in] CpuName Value used to generate the CPU node name. + @param [in] Node CPU Node to which the ET device node is + attached. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_UNSUPPORTED Feature Unsupported. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +CreateAmlEtNode ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN CM_ARM_GICC_INFO *GicCInfo, + IN UINT32 CpuName, + IN AML_OBJECT_NODE_HANDLE *Node + ) +{ + EFI_STATUS Status; + CM_ARM_ET_INFO *EtInfo; + + Status = GetEArmObjEtInfo ( + CfgMgrProtocol, + GicCInfo->EtToken, + &EtInfo, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // Currently we only support creation of a ETE Node. + if (EtInfo->EtType != ArmEtTypeEte) { + return EFI_UNSUPPORTED; + } + + Status = CreateAmlEtd ( + Generator, + Node, + CpuName, + NULL + ); + ASSERT_EFI_ERROR (Status); + return Status; +} + /** Create and add an _LPI method to Cpu/Cluster Node. For instance, transform an AML node from: @@ -XXX,XX +XXX,XX @@ CreateAmlCpuFromProcHierarchy ( } } + // Add an Embedded Trace node if present. + if (GicCInfo->EtToken != CM_NULL_TOKEN) { + Status = CreateAmlEtNode ( + Generator, + CfgMgrProtocol, + GicCInfo, + CpuName, + CpuNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } + return Status; } @@ -XXX,XX +XXX,XX @@ CreateTopologyFromGicC ( break; } } + + if (GicCInfo[Index].EtToken != CM_NULL_TOKEN) { + Status = CreateAmlEtNode ( + Generator, + CfgMgrProtocol, + &GicCInfo[Index], + Index, + CpuNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } } // for return Status; diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h @@ -XXX,XX +XXX,XX @@ /** @file SSDT Cpu Topology Table Generator. - Copyright (c) 2021, Arm Limited. All rights reserved.<BR> + Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): - ACPI 6.3 Specification - January 2019 - s8.4 Declaring Processors + - ACPI for CoreSight version 1.2 Platform Design Document + (https://developer.arm.com/documentation/den0067/a/?lang=en) + + @par Glossary: + - ETE - Embedded Trace Extension. + - ETM - Embedded Trace Macrocell. **/ #ifndef SSDT_CPU_TOPOLOGY_GENERATOR_H_ @@ -XXX,XX +XXX,XX @@ /// HID for a processor device. #define ACPI_HID_PROCESSOR_DEVICE "ACPI0007" +/// HID for a ETM/ETE device. +#define ACPI_HID_ET_DEVICE "ARMHC500" + /// HID for a processor container device. #define ACPI_HID_PROCESSOR_CONTAINER_DEVICE "ACPI0010" -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107234): https://edk2.groups.io/g/devel/message/107234 Mute This Topic: https://groups.io/mt/100347383/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The CpcToken has been incorrectly referenced in the CreateTopologyFromGicC() and always points to the CPC token in the first GICC Info object. Therefore, fix this by correctly indexing into the GicCInfo object array. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c @@ -XXX,XX +XXX,XX @@ CreateTopologyFromGicC ( // If a CPC info is associated with the // GicCinfo, create an _CPC method returning them. - if (GicCInfo->CpcToken != CM_NULL_TOKEN) { + if (GicCInfo[Index].CpcToken != CM_NULL_TOKEN) { Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, &GicCInfo[Index], CpuNode); if (EFI_ERROR (Status)) { ASSERT_EFI_ERROR (Status); -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107238): https://edk2.groups.io/g/devel/message/107238 Mute This Topic: https://groups.io/mt/100347389/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
This patch series provides the following updates: - The patches 1 & 2 add the new fields introduced in MADT (APIC table) by ACPI 6.5 and the patch 7/11 updates the Acpiview MADT parser accordingly. - The patches 3, 4 & 5 adds TRBE support to the MADT table generator in DynamicTablesPkg. - Patch 6/11 updates the FADT ACPI revision to 6.5. - The patches 8, 9 & 10 add support to generate ETE device nodes. - The last patch series fixes a bug wherein the CPC token was incorrectly referenced. Updates from v1 patch series: - Fixed issue with setting TRBE interrupt in patch 5/11. The changes can be seen at: https://github.com/samimujawar/edk2/tree/2620_ete_dev_fvp_v2 Sami Mujawar (11): MdePkg: MADT: Add Online capable flag in GICC MdePkg: MADT: Add TRBE interrupt to GICC DynamicTablesPkg: Add TRBE interrupt to GICC object DynamicTablesPkg: Add TRBE interrupt to GICC object parser DynamicTablesPkg: Update MADT generator for ACPI 6.5 DynamicTablesPkg: Update FADT generator to ACPI 6.5 ShellPkg: Acpiview: Update MADT parser for TRBE interrupt DynamicTablesPkg: Add an ET info object to Arm namespace DynamicTablesPkg: Add an ET info object parser DynamicTablesPkg: Add ETE device to CPU node in AML DynamicTablesPkg: Fix referencing of CPC token DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 32 +++- DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c | 108 +++++------ DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 83 +++++---- DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c | 188 +++++++++++++++++++- DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h | 11 +- DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c | 11 +- MdePkg/Include/IndustryStandard/Acpi65.h | 4 +- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c | 48 ++++- 8 files changed, 386 insertions(+), 99 deletions(-) -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108591): https://edk2.groups.io/g/devel/message/108591 Mute This Topic: https://groups.io/mt/101335843/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
Bugzilla: 3706 'Code First - MADT GICC new flags' On ARM systems physical CPU hotplug is not supported. All CPUs are considered present and this is true throughout the system uptime. The ECR 2285 introduces a new 'online-capable' flag in the GICC structure flags in ACPI 6.5, to signal firmware policy (CPU is not enabled but it can be enabled and onlined). This enables OSPM to support virtual CPU hotplug (on virtual platforms for instance). This ECR also updates the MADT table revision to 6 to reflect the ACPI 6.5 changes. Therefore, update the MADT table revision to match the value as specified in ACPI 6.5. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - No code change from v1 patch series. [SAMI] MdePkg/Include/IndustryStandard/Acpi65.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MdePkg/Include/IndustryStandard/Acpi65.h b/MdePkg/Include/IndustryStandard/Acpi65.h index XXXXXXX..XXXXXXX 100644 --- a/MdePkg/Include/IndustryStandard/Acpi65.h +++ b/MdePkg/Include/IndustryStandard/Acpi65.h @@ -XXX,XX +XXX,XX @@ ACPI 6.5 definitions from the ACPI Specification Revision 6.5 Aug, 2022. Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.<BR> - Copyright (c) 2019 - 2021, ARM Ltd. All rights reserved.<BR> + Copyright (c) 2019 - 2023, ARM Ltd. All rights reserved.<BR> Copyright (c) 2023, Loongson Technology Corporation Limited. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent @@ -XXX,XX +XXX,XX @@ typedef struct { #define EFI_ACPI_6_5_GIC_ENABLED BIT0 #define EFI_ACPI_6_5_PERFORMANCE_INTERRUPT_MODEL BIT1 #define EFI_ACPI_6_5_VGIC_MAINTENANCE_INTERRUPT_MODE_FLAGS BIT2 +#define EFI_ACPI_6_5_GIC_ONLINE_CAPABLE BIT3 /// /// GIC Distributor Structure -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108586): https://edk2.groups.io/g/devel/message/108586 Mute This Topic: https://groups.io/mt/101335838/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The ASWG ECR 2303 introduces a new field 'TRBE interrupt' to GICC structure in ACPI 6.5. The Trace Buffer Extension (TRBE) interrupt is a Processor Private interrupt (PPI) and is used to specify a platform-specific interrupt to signal TRBE events. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - No code change from v1 patch series. [SAMI] MdePkg/Include/IndustryStandard/Acpi65.h | 1 + 1 file changed, 1 insertion(+) diff --git a/MdePkg/Include/IndustryStandard/Acpi65.h b/MdePkg/Include/IndustryStandard/Acpi65.h index XXXXXXX..XXXXXXX 100644 --- a/MdePkg/Include/IndustryStandard/Acpi65.h +++ b/MdePkg/Include/IndustryStandard/Acpi65.h @@ -XXX,XX +XXX,XX @@ typedef struct { UINT8 ProcessorPowerEfficiencyClass; UINT8 Reserved2; UINT16 SpeOverflowInterrupt; + UINT16 TrbeInterrupt; } EFI_ACPI_6_5_GIC_STRUCTURE; /// -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108588): https://edk2.groups.io/g/devel/message/108588 Mute This Topic: https://groups.io/mt/101335840/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
ACPI 6.5 introduces a new filed to the MADT GICC structure to specify the Trace Buffer Extension (TRBE) interrupt. The TRBE interrupt is a Processor Private interrupt (PPI) and is used to specify a platform-specific interrupt to signal TRBE events. Therefore, update the CM_ARM_GICC_INFO to reflect the addition of the TRBE interrupt field. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - No code change from v1 patch series. [SAMI] DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -XXX,XX +XXX,XX @@ typedef struct CmArmGicCInfo { i.e. a token referencing a CM_ARM_CPC_INFO object. */ CM_OBJECT_TOKEN CpcToken; + + /** Trace Buffer Extension interrupt GSIV. Zero if + unsupported by this processor. This field was introduced in + ACPI 6.5 (MADT revision 6) and is therefore ignored when + generating MADT revision 5 or lower. + */ + UINT16 TrbeInterrupt; } CM_ARM_GICC_INFO; /** A structure that describes the -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108582): https://edk2.groups.io/g/devel/message/108582 Mute This Topic: https://groups.io/mt/101335834/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
ACPI 6.5 introduces a new filed to the MADT GICC structure to specify the Trace Buffer Extension (TRBE) interrupt. The TRBE interrupt is a Processor Private interrupt (PPI) and is used to specify a platform-specific interrupt to signal TRBE events. This field has already been added to the CM_ARM_GICC_INFO structure in a previous patch. Therefore, update the Configuration Manager Object Parser to reflect the addition of the TRBE interrupt field. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - No code change from v1 patch series. [SAMI] DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c @@ -XXX,XX +XXX,XX @@ STATIC CONST CM_OBJ_PARSER CmArmGicCInfoParser[] = { { "ProximityDomain", 4, "0x%x", NULL }, { "ClockDomain", 4, "0x%x", NULL }, { "AffinityFlags", 4, "0x%x", NULL }, - { "CpcToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL } + { "CpcToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, + { "TRBEInterrupt", 2, "0x%x", NULL } }; /** A parser for EArmObjGicDInfo. -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108583): https://edk2.groups.io/g/devel/message/108583 Mute This Topic: https://groups.io/mt/101335835/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The ACPI 6.5 specification updates the MADT table to add a new field to GICC for specifying the TRBE interrupt and also adds support for Online Capable flag to the GICC flags. The Online Capable flags should be passed transparently through as specified in the CM_ARM_GICC_INFO.Flags field and only require the MADT table revision to be setup to 6 to reflect the ACPI 6.5 specification. The TRBE field needs to be appropriately setup in the GICC structure. Therefore, update the MADT generator to reflect the above updates required for supporting ACPI 6.5 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - TRBE interrupt not set correctly for ACPI 6.4 [Jeshua] - Fixed issue with setting TRBE interrupt [Sami] Ref: https://edk2.groups.io/g/devel/message/107427 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 83 +++++++++++--------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c @@ -XXX,XX +XXX,XX @@ /** @file MADT Table Generator - Copyright (c) 2017 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2017 - 2023, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): - - ACPI 6.3 Specification - January 2019 + - ACPI 6.5 Specification - Aug 29, 2022 **/ @@ -XXX,XX +XXX,XX @@ GET_OBJECT_LIST ( ); /** This function updates the GIC CPU Interface Information in the - EFI_ACPI_6_3_GIC_STRUCTURE structure. + EFI_ACPI_6_5_GIC_STRUCTURE structure. @param [in] Gicc Pointer to GIC CPU Interface structure. @param [in] GicCInfo Pointer to the GIC CPU Interface Information. @@ -XXX,XX +XXX,XX @@ GET_OBJECT_LIST ( STATIC VOID AddGICC ( - IN EFI_ACPI_6_3_GIC_STRUCTURE *CONST Gicc, + IN EFI_ACPI_6_5_GIC_STRUCTURE *CONST Gicc, IN CONST CM_ARM_GICC_INFO *CONST GicCInfo, IN CONST UINT8 MadtRev ) @@ -XXX,XX +XXX,XX @@ AddGICC ( ASSERT (GicCInfo != NULL); // UINT8 Type - Gicc->Type = EFI_ACPI_6_3_GIC; + Gicc->Type = EFI_ACPI_6_5_GIC; // UINT8 Length - Gicc->Length = sizeof (EFI_ACPI_6_3_GIC_STRUCTURE); + Gicc->Length = sizeof (EFI_ACPI_6_5_GIC_STRUCTURE); // UINT16 Reserved Gicc->Reserved = EFI_ACPI_RESERVED_WORD; @@ -XXX,XX +XXX,XX @@ AddGICC ( // in EFI_ACPI_6_2_GIC_STRUCTURE. Gicc->SpeOverflowInterrupt = 0; } + + // UINT16 TrbeInterrupt + if (MadtRev > EFI_ACPI_6_4_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) { + Gicc->TrbeInterrupt = GicCInfo->TrbeInterrupt; + } else { + // Setting TrbeInterrupt to 0 ensures backward compatibility with + // ACPI 6.4 + Gicc->TrbeInterrupt = 0; + } } /** @@ -XXX,XX +XXX,XX @@ IsAcpiUidEqual ( STATIC EFI_STATUS AddGICCList ( - IN EFI_ACPI_6_3_GIC_STRUCTURE *Gicc, + IN EFI_ACPI_6_5_GIC_STRUCTURE *Gicc, IN CONST CM_ARM_GICC_INFO *GicCInfo, IN UINT32 GicCCount, IN CONST UINT8 MadtRev @@ -XXX,XX +XXX,XX @@ AddGICCList ( STATIC VOID AddGICD ( - EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE *CONST Gicd, + EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE *CONST Gicd, CONST CM_ARM_GICD_INFO *CONST GicDInfo ) { @@ -XXX,XX +XXX,XX @@ AddGICD ( ASSERT (GicDInfo != NULL); // UINT8 Type - Gicd->Type = EFI_ACPI_6_3_GICD; + Gicd->Type = EFI_ACPI_6_5_GICD; // UINT8 Length - Gicd->Length = sizeof (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE); + Gicd->Length = sizeof (EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE); // UINT16 Reserved Gicd->Reserved1 = EFI_ACPI_RESERVED_WORD; // UINT32 Identifier @@ -XXX,XX +XXX,XX @@ AddGICD ( STATIC VOID AddGICMsiFrame ( - IN EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE *CONST GicMsiFrame, + IN EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE *CONST GicMsiFrame, IN CONST CM_ARM_GIC_MSI_FRAME_INFO *CONST GicMsiFrameInfo ) { ASSERT (GicMsiFrame != NULL); ASSERT (GicMsiFrameInfo != NULL); - GicMsiFrame->Type = EFI_ACPI_6_3_GIC_MSI_FRAME; - GicMsiFrame->Length = sizeof (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE); + GicMsiFrame->Type = EFI_ACPI_6_5_GIC_MSI_FRAME; + GicMsiFrame->Length = sizeof (EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE); GicMsiFrame->Reserved1 = EFI_ACPI_RESERVED_WORD; GicMsiFrame->GicMsiFrameId = GicMsiFrameInfo->GicMsiFrameId; GicMsiFrame->PhysicalBaseAddress = GicMsiFrameInfo->PhysicalBaseAddress; @@ -XXX,XX +XXX,XX @@ AddGICMsiFrame ( STATIC VOID AddGICMsiFrameInfoList ( - IN EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE *GicMsiFrame, + IN EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE *GicMsiFrame, IN CONST CM_ARM_GIC_MSI_FRAME_INFO *GicMsiFrameInfo, IN UINT32 GicMsiFrameCount ) @@ -XXX,XX +XXX,XX @@ AddGICMsiFrameInfoList ( STATIC VOID AddGICRedistributor ( - IN EFI_ACPI_6_3_GICR_STRUCTURE *CONST Gicr, + IN EFI_ACPI_6_5_GICR_STRUCTURE *CONST Gicr, IN CONST CM_ARM_GIC_REDIST_INFO *CONST GicRedistributorInfo ) { ASSERT (Gicr != NULL); ASSERT (GicRedistributorInfo != NULL); - Gicr->Type = EFI_ACPI_6_3_GICR; - Gicr->Length = sizeof (EFI_ACPI_6_3_GICR_STRUCTURE); + Gicr->Type = EFI_ACPI_6_5_GICR; + Gicr->Length = sizeof (EFI_ACPI_6_5_GICR_STRUCTURE); Gicr->Reserved = EFI_ACPI_RESERVED_WORD; Gicr->DiscoveryRangeBaseAddress = GicRedistributorInfo->DiscoveryRangeBaseAddress; @@ -XXX,XX +XXX,XX @@ AddGICRedistributor ( STATIC VOID AddGICRedistributorList ( - IN EFI_ACPI_6_3_GICR_STRUCTURE *Gicr, + IN EFI_ACPI_6_5_GICR_STRUCTURE *Gicr, IN CONST CM_ARM_GIC_REDIST_INFO *GicRInfo, IN UINT32 GicRCount ) @@ -XXX,XX +XXX,XX @@ AddGICRedistributorList ( STATIC VOID AddGICInterruptTranslationService ( - IN EFI_ACPI_6_3_GIC_ITS_STRUCTURE *CONST GicIts, + IN EFI_ACPI_6_5_GIC_ITS_STRUCTURE *CONST GicIts, IN CONST CM_ARM_GIC_ITS_INFO *CONST GicItsInfo ) { ASSERT (GicIts != NULL); ASSERT (GicItsInfo != NULL); - GicIts->Type = EFI_ACPI_6_3_GIC_ITS; - GicIts->Length = sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE); + GicIts->Type = EFI_ACPI_6_5_GIC_ITS; + GicIts->Length = sizeof (EFI_ACPI_6_5_GIC_ITS_STRUCTURE); GicIts->Reserved = EFI_ACPI_RESERVED_WORD; GicIts->GicItsId = GicItsInfo->GicItsId; GicIts->PhysicalBaseAddress = GicItsInfo->PhysicalBaseAddress; @@ -XXX,XX +XXX,XX @@ AddGICInterruptTranslationService ( STATIC VOID AddGICItsList ( - IN EFI_ACPI_6_3_GIC_ITS_STRUCTURE *GicIts, + IN EFI_ACPI_6_5_GIC_ITS_STRUCTURE *GicIts, IN CONST CM_ARM_GIC_ITS_INFO *GicItsInfo, IN UINT32 GicItsCount ) @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( UINT32 GicRedistOffset; UINT32 GicItsOffset; - EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt; + EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt; ASSERT (This != NULL); ASSERT (AcpiTableInfo != NULL); @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( goto error_handler; } - TableSize = sizeof (EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER); + TableSize = sizeof (EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER); GicCOffset = TableSize; - TableSize += (sizeof (EFI_ACPI_6_3_GIC_STRUCTURE) * GicCCount); + TableSize += (sizeof (EFI_ACPI_6_5_GIC_STRUCTURE) * GicCCount); GicDOffset = TableSize; - TableSize += (sizeof (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE) * GicDCount); + TableSize += (sizeof (EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE) * GicDCount); GicMSIOffset = TableSize; - TableSize += (sizeof (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE) * GicMSICount); + TableSize += (sizeof (EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE) * GicMSICount); GicRedistOffset = TableSize; - TableSize += (sizeof (EFI_ACPI_6_3_GICR_STRUCTURE) * GicRedistCount); + TableSize += (sizeof (EFI_ACPI_6_5_GICR_STRUCTURE) * GicRedistCount); GicItsOffset = TableSize; - TableSize += (sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE) * GicItsCount); + TableSize += (sizeof (EFI_ACPI_6_5_GIC_ITS_STRUCTURE) * GicItsCount); // Allocate the Buffer for MADT table *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize); @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( goto error_handler; } - Madt = (EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *)*Table; + Madt = (EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *)*Table; DEBUG (( DEBUG_INFO, @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( } Status = AddGICCList ( - (EFI_ACPI_6_3_GIC_STRUCTURE *)((UINT8 *)Madt + GicCOffset), + (EFI_ACPI_6_5_GIC_STRUCTURE *)((UINT8 *)Madt + GicCOffset), GicCInfo, GicCCount, Madt->Header.Revision @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( } AddGICD ( - (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE *)((UINT8 *)Madt + GicDOffset), + (EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE *)((UINT8 *)Madt + GicDOffset), GicDInfo ); if (GicMSICount != 0) { AddGICMsiFrameInfoList ( - (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE *)((UINT8 *)Madt + GicMSIOffset), + (EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE *)((UINT8 *)Madt + GicMSIOffset), GicMSIInfo, GicMSICount ); @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( if (GicRedistCount != 0) { AddGICRedistributorList ( - (EFI_ACPI_6_3_GICR_STRUCTURE *)((UINT8 *)Madt + GicRedistOffset), + (EFI_ACPI_6_5_GICR_STRUCTURE *)((UINT8 *)Madt + GicRedistOffset), GicRedistInfo, GicRedistCount ); @@ -XXX,XX +XXX,XX @@ BuildMadtTable ( if (GicItsCount != 0) { AddGICItsList ( - (EFI_ACPI_6_3_GIC_ITS_STRUCTURE *)((UINT8 *)Madt + GicItsOffset), + (EFI_ACPI_6_5_GIC_ITS_STRUCTURE *)((UINT8 *)Madt + GicItsOffset), GicItsInfo, GicItsCount ); @@ -XXX,XX +XXX,XX @@ ACPI_TABLE_GENERATOR MadtGenerator = { // Generator Description L"ACPI.STD.MADT.GENERATOR", // ACPI Table Signature - EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, // ACPI Table Revision supported by this Generator - EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, + EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, // Minimum supported ACPI Table Revision EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, // Creator ID -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108592): https://edk2.groups.io/g/devel/message/108592 Mute This Topic: https://groups.io/mt/101335844/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The ACPI 6.5 specification updates the minor revision of the FADT table to 5. Therefore, update the FADT generator to setup the minor revision for ACPI 6.5. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - No code change from v1 patch series. [SAMI] DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c | 108 ++++++++++---------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c @@ -XXX,XX +XXX,XX @@ /** @file FADT Table Generator - Copyright (c) 2017 - 2022, Arm Limited. All rights reserved. + Copyright (c) 2017 - 2023, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): - - ACPI 6.4 Specification, January 2021 + - ACPI 6.5 Specification, Aug 29, 2022 **/ @@ -XXX,XX +XXX,XX @@ Requirements: /** This macro defines the FADT flag options for ARM Platforms. */ -#define FADT_FLAGS (EFI_ACPI_6_4_HW_REDUCED_ACPI | \ - EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE) +#define FADT_FLAGS (EFI_ACPI_6_5_HW_REDUCED_ACPI | \ + EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE) /** This macro defines the valid mask for the FADT flag option if HW_REDUCED_ACPI flag in the table is set. @@ -XXX,XX +XXX,XX @@ Requirements: 22-31 (reserved). Valid bits are: - EFI_ACPI_6_4_WBINVD BIT0 - EFI_ACPI_6_4_PWR_BUTTON BIT4 - EFI_ACPI_6_4_SLP_BUTTON BIT5 - EFI_ACPI_6_4_FIX_RTC BIT6 - EFI_ACPI_6_4_DCK_CAP BIT9 - EFI_ACPI_6_4_RESET_REG_SUP BIT10 - EFI_ACPI_6_4_SEALED_CASE BIT11 - EFI_ACPI_6_4_HEADLESS BIT12 - EFI_ACPI_6_4_USE_PLATFORM_CLOCK BIT15 - EFI_ACPI_6_4_FORCE_APIC_CLUSTER_MODEL BIT18 - EFI_ACPI_6_4_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19 - EFI_ACPI_6_4_HW_REDUCED_ACPI BIT20 - EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE BIT21 + EFI_ACPI_6_5_WBINVD BIT0 + EFI_ACPI_6_5_PWR_BUTTON BIT4 + EFI_ACPI_6_5_SLP_BUTTON BIT5 + EFI_ACPI_6_5_FIX_RTC BIT6 + EFI_ACPI_6_5_DCK_CAP BIT9 + EFI_ACPI_6_5_RESET_REG_SUP BIT10 + EFI_ACPI_6_5_SEALED_CASE BIT11 + EFI_ACPI_6_5_HEADLESS BIT12 + EFI_ACPI_6_5_USE_PLATFORM_CLOCK BIT15 + EFI_ACPI_6_5_FORCE_APIC_CLUSTER_MODEL BIT18 + EFI_ACPI_6_5_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19 + EFI_ACPI_6_5_HW_REDUCED_ACPI BIT20 + EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE BIT21 */ #define VALID_HARDWARE_REDUCED_FLAG_MASK ( \ - EFI_ACPI_6_4_WBINVD | \ - EFI_ACPI_6_4_PWR_BUTTON | \ - EFI_ACPI_6_4_SLP_BUTTON | \ - EFI_ACPI_6_4_FIX_RTC | \ - EFI_ACPI_6_4_DCK_CAP | \ - EFI_ACPI_6_4_RESET_REG_SUP | \ - EFI_ACPI_6_4_SEALED_CASE | \ - EFI_ACPI_6_4_HEADLESS | \ - EFI_ACPI_6_4_USE_PLATFORM_CLOCK | \ - EFI_ACPI_6_4_FORCE_APIC_CLUSTER_MODEL | \ - EFI_ACPI_6_4_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \ - EFI_ACPI_6_4_HW_REDUCED_ACPI | \ - EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE) + EFI_ACPI_6_5_WBINVD | \ + EFI_ACPI_6_5_PWR_BUTTON | \ + EFI_ACPI_6_5_SLP_BUTTON | \ + EFI_ACPI_6_5_FIX_RTC | \ + EFI_ACPI_6_5_DCK_CAP | \ + EFI_ACPI_6_5_RESET_REG_SUP | \ + EFI_ACPI_6_5_SEALED_CASE | \ + EFI_ACPI_6_5_HEADLESS | \ + EFI_ACPI_6_5_USE_PLATFORM_CLOCK | \ + EFI_ACPI_6_5_FORCE_APIC_CLUSTER_MODEL | \ + EFI_ACPI_6_5_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \ + EFI_ACPI_6_5_HW_REDUCED_ACPI | \ + EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE) #pragma pack(1) -/** The AcpiFadt is a template EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE +/** The AcpiFadt is a template EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE structure used for generating the FADT Table. Note: fields marked with "{Template}" will be updated dynamically. */ STATIC -EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = { +EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = { ACPI_HEADER ( - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE, - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_REVISION + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE, + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_REVISION ), // UINT32 FirmwareCtrl 0, @@ -XXX,XX +XXX,XX @@ EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = { // UINT8 Reserved0 EFI_ACPI_RESERVED_BYTE, // UINT8 PreferredPmProfile - EFI_ACPI_6_4_PM_PROFILE_UNSPECIFIED, // {Template}: Power Management Profile + EFI_ACPI_6_5_PM_PROFILE_UNSPECIFIED, // {Template}: Power Management Profile // UINT16 SciInt 0, // UINT32 SmiCmd @@ -XXX,XX +XXX,XX @@ EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = { 0, // UINT32 Flags FADT_FLAGS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE ResetReg + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE ResetReg NULL_GAS, // UINT8 ResetValue 0, // UINT16 ArmBootArch - EFI_ACPI_6_4_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags + EFI_ACPI_6_5_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags // UINT8 MinorRevision - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, // {Template} + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, // {Template} // UINT64 XFirmwareCtrl 0, // UINT64 XDsdt 0, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XGpe0Blk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XGpe0Blk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XGpe1Blk + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE XGpe1Blk NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE SleepControlReg + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE SleepControlReg NULL_GAS, - // EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE SleepStatusReg + // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE SleepStatusReg NULL_GAS, // UINT64 HypervisorVendorIdentity EFI_ACPI_RESERVED_QWORD // {Template}: Hypervisor Vendor ID @@ -XXX,XX +XXX,XX @@ BuildFadtTable ( This, (EFI_ACPI_DESCRIPTION_HEADER *)&AcpiFadt, AcpiTableInfo, - sizeof (EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE) + sizeof (EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE) ); if (EFI_ERROR (Status)) { DEBUG (( @@ -XXX,XX +XXX,XX @@ BuildFadtTable ( if (((AcpiTableInfo->MinorRevision & 0xF) >= EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION) && ((AcpiTableInfo->MinorRevision & 0xF) <= - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION)) + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION)) { AcpiFadt.MinorVersion = AcpiTableInfo->MinorRevision; } else { @@ -XXX,XX +XXX,XX @@ BuildFadtTable ( "WARNING: FADT: Unsupported FADT Minor Revision 0x%x specified, " \ "defaulting to FADT Minor Revision 0x%x\n", AcpiTableInfo->MinorRevision, - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION )); } } @@ -XXX,XX +XXX,XX @@ ACPI_TABLE_GENERATOR FadtGenerator = { // Generator Description L"ACPI.STD.FADT.GENERATOR", // ACPI Table Signature - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, // ACPI Table Revision supported by this Generator - EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, + EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, // Minimum supported ACPI Table Revision EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, // Creator ID -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108584): https://edk2.groups.io/g/devel/message/108584 Mute This Topic: https://groups.io/mt/101335836/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
ACPI 6.5 introduces a new filed to the MADT GICC structure to specify the TRBE interrupt. The TRBE interrupt is a Processor Private interrupt (PPI) and is used to specify a platform-specific interrupt to signal TRBE events. Therefore, update the MADT GICC structure parser to parse the new TRBE interrupt field. Also, add validations to check that the TRBE interrupt is within the PPI interrupt range. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - No code change from v1 patch series. [SAMI] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c | 48 +++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c index XXXXXXX..XXXXXXX 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c @@ -XXX,XX +XXX,XX @@ /** @file MADT table parser - Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2023, ARM Limited. All rights reserved. Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -XXX,XX +XXX,XX @@ ValidateSpeOverflowInterrupt ( } } +/** + This function validates the TRBE Interrupt in the GICC. + + @param [in] Ptr Pointer to the start of the field data. + @param [in] Context Pointer to context specific information e.g. this + could be a pointer to the ACPI table header. +**/ +STATIC +VOID +EFIAPI +ValidateTrbeInterrupt ( + IN UINT8 *Ptr, + IN VOID *Context + ) +{ + UINT16 TrbeInterrupt; + + TrbeInterrupt = *(UINT16 *)Ptr; + + // SPE not supported by this processor + if (TrbeInterrupt == 0) { + return; + } + + if ((TrbeInterrupt < ARM_PPI_ID_MIN) || + ((TrbeInterrupt > ARM_PPI_ID_MAX) && + (TrbeInterrupt < ARM_PPI_ID_EXTENDED_MIN)) || + (TrbeInterrupt > ARM_PPI_ID_EXTENDED_MAX)) + { + IncrementErrorCount (); + Print ( + L"\nERROR: TRBE Interrupt ID of %d is not in the allowed PPI ID " + L"ranges of %d-%d or %d-%d (for GICv3.1 or later).", + TrbeInterrupt, + ARM_PPI_ID_MIN, + ARM_PPI_ID_MAX, + ARM_PPI_ID_EXTENDED_MIN, + ARM_PPI_ID_EXTENDED_MAX + ); + } +} + /** An ACPI_PARSER array describing the GICC Interrupt Controller Structure. **/ @@ -XXX,XX +XXX,XX @@ STATIC CONST ACPI_PARSER GicCParser[] = { NULL }, { L"Reserved", 1, 77, L"0x%x", NULL, NULL, NULL, NULL }, { L"SPE overflow Interrupt", 2, 78, L"0x%x", NULL, NULL, - ValidateSpeOverflowInterrupt, NULL } + ValidateSpeOverflowInterrupt, NULL }, + { L"TRBE Interrupt", 2, 80, L"0x%x", NULL, NULL, + ValidateTrbeInterrupt, NULL } }; /** -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108590): https://edk2.groups.io/g/devel/message/108590 Mute This Topic: https://groups.io/mt/101335842/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
Add an Embedded Trace (ET) info object that can be used to provide information about Embedded Trace Extension (ETE) or Embedded Trace Module (ETM) available on a platform. Although ETE and ETM share the same HID, ETE has a system register interfaces, unlike ETM which requires memory mapped registers. Since this patch aims to support ETE it does not describe any memory mapped registers. However, required support for ETM can be added in the future. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - No code change from v1 patch series. [SAMI] DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 25 +++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -XXX,XX +XXX,XX @@ /** @file - Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR> + Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent @@ -XXX,XX +XXX,XX @@ typedef enum ArmObjectID { EArmObjPccSubspaceType3Info, ///< 46 - Pcc Subspace Type 3 Info EArmObjPccSubspaceType4Info, ///< 47 - Pcc Subspace Type 4 Info EArmObjPccSubspaceType5Info, ///< 48 - Pcc Subspace Type 5 Info + EArmObjEtInfo, ///< 49 - Embedded Trace Extension/Module Info EArmObjMax } EARM_OBJECT_ID; @@ -XXX,XX +XXX,XX @@ typedef struct CmArmGicCInfo { generating MADT revision 5 or lower. */ UINT16 TrbeInterrupt; + + /** Optional field: Reference Token for the Embedded Trace device info for + this processing element. + i.e. a token referencing a CM_ARM_ET_INFO object. + */ + CM_OBJECT_TOKEN EtToken; } CM_ARM_GICC_INFO; /** A structure that describes the @@ -XXX,XX +XXX,XX @@ typedef struct CmArmPccSubspaceType5Info { PCC_MAILBOX_REGISTER_INFO ErrorStatusReg; } CM_ARM_PCC_SUBSPACE_TYPE5_INFO; +/** An enum describing the Arm Embedded Trace device type. +*/ +typedef enum ArmEtType { + ArmEtTypeEtm, ///< Embedded Trace module. + ArmEtTypeEte, ///< Embedded Trace Extension. + ArmEtTypeMax +} ARM_ET_TYPE; + +/** A structure that describes the Embedded Trace Extension/Module. + + ID: EArmObjEtInfo +*/ +typedef struct CmArmEtInfo { + ARM_ET_TYPE EtType; +} CM_ARM_ET_INFO; + #pragma pack() #endif // ARM_NAMESPACE_OBJECTS_H_ -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108587): https://edk2.groups.io/g/devel/message/108587 Mute This Topic: https://groups.io/mt/101335839/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
An Embedded Trace (ET) info object is used to provide information about an Embedded Trace Extension (ETE) or an Embedded Trace Module (ETM) available on a platform. The CM_ARM_ET_INFO object has already been added to the Arm namespace objects list by a previous patch. Therefore, update the CM Object parser to add support for parsing the CM_ARM_ET_INFO object. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - No code change from v1 patch series. [SAMI] DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c @@ -XXX,XX +XXX,XX @@ STATIC CONST CM_OBJ_PARSER CmArmPccSubspaceType5InfoParser[] = { ARRAY_SIZE (CmArmMailboxRegisterInfoParser) }, }; +/** A parser for EArmObjEtInfo. +*/ +STATIC CONST CM_OBJ_PARSER CmArmEtInfo[] = { + { "EtType", sizeof (ARM_ET_TYPE), "0x%x", NULL } +}; + /** A parser for Arm namespace objects. */ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = { @@ -XXX,XX +XXX,XX @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = { ARRAY_SIZE (CmArmPccSubspaceType34InfoParser) }, { "EArmObjPccSubspaceType5Info", CmArmPccSubspaceType5InfoParser, ARRAY_SIZE (CmArmPccSubspaceType5InfoParser) }, + { "EArmObjEtInfo", CmArmEtInfo, + ARRAY_SIZE (CmArmEtInfo) }, { "EArmObjMax", NULL, 0 }, }; -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108585): https://edk2.groups.io/g/devel/message/108585 Mute This Topic: https://groups.io/mt/101335837/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The Coresight Embedded Trace Extension (ETE) feature can be detected by the platform firmware by examining the debug feature register ID_AA64DFR0_EL1.TraceVer field. The platform configuration manager can then describe the ETE by creating CM_ARM_ET_INFO object(s) and referencing these in CM_ARM_GICC_INFO.EtToken. The 'Table 3: Compatible IDs for architected CoreSight components' in the 'ACPI for CoreSight 1.2 Platform Design Document' specifies the HID value for Coresight ETE and CoreSight Embedded Trace Macrocell (ETM) v4.x as ARMH C500. Therefore, update the SsdtCpuTopologyGenerator to add an ETE device to the CPU node in the AML CPU hierarchy so that an OS can utilise this information. Note: Although ETE and ETM share the same HID, ETE has a system register interfaces, unlike ETM which requires memory mapped registers. Since this patch aims to support ETE, the AML description does not describe any memory mapped registers. However, support for ETM can be added in the future. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - No code change from v1 patch series. [SAMI] DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c | 186 +++++++++++++++++++- DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h | 11 +- 2 files changed, 195 insertions(+), 2 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c @@ -XXX,XX +XXX,XX @@ /** @file SSDT Cpu Topology Table Generator. - Copyright (c) 2021, Arm Limited. All rights reserved.<BR> + Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): - ACPI 6.3 Specification - January 2019 - s8.4 Declaring Processors + - ACPI for CoreSight version 1.2 Platform Design Document + (https://developer.arm.com/documentation/den0067/a/?lang=en) + + @par Glossary: + - ETE - Embedded Trace Extension. + - ETM - Embedded Trace Macrocell. **/ #include <Library/AcpiLib.h> @@ -XXX,XX +XXX,XX @@ Requirements: - EArmObjProcHierarchyInfo (OPTIONAL) along with - EArmObjCmRef (OPTIONAL) - EArmObjLpiInfo (OPTIONAL) + - GetEArmObjEtInfo (OPTIONAL) */ /** This macro expands to a function that retrieves the GIC @@ -XXX,XX +XXX,XX @@ GET_OBJECT_LIST ( CM_ARM_CPC_INFO ); +/** + This macro expands to a function that retrieves the ET device + information from the Configuration Manager. +*/ +GET_OBJECT_LIST ( + EObjNameSpaceArm, + EArmObjEtInfo, + CM_ARM_ET_INFO + ); + /** Initialize the TokenTable. One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO @@ -XXX,XX +XXX,XX @@ CreateAmlCpcNode ( return Status; } +/** Create an embedded trace device and add it to the Cpu Node in the + AML namespace. + + This generates the following ASL code: + Device (E002) + { + Name (_UID, 2) + Name (_HID, "ARMHC500") + } + + Note: Currently we only support generating ETE nodes. Unlike ETM, + ETE has a system register interface and therefore does not need + the MMIO range to be described. + + @param [in] Generator The SSDT Cpu Topology generator. + @param [in] ParentNode Parent node to attach the Cpu node to. + @param [in] CpuName Value used to generate the node name. + @param [out] EtNodePtr If not NULL, return the created Cpu node. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +CreateAmlEtd ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN AML_NODE_HANDLE ParentNode, + IN UINT32 CpuName, + OUT AML_OBJECT_NODE_HANDLE *EtNodePtr OPTIONAL + ) +{ + EFI_STATUS Status; + AML_OBJECT_NODE_HANDLE EtNode; + CHAR8 AslName[AML_NAME_SEG_SIZE + 1]; + + ASSERT (Generator != NULL); + ASSERT (ParentNode != NULL); + + Status = WriteAslName ('E', CpuName, AslName); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status = AmlCodeGenDevice (AslName, ParentNode, &EtNode); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status = AmlCodeGenNameInteger ( + "_UID", + CpuName, + EtNode, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + Status = AmlCodeGenNameString ( + "_HID", + ACPI_HID_ET_DEVICE, + EtNode, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // If requested, return the handle to the EtNode. + if (EtNodePtr != NULL) { + *EtNodePtr = EtNode; + } + + return Status; +} + +/** Create and add an Embedded trace device to the Cpu Node. + + @param [in] Generator The SSDT Cpu Topology generator. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol Interface. + @param [in] GicCInfo Pointer to the CM_ARM_GICC_INFO object + describing the Cpu. + @param [in] CpuName Value used to generate the CPU node name. + @param [in] Node CPU Node to which the ET device node is + attached. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_UNSUPPORTED Feature Unsupported. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory. +**/ +STATIC +EFI_STATUS +EFIAPI +CreateAmlEtNode ( + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, + IN CM_ARM_GICC_INFO *GicCInfo, + IN UINT32 CpuName, + IN AML_OBJECT_NODE_HANDLE *Node + ) +{ + EFI_STATUS Status; + CM_ARM_ET_INFO *EtInfo; + + Status = GetEArmObjEtInfo ( + CfgMgrProtocol, + GicCInfo->EtToken, + &EtInfo, + NULL + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + // Currently we only support creation of a ETE Node. + if (EtInfo->EtType != ArmEtTypeEte) { + return EFI_UNSUPPORTED; + } + + Status = CreateAmlEtd ( + Generator, + Node, + CpuName, + NULL + ); + ASSERT_EFI_ERROR (Status); + return Status; +} + /** Create and add an _LPI method to Cpu/Cluster Node. For instance, transform an AML node from: @@ -XXX,XX +XXX,XX @@ CreateAmlCpuFromProcHierarchy ( } } + // Add an Embedded Trace node if present. + if (GicCInfo->EtToken != CM_NULL_TOKEN) { + Status = CreateAmlEtNode ( + Generator, + CfgMgrProtocol, + GicCInfo, + CpuName, + CpuNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } + return Status; } @@ -XXX,XX +XXX,XX @@ CreateTopologyFromGicC ( break; } } + + if (GicCInfo[Index].EtToken != CM_NULL_TOKEN) { + Status = CreateAmlEtNode ( + Generator, + CfgMgrProtocol, + &GicCInfo[Index], + Index, + CpuNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + } } // for return Status; diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h @@ -XXX,XX +XXX,XX @@ /** @file SSDT Cpu Topology Table Generator. - Copyright (c) 2021, Arm Limited. All rights reserved.<BR> + Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): - ACPI 6.3 Specification - January 2019 - s8.4 Declaring Processors + - ACPI for CoreSight version 1.2 Platform Design Document + (https://developer.arm.com/documentation/den0067/a/?lang=en) + + @par Glossary: + - ETE - Embedded Trace Extension. + - ETM - Embedded Trace Macrocell. **/ #ifndef SSDT_CPU_TOPOLOGY_GENERATOR_H_ @@ -XXX,XX +XXX,XX @@ /// HID for a processor device. #define ACPI_HID_PROCESSOR_DEVICE "ACPI0007" +/// HID for a ETM/ETE device. +#define ACPI_HID_ET_DEVICE "ARMHC500" + /// HID for a processor container device. #define ACPI_HID_PROCESSOR_CONTAINER_DEVICE "ACPI0010" -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108593): https://edk2.groups.io/g/devel/message/108593 Mute This Topic: https://groups.io/mt/101335846/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The CpcToken has been incorrectly referenced in the CreateTopologyFromGicC() and always points to the CPC token in the first GICC Info object. Therefore, fix this by correctly indexing into the GicCInfo object array. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> --- Notes: v2: - No code change from v1 patch series. [SAMI] DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c index XXXXXXX..XXXXXXX 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c @@ -XXX,XX +XXX,XX @@ CreateTopologyFromGicC ( // If a CPC info is associated with the // GicCinfo, create an _CPC method returning them. - if (GicCInfo->CpcToken != CM_NULL_TOKEN) { + if (GicCInfo[Index].CpcToken != CM_NULL_TOKEN) { Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, &GicCInfo[Index], CpuNode); if (EFI_ERROR (Status)) { ASSERT_EFI_ERROR (Status); -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108589): https://edk2.groups.io/g/devel/message/108589 Mute This Topic: https://groups.io/mt/101335841/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-