From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) by mx.groups.io with SMTP id smtpd.web08.11429.1638966545399255384 for ; Wed, 08 Dec 2021 04:29:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cN+5e9Mu; spf=pass (domain: gmail.com, ip: 209.85.222.48, mailfrom: ch.chandni@gmail.com) Received: by mail-ua1-f48.google.com with SMTP id r15so4397754uao.3 for ; Wed, 08 Dec 2021 04:29:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=B6L3xXt/69tMlfMWT+1a52aK9A9Xsn5yQNk1gfo0qEo=; b=cN+5e9Mu7ibLexy2FEle69cW5WMy4Zr9zjGu912i/PbJwlzQAEx3z1A1+9wPV9iJFJ 2FdZRhvas8goECkD56Zdtg7w7xx1KWmyLXlRAtoj5+drKYmV1gQ3CXiXS9zOfqK26JfY GCreYhiZuFBgCsEKhJUAInz4e8o4S052ZI8KunSh/jb1rA2Ai3/mirimVNFjxaPPIP+S KGvEkN7SmAnjKOdbLEad1+rr4sLVQLUOnyh909TbLyN055Ykim4Z5O1yD61tP1btHxx1 O8Uhf2akWFrU+8REp2ccZ2fcmvG6cplKsedgMgTPdOoDRT5LaD0Ts2Ivj+GM8q1nbDmp V+zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=B6L3xXt/69tMlfMWT+1a52aK9A9Xsn5yQNk1gfo0qEo=; b=GVr0DuaSnEsSOo98/eousSx+0qywgATHV12JBvl/mnTxXqUK6+OpZuIGa2OqMgvV10 rAebiHpAkMWXZgUbJnWZG/nPVcZxJ/xGaav/e84ADuWCPMPYc0Y4x/IejJ6y9HEVMnDp oLseyYnvVE5bP+BUvXE4c3tzsppUwDrvhm5h32AbxJzAX5/QxdQ//VrGburxXbITL3Xs Iatu9LdZDoNL/hkqxjYZm/QgOuMLWqvAnvOloUNCzblDYWveGpjCZv4BTxaxnxzoHQq0 PAogTiDik9bvUjxefSCW9P1nBViCgSPvZiYWwhipgW9JqV0aGQIvtJrvFO8PpyzuBBGX Y/fw== X-Gm-Message-State: AOAM530ItnDMBdBoHOKMRsuAafbItCqQYwEF6+438rNadt06puJki+7z AmrWerp3tM82CX05fjNyybq6+dUHD1eWpWenzMk8G+9a X-Google-Smtp-Source: ABdhPJwJXSehBuuUGLAfMlkZo3tzWwUXriWQ8XH5s3wB/Dt2aDbeQ5QqFXRprscZ4jros7VjiF+Aihcm0pV/yB/a77M= X-Received: by 2002:a67:f805:: with SMTP id l5mr53844607vso.17.1638966544139; Wed, 08 Dec 2021 04:29:04 -0800 (PST) MIME-Version: 1.0 References: <20211204123042.32140-1-chandni.cherukuri@arm.com> <20211204123042.32140-5-chandni.cherukuri@arm.com> <21f8cb2b-d86a-077f-27a9-49f74c60839e@arm.com> In-Reply-To: <21f8cb2b-d86a-077f-27a9-49f74c60839e@arm.com> From: "chandni cherukuri" Date: Wed, 8 Dec 2021 17:58:52 +0530 Message-ID: Subject: Re: [edk2-devel] [edk2-platforms][PATCH V1 04/11] Platform/ARM/Morello: Add ConfigurationManager for Morello SoC To: devel@edk2.groups.io, Sami Mujawar Content-Type: text/plain; charset="UTF-8" Hi Sami, Thanks for reviewing the patch. Sure, will try to use the SSDT CPU generator for both the Morello FVP and Morello SoC platforms. Thanks Chandni On Wed, Dec 8, 2021 at 2:22 AM Sami Mujawar wrote: > > Hi Chandni, > > Since you have the CPU information in MADT.GICC and the PPTT table, it > should be possible to use the SSDT CPU generator to create the AML > description for the CPUs. This patch series can go ahead. However, you > may want to consider using the SSDT Cpu Generator in the furture. > > Otherwise, these changes look good to me. > > Reviewed-by: Sami Mujawar > > Regards, > > Sami Mujawar > > > > On 04/12/2021 12:30 PM, Chandni Cherukuri wrote: > > This patch implements the configuration manager for Morello > > SoC platform. It enables support for generating the following > > ACPI tables for Morello SoC Platform: > > 1. FADT > > 2. DSDT > > 3. GTDT > > 4. MADT > > 5. SPCR > > 6. DBG2 > > 7. PPTT > > > > Signed-off-by: Chandni Cherukuri > > --- > > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerSoc.dsc.inc | 16 ++ > > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeSoc.inf | 72 +++++++++ > > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerSoc.h | 97 ++++++++++++ > > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerSoc.c | 161 ++++++++++++++++++++ > > Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/AslTables/DsdtSoc.asl | 41 +++++ > > 5 files changed, 387 insertions(+) > > > > diff --git a/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerSoc.dsc.inc b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerSoc.dsc.inc > > new file mode 100644 > > index 000000000000..f7e58185696e > > --- /dev/null > > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerSoc.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/ConfigurationManagerDxeSoc.inf > > diff --git a/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeSoc.inf b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeSoc.inf > > new file mode 100644 > > index 000000000000..6f9199a6fda2 > > --- /dev/null > > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeSoc.inf > > @@ -0,0 +1,72 @@ > > +## @file > > +# Configuration Manager Dxe > > +# > > +# Copyright (c) 2021, ARM Limited. All rights reserved.
> > +# > > +# SPDX-License-Identifier: BSD-2-Clause-Patent > > +## > > + > > +[Defines] > > + INF_VERSION = 0x0001001B > > + BASE_NAME = ConfigurationManagerDxe > > + FILE_GUID = BF8FBCEE-AD95-466B-9185-50A1BB651DDA > > + MODULE_TYPE = DXE_DRIVER > > + VERSION_STRING = 1.0 > > + ENTRY_POINT = ConfigurationManagerDxeInitialize > > + > > +# > > +# The following information is for reference only and not required by the build tools. > > +# > > +# VALID_ARCHITECTURES = AARCH64 > > +# > > + > > +[Sources] > > + AslTables/DsdtSoc.asl > > + ConfigurationManager.c > > + ConfigurationManager.h > > + ConfigurationManagerSoc.c > > + ConfigurationManagerSoc.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] > > + ## 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/ConfigurationManagerDxe/ConfigurationManagerSoc.h b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerSoc.h > > new file mode 100644 > > index 000000000000..8a521b83c8dc > > --- /dev/null > > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerSoc.h > > @@ -0,0 +1,97 @@ > > +/** @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 SOC_CONFIGURATION_MANAGER_H_ > > +#define SOC_CONFIGURATION_MANAGER_H_ > > + > > +#include "ConfigurationManager.h" > > + > > +/** The number of ACPI tables to install > > +*/ > > +#define PLAT_ACPI_TABLE_COUNT 7 > > + > > +/** A helper macro for mapping a reference token > > +*/ > > +#define REFERENCE_TOKEN_SOC(Field) \ > > + (CM_OBJECT_TOKEN)((UINT8*)&MorelloSocRepositoryInfo + \ > > + OFFSET_OF (EDKII_SOC_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 dsdtsoc_aml_code[]; > > + > > +/** A structure describing the SoC Platform specific information > > +*/ > > +typedef struct SocPlatformRepositoryInfo { > > + /// List of ACPI tables > > + CM_STD_OBJ_ACPI_TABLE_INFO CmAcpiTableList[PLAT_ACPI_TABLE_COUNT]; > > +} EDKII_SOC_PLATFORM_REPOSITORY_INFO; > > + > > +/** A structure describing the platform configuration > > + manager repository information > > +*/ > > +typedef struct PlatformRepositoryInfo { > > + /// Common information > > + EDKII_COMMON_PLATFORM_REPOSITORY_INFO *CommonPlatRepoInfo; > > + > > + /// SoC Platform specific information > > + EDKII_SOC_PLATFORM_REPOSITORY_INFO *SocPlatRepoInfo; > > +} 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 object. 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 CmObjectId, > > + IN CONST CM_OBJECT_TOKEN Token OPTIONAL, > > + 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 object. 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 CmObjectId, > > + IN CONST CM_OBJECT_TOKEN Token OPTIONAL, > > + IN OUT CM_OBJ_DESCRIPTOR *CONST CmObject > > + ); > > + > > +#endif // SOC_CONFIGURATION_MANAGER_H_ > > diff --git a/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerSoc.c b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerSoc.c > > new file mode 100644 > > index 000000000000..7ca8ae212a61 > > --- /dev/null > > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerSoc.c > > @@ -0,0 +1,161 @@ > > +/** @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 "ConfigurationManagerSoc.h" > > +#include "Platform.h" > > + > > +EDKII_SOC_PLATFORM_REPOSITORY_INFO MorelloSocRepositoryInfo = { > > + // 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_SIGNATURE, > > + 0, // Unused > > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdDsdt), > > + (EFI_ACPI_DESCRIPTION_HEADER *)dsdtsoc_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_SIGNATURE, > > + EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_REVISION, > > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdPptt), > > + NULL > > + }, > > + }, > > +}; > > + > > +EDKII_PLATFORM_REPOSITORY_INFO MorelloRepositoryInfo = { > > + &CommonPlatformInfo, > > + &MorelloSocRepositoryInfo > > +}; > > + > > +/** 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 object. 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 CmObjectId, > > + IN CONST CM_OBJECT_TOKEN Token OPTIONAL, > > + IN OUT CM_OBJ_DESCRIPTOR *CONST CmObject > > + ) > > +{ > > + return EFI_NOT_FOUND; > > +} > > + > > +/** 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 object. 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 CmObjectId, > > + IN CONST CM_OBJECT_TOKEN Token OPTIONAL, > > + IN OUT CM_OBJ_DESCRIPTOR *CONST CmObject > > + ) > > +{ > > + EFI_STATUS Status; > > + EDKII_SOC_PLATFORM_REPOSITORY_INFO *PlatformRepo; > > + > > + if ((This == NULL) || (CmObject == NULL)) { > > + ASSERT (This != NULL); > > + ASSERT (CmObject != NULL); > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + Status = EFI_NOT_FOUND; > > + PlatformRepo = This->PlatRepoInfo->SocPlatRepoInfo; > > + > > + switch (GET_CM_OBJECT_ID (CmObjectId)) { > > + case EStdObjAcpiTableList: > > + Status = HandleCmObject ( > > + CmObjectId, > > + PlatformRepo->CmAcpiTableList, > > + sizeof (PlatformRepo->CmAcpiTableList), > > + ARRAY_SIZE (PlatformRepo->CmAcpiTableList), > > + CmObject > > + ); > > + break; > > + > > + default: > > + { > > + break; > > + } > > + } > > + > > + return Status; > > +} > > diff --git a/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/AslTables/DsdtSoc.asl b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/AslTables/DsdtSoc.asl > > new file mode 100644 > > index 000000000000..806e170515b7 > > --- /dev/null > > +++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/AslTables/DsdtSoc.asl > > @@ -0,0 +1,41 @@ > > +/** @file > > + Differentiated System Description Table Fields (DSDT) > > + > > + Copyright (c) 2021, ARM Ltd. All rights reserved.
> > + > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > + @par Reference(s): > > + - ACPI for Arm Components 1.0, Platform Design Document > > + > > +**/ > > + > > +#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) > > + } > > + } // Scope(_SB) > > +} > > > > > >