When ETE is enabled in the FVP model the firmware can check the debug feature register ID_AA64DFR0_EL1.TraceVer field to identify the presence of FEAT_ETE and add an ETE device to the CPU node in the AML CPU hierarchy. This enables the Operating System driver to probe and enable ETE support.
Note: To enable ETE support in the FVP REvC model 1. Build TF-A with the CTX_INCLUDE_AARCH32_REGS=0 build flag set, otherwise this results in an exception when booting TF-A 2. Set the model parameters to enable TRBE as this is required for ETE -C cluster0.has_trbe=1 -C cluster1.has_trbe=1 3. Set the ETE plugin for the model --plugin <PLUGIN_PATH>\libete-plugin.[so|dll] Signed-off-by: Sami Mujawar <sami.muja...@arm.com> --- Notes: v3: - Use macros instead of magic numbers in ETE feature [Pierre] detection code. - Implemented helper functions in ArmLib to detect if [Sami] the ETE feature is present and used it instead. Ref: https://edk2.groups.io/g/devel/message/108986 v2: - No code change from v1 patch series. [SAMI] Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 25 ++++++++++++++++++++ Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h | 2 ++ 2 files changed, 27 insertions(+) diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c index 749d8eaf52de0888e9e44173f4f84aa41c4c70b5..5b5d1f9d04c0f27bf32cca62f51c259152e16711 100644 --- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c @@ -365,6 +365,11 @@ EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = { FixedPcdGet32 (PcdPciBusMin), FixedPcdGet32 (PcdPciBusMax) }, + + // Embedded Trace device info + { + ArmEtTypeEte + } }; /** A helper function for returning the Configuration Manager Objects. @@ -476,6 +481,7 @@ InitializePlatformRepository ( EDKII_PLATFORM_REPOSITORY_INFO * PlatformRepo; UINTN Index; UINT16 TrbeInterrupt; + CM_OBJECT_TOKEN EtToken; PlatformRepo = This->PlatRepoInfo; @@ -495,6 +501,7 @@ InitializePlatformRepository ( } TrbeInterrupt = 0; + EtToken = CM_NULL_TOKEN; // The ID_AA64DFR0_EL1.TraceBuffer field identifies support for FEAT_TRBE. if (ArmHasTrbe ()) { @@ -502,8 +509,14 @@ InitializePlatformRepository ( TrbeInterrupt = 31; } + // The ID_AA64DFR0_EL1.TraceVer field identifies the presence of FEAT_ETE. + if (ArmHasEte ()) { + EtToken = (CM_OBJECT_TOKEN)&PlatformRepo->EtInfo; + } + for (Index = 0; Index < PLAT_CPU_COUNT; Index++) { PlatformRepo->GicCInfo[Index].TrbeInterrupt = TrbeInterrupt; + PlatformRepo->GicCInfo[Index].EtToken = EtToken; } return EFI_SUCCESS; @@ -975,6 +988,18 @@ GetArmNameSpaceObject ( ); break; + case EArmObjEtInfo: + if (Token == (CM_OBJECT_TOKEN)&PlatformRepo->EtInfo) { + Status = HandleCmObject ( + CmObjectId, + &PlatformRepo->EtInfo, + sizeof (PlatformRepo->EtInfo), + 1, + CmObject + ); + } + break; + default: { Status = EFI_NOT_FOUND; DEBUG (( diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h index 1b52c2ebc7efb633c748f7316606e3dbe4e0b21c..be2b512911f897dc57328673ae4f4a2014ec20fb 100644 --- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h @@ -171,6 +171,8 @@ typedef struct PlatformRepositoryInfo { /// PCI configuration space information CM_ARM_PCI_CONFIG_SPACE_INFO PciConfigInfo; + CM_ARM_ET_INFO EtInfo; + /// System ID UINT32 SysId; } EDKII_PLATFORM_REPOSITORY_INFO; -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109010): https://edk2.groups.io/g/devel/message/109010 Mute This Topic: https://groups.io/mt/101522392/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-