From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f175.google.com (mail-vk1-f175.google.com [209.85.221.175]) by mx.groups.io with SMTP id smtpd.web09.7794.1618833209719058849 for ; Mon, 19 Apr 2021 04:53:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YujcWlMD; spf=pass (domain: gmail.com, ip: 209.85.221.175, mailfrom: ch.chandni@gmail.com) Received: by mail-vk1-f175.google.com with SMTP id p9so2345262vkf.10 for ; Mon, 19 Apr 2021 04:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=2vS4y+peezX9Y4H+czFqCHcMOTIm3AGdyOAO8xnD1nk=; b=YujcWlMD/uUrPCxywBeoA5RWxdIkWxM3pVkvUyJsJnAJ6wt0MjdUU5Y6EBRTqCM4xp k22kK3SJDiFI1viu08TnNxFxA5j3ZjLkBGZLTEcliY3OL7gUzOzq5x0AEX3O3LWb4ES4 SUgIdhbaIhaU3r3MwLt1ytvRzcfLR0rYmgWuzi/oD7keti7ZhoaiYV+8MswxruslIuhd v7zBo6vuZrGbbGfS5lXaUQEwDtxX77HB7xsqFAYrjpZ8EpJHeFi0S2i1VXGOERCSLb1y oLnJY8braABF0jAYBy38X3VU5ofL/nqY6R65JbTlTY6/rb+eVgl9cb4uf/CAsN8/b7hg 9VXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=2vS4y+peezX9Y4H+czFqCHcMOTIm3AGdyOAO8xnD1nk=; b=MSziJvaek7zme56AH2efYU00w7bBg9xJWeXb4qK363IGT5I03lyrnInM1jUO3RoQG3 vx0kA++POPt6YHkxMV18mJWuNl/+Pm2fP5FCDdzapg+s5464wN6Z1dCBNYi5R544RSoN J+L6iZ5u6MDRluxAuqDo+gCAe+1/JHM7P1hwgxvsEnUk4YsKDXbKGzz+s+9ymqzswDee gu/fhE0sn8g9Qm5tKIkikfBwgSlSaDKuWeBFeIrBm5v93aQ2f7WJZIJblfAEgeOXvbbR cEVnB6DW1sJDSN+vLv30x+WLWGc+PmLwnuAeu6u1+9vnuaUjPaKbamsxkudzACT1qGPz HJ9w== X-Gm-Message-State: AOAM530pbdc1u+k/B6N5qgf1+whG17k+FhMCxR3qCUzuMwCqHk//rChY y1B5LV6HN/+4xORh8GdLTlKCz3YTY6O68dIn+pa1rB33 X-Google-Smtp-Source: ABdhPJyKgrHH0e37R14rHQxjyZxrLZrMzhop3d0SeEhTQ5YLqK5alQxtQ8gN1WqyQy32Cz6o/DWW/w7dOF1DBZ+hZho= X-Received: by 2002:a1f:2e07:: with SMTP id u7mr4555336vku.22.1618833208001; Mon, 19 Apr 2021 04:53:28 -0700 (PDT) MIME-Version: 1.0 References: <20210419054043.21909-1-chandni.cherukuri@arm.com> <20210419054043.21909-5-chandni.cherukuri@arm.com> <44071285-29A2-44A8-86A1-B25A0CCCDF8E@arm.com> In-Reply-To: <44071285-29A2-44A8-86A1-B25A0CCCDF8E@arm.com> From: "chandni cherukuri" Date: Mon, 19 Apr 2021 17:23:15 +0530 Message-ID: Subject: Re: [edk2-devel] [edk2-platforms][PATCH V3 4/7] Platform/ARM/Morello: Add Configuration Manager for Morello To: devel@edk2.groups.io, Sami Mujawar Cc: Ard Biesheuvel , Leif Lindholm , nd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Sami, Please go ahead with the change. Thanks Chandni On Mon, Apr 19, 2021 at 3:30 PM Sami Mujawar wrote: > > Hi Chandni, > > Please find my response inline marked [SAMI]. > > Regards, > > Sami Mujawar > > =EF=BB=BFOn 19/04/2021, 06:41, "Chandni Cherukuri" wrote: > > This patch implements the configuration manager for Morello > platform. It enables support for generating the following > ACPI tables for Morello FVP Platform: > 1. FADT > 2. DSDT > 3. GTDT > 4. MADT > 5. SPCR > 6. DBG2 > 7. PPTT > 8. IORT > 9. MCFG > 10. SSDT > > Structures have been created to add Common Platform information > and FVP/Testchip platform specific information so that the > same Dxe is usable for all variants of the platform. > > Co-authored-by: Jessica Clarke > Signed-off-by: Chandni Cherukuri > --- > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerFvp.d= sc.inc | 16 + > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/C= onfigurationManagerDxeFvp.inf | 94 ++ > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/C= onfigurationManager.h | 281 +++++ > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/C= onfigurationManagerFvp.h | 122 ++ > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/P= latform.h | 91 ++ > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/C= onfigurationManager.c | 1170 ++++++++++++++++++++ > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/C= onfigurationManagerFvp.c | 602 ++++++++++ > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/A= slTables/DsdtFvp.asl | 98 ++ > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/A= slTables/SsdtPciFvp.asl | 130 +++ > 9 files changed, 2604 insertions(+) > > diff --git a/Platform/ARM/Morello/ConfigurationManager/Configuration= ManagerFvp.dsc.inc b/Platform/ARM/Morello/ConfigurationManager/Configuratio= nManagerFvp.dsc.inc > new file mode 100644 > index 000000000000..71916783c24c > --- /dev/null > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManager= Fvp.dsc.inc > @@ -0,0 +1,16 @@ > +## @file > +# dsc include file for Configuration Manager > +# > +# Copyright (c) 2021, ARM Limited. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + > +[BuildOptions] > + > +[Components.common] > + # Configuration Manager > + Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe= /ConfigurationManagerDxeFvp.inf > diff --git a/Platform/ARM/Morello/ConfigurationManager/Configuration= ManagerDxe/ConfigurationManagerDxeFvp.inf b/Platform/ARM/Morello/Configurat= ionManager/ConfigurationManagerDxe/ConfigurationManagerDxeFvp.inf > new file mode 100644 > index 000000000000..6fc307df014c > --- /dev/null > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManagerDxeFvp.inf > @@ -0,0 +1,94 @@ > +## @file > +# Configuration Manager Dxe > +# > +# Copyright (c) 2021, ARM Limited. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +## > + > +[Defines] > + INF_VERSION =3D 0x0001001B > + BASE_NAME =3D ConfigurationManagerDxe > + FILE_GUID =3D 6F9C3B47-6F7D-44B6-87E5-4B7F44= A60147 > + MODULE_TYPE =3D DXE_DRIVER > + VERSION_STRING =3D 1.0 > + ENTRY_POINT =3D ConfigurationManagerDxeInitial= ize > + > +# > +# The following information is for reference only and not required = by the build tools. > +# > +# VALID_ARCHITECTURES =3D AARCH64 > +# > + > +[Sources] > + AslTables/DsdtFvp.asl > + AslTables/SsdtPciFvp.asl > + ConfigurationManager.c > + ConfigurationManager.h > + ConfigurationManagerFvp.c > + ConfigurationManagerFvp.h > + Platform.h > + > +[Packages] > + ArmPkg/ArmPkg.dec > + ArmPlatformPkg/ArmPlatformPkg.dec > + DynamicTablesPkg/DynamicTablesPkg.dec > + MdeModulePkg/MdeModulePkg.dec > + MdePkg/MdePkg.dec > + Platform/ARM/Morello/MorelloPlatform.dec > + > +[LibraryClasses] > + UefiDriverEntryPoint > + > +[Protocols] > + gEdkiiConfigurationManagerProtocolGuid > + > +[FixedPcd] > + gArmMorelloTokenSpaceGuid.PcdPciBusCount > + gArmMorelloTokenSpaceGuid.PcdPciBusMax > + gArmMorelloTokenSpaceGuid.PcdPciBusMin > + gArmMorelloTokenSpaceGuid.PcdPciExpressBaseAddress > + gArmMorelloTokenSpaceGuid.PcdPciIoBase > + gArmMorelloTokenSpaceGuid.PcdPciIoMaxBase > + gArmMorelloTokenSpaceGuid.PcdPciIoSize > + gArmMorelloTokenSpaceGuid.PcdPciIoTranslation > + gArmMorelloTokenSpaceGuid.PcdPciMmio32Base > + gArmMorelloTokenSpaceGuid.PcdPciMmio32MaxBase > + gArmMorelloTokenSpaceGuid.PcdPciMmio32Size > + gArmMorelloTokenSpaceGuid.PcdPciMmio32Translation > + gArmMorelloTokenSpaceGuid.PcdPciMmio64Base > + gArmMorelloTokenSpaceGuid.PcdPciMmio64MaxBase > + gArmMorelloTokenSpaceGuid.PcdPciMmio64Size > + gArmMorelloTokenSpaceGuid.PcdPciMmio64Translation > + > + gArmMorelloTokenSpaceGuid.PcdVirtioBlkBaseAddress > + gArmMorelloTokenSpaceGuid.PcdVirtioBlkInterrupt > + gArmMorelloTokenSpaceGuid.PcdVirtioBlkSize > + > + ## PL011 Serial Debug UART > + gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase > + gArmPlatformTokenSpaceGuid.PcdSerialDbgUartBaudRate > + gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz > + > + gArmPlatformTokenSpaceGuid.PL011UartClkInHz > + gArmPlatformTokenSpaceGuid.PL011UartInterrupt > + > + gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum > + gArmTokenSpaceGuid.PcdArmArchTimerIntrNum > + gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum > + gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum > + > + # SBSA Generic Watchdog > + gArmTokenSpaceGuid.PcdGenericWatchdogControlBase > + gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum > + gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase > + > + gArmTokenSpaceGuid.PcdGicDistributorBase > + gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase > + gArmTokenSpaceGuid.PcdGicRedistributorsBase > + > + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase > + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate > + > +[Depex] > + TRUE > diff --git a/Platform/ARM/Morello/ConfigurationManager/Configuration= ManagerDxe/ConfigurationManager.h b/Platform/ARM/Morello/ConfigurationManag= er/ConfigurationManagerDxe/ConfigurationManager.h > new file mode 100644 > index 000000000000..fea4a0efd24a > --- /dev/null > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManager.h > @@ -0,0 +1,281 @@ > +/** @file > + > + Copyright (c) 2021, ARM Limited. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + @par Glossary: > + - Cm or CM - Configuration Manager > + - Obj or OBJ - Object > +**/ > + > +#ifndef CONFIGURATION_MANAGER_H_ > +#define CONFIGURATION_MANAGER_H_ > + > +/** The configuration manager version. > +*/ > +#define CONFIGURATION_MANAGER_REVISION CREATE_REVISION (1, 0) > + > +/** The OEM ID > +*/ > +#define CFG_MGR_OEM_ID { 'A', 'R', 'M', 'L', 'T', 'D' } > +#define CFG_MGR_OEM_REVISION 0x20181101 > + > +/** A helper macro for mapping a reference token > +*/ > +#define REFERENCE_TOKEN(Field) \ > + (CM_OBJECT_TOKEN)((UINT8*)&CommonPlatformInfo + \ > + OFFSET_OF (EDKII_COMMON_PLATFORM_REPOSITORY_INFO, Field)) > + > +/** A helper macro that constructs the MPID based on the > + Aff0, Aff1, Aff2, Aff3 values > +*/ > +#define GET_MPID3(Aff3, Aff2, Aff1, Aff0) \ > + (((Aff3##ULL) << 32) | ((Aff2) << 16) | ((Aff1) << 8) | (Aff0)) > + > +/** A helper macro for populating the GIC CPU information > +*/ > +#define GICC_ENTRY( = \ > + CPUInterfaceNumber, = \ > + Mpidr, = \ > + PmuIrq, = \ > + VGicIrq, = \ > + GicRedistBase, = \ > + EnergyEfficiency, = \ > + SpeIrq, = \ > + ProximityDomain, = \ > + ClockDomain = \ > + ) { = \ > + CPUInterfaceNumber, /* UINT32 CPUInterfaceNumber = */ \ > + CPUInterfaceNumber, /* UINT32 AcpiProcessorUid = */ \ > + EFI_ACPI_6_2_GIC_ENABLED, /* UINT32 Flags = */ \ > + 0, /* UINT32 ParkingProtocolVersion = */ \ > + PmuIrq, /* UINT32 PerformanceInterruptGsiv = */ \ > + 0, /* UINT64 ParkedAddress = */ \ > + FixedPcdGet64 ( = \ > + PcdGicInterruptInterfaceBase = \ > + ), /* UINT64 PhysicalBaseAddress = */ \ > + 0, /* UINT64 GICV = */ \ > + 0, /* UINT64 GICH = */ \ > + VGicIrq, /* UINT32 VGICMaintenanceInterrupt = */ \ > + GicRedistBase, /* UINT64 GICRBaseAddress = */ \ > + Mpidr, /* UINT64 MPIDR = */ \ > + EnergyEfficiency, /* UINT8 ProcessorPowerEfficiencyCl= ass*/ \ > + SpeIrq, /* UINT16 SpeOverflowInterrupt = */ \ > + ProximityDomain, /* UINT32 ProximityDomain = */ \ > + ClockDomain, /* UINT32 ClockDomain = */ \ > + EFI_ACPI_6_3_GICC_ENABLED,/* UINT32 Flags = */ \ > + } > + > +/** A helper macro for populating the Processor Hierarchy Node flag= s > +*/ > +#define PROC_NODE_FLAGS( = \ > + PhysicalPackage, = \ > + AcpiProcessorIdValid, = \ > + ProcessorIsThread, = \ > + NodeIsLeaf, = \ > + IdenticalImplementation = \ > + ) = \ > + ( = \ > + PhysicalPackage | = \ > + (AcpiProcessorIdValid << 1) | = \ > + (ProcessorIsThread << 2) | = \ > + (NodeIsLeaf << 3) | = \ > + (IdenticalImplementation << 4) = \ > + ) > + > +/** A helper macro for populating the Cache Type Structure's attrib= utes > +*/ > +#define CACHE_ATTRIBUTES( = \ > + AllocationType, = \ > + CacheType, = \ > + WritePolicy = \ > + ) = \ > + ( = \ > + AllocationType | = \ > + (CacheType << 2) | = \ > + (WritePolicy << 4) = \ > + ) > + > +/** A function that prepares Configuration Manager Objects for retu= rning. > + > + @param [in] This Pointer to the Configuration Manager Pro= tocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token A token for identifying the object. > + @param [out] CmObject Pointer to the Configuration Manager Obj= ect > + descriptor describing the requested Obje= ct. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +typedef EFI_STATUS (*CM_OBJECT_HANDLER_PROC) ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ); > + > +/** A helper function for returning the Configuration Manager Objec= ts. > + > + @param [in] CmObjectId The Configuration Manager Object= ID. > + @param [in] Object Pointer to the Object(s). > + @param [in] ObjectSize Total size of the Object(s). > + @param [in] ObjectCount Number of Objects. > + @param [in, out] CmObjectDesc Pointer to the Configuration Man= ager Object > + descriptor describing the reques= ted Object. > + > + @retval EFI_SUCCESS Success. > +**/ > +EFI_STATUS > +EFIAPI > +HandleCmObject ( > + IN CONST CM_OBJECT_ID CmObjectId, > + IN VOID * Object, > + IN CONST UINTN ObjectSize, > + IN CONST UINTN ObjectCount, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObjectDesc > + ); > + > +/** A helper function for returning the Configuration Manager Objec= ts that > + match the token. > + > + @param [in] This Pointer to the Configuration Mana= ger Protocol. > + @param [in] CmObjectId The Configuration Manager Object = ID. > + @param [in] Object Pointer to the Object(s). > + @param [in] ObjectSize Total size of the Object(s). > + @param [in] ObjectCount Number of Objects. > + @param [in] Token A token identifying the object. > + @param [in] HandlerProc A handler function to search the = object > + referenced by the token. > + @param [in, out] CmObjectDesc Pointer to the Configuration Mana= ger Object > + descriptor describing the request= ed Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +HandleCmObjectRefByToken ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN VOID * Object, > + IN CONST UINTN ObjectSiz= e, > + IN CONST UINTN ObjectCou= nt, > + IN CONST CM_OBJECT_TOKEN Token, > + IN CONST CM_OBJECT_HANDLER_PROC HandlerPr= oc, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObjectD= esc > + ); > + > +/** The number of CPUs > +*/ > +#define PLAT_CPU_COUNT 4 > + > +/** The number of platform generic timer blocks > +*/ > +#define PLAT_GTBLOCK_COUNT 1 > + > +/** The number of timer frames per generic timer block > +*/ > +#define PLAT_GTFRAME_COUNT 2 > + > +/** The number of Processor Hierarchy Nodes > + - one package node > + - two cluster nodes > + - two cores in cluster 0 > + - two cores in cluster 1 > +*/ > +#define PLAT_PROC_HIERARCHY_NODE_COUNT 7 > + > +/** The number of unique cache structures: > + - cluster L3 unified cache > + - core L1 instruction cache > + - core L1 data cache > + - core L2 cache > + - slc unified cache > +*/ > +#define PLAT_CACHE_COUNT 5 > + > +/** The number of resources private to the cluster > + - L3 cache > +*/ > +#define CLUSTER_RESOURCE_COUNT 1 > + > +/** The number of resources private to 'core instance > + - L1 data cache > + - L1 instruction cache > + - L2 cache > +*/ > +#define CORE_RESOURCE_COUNT 3 > + > +/** The number of resources private to SoC > + - slc cache > +*/ > +#define SOC_RESOURCE_COUNT 1 > + > +/** A structure describing the platform configuration > + manager repository information > +*/ > +typedef struct CommonPlatformRepositoryInfo { > + /// Configuration Manager Information > + CM_STD_OBJ_CONFIGURATION_MANAGER_INFO CmInfo; > + > + /// Boot architecture information > + CM_ARM_BOOT_ARCH_INFO BootArchInfo; > + > +#ifdef HEADLESS_PLATFORM > + /// Fixed feature flag information > + CM_ARM_FIXED_FEATURE_FLAGS FixedFeatureFlags; > +#endif > + > + /// Power management profile information > + CM_ARM_POWER_MANAGEMENT_PROFILE_INFO PmProfileInfo; > + > + /// GIC CPU interface information > + CM_ARM_GICC_INFO GicCInfo[PLAT_CPU_COUNT]; > + > + /// GIC distributor information > + CM_ARM_GICD_INFO GicDInfo; > + > + /// GIC Redistributor information > + CM_ARM_GIC_REDIST_INFO GicRedistInfo; > + > + /// Generic timer information > + CM_ARM_GENERIC_TIMER_INFO GenericTimerInfo; > + > + /// Generic timer block information > + CM_ARM_GTBLOCK_INFO GTBlockInfo[PLAT_GTBLOCK_CO= UNT]; > + > + /// Generic timer frame information > + CM_ARM_GTBLOCK_TIMER_FRAME_INFO GTBlock0TimerInfo[PLAT_GTFR= AME_COUNT]; > + > + /// Watchdog information > + CM_ARM_GENERIC_WATCHDOG_INFO Watchdog; > + > + /** Serial port information for the > + serial port console redirection port > + */ > + CM_ARM_SERIAL_PORT_INFO SpcrSerialPort; > + > + /// Serial port information for the DBG2 UART port > + CM_ARM_SERIAL_PORT_INFO DbgSerialPort; > + > + // Processor topology information > + CM_ARM_PROC_HIERARCHY_INFO ProcHierarchyInfo[PLAT_PROC= _HIERARCHY_NODE_COUNT]; > + > + // Cache information > + CM_ARM_CACHE_INFO CacheInfo[PLAT_CACHE_COUNT]= ; > + > + // Cluster private resources > + CM_ARM_OBJ_REF ClusterResources[CLUSTER_RE= SOURCE_COUNT]; > + > + // Core private resources > + CM_ARM_OBJ_REF CoreResources[CORE_RESOURCE= _COUNT]; > + > + // SoC Resources > + CM_ARM_OBJ_REF SocResources[SOC_RESOURCE_C= OUNT]; > + > +} EDKII_COMMON_PLATFORM_REPOSITORY_INFO; > + > +#endif // CONFIGURATION_MANAGER_H_ > diff --git a/Platform/ARM/Morello/ConfigurationManager/Configuration= ManagerDxe/ConfigurationManagerFvp.h b/Platform/ARM/Morello/ConfigurationMa= nager/ConfigurationManagerDxe/ConfigurationManagerFvp.h > new file mode 100644 > index 000000000000..4628b7a879aa > --- /dev/null > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManagerFvp.h > @@ -0,0 +1,122 @@ > +/** @file > + > + Copyright (c) 2021, ARM Limited. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + @par Glossary: > + - Cm or CM - Configuration Manager > + - Obj or OBJ - Object > +**/ > + > +#ifndef FVP_CONFIGURATION_MANAGER_H_ > +#define FVP_CONFIGURATION_MANAGER_H_ > + > +#include "ConfigurationManager.h" > + > +/** The number of ACPI tables to install > +*/ > +#define PLAT_ACPI_TABLE_COUNT 10 > + > +/** A helper macro for mapping a reference token > +*/ > +#define REFERENCE_TOKEN_FVP(Field) \ > + (CM_OBJECT_TOKEN)((UINT8*)&MorelloFvpRepositoryInfo + \ > + OFFSET_OF (EDKII_FVP_PLATFORM_REPOSITORY_INFO, Field)) > + > +/** C array containing the compiled AML template. > + These symbols are defined in the auto generated C file > + containing the AML bytecode array. > +*/ > +extern CHAR8 dsdtfvp_aml_code[]; > +extern CHAR8 ssdtpcifvp_aml_code[]; > + > +/** A structure describing the FVP Platform specific information > +*/ > +typedef struct FvpPlatformRepositoryInfo { > + /// List of ACPI tables > + CM_STD_OBJ_ACPI_TABLE_INFO CmAcpiTableList[PLAT_ACPI_T= ABLE_COUNT]; > + > + /// GIC ITS information > + CM_ARM_GIC_ITS_INFO GicItsInfo[2]; > + > + /// ITS Group node > + CM_ARM_ITS_GROUP_NODE ItsGroupInfo[2]; > + > + /// ITS Identifier array > + CM_ARM_ITS_IDENTIFIER ItsIdentifierArray[2]; > + > + /// SMMUv3 node > + CM_ARM_SMMUV3_NODE SmmuV3Info[1]; > + > + /// PCI Root complex node > + CM_ARM_ROOT_COMPLEX_NODE RootComplexInfo[1]; > + > + /// Array of DeviceID mapping > + CM_ARM_ID_MAPPING DeviceIdMapping[2][2]; > + > + /// PCI configuration space information > + CM_ARM_PCI_CONFIG_SPACE_INFO PciConfigInfo[1]; > + > +} EDKII_FVP_PLATFORM_REPOSITORY_INFO; > + > +/** A structure describing the platform configuration > + manager repository information > +*/ > +typedef struct PlatformRepositoryInfo { > + > + /// Common information > + EDKII_COMMON_PLATFORM_REPOSITORY_INFO * CommonPlatRepoInfo; > + > + /// FVP Platform specific information > + EDKII_FVP_PLATFORM_REPOSITORY_INFO * FvpPlatRepoInfo; > + > +} EDKII_PLATFORM_REPOSITORY_INFO; > + > +extern EDKII_COMMON_PLATFORM_REPOSITORY_INFO CommonPlatformInfo; > + > +/** Return platform specific ARM namespace object. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token An optional token identifying the ob= ject. If > + unused this must be CM_NULL_TOKEN. > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested = Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetArmNameSpaceObjectPlat ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token OPT= IONAL, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ); > + > +/** Return platform specific standard namespace object. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token An optional token identifying the ob= ject. If > + unused this must be CM_NULL_TOKEN. > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested = Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetStandardNameSpaceObjectPlat ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token OPT= IONAL, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ); > + > +#endif // FVP_CONFIGURATION_MANAGER_H_ > diff --git a/Platform/ARM/Morello/ConfigurationManager/Configuration= ManagerDxe/Platform.h b/Platform/ARM/Morello/ConfigurationManager/Configura= tionManagerDxe/Platform.h > new file mode 100644 > index 000000000000..e6af6e170e4a > --- /dev/null > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManager= Dxe/Platform.h > @@ -0,0 +1,91 @@ > +/** @file > + > + Copyright (c) 2021, ARM Limited. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > +**/ > + > +#ifndef PLATFORM_H_ > +#define PLATFORM_H_ > + > +#define ENABLE_MEM_MAPPED_TIMER > + > +#ifdef ENABLE_MEM_MAPPED_TIMER > +// REFCLK CNTControl > +#define MORELLO_SYSTEM_TIMER_BASE_ADDRESS 0x2A430000 > +// REFCLK CNTRead > +#define MORELLO_CNT_READ_BASE_ADDRESS 0x2A800000 > +#else > +#define MORELLO_SYSTEM_TIMER_BASE_ADDRESS 0xFFFFFFFFFFFFFFFF > +#define MORELLO_CNT_READ_BASE_ADDRESS 0xFFFFFFFFFFFFFFFF > +#endif > + > +// GT Block Timer > +// AP_REFCLK CNTCTL > +#define MORELLO_GT_BLOCK_CTL_BASE 0x2A810000 > +#define MORELLO_TIMER_FRAMES_COUNT 2 > + > +// GT Block Timer Frames > +// AP_REFCLK_NS CNTBase0 > +#define MORELLO_GT_BLOCK_FRAME0_CTL_BASE 0x2A830000 > +#define MORELLO_GT_BLOCK_FRAME0_CTL_EL0_BASE 0xFFFFFFFFFFFFFFFF > +#define MORELLO_GT_BLOCK_FRAME0_GSIV 92 > + > +// AP_REFCLK_S CNTBase1 > +#define MORELLO_GT_BLOCK_FRAME1_CTL_BASE 0x2A820000 > +#define MORELLO_GT_BLOCK_FRAME1_CTL_EL0_BASE 0xFFFFFFFFFFFFFFFF > +#define MORELLO_GT_BLOCK_FRAME1_GSIV 91 > + > +#define GTDT_TIMER_EDGE_TRIGGERED \ > + EFI_ACPI_6_3_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE > +#define GTDT_TIMER_LEVEL_TRIGGERED 0 > +#define GTDT_TIMER_ACTIVE_LOW \ > + EFI_ACPI_6_3_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY > +#define GTDT_TIMER_ACTIVE_HIGH 0 > +#define GTDT_TIMER_SAVE_CONTEXT \ > + EFI_ACPI_6_3_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY > +#define GTDT_TIMER_LOSE_CONTEXT 0 > + > +#define MORELLO_GTDT_GTIMER_FLAGS (GTDT_TIMER_LOSE_CONTEXT = | \ > + GTDT_TIMER_ACTIVE_LOW | = \ > + GTDT_TIMER_LEVEL_TRIGGERED= ) > + > +// GT Block Timer Flags > +#define GTX_TIMER_EDGE_TRIGGERED \ > + EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_MOD= E > +#define GTX_TIMER_LEVEL_TRIGGERED 0 > +#define GTX_TIMER_ACTIVE_LOW \ > + EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_POL= ARITY > +#define GTX_TIMER_ACTIVE_HIGH 0 > + > +#define MORELLO_GTX_TIMER_FLAGS (GTX_TIMER_ACTIVE_HIGH | \ > + GTX_TIMER_LEVEL_TRIGGERED) > + > +#define GTX_TIMER_SECURE \ > + EFI_ACPI_6_3_GTDT_GT_BLOCK_COMMON_FLAG_SECURE_TIMER > +#define GTX_TIMER_NON_SECURE 0 > +#define GTX_TIMER_SAVE_CONTEXT \ > + EFI_ACPI_6_3_GTDT_GT_BLOCK_COMMON_FLAG_ALWAYS_ON_CAPABILI= TY > +#define GTX_TIMER_LOSE_CONTEXT 0 > + > +#define MORELLO_GTX_COMMON_FLAGS_S (GTX_TIMER_SAVE_CONTEXT = | \ > + GTX_TIMER_SECURE) > +#define MORELLO_GTX_COMMON_FLAGS_NS (GTX_TIMER_SAVE_CONTEXT = | \ > + GTX_TIMER_NON_SECURE) > + > +// Watchdog > +#define SBSA_WATCHDOG_EDGE_TRIGGERED \ > + EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERR= UPT_MODE > +#define SBSA_WATCHDOG_LEVEL_TRIGGERED 0 > +#define SBSA_WATCHDOG_ACTIVE_LOW \ > + EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERR= UPT_POLARITY > +#define SBSA_WATCHDOG_ACTIVE_HIGH 0 > +#define SBSA_WATCHDOG_SECURE \ > + EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER > +#define SBSA_WATCHDOG_NON_SECURE 0 > + > +#define MORELLO_SBSA_WATCHDOG_FLAGS (SBSA_WATCHDOG_NON_SECUR= E | \ > + SBSA_WATCHDOG_ACTIVE_HI= GH | \ > + SBSA_WATCHDOG_LEVEL_TRI= GGERED) > + > +#endif // PLATFORM_H_ > diff --git a/Platform/ARM/Morello/ConfigurationManager/Configuration= ManagerDxe/ConfigurationManager.c b/Platform/ARM/Morello/ConfigurationManag= er/ConfigurationManagerDxe/ConfigurationManager.c > new file mode 100644 > index 000000000000..89fadbcb03a8 > --- /dev/null > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManager.c > @@ -0,0 +1,1170 @@ > +/** @file > + Configuration Manager Dxe > + > + Copyright (c) 2021, ARM Limited. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + @par Glossary: > + - Cm or CM - Configuration Manager > + - Obj or OBJ - Object > +**/ > + > +#include > +#include > +#include > +#include > +#include > + > +#include "ConfigurationManagerFvp.h" > +#include "ConfigurationManager.h" > +#include "Platform.h" > + > +extern EDKII_PLATFORM_REPOSITORY_INFO MorelloRepositoryInfo; > + > +// The platform configuration repository information. > +EDKII_COMMON_PLATFORM_REPOSITORY_INFO CommonPlatformInfo =3D { > + // Configuration Manager information > + { CONFIGURATION_MANAGER_REVISION, CFG_MGR_OEM_ID }, > + > + // Boot architecture information > + { EFI_ACPI_6_3_ARM_PSCI_COMPLIANT }, // BootArchFlag= s > + > +#ifdef HEADLESS_PLATFORM > + // Fixed feature flag information > + { EFI_ACPI_6_3_HEADLESS }, // Fixed featur= e flags > +#endif > + > + // Power management profile information > + { EFI_ACPI_6_3_PM_PROFILE_ENTERPRISE_SERVER }, // PowerManagem= ent Profile > + > + /* GIC CPU Interface information > + GIC_ENTRY (CPUInterfaceNumber, Mpidr, PmuIrq, VGicIrq, GicRedi= stBase, > + EnergyEfficiency, SpeIrq, ProximityDomain, ClockDom= ain) > + */ > + { > + GICC_ENTRY (0, GET_MPID3 (0x0, 0x0, 0x0, 0x0), 23, 25, 0, 0, 21= , 0, 0), > + GICC_ENTRY (1, GET_MPID3 (0x0, 0x0, 0x1, 0x0), 23, 25, 0, 0, 21= , 0, 0), > + GICC_ENTRY (2, GET_MPID3 (0x0, 0x1, 0x0, 0x0), 23, 25, 0, 0, 21= , 0, 0), > + GICC_ENTRY (3, GET_MPID3 (0x0, 0x1, 0x1, 0x0), 23, 25, 0, 0, 21= , 0, 0), > + }, > + > + // GIC Distributor Info > + { > + FixedPcdGet64 (PcdGicDistributorBase), // UINT64 PhysicalBase= Address > + 0, // UINT32 SystemVector= Base > + 3 // UINT8 GicVersion > + }, > + > + // GIC Re-Distributor Info > + { > + // UINT64 DiscoveryRangeBaseAddress > + FixedPcdGet64 (PcdGicRedistributorsBase), > + // UINT32 DiscoveryRangeLength > + SIZE_1MB > + }, > + > + // Generic Timer Info > + { > + // The physical base address for the counter control frame > + MORELLO_SYSTEM_TIMER_BASE_ADDRESS, > + // The physical base address for the counter read frame > + MORELLO_CNT_READ_BASE_ADDRESS, > + // The secure PL1 timer interrupt > + FixedPcdGet32 (PcdArmArchTimerSecIntrNum), > + // The secure PL1 timer flags > + MORELLO_GTDT_GTIMER_FLAGS, > + // The non-secure PL1 timer interrupt > + FixedPcdGet32 (PcdArmArchTimerIntrNum), > + // The non-secure PL1 timer flags > + MORELLO_GTDT_GTIMER_FLAGS, > + // The virtual timer interrupt > + FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), > + // The virtual timer flags > + MORELLO_GTDT_GTIMER_FLAGS, > + // The non-secure PL2 timer interrupt > + FixedPcdGet32 (PcdArmArchTimerHypIntrNum), > + // The non-secure PL2 timer flags > + MORELLO_GTDT_GTIMER_FLAGS > + }, > + > + // Generic Timer Block Information > + { > + { > + // The physical base address for the GT Block Timer structure > + MORELLO_GT_BLOCK_CTL_BASE, > + // The number of timer frames implemented in the GT Block > + MORELLO_TIMER_FRAMES_COUNT, > + // Reference token for the GT Block timer frame list > + REFERENCE_TOKEN (GTBlock0TimerInfo) > + } > + }, > + > + // GT Block Timer Frames > + { > + // Frame 0 > + { > + 0, // UINT8 FrameNumber > + MORELLO_GT_BLOCK_FRAME0_CTL_BASE, // UINT64 PhysicalAddr= essCntBase > + MORELLO_GT_BLOCK_FRAME0_CTL_EL0_BASE, // UINT64 PhysicalAddr= essCntEL0Base > + MORELLO_GT_BLOCK_FRAME0_GSIV, // UINT32 PhysicalTime= rGSIV > + MORELLO_GTX_TIMER_FLAGS, // UINT32 PhysicalTime= rFlags > + 0, // UINT32 VirtualTimer= GSIV > + 0, // UINT32 VirtualTimer= Flags > + MORELLO_GTX_COMMON_FLAGS_NS // UINT32 CommonFlags > + }, > + // Frame 1 > + { > + 1, // UINT8 FrameNumber > + MORELLO_GT_BLOCK_FRAME1_CTL_BASE, // UINT64 PhysicalAddr= essCntBase > + MORELLO_GT_BLOCK_FRAME1_CTL_EL0_BASE, // UINT64 PhysicalAddr= essCntEL0Base > + MORELLO_GT_BLOCK_FRAME1_GSIV, // UINT32 PhysicalTime= rGSIV > + MORELLO_GTX_TIMER_FLAGS, // UINT32 PhysicalTime= rFlags > + 0, // UINT32 VirtualTimer= GSIV > + 0, // UINT32 VirtualTimer= Flags > + MORELLO_GTX_COMMON_FLAGS_S // UINT32 CommonFlags > + }, > + }, > + > + // Watchdog Info > + { > + // The physical base address of the SBSA Watchdog control frame > + FixedPcdGet64 (PcdGenericWatchdogControlBase), > + // The physical base address of the SBSA Watchdog refresh frame > + FixedPcdGet64 (PcdGenericWatchdogRefreshBase), > + // The watchdog interrupt > + FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum), > + // The watchdog flags > + MORELLO_SBSA_WATCHDOG_FLAGS > + }, > + > + // SPCR Serial Port > + { > + FixedPcdGet64 (PcdSerialRegisterBase), // Base= Address > + FixedPcdGet32 (PL011UartInterrupt), // Inte= rrupt > + FixedPcdGet64 (PcdUartDefaultBaudRate), // Baud= Rate > + FixedPcdGet32 (PL011UartClkInHz), // Cloc= k > + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART // Port= subtype > + }, > + > + // Debug Serial Port > + { > + FixedPcdGet64 (PcdSerialDbgRegisterBase), // Base= Address > + 0, // Inte= rrupt -unused > + FixedPcdGet64 (PcdSerialDbgUartBaudRate), // Baud= Rate > + FixedPcdGet32 (PcdSerialDbgUartClkInHz), // Cloc= k > + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART // Port= subtype > + }, > + > + // Processor Hierarchy Nodes > + { > + // Package > + { > + // CM_OBJECT_TOKEN Token > + REFERENCE_TOKEN (ProcHierarchyInfo[0]), > + // UINT32 Flags > + PROC_NODE_FLAGS ( > + EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL, > + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID, > + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, > + EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF, > + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_IDENTICAL > + ), > + // CM_OBJECT_TOKEN ParentToken > + CM_NULL_TOKEN, > + // CM_OBJECT_TOKEN GicCToken > + CM_NULL_TOKEN, > + // UINT32 NoOfPrivateResources > + SOC_RESOURCE_COUNT, > + // CM_OBJECT_TOKEN PrivateResourcesArrayToken > + REFERENCE_TOKEN (SocResources) > + }, > + > + // Cluster0 > + { > + // CM_OBJECT_TOKEN Token > + REFERENCE_TOKEN (ProcHierarchyInfo[1]), > + // UINT32 Flags > + PROC_NODE_FLAGS ( > + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, > + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID, > + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, > + EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF, > + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_IDENTICAL > + ), > + // CM_OBJECT_TOKEN ParentToken > + REFERENCE_TOKEN (ProcHierarchyInfo[0]), // -> Package > + // CM_OBJECT_TOKEN GicCToken > + CM_NULL_TOKEN, > + // UINT32 NoOfPrivateResources > + CLUSTER_RESOURCE_COUNT, > + // CM_OBJECT_TOKEN PrivateResourcesArrayToken > + REFERENCE_TOKEN (ClusterResources) > + }, > + // Cluster1 > + { > + // CM_OBJECT_TOKEN Token > + REFERENCE_TOKEN (ProcHierarchyInfo[2]), > + // UINT32 Flags > + PROC_NODE_FLAGS ( > + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, > + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID, > + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, > + EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF, > + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_IDENTICAL > + ), > + // CM_OBJECT_TOKEN ParentToken > + REFERENCE_TOKEN (ProcHierarchyInfo[0]), // -> Package > + // CM_OBJECT_TOKEN GicCToken > + CM_NULL_TOKEN, > + // UINT32 NoOfPrivateResources > + CLUSTER_RESOURCE_COUNT, > + // CM_OBJECT_TOKEN PrivateResourcesArrayToken > + REFERENCE_TOKEN (ClusterResources) > + }, > + // Cluster0 - Cpu0 > + { > + // CM_OBJECT_TOKEN Token > + REFERENCE_TOKEN (ProcHierarchyInfo[3]), > + // UINT32 Flags > + PROC_NODE_FLAGS ( > + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, > + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, > + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, > + EFI_ACPI_6_3_PPTT_NODE_IS_LEAF, > + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL > + ), > + // CM_OBJECT_TOKEN ParentToken > + REFERENCE_TOKEN (ProcHierarchyInfo[1]), // -> 'cluster in Clu= ster0 > + // CM_OBJECT_TOKEN GicCToken > + REFERENCE_TOKEN (GicCInfo[0]), > + // UINT32 NoOfPrivateResources > + CORE_RESOURCE_COUNT, > + // CM_OBJECT_TOKEN PrivateResourcesArrayToken > + REFERENCE_TOKEN (CoreResources) > + }, > + // Cluster0 - Cpu1 > + { > + // CM_OBJECT_TOKEN Token > + REFERENCE_TOKEN (ProcHierarchyInfo[4]), > + // UINT32 Flags > + PROC_NODE_FLAGS ( > + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, > + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, > + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, > + EFI_ACPI_6_3_PPTT_NODE_IS_LEAF, > + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL > + ), > + // CM_OBJECT_TOKEN ParentToken > + REFERENCE_TOKEN (ProcHierarchyInfo[1]), // -> 'cluster in Clu= ster0 > + // CM_OBJECT_TOKEN GicCToken > + REFERENCE_TOKEN (GicCInfo[1]), > + // UINT32 NoOfPrivateResources > + CORE_RESOURCE_COUNT, > + // CM_OBJECT_TOKEN PrivateResourcesArrayToken > + REFERENCE_TOKEN (CoreResources) > + }, > + // Cluster1 - Cpu0 > + { > + // CM_OBJECT_TOKEN Token > + REFERENCE_TOKEN (ProcHierarchyInfo[3]), > + // UINT32 Flags > + PROC_NODE_FLAGS ( > + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, > + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, > + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, > + EFI_ACPI_6_3_PPTT_NODE_IS_LEAF, > + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL > + ), > + // CM_OBJECT_TOKEN ParentToken > + REFERENCE_TOKEN (ProcHierarchyInfo[2]), // -> 'cluster in Clu= ster1 > + // CM_OBJECT_TOKEN GicCToken > + REFERENCE_TOKEN (GicCInfo[2]), > + // UINT32 NoOfPrivateResources > + CORE_RESOURCE_COUNT, > + // CM_OBJECT_TOKEN PrivateResourcesArrayToken > + REFERENCE_TOKEN (CoreResources) > + }, > + > + // Cluster1 - Cpu1 > + { > + // CM_OBJECT_TOKEN Token > + REFERENCE_TOKEN (ProcHierarchyInfo[4]), > + // UINT32 Flags > + PROC_NODE_FLAGS ( > + EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, > + EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, > + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, > + EFI_ACPI_6_3_PPTT_NODE_IS_LEAF, > + EFI_ACPI_6_3_PPTT_IMPLEMENTATION_NOT_IDENTICAL > + ), > + // CM_OBJECT_TOKEN ParentToken > + REFERENCE_TOKEN (ProcHierarchyInfo[2]), // -> 'cluster in Clu= ster1 > + // CM_OBJECT_TOKEN GicCToken > + REFERENCE_TOKEN (GicCInfo[3]), > + // UINT32 NoOfPrivateResources > + CORE_RESOURCE_COUNT, > + // CM_OBJECT_TOKEN PrivateResourcesArrayToken > + REFERENCE_TOKEN (CoreResources) > + }, > + }, > + > + // Cache information > + { > + // 'cluster's L3 cache > + { > + REFERENCE_TOKEN (CacheInfo[0]), // CM_OBJECT_TOKEN Token > + CM_NULL_TOKEN, // CM_OBJECT_TOKEN NextLeve= lOfCacheToken > + SIZE_1MB, // UINT32 Size > + 2048, // UINT32 NumberOfSets > + 8, // UINT32 Associativity > + CACHE_ATTRIBUTES ( // UINT8 Attributes > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ, > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_UNIFIED, > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK > + ), > + 64 // UINT16 LineSize > + }, > + // 'core's L1 instruction cache > + { > + REFERENCE_TOKEN (CacheInfo[1]), // CM_OBJECT_TOKEN Token > + REFERENCE_TOKEN (CacheInfo[3]), // CM_OBJECT_TOKEN NextLeve= lOfCacheToken > + SIZE_64KB, // UINT32 Size > + 256, // UINT32 NumberOfSets > + 4, // UINT32 Associativity > + CACHE_ATTRIBUTES ( // UINT8 Attributes > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ, > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_INSTRUCTION, > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK > + ), > + 64 // UINT16 LineSize > + }, > + // 'core's L1 data cache > + { > + REFERENCE_TOKEN (CacheInfo[2]), // CM_OBJECT_TOKEN Token > + REFERENCE_TOKEN (CacheInfo[3]), // CM_OBJECT_TOKEN NextLeve= lOfCacheToken > + SIZE_64KB, // UINT32 Size > + 256, // UINT32 NumberOfSets > + 4, // UINT32 Associativity > + CACHE_ATTRIBUTES ( // UINT8 Attributes > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ_WRITE, > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_DATA, > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK > + ), > + 64 // UINT16 LineSize > + }, > + // cores's L2 cache > + { > + REFERENCE_TOKEN (CacheInfo[3]), // CM_OBJECT_TOKEN Token > + CM_NULL_TOKEN, // CM_OBJECT_TOKEN NextLeve= lOfCacheToken > + SIZE_1MB, // UINT32 Size > + 2048, // UINT32 NumberOfSets > + 8, // UINT32 Associativity > + CACHE_ATTRIBUTES ( // UINT8 Attributes > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ, > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_UNIFIED, > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK > + ), > + 64 // UINT16 LineSize > + }, > + // slc cache > + { > + REFERENCE_TOKEN (CacheInfo[4]), // CM_OBJECT_TOKEN Token > + CM_NULL_TOKEN, // CM_OBJECT_TOKEN NextLeve= lOfCacheToken > + SIZE_8MB, // UINT32 Size > + 4096, // UINT32 NumberOfSets > + 16, // UINT32 Associativity > + CACHE_ATTRIBUTES ( // UINT8 Attributes > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ, > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_UNIFIED, > + EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK > + ), > + 64 // UINT16 LineSize > + }, > + }, > + // Resources private to the 'cluster (shared among cores) in Clus= ter > + { > + { REFERENCE_TOKEN (CacheInfo[0]) } // -> 'cluster's L3 cache i= n Cluster > + }, > + // Resources private to each individual 'core instance in Cluster > + { > + { REFERENCE_TOKEN (CacheInfo[1]) }, // -> 'core's L1 I-cache in= Cluster > + { REFERENCE_TOKEN (CacheInfo[2]) }, // -> 'core's L1 D-cache in= Cluster > + { REFERENCE_TOKEN (CacheInfo[3]) } // -> 'core's L2 cache in C= luster > + }, > + > + // Resources private to the SoC > + { > + { REFERENCE_TOKEN (CacheInfo[4]) } // -> slc for SoC > + }, > +}; > + > +/** A helper function for returning the Configuration Manager Objec= ts. > + > + @param [in] CmObjectId The Configuration Manager Object= ID. > + @param [in] Object Pointer to the Object(s). > + @param [in] ObjectSize Total size of the Object(s). > + @param [in] ObjectCount Number of Objects. > + @param [in, out] CmObjectDesc Pointer to the Configuration Man= ager Object > + descriptor describing the reques= ted Object. > + > + @retval EFI_SUCCESS Success. > +**/ > +EFI_STATUS > +EFIAPI > +HandleCmObject ( > + IN CONST CM_OBJECT_ID CmObjectId, > + IN VOID * Object, > + IN CONST UINTN ObjectSize, > + IN CONST UINTN ObjectCount, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObjectDesc > + ) > +{ > + CmObjectDesc->ObjectId =3D CmObjectId; > + CmObjectDesc->Size =3D ObjectSize; > + CmObjectDesc->Data =3D (VOID*)Object; > + CmObjectDesc->Count =3D ObjectCount; > + DEBUG (( > + DEBUG_INFO, > + "INFO: CmObjectId =3D %x, Ptr =3D 0x%p, Size =3D %d, Count =3D = %d\n", > + CmObjectId, > + CmObjectDesc->Data, > + CmObjectDesc->Size, > + CmObjectDesc->Count > + )); > + return EFI_SUCCESS; > +} > + > +/** A helper function for returning the Configuration Manager Objec= ts that > + match the token. > + > + @param [in] This Pointer to the Configuration Mana= ger Protocol. > + @param [in] CmObjectId The Configuration Manager Object = ID. > + @param [in] Object Pointer to the Object(s). > + @param [in] ObjectSize Total size of the Object(s). > + @param [in] ObjectCount Number of Objects. > + @param [in] Token A token identifying the object. > + @param [in] HandlerProc A handler function to search the = object > + referenced by the token. > + @param [in, out] CmObjectDesc Pointer to the Configuration Mana= ger Object > + descriptor describing the request= ed Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +HandleCmObjectRefByToken ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN VOID * Object, > + IN CONST UINTN ObjectSiz= e, > + IN CONST UINTN ObjectCou= nt, > + IN CONST CM_OBJECT_TOKEN Token, > + IN CONST CM_OBJECT_HANDLER_PROC HandlerPr= oc, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObjectD= esc > + ) > +{ > + EFI_STATUS Status; > + CmObjectDesc->ObjectId =3D CmObjectId; > + if (Token =3D=3D CM_NULL_TOKEN) { > + CmObjectDesc->Size =3D ObjectSize; > + CmObjectDesc->Data =3D (VOID*)Object; > + CmObjectDesc->Count =3D ObjectCount; > + Status =3D EFI_SUCCESS; > + } else { > + Status =3D HandlerProc (This, CmObjectId, Token, CmObjectDesc); > + } > + > + DEBUG (( > + DEBUG_INFO, > + "INFO: Token =3D 0x%p, CmObjectId =3D %x, Ptr =3D 0x%p, Size = =3D %d, Count =3D %d\n", > + (VOID*)Token, > + CmObjectId, > + CmObjectDesc->Data, > + CmObjectDesc->Size, > + CmObjectDesc->Count > + )); > + return Status; > +} > + > +/** A helper function for returning Configuration Manager Object(s)= referenced > + by token when the entire platform repository is in scope and th= e > + CM_NULL_TOKEN value is not allowed. > + > + @param [in] This Pointer to the Configuration Mana= ger Protocol. > + @param [in] CmObjectId The Configuration Manager Object = ID. > + @param [in] Token A token identifying the object. > + @param [in] HandlerProc A handler function to search the = object(s) > + referenced by the token. > + @param [in, out] CmObjectDesc Pointer to the Configuration Mana= ger Object > + descriptor describing the request= ed Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +STATIC > +EFI_STATUS > +EFIAPI > +HandleCmObjectSearchPlatformRepo ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token, > + IN CONST CM_OBJECT_HANDLER_PROC HandlerPr= oc, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObjectD= esc > + ) > +{ > + EFI_STATUS Status; > + CmObjectDesc->ObjectId =3D CmObjectId; > + if (Token =3D=3D CM_NULL_TOKEN) { > + DEBUG (( > + DEBUG_ERROR, > + "ERROR: CM_NULL_TOKEN value is not allowed when searching" > + " the entire platform repository.\n" > + )); > + return EFI_INVALID_PARAMETER; > + } > + > + Status =3D HandlerProc (This, CmObjectId, Token, CmObjectDesc); > + DEBUG (( > + DEBUG_INFO, > + "INFO: Token =3D 0x%p, CmObjectId =3D %x, Ptr =3D 0x%p, Size = =3D %d, Count =3D %d\n", > + CmObjectId, > + (VOID*)Token, > + CmObjectDesc->Data, > + CmObjectDesc->Size, > + CmObjectDesc->Count > + )); > + return Status; > +} > + > +/** Initialize the Platform Configuration Repository. > + > + @param [in] PlatformRepo Pointer to the Platform Configuration = Repository. > + > + @retval > + EFI_SUCCESS Success > +**/ > +STATIC > +EFI_STATUS > +EFIAPI > +InitializePlatformRepository ( > + IN EDKII_PLATFORM_REPOSITORY_INFO * CONST PlatformRepo > + ) > +{ > + return EFI_SUCCESS; > +} > + > +/** Return a GT Block timer frame info list. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token A token for identifying the object > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested = Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetGTBlockTimerFrameInfo ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EDKII_COMMON_PLATFORM_REPOSITORY_INFO * PlatformRepo; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + > + PlatformRepo =3D This->PlatRepoInfo->CommonPlatRepoInfo; > + > + if (Token !=3D (CM_OBJECT_TOKEN)&PlatformRepo->GTBlock0TimerInfo)= { > + return EFI_NOT_FOUND; > + } > + > + CmObject->ObjectId =3D CmObjectId; > + CmObject->Size =3D sizeof (PlatformRepo->GTBlock0TimerInfo); > + CmObject->Data =3D (VOID*)&PlatformRepo->GTBlock0TimerInfo; > + CmObject->Count =3D ARRAY_SIZE (PlatformRepo->GTBlock0TimerInfo); > + return EFI_SUCCESS; > +} > + > +/** Return GIC CPU Interface Info. > + > + @param [in] This Pointer to the Configuration Mana= ger Protocol. > + @param [in] CmObjectId The Object ID of the CM object re= quested > + @param [in] SearchToken A unique token for identifying th= e requested > + CM_ARM_GICC_INFO object. > + @param [in, out] CmObject Pointer to the Configuration Mana= ger Object > + descriptor describing the request= ed Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information i= s not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetGicCInfo ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN SearchTok= en, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EDKII_COMMON_PLATFORM_REPOSITORY_INFO * PlatformRepo; > + UINT32 ObjIndex; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + > + PlatformRepo =3D This->PlatRepoInfo->CommonPlatRepoInfo; > + > + for (ObjIndex =3D 0; ObjIndex < PLAT_CPU_COUNT; ObjIndex++) { > + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->GicCInfo= [ObjIndex]) { > + CmObject->ObjectId =3D CmObjectId; > + CmObject->Size =3D sizeof (PlatformRepo->GicCInfo[ObjIndex]); > + CmObject->Data =3D (VOID*)&PlatformRepo->GicCInfo[ObjIndex]; > + CmObject->Count =3D 1; > + return EFI_SUCCESS; > + } > + } > + > + return EFI_NOT_FOUND; > +} > + > +/** Return a list of Configuration Manager object references pointe= d to by the > + given input token. > + > + @param [in] This Pointer to the Configuration Mana= ger Protocol. > + @param [in] CmObjectId The Object ID of the CM object re= quested > + @param [in] SearchToken A unique token for identifying th= e requested > + CM_ARM_OBJ_REF list. > + @param [in, out] CmObject Pointer to the Configuration Mana= ger Object > + descriptor describing the request= ed Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information i= s not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetCmObjRefs ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN SearchTok= en, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EDKII_COMMON_PLATFORM_REPOSITORY_INFO * CommonPlatRepo; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + > + CommonPlatRepo =3D This->PlatRepoInfo->CommonPlatRepoInfo; > + > + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&CommonPlatRepo->ClusterR= esources) { > + CmObject->Size =3D sizeof (CommonPlatRepo->ClusterResources); > + CmObject->Data =3D (VOID*)&CommonPlatRepo->ClusterResources; > + CmObject->Count =3D ARRAY_SIZE (CommonPlatRepo->ClusterResource= s); > + return EFI_SUCCESS; > + } > + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&CommonPlatRepo->CoreReso= urces) { > + CmObject->Size =3D sizeof (CommonPlatRepo->CoreResources); > + CmObject->Data =3D (VOID*)&CommonPlatRepo->CoreResources; > + CmObject->Count =3D ARRAY_SIZE (CommonPlatRepo->CoreResources); > + return EFI_SUCCESS; > + } > + if (SearchToken =3D=3D (CM_OBJECT_TOKEN)&CommonPlatRepo->SocResou= rces) { > + CmObject->Size =3D sizeof (CommonPlatRepo->SocResources); > + CmObject->Data =3D (VOID*)&CommonPlatRepo->SocResources; > + CmObject->Count =3D ARRAY_SIZE (CommonPlatRepo->SocResources); > + return EFI_SUCCESS; > + } > + > + return EFI_NOT_FOUND; > +} > + > +/** Return a standard namespace object. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token An optional token identifying the ob= ject. If > + unused this must be CM_NULL_TOKEN. > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested = Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetStandardNameSpaceObject ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token OPT= IONAL, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EFI_STATUS Status; > + EDKII_COMMON_PLATFORM_REPOSITORY_INFO * CommonPlatRepo; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + > + CommonPlatRepo =3D This->PlatRepoInfo->CommonPlatRepoInfo; > + > + //First search the FVP/SoC platform specific objects and enter th= e below > + //if condition only when this function returns EFI_NOT_FOUND stat= us. > + Status =3D GetStandardNameSpaceObjectPlat (This, CmObjectId, Toke= n, CmObject); > + > + if (Status =3D=3D EFI_NOT_FOUND) { > + switch (GET_CM_OBJECT_ID (CmObjectId)) { > + case EStdObjCfgMgrInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + &CommonPlatRepo->CmInfo, > + sizeof (CommonPlatRepo->CmInfo), > + 1, > + CmObject > + ); > + break; > + > + default: { > + Status =3D EFI_NOT_FOUND; > + DEBUG (( > + DEBUG_ERROR, > + "ERROR: Object 0x%x. Status =3D %r\n", > + CmObjectId, > + Status > + )); > + break; > + } > + } //switch > + } > + > + return Status; > +} > + > +/** Return an ARM namespace object. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token An optional token identifying the ob= ject. If > + unused this must be CM_NULL_TOKEN. > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested = Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetArmNameSpaceObject ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token OPT= IONAL, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EFI_STATUS Status; > + EDKII_COMMON_PLATFORM_REPOSITORY_INFO * CommonPlatRepo; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + CommonPlatRepo =3D This->PlatRepoInfo->CommonPlatRepoInfo; > + > + //First search the FVP/SoC platform specific objects and enter th= e below > + //if condition only when this function return EFI_NOT_FOUND statu= s. > + Status =3D GetArmNameSpaceObjectPlat (This, CmObjectId, Token, Cm= Object); > + > + if (Status =3D=3D EFI_NOT_FOUND) { > + switch (GET_CM_OBJECT_ID (CmObjectId)) { > + case EArmObjBootArchInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + &CommonPlatRepo->BootArchInfo, > + sizeof (CommonPlatRepo->BootArchInfo), > + 1, > + CmObject > + ); > + break; > + > +#ifdef HEADLESS_PLATFORM > + case EArmObjFixedFeatureFlags: > + Status =3D HandleCmObject ( > + CmObjectId, > + &CommonPlatRepo->FixedFeatureFlags, > + sizeof (CommonPlatRepo->FixedFeatureFlags), > + 1, > + CmObject > + ); > + break; > +#endif > + case EArmObjPowerManagementProfileInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + &CommonPlatRepo->PmProfileInfo, > + sizeof (CommonPlatRepo->PmProfileInfo), > + 1, > + CmObject > + ); > + break; > + > + case EArmObjGenericTimerInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + &CommonPlatRepo->GenericTimerInfo, > + sizeof (CommonPlatRepo->GenericTimerInfo), > + 1, > + CmObject > + ); > + break; > + > + case EArmObjPlatformGenericWatchdogInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + &CommonPlatRepo->Watchdog, > + sizeof (CommonPlatRepo->Watchdog), > + 1, > + CmObject > + ); > + break; > + > + case EArmObjPlatformGTBlockInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + CommonPlatRepo->GTBlockInfo, > + sizeof (CommonPlatRepo->GTBlockInfo), > + 1, > + CmObject > + ); > + break; > + > + case EArmObjGTBlockTimerFrameInfo: > + Status =3D HandleCmObjectRefByToken ( > + This, > + CmObjectId, > + CommonPlatRepo->GTBlock0TimerInfo, > + sizeof (CommonPlatRepo->GTBlock0TimerInfo), > + ARRAY_SIZE (CommonPlatRepo->GTBlock0TimerInfo), > + Token, > + GetGTBlockTimerFrameInfo, > + CmObject > + ); > + break; > + > + case EArmObjGicCInfo: > + Status =3D HandleCmObjectRefByToken ( > + This, > + CmObjectId, > + CommonPlatRepo->GicCInfo, > + sizeof (CommonPlatRepo->GicCInfo), > + PLAT_CPU_COUNT, > + Token, > + GetGicCInfo, > + CmObject > + ); > + break; > + > + case EArmObjGicDInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + &CommonPlatRepo->GicDInfo, > + sizeof (CommonPlatRepo->GicDInfo), > + 1, > + CmObject > + ); > + break; > + > + case EArmObjGicRedistributorInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + &CommonPlatRepo->GicRedistInfo, > + sizeof (CommonPlatRepo->GicRedistInfo), > + 1, > + CmObject > + ); > + break; > + > + case EArmObjSerialConsolePortInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + &CommonPlatRepo->SpcrSerialPort, > + sizeof (CommonPlatRepo->SpcrSerialPort), > + 1, > + CmObject > + ); > + break; > + > + case EArmObjSerialDebugPortInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + &CommonPlatRepo->DbgSerialPort, > + sizeof (CommonPlatRepo->DbgSerialPort), > + 1, > + CmObject > + ); > + break; > + > + case EArmObjProcHierarchyInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + CommonPlatRepo->ProcHierarchyInfo, > + sizeof (CommonPlatRepo->ProcHierarchyInfo), > + PLAT_PROC_HIERARCHY_NODE_COUNT, > + CmObject > + ); > + break; > + > + case EArmObjCacheInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + CommonPlatRepo->CacheInfo, > + sizeof (CommonPlatRepo->CacheInfo), > + ARRAY_SIZE (CommonPlatRepo->CacheInfo), > + CmObject > + ); > + break; > + > + case EArmObjCmRef: > + Status =3D HandleCmObjectSearchPlatformRepo ( > + This, > + CmObjectId, > + Token, > + GetCmObjRefs, > + CmObject > + ); > + break; > + > + default: { > + Status =3D EFI_NOT_FOUND; > + DEBUG (( > + DEBUG_INFO, > + "INFO: Object 0x%x. Status =3D %r\n", > + CmObjectId, > + Status > + )); > + break; > + } > + }//switch > + } > + return Status; > +} > + > +/** Return an OEM namespace object. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token An optional token identifying the ob= ject. If > + unused this must be CM_NULL_TOKEN. > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested = Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetOemNameSpaceObject ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token OPT= IONAL, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EFI_STATUS Status; > + > + Status =3D EFI_SUCCESS; > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + > + switch (GET_CM_OBJECT_ID (CmObjectId)) { > + default: { > + Status =3D EFI_NOT_FOUND; > + DEBUG (( > + DEBUG_ERROR, > + "ERROR: Object 0x%x. Status =3D %r\n", > + CmObjectId, > + Status > + )); > + break; > + } > + } > + > + return Status; > +} > + > +/** The GetObject function defines the interface implemented by the > + Configuration Manager Protocol for returning the Configuration > + Manager Objects. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token An optional token identifying the ob= ject. If > + unused this must be CM_NULL_TOKEN. > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested = Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +MorelloPlatformGetObject ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token OPT= IONAL, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EFI_STATUS Status; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + > + switch (GET_CM_NAMESPACE_ID (CmObjectId)) { > + case EObjNameSpaceStandard: > + Status =3D GetStandardNameSpaceObject (This, CmObjectId, Toke= n, CmObject); > + break; > + case EObjNameSpaceArm: > + Status =3D GetArmNameSpaceObject (This, CmObjectId, Token, Cm= Object); > + break; > + case EObjNameSpaceOem: > + Status =3D GetOemNameSpaceObject (This, CmObjectId, Token, Cm= Object); > + break; > + default: { > + Status =3D EFI_INVALID_PARAMETER; > + DEBUG (( > + DEBUG_ERROR, > + "ERROR: Unknown Namespace Object =3D 0x%x. Status =3D %r\n"= , > + CmObjectId, > + Status > + )); > + break; > + } > + } > + > + return Status; > +} > + > +/** The SetObject function defines the interface implemented by the > + Configuration Manager Protocol for updating the Configuration > + Manager Objects. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token An optional token identifying the ob= ject. If > + unused this must be CM_NULL_TOKEN. > + @param [in] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the Object. > + > + @retval EFI_UNSUPPORTED This operation is not supported. > +**/ > +EFI_STATUS > +EFIAPI > +MorelloPlatformSetObject ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token OPT= IONAL, > + IN CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + return EFI_UNSUPPORTED; > +} > + > +/** A structure describing the configuration manager protocol inter= face. > +*/ > +STATIC > +CONST > +EDKII_CONFIGURATION_MANAGER_PROTOCOL MorelloPlatformConfigManagerPr= otocol =3D { > + CREATE_REVISION(1,0), > + MorelloPlatformGetObject, > + MorelloPlatformSetObject, > + &MorelloRepositoryInfo > +}; > + > +/** > + Entrypoint of Configuration Manager Dxe. > + > + @param ImageHandle > + @param SystemTable > + > + @return EFI_SUCCESS > + @return EFI_LOAD_ERROR > + @return EFI_OUT_OF_RESOURCES > + > +**/ > +EFI_STATUS > +EFIAPI > +ConfigurationManagerDxeInitialize ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE * SystemTable > + ) > +{ > + EFI_STATUS Status; > + > + // Initialize the Platform Configuration Repository before instal= ling the > + // Configuration Manager Protocol > + Status =3D InitializePlatformRepository ( > + MorelloPlatformConfigManagerProtocol.PlatRepoInfo > + ); > + if (EFI_ERROR (Status)) { > + DEBUG (( > + DEBUG_ERROR, > + "ERROR: Failed to initialize the Platform Configuration Repos= itory." \ > + " Status =3D %r\n", > + Status > + )); > + } > + > + Status =3D gBS->InstallProtocolInterface ( > + &ImageHandle, > + &gEdkiiConfigurationManagerProtocolGuid, > + EFI_NATIVE_INTERFACE, > + (VOID*)&MorelloPlatformConfigManagerProtocol > + ); > + if (EFI_ERROR (Status)) { > + DEBUG (( > + DEBUG_ERROR, > + "ERROR: Failed to get Install Configuration Manager Protocol.= " \ > + " Status =3D %r\n", > + Status > + )); > + goto error_handler; > + } > + > +error_handler: > + return Status; > +} > diff --git a/Platform/ARM/Morello/ConfigurationManager/Configuration= ManagerDxe/ConfigurationManagerFvp.c b/Platform/ARM/Morello/ConfigurationMa= nager/ConfigurationManagerDxe/ConfigurationManagerFvp.c > new file mode 100644 > index 000000000000..333d961ed88a > --- /dev/null > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManager= Dxe/ConfigurationManagerFvp.c > @@ -0,0 +1,602 @@ > +/** @file > + Configuration Manager Dxe > + > + Copyright (c) 2021, ARM Limited. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + @par Glossary: > + - Cm or CM - Configuration Manager > + - Obj or OBJ - Object > +**/ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "ConfigurationManagerFvp.h" > +#include "Platform.h" > + > +EDKII_FVP_PLATFORM_REPOSITORY_INFO MorelloFvpRepositoryInfo =3D { > + // ACPI Table List > + { > + // FADT Table > + { > + EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, > + EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt), > + NULL > + }, > + // GTDT Table > + { > + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, > + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION, > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdGtdt), > + NULL > + }, > + // MADT Table > + { > + EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, > + EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdMadt), > + NULL > + }, > + // SPCR Table > + { > + EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, > + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION, > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSpcr), > + NULL > + }, > + // DSDT Table > + { > + EFI_ACPI_6_3_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATUR= E, > + 0, // Unused > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdDsdt), > + (EFI_ACPI_DESCRIPTION_HEADER*)dsdtfvp_aml_code > + }, > + // DBG2 Table > + { > + EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE, > + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdDbg2), > + NULL > + }, > + // PPTT Table > + { > + EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SI= GNATURE, > + EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_REVISION, > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdPptt), > + NULL > + }, > + // IORT Table > + { > + EFI_ACPI_6_3_IO_REMAPPING_TABLE_SIGNATURE, > + EFI_ACPI_IO_REMAPPING_TABLE_REVISION, > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdIort), > + NULL > + }, > + // PCI MCFG Table > + { > + EFI_ACPI_6_3_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BA= SE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE, > + EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVIS= ION, > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdMcfg), > + NULL, > + }, > + // SSDT table describing the PCI root complex > + { > + EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, > + 0, // Unused > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdt), > + (EFI_ACPI_DESCRIPTION_HEADER*)ssdtpcifvp_aml_code > + }, > + }, > + > + // GIC ITS > + { > + // GIC ITS - PCIe TCU > + { > + // The GIC ITS ID. > + 0, > + // The physical address for the Interrupt Translation Service > + 0x30060000, > + //Proximity Domain > + 0 > + }, > + // GIC ITS - PCIe RC > + { > + // The GIC ITS ID. > + 1, > + // The physical address for the Interrupt Translation Service > + 0x300A0000, > + //Proximity Domain > + 0 > + }, > + }, > + > + // ITS group node > + { > + { > + // Reference token for this Iort node > + REFERENCE_TOKEN_FVP (ItsGroupInfo[0]), > + // The number of ITS identifiers in the ITS node. > + 1, > + // Reference token for the ITS identifier array > + REFERENCE_TOKEN_FVP (ItsIdentifierArray[0]) > + }, > + { > + // Reference token for this Iort node > + REFERENCE_TOKEN_FVP (ItsGroupInfo[1]), > + // The number of ITS identifiers in the ITS node. > + 1, > + // Reference token for the ITS identifier array > + REFERENCE_TOKEN_FVP (ItsIdentifierArray[1]) > + }, > + }, > + > + // ITS identifier array > + { > + { > + // The ITS Identifier > + 0 > + }, > + { > + // The ITS Identifier > + 1 > + }, > + }, > + > + // SMMUv3 Node > + { > + { > + // Reference token for this Iort node > + REFERENCE_TOKEN_FVP (SmmuV3Info[0]), > + // Number of ID mappings > + 2, > + // Reference token for the ID mapping array > + REFERENCE_TOKEN_FVP (DeviceIdMapping[0][0]), > + // SMMU Base Address > + 0x4F400000, > + // SMMU flags > + EFI_ACPI_IORT_SMMUv3_FLAG_COHAC_OVERRIDE, > + // VATOS address > + 0, > + // Model > + EFI_ACPI_IORT_SMMUv3_MODEL_GENERIC, > + // GSIV of the Event interrupt if SPI based > + 0x10B, > + // PRI Interrupt if SPI based > + 0, > + // GERR interrupt if GSIV based > + 0x10D, > + // Sync interrupt if GSIV based > + 0x10C, > + // Proximity domain flag, ignored in this case > + 0, > + // Index into the array of ID mapping, ignored as all > + // the SMMU control interrupts are GSIV based > [SAMI] If I understand correctly the PRI interrupt is MSI based. In that= case should this comment be only 'Index into the array of ID mapping'? > Let me know if you agree, I will make this change locally before pushing= the changes. > [/SAMI] > + 1 > + }, > + }, > + > + // Root Complex node info > + { > + { > + // Reference token for this Iort node > + REFERENCE_TOKEN_FVP (RootComplexInfo[0]), > + // Number of ID mappings > + 1, > + // Reference token for the ID mapping array > + REFERENCE_TOKEN_FVP (DeviceIdMapping[1][0]), > + > + // Memory access properties : Cache coherent attributes > + EFI_ACPI_IORT_MEM_ACCESS_PROP_CCA, > + // Memory access properties : Allocation hints > + 0, > + // Memory access properties : Memory access flags > + 0, > + // ATS attributes > + EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTED, > + // PCI segment number > + 0, > + // Memory address size limit > + 42 > + }, > + }, > + > + // Array of Device ID mappings > + { > + // DeviceIdMapping[0][0] - [0][1] > + { > + /* Mapping SMMUv3 -> ITS Group > + */ > + > + // SMMUv3 device ID mapping > + { > + // Input base > + 0x0, > + // Number of input IDs > + 0x0000FFFF, > + // Output Base > + 0x0, > + // Output reference > + REFERENCE_TOKEN_FVP (ItsGroupInfo[1]), > + // Flags > + 0 > + }, > + // SMMUv3 device ID mapping > + { > + // Input base > + 0x0, > + // Number of input IDs > + 0x00000001, > + // Output Base > + 0x0, > + // Output reference token for the IORT node > + REFERENCE_TOKEN_FVP (ItsGroupInfo[0]), > + // Flags > + EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE > + } > + }, > + // DeviceIdMapping[1][0] > + { > + // Mapping for RootComplex -> SMMUv3 > + > + // Device ID mapping for Root complex node > + { > + // Input base > + 0x0, > + // Number of input IDs > + 0x0000FFFF, > + // Output Base > + 0x0, > + // Output reference > + REFERENCE_TOKEN_FVP (SmmuV3Info[0]), > + // Flags > + 0 > + }, > + }, > + }, > + // PCI Configuration Space Info > + { > + // PCIe ECAM > + { > + FixedPcdGet64 (PcdPciExpressBaseAddress), // Base Address > + 0x0, // Segment Group = Number > + FixedPcdGet32 (PcdPciBusMin), // Start Bus Numbe= r > + FixedPcdGet32 (PcdPciBusMax) // End Bus Number > + }, > + }, > +}; > + > +EDKII_PLATFORM_REPOSITORY_INFO MorelloRepositoryInfo =3D { > + &CommonPlatformInfo, > + &MorelloFvpRepositoryInfo > +}; > + > +/** Return a device Id mapping array. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token A token for identifying the object > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested O= bject. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetDeviceIdMappingArray ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EDKII_FVP_PLATFORM_REPOSITORY_INFO * PlatformRepo; > + UINTN Count; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + > + PlatformRepo =3D This->PlatRepoInfo->FvpPlatRepoInfo; > + > + DEBUG ((DEBUG_INFO, "DeviceIdMapping - Token =3D %p\n")); > + > + if (Token =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->DeviceIdMapping[= 0][0]) { > + Count =3D 2; > + DEBUG ((DEBUG_INFO, "DeviceIdMapping - Found DeviceIdMapping[0]= [0]\n")); > + } else if (Token =3D=3D > + (CM_OBJECT_TOKEN)&PlatformRepo->DeviceIdMapping[1][0])= { > + Count =3D 1; > + DEBUG ((DEBUG_INFO, "DeviceIdMapping - Found DeviceIdMapping[1]= [0]\n")); > + } else { > + DEBUG ((DEBUG_INFO, "DeviceIdMapping - Not Found\n")); > + return EFI_NOT_FOUND; > + } > + > + CmObject->Data =3D (VOID*)Token; > + CmObject->ObjectId =3D CmObjectId; > + CmObject->Count =3D Count; > + CmObject->Size =3D Count * sizeof (CM_ARM_ID_MAPPING); > + > + return EFI_SUCCESS; > +} > + > +/** Return an ITS identifier array. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token A token for identifying the object > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested O= bject. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetItsIdentifierArray ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EDKII_FVP_PLATFORM_REPOSITORY_INFO * PlatformRepo; > + UINTN Count; > + UINTN Index; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + > + PlatformRepo =3D This->PlatRepoInfo->FvpPlatRepoInfo; > + > + Count =3D ARRAY_SIZE (PlatformRepo->ItsIdentifierArray); > + > + for (Index =3D 0; Index < Count; Index++) { > + if (Token =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->ItsIdentifierA= rray[Index]) { > + CmObject->ObjectId =3D CmObjectId; > + CmObject->Size =3D sizeof (PlatformRepo->ItsIdentifierArray[0= ]); > + CmObject->Data =3D (VOID*)&PlatformRepo->ItsIdentifierArray[I= ndex]; > + CmObject->Count =3D 1; > + return EFI_SUCCESS; > + } > + } > + > + return EFI_NOT_FOUND; > +} > + > +/** Return an ITS group info. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token A token for identifying the object > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested O= bject. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetItsGroupInfo ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EDKII_FVP_PLATFORM_REPOSITORY_INFO * PlatformRepo; > + UINTN Count; > + UINTN Index; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + > + PlatformRepo =3D This->PlatRepoInfo->FvpPlatRepoInfo; > + > + Count =3D ARRAY_SIZE (PlatformRepo->ItsGroupInfo); > + > + for (Index =3D 0; Index < Count; Index++) { > + if (Token =3D=3D (CM_OBJECT_TOKEN)&PlatformRepo->ItsGroupInfo[I= ndex]) { > + CmObject->ObjectId =3D CmObjectId; > + CmObject->Size =3D sizeof (PlatformRepo->ItsGroupInfo[0]); > + CmObject->Data =3D (VOID*)&PlatformRepo->ItsGroupInfo[Index]; > + CmObject->Count =3D 1; > + return EFI_SUCCESS; > + } > + } > + > + return EFI_NOT_FOUND; > +} > + > +/** Return platform specific ARM namespace object. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token An optional token identifying the ob= ject. If > + unused this must be CM_NULL_TOKEN. > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested = Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetArmNameSpaceObjectPlat ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token OPT= IONAL, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EFI_STATUS Status; > + EDKII_FVP_PLATFORM_REPOSITORY_INFO * PlatformRepo; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + PlatformRepo =3D This->PlatRepoInfo->FvpPlatRepoInfo; > + Status =3D EFI_NOT_FOUND; > + > + switch (GET_CM_OBJECT_ID (CmObjectId)) { > + case EArmObjGicItsInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + &PlatformRepo->GicItsInfo, > + sizeof (PlatformRepo->GicItsInfo), > + ARRAY_SIZE (PlatformRepo->GicItsInfo), > + CmObject > + ); > + break; > + > + case EArmObjSmmuV3: > + Status =3D HandleCmObject ( > + CmObjectId, > + PlatformRepo->SmmuV3Info, > + sizeof (PlatformRepo->SmmuV3Info), > + 1, > + CmObject > + ); > + break; > + > + case EArmObjItsGroup: > + Status =3D HandleCmObjectRefByToken ( > + This, > + CmObjectId, > + PlatformRepo->ItsGroupInfo, > + sizeof (PlatformRepo->ItsGroupInfo), > + ARRAY_SIZE (PlatformRepo->ItsGroupInfo), > + Token, > + GetItsGroupInfo, > + CmObject > + ); > + break; > + > + case EArmObjGicItsIdentifierArray: > + Status =3D HandleCmObjectRefByToken ( > + This, > + CmObjectId, > + PlatformRepo->ItsIdentifierArray, > + sizeof (PlatformRepo->ItsIdentifierArray), > + ARRAY_SIZE (PlatformRepo->ItsIdentifierArray), > + Token, > + GetItsIdentifierArray, > + CmObject > + ); > + break; > + > + case EArmObjRootComplex: > + Status =3D HandleCmObject ( > + CmObjectId, > + PlatformRepo->RootComplexInfo, > + sizeof (PlatformRepo->RootComplexInfo), > + 1, > + CmObject > + ); > + break; > + > + case EArmObjIdMappingArray: > + Status =3D HandleCmObjectRefByToken ( > + This, > + CmObjectId, > + PlatformRepo->DeviceIdMapping, > + sizeof (PlatformRepo->DeviceIdMapping), > + ARRAY_SIZE (PlatformRepo->DeviceIdMapping), > + Token, > + GetDeviceIdMappingArray, > + CmObject > + ); > + break; > + > + case EArmObjPciConfigSpaceInfo: > + Status =3D HandleCmObject ( > + CmObjectId, > + PlatformRepo->PciConfigInfo, > + sizeof (PlatformRepo->PciConfigInfo), > + 1, > + CmObject > + ); > + break; > + > + default: { > + break; > + } > + }//switch > + return Status; > +} > + > +/** Return platform specific standard namespace object. > + > + @param [in] This Pointer to the Configuration Manager= Protocol. > + @param [in] CmObjectId The Configuration Manager Object ID. > + @param [in] Token An optional token identifying the ob= ject. If > + unused this must be CM_NULL_TOKEN. > + @param [in, out] CmObject Pointer to the Configuration Manager= Object > + descriptor describing the requested = Object. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_NOT_FOUND The required object information is = not found. > +**/ > +EFI_STATUS > +EFIAPI > +GetStandardNameSpaceObjectPlat ( > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, > + IN CONST CM_OBJECT_ID CmObjectI= d, > + IN CONST CM_OBJECT_TOKEN Token OPT= IONAL, > + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject > + ) > +{ > + EFI_STATUS Status; > + EDKII_FVP_PLATFORM_REPOSITORY_INFO * PlatformRepo; > + > + if ((This =3D=3D NULL) || (CmObject =3D=3D NULL)) { > + ASSERT (This !=3D NULL); > + ASSERT (CmObject !=3D NULL); > + return EFI_INVALID_PARAMETER; > + } > + > + Status =3D EFI_NOT_FOUND; > + PlatformRepo =3D This->PlatRepoInfo->FvpPlatRepoInfo; > + > + switch (GET_CM_OBJECT_ID (CmObjectId)) { > + case EStdObjAcpiTableList: > + Status =3D HandleCmObject ( > + CmObjectId, > + PlatformRepo->CmAcpiTableList, > + sizeof (PlatformRepo->CmAcpiTableList), > + ARRAY_SIZE (PlatformRepo->CmAcpiTableList), > + CmObject > + ); > + break; > + > + default: { > + break; > + } > + } > + > + return Status; > +} > diff --git a/Platform/ARM/Morello/ConfigurationManager/Configuration= ManagerDxe/AslTables/DsdtFvp.asl b/Platform/ARM/Morello/ConfigurationManage= r/ConfigurationManagerDxe/AslTables/DsdtFvp.asl > new file mode 100644 > index 000000000000..6ff3d030ba9f > --- /dev/null > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManager= Dxe/AslTables/DsdtFvp.asl > @@ -0,0 +1,98 @@ > +/** @file > + Differentiated System Description Table Fields (DSDT) > + > + Copyright (c) 2021, ARM Ltd. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > +**/ > + > +#include "ConfigurationManager.h" > + > +DefinitionBlock("Dsdt.aml", "DSDT", 1, "ARMLTD", "MORELLO", CFG_MGR= _OEM_REVISION) { > + Scope(_SB) { > + Device(CP00) { // Cluster 0, Cpu 0 > + Name(_HID, "ACPI0007") > + Name(_UID, 0) > + Name(_STA, 0xF) > + } > + > + Device(CP01) { // Cluster 0, Cpu 1 > + Name(_HID, "ACPI0007") > + Name(_UID, 1) > + Name(_STA, 0xF) > + } > + > + Device(CP02) { // Cluster 1, Cpu 0 > + Name(_HID, "ACPI0007") > + Name(_UID, 2) > + Name(_STA, 0xF) > + } > + > + Device(CP03) { // Cluster 1, Cpu 1 > + Name(_HID, "ACPI0007") > + Name(_UID, 3) > + Name(_STA, 0xF) > + } > + > + // VIRTIO DISK > + Device(VR00) { > + Name(_HID, "LNRO0005") > + Name(_UID, 0) > + > + Name(_CRS, ResourceTemplate() { > + Memory32Fixed( > + ReadWrite, > + FixedPcdGet32 (PcdVirtioBlkBaseAddress), > + FixedPcdGet32 (PcdVirtioBlkSize) > + ) > + Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { > + FixedPcdGet32 (PcdVirtioBlkInterrupt) > + } > + }) > + } > + > + // VIRTIO NET > + Device(VR01) { > + Name(_HID, "LNRO0005") > + Name(_UID, 1) > + > + Name(_CRS, ResourceTemplate() { > + Memory32Fixed(ReadWrite, 0x1C180000, 0x00000200) > + Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) {= 134 } > + }) > + } > + > + // VIRTIO RANDOM > + Device(VR02) { > + Name(_HID, "LNRO0005") > + Name(_UID, 2) > + > + Name(_CRS, ResourceTemplate() { > + Memory32Fixed(ReadWrite, 0x1C190000, 0x00000200) > + Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) {= 133 } > + }) > + } > + > + // VIRTIO P9 Device > + Device(VR03) { > + Name(_HID, "LNRO0005") > + Name(_UID, 3) > + > + Name(_CRS, ResourceTemplate() { > + Memory32Fixed(ReadWrite, 0x1C1A0000, 0x00000200) > + Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) {= 135 } > + }) > + } > + > + // SMC91X > + Device(NET0) { > + Name(_HID, "LNRO0003") > + Name(_UID, 0) > + > + Name(_CRS, ResourceTemplate() { > + Memory32Fixed(ReadWrite, 0x1D100000, 0x00001000) > + Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) {= 130 } > + }) > + } > + } // Scope(_SB) > +} > diff --git a/Platform/ARM/Morello/ConfigurationManager/Configuration= ManagerDxe/AslTables/SsdtPciFvp.asl b/Platform/ARM/Morello/ConfigurationMan= ager/ConfigurationManagerDxe/AslTables/SsdtPciFvp.asl > new file mode 100644 > index 000000000000..bdf2f06aed69 > --- /dev/null > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManager= Dxe/AslTables/SsdtPciFvp.asl > @@ -0,0 +1,130 @@ > +/** @file > + Secondary System Description Table (SSDT) > + > + Copyright (c) 2021, ARM Limited. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > +**/ > + > +#include "ConfigurationManager.h" > + > +#define LNK_DEVICE(Unique_Id, Link_Name, irq) = \ > + Device(Link_Name) { = \ > + Name(_HID, EISAID("PNP0C0F")) = \ > + Name(_UID, Unique_Id) = \ > + Name(_PRS, ResourceTemplate() { = \ > + Interrupt(ResourceProducer, Level, ActiveHigh, Exclusive) { irq= } \ > + }) = \ > + Method (_CRS, 0) { Return (_PRS) } = \ > + Method (_SRS, 1) { } = \ > + Method (_DIS) { } = \ > +} > + > +#define PRT_ENTRY(Address, Pin, Link) = \ > + Package (4) { = \ > + Address, /* uses the same format as _ADR */ = \ > + Pin, /* The PCI pin number of the device (0-INTA, 1-INTB, = 2-INTC, 3-INTD) */ \ > + Link, /* Interrupt allocated via Link device */ = \ > + Zero /* global system interrupt number (no used) */ = \ > +} > + > +#define ROOT_PRT_ENTRY(Pin, Link) PRT_ENTRY(0x0000FFFF, Pin, Link= ) // Device 0 for Bridge. > + > +DefinitionBlock("SsdtPci.aml", "SSDT", 1, "ARMLTD", "MORELLO", > + CFG_MGR_OEM_REVISION) > +{ > + Scope (_SB) { > + // > + // PCI Root Complex > + // > + LNK_DEVICE(1, LNKA, 201) > + LNK_DEVICE(2, LNKB, 202) > + LNK_DEVICE(3, LNKC, 203) > + LNK_DEVICE(4, LNKD, 204) > + > + // PCI Root Complex > + Device(PCI0) { > + Name (_HID, EISAID("PNP0A08")) // PCI Express Root Bridge > + Name (_CID, EISAID("PNP0A03")) // Compatible PCI Root Bridge > + Name (_SEG, Zero) // PCI Segment Group number > + Name (_BBN, Zero) // PCI Base Bus Number > + Name (_CCA, 1) // Cache Coherency Attribute > + > + // Root Complex 0 > + Device (RP0) { > + Name(_ADR, 0xF0000000) // Dev 0, Func 0 > + } > + > + // PCI Routing Table > + Name(_PRT, Package() { > + ROOT_PRT_ENTRY(0, LNKA), // INTA > + ROOT_PRT_ENTRY(1, LNKB), // INTB > + ROOT_PRT_ENTRY(2, LNKC), // INTC > + ROOT_PRT_ENTRY(3, LNKD), // INTD > + }) > + > + // Root complex resources > + Method (_CRS, 0, Serialized) { > + Name (RBUF, ResourceTemplate () { > + WordBusNumber ( // Bus number= s assigned to this root > + ResourceProducer, > + MinFixed, > + MaxFixed, > + PosDecode, > + 0, // AddressGra= nularity > + FixedPcdGet32 (PcdPciBusMin), // AddressMin= imum - Minimum Bus Number > + FixedPcdGet32 (PcdPciBusMax), // AddressMax= imum - Maximum Bus Number > + 0, // AddressTra= nslation - Set to 0 > + FixedPcdGet32 (PcdPciBusCount) // RangeLengt= h - Number of Busses > + ) > + > + DWordMemory ( // 32-bit BAR= Windows > + ResourceProducer, > + PosDecode, > + MinFixed, > + MaxFixed, > + Cacheable, > + ReadWrite, > + 0x00000000, // Granularity > + FixedPcdGet32 (PcdPciMmio32Base), // Min Base Ad= dress > + FixedPcdGet32 (PcdPciMmio32MaxBase), // Max Base Ad= dress > + FixedPcdGet32 (PcdPciMmio32Translation), // Translate > + FixedPcdGet32 (PcdPciMmio32Size) // Length > + ) > + > + QWordMemory ( // 64-bit BAR= Windows > + ResourceProducer, > + PosDecode, > + MinFixed, > + MaxFixed, > + Cacheable, > + ReadWrite, > + 0x00000000, // Granularity > + FixedPcdGet64 (PcdPciMmio64Base), // Min Base Ad= dress > + FixedPcdGet64 (PcdPciMmio64MaxBase), // Max Base Ad= dress > + FixedPcdGet64 (PcdPciMmio64Translation), // Translate > + FixedPcdGet64 (PcdPciMmio64Size) // Length > + ) > + > + DWordIo ( // IO window > + ResourceProducer, > + MinFixed, > + MaxFixed, > + PosDecode, > + EntireRange, > + 0x00000000, // Granularity > + FixedPcdGet32 (PcdPciIoBase), // Min Base Ad= dress > + FixedPcdGet32 (PcdPciIoMaxBase), // Max Base Ad= dress > + FixedPcdGet32 (PcdPciIoTranslation), // Translate > + FixedPcdGet32 (PcdPciIoSize), // Length > + , > + , > + , > + TypeTranslation > + ) > + }) // Name(RBUF) > + Return (RBUF) > + } // Method (_CRS) > + } // Device (PCI0) > + } // _SB > +} // DB > -- > 2.17.1 > > > > >=20 > >