From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.1.69; helo=eur02-he1-obe.outbound.protection.outlook.com; envelope-from=sami.mujawar@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10069.outbound.protection.outlook.com [40.107.1.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 700D7211ACED2 for ; Wed, 2 Jan 2019 06:45:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=37cA10DdCvGIxIfqpUx7mqapIFxLcVrDs3X5eumNcmA=; b=BGi8qyXGTu8IsLq2FNC5o1yKhY4jA3MARWGBLbMozL1mmtTzlpwS83WZ9DffDGijjfFqOJxFwuWEJ7v00qb7BR0eHwFOhOKPOVckv/udL/2ASjbacVCEzy+uIeHeTq3eyxRMHsvJ9GmjAmcVh3n+u/S28km7qowLu+5QSgnJero= Received: from DB6PR0802MB2375.eurprd08.prod.outlook.com (10.172.228.142) by DB6PR0802MB2392.eurprd08.prod.outlook.com (10.172.250.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Wed, 2 Jan 2019 14:45:29 +0000 Received: from DB6PR0802MB2375.eurprd08.prod.outlook.com ([fe80::61d7:15a0:e254:728f]) by DB6PR0802MB2375.eurprd08.prod.outlook.com ([fe80::61d7:15a0:e254:728f%9]) with mapi id 15.20.1495.005; Wed, 2 Jan 2019 14:45:29 +0000 From: Sami Mujawar To: "edk2-devel@lists.01.org" , Leif Lindholm , Ard Biesheuvel CC: nd , Alexei Fedorov , Stephanie Hughes-Fitt , "michael.d.kinney@intel.com" Thread-Topic: [edk2] [PATCH edk2-platforms v1 3/6] Platform/ARM: Configuration Manager for FVP Thread-Index: AQHUmWkHzEB95TSjLUmlW2CxckSVU6WcGQNQ Date: Wed, 2 Jan 2019 14:45:29 +0000 Message-ID: References: <20181221170021.145024-1-sami.mujawar@arm.com> <20181221170021.145024-4-sami.mujawar@arm.com> In-Reply-To: <20181221170021.145024-4-sami.mujawar@arm.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Sami.Mujawar@arm.com; x-originating-ip: [217.140.106.53] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2392; 6:fsL4bn5KshGX+ULt5BcCL49PbKiUkovdhn7620tPDEUcso2CB0NwRV8aghp4wFUpGXnNCTXLALqe1/5Ud8XS+oHg+J0IqgkF/B/R5rbIb+N3UDZA5U9vCKPznPdhDmVeZa2ii528Bbr4NSBAv0Gg4yFY9O5qv3LKqIa0XSETtrWVqpxTXJUiwjzDrAwC9TSfCBv3/UEslJx4MuMVjdrMxVUseKRbzEd354+3m3/T9/PCRGOh9lT1uk8IAJPIlHGTA4naK4eum+ZVRToyJWJdLuZ1Zx5KP7MbIqIPFV5ENBt3xi0brcwgj1TlKybmGLkPmvZ/WfPnXF/7TTHiEJHvgFJhtuV73NO9ebqOWsyMPZtCcl1xb0SVYOrkz0ppji7MYRBC9Zd3kADxCcGXK6Fmq3aQnaDIW8kZertaPrum1wlVe/nAp4tVh7agcjrDtynsW9ZvglR2lCc4EeGb9Cfztw==; 5:mF37gTYU7qqFYoWK9kZF6OjnmLlMd2wqRa2+zYn5HE617gFXcPRUnQedNPiU3sPMrlKegILF680tnh2mXBGyCCoKOGw2Rljy1+AJl8qeG5bXyHdILglydgYcUKc1fTvmpM1Q8Y8VRQGGUdApEGrhBejA8z+DqH12D9YlKQycFyw=; 7:CiszKkLLlGTIdMkOF0RKGsM6DofQLNZ7QLbf2O+tGVVb23ZT/sgneLgmuMNksWsviPjtSJpL5KFgGPRd6hiMVQp2guns1cfom5ufLbB54ovA+Y0DFl0UIzi+wIS7V/Xjl2YRBFDqXkLEoFLYsb+wZA== x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-correlation-id: e55f84c6-ec68-478b-413f-08d670c0f0c1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2392; x-ms-traffictypediagnostic: DB6PR0802MB2392: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(93006095)(93001095)(3231475)(944501520)(4982022)(52105112)(3002001)(10201501046)(6055026)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2392; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2392; x-forefront-prvs: 0905A6B2C7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(366004)(396003)(136003)(13464003)(199004)(189003)(5660300001)(6116002)(3846002)(2501003)(14454004)(966005)(7736002)(476003)(229853002)(110136005)(478600001)(72206003)(71190400001)(33656002)(54906003)(105586002)(74316002)(305945005)(316002)(2906002)(4744004)(71200400001)(106356001)(97736004)(15188155005)(6246003)(53376002)(575784001)(25786009)(99286004)(4326008)(81166006)(66066001)(53936002)(9686003)(446003)(7696005)(11346002)(256004)(6306002)(19627235002)(68736007)(8676002)(55016002)(53546011)(76176011)(186003)(6506007)(102836004)(81156014)(86362001)(8936002)(486006)(53946003)(26005)(6436002)(16799955002)(579004)(559001)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2392; H:DB6PR0802MB2375.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Yns2ny60O83EBJNfX9tWLM3iSTxQR0i5swdHOEnYOhGm9imp1Z+F/5YjorJsifTxr6Y4QMlWsZj37lQ1wrfjRxKitmsRx6325YbCmvb2992YoRwI1/aw8AX0ta31Qq2fMBklaQWPx8tTvqOH26KeXNFvT4EdujKkTIVEn0T1wov8r6M6JNcdPf43JjGiB3k1n1OhakQOIDVzF+K6bMCkMHaXtLUuXV/tEVjD+4AmIF/74wSffgWPIEaa4AjAA+nmt8GOstS6yThvfH2gtlnWEr3RByelmgS9wQVb1vtEMim1kUBoMgN68e+sTi3brv7R spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: e55f84c6-ec68-478b-413f-08d670c0f0c1 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jan 2019 14:45:29.4052 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2392 Subject: Re: [PATCH edk2-platforms v1 3/6] Platform/ARM: Configuration Manager for FVP X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 14:45:36 -0000 X-List-Received-Date: Wed, 02 Jan 2019 14:45:36 -0000 X-List-Received-Date: Wed, 02 Jan 2019 14:45:36 -0000 X-List-Received-Date: Wed, 02 Jan 2019 14:45:36 -0000 X-List-Received-Date: Wed, 02 Jan 2019 14:45:36 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ard, Leif, Please ignore this patch in the series. I am sending an updated (v2) patch = that configures the GT Timer Frame 1 as non-secure.=20 Regards, Sami Mujawar -----Original Message----- From: edk2-devel On Behalf Of Sami Mujawa= r Sent: 21 December 2018 05:00 PM To: edk2-devel@lists.01.org Cc: nd ; Arvind Chauhan ; Alexei Fedoro= v ; Stephanie Hughes-Fitt ; michael.d.kinney@intel.com Subject: [edk2] [PATCH edk2-platforms v1 3/6] Platform/ARM: Configuration M= anager for FVP The dynamic tables framework utilizes the configuration manager protocol to= get the platform specific information required for building the firmware t= ables. The configuration manager is a platform specific component that collates th= e platform hardware information and builds an abstract platform configurati= on repository. The configuration manager also implements the configuration = manager protocol which returns the hardware information requested by the ta= ble generators. This patch implements the configuration manager support for the FVP platfor= m. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar --- Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc= | 31 + Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Conf= igurationManager.c | 610 ++++++++++++++++++++ Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Conf= igurationManager.h | 172 ++++++ Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Conf= igurationManagerDxe.inf | 79 +++ Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Plat= form.h | 91 +++ Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.as= l | 73 +++ Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Platfor= mASLTablesLib.inf | 35 ++ 7 files changed, 1091 insertions(+) diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationMan= ager.dsc.inc b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationM= anager.dsc.inc new file mode 100644 index 0000000000000000000000000000000000000000..788b145b273fd49da7fb5d23849= 1aef956977e61 --- /dev/null +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager +++ .dsc.inc @@ -0,0 +1,31 @@ +## @file +# dsc include file for Configuration Manager # # Copyright (c) 2017 -=20 +2018, ARM Limited. All rights reserved. +# +# This program and the accompanying materials # are licensed and made=20 +available under the terms and conditions of the BSD License # which=20 +accompanies this distribution. The full text of the license may be=20 +found at # http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"=20 +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRES= S OR IMPLIED. +## + +[Defines] + +[BuildOptions] +# Required for pre-processing ASL files that include ArmPlatform.h + *_*_*_ASLPP_FLAGS =3D $(PLATFORM_FLAGS) + +[LibraryClasses.common] + +[Components.common] + # Configuration Manager + Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Co= nfigurationManagerDxe.inf { + + # Platform ASL Tables + =20 +PlatformAslTablesLib|Platform/ARM/VExpressPkg/ConfigurationManager/Plat +formASLTablesLib/PlatformASLTablesLib.inf + + *_*_*_PLATFORM_FLAGS =3D=20 +-I$(BIN_DIR)/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLT +ablesLib/PlatformASLTablesLib/OUTPUT + } diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationMan= agerDxe/ConfigurationManager.c b/Platform/ARM/VExpressPkg/ConfigurationMana= ger/ConfigurationManagerDxe/ConfigurationManager.c new file mode 100644 index 0000000000000000000000000000000000000000..4f79f91ef32cad4a1967d969cb3= 9f801c3593089 --- /dev/null +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager +++ Dxe/ConfigurationManager.c @@ -0,0 +1,610 @@ +/** @file + Configuration Manager Dxe + + Copyright (c) 2017 - 2018, ARM Limited. All rights reserved. + + This program and the accompanying materials are licensed and made=20 + available under the terms and conditions of the BSD License which=20 + accompanies this distribution. The full text of the license may be=20 + found at http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, =20 + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPL= IED. + + @par Glossary: + - Cm or CM - Configuration Manager + - Obj or OBJ - Object +**/ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "ConfigurationManager.h" +#include "Platform.h" + +// AML Code Include files generated by iASL Compiler #include=20 + + +/** The platform configuration repository information. +*/ +STATIC +EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo =3D { + /// Configuration Manager information + { CONFIGURATION_MANAGER_REVISION, CFG_MGR_OEM_ID }, + + // ACPI Table List + { + // FADT Table + { + EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, + CREATE_STD_ACPI_TABLE_GEN_ID (ESTD_ACPI_TABLE_ID_FADT), + NULL + }, + // GTDT Table + { + EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, + CREATE_STD_ACPI_TABLE_GEN_ID (ESTD_ACPI_TABLE_ID_GTDT), + NULL + }, + // MADT Table + { + EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, + CREATE_STD_ACPI_TABLE_GEN_ID (ESTD_ACPI_TABLE_ID_MADT), + NULL + }, + // SPCR Table + { + EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, + CREATE_STD_ACPI_TABLE_GEN_ID (ESTD_ACPI_TABLE_ID_SPCR), + NULL + }, + // DSDT Table + { + EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, + CREATE_STD_ACPI_TABLE_GEN_ID (ESTD_ACPI_TABLE_ID_DSDT), + (EFI_ACPI_DESCRIPTION_HEADER*)dsdt_aml_code + }, + // DBG2 Table + { + EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE, + CREATE_STD_ACPI_TABLE_GEN_ID (ESTD_ACPI_TABLE_ID_DBG2), + NULL + } + }, + + // Boot architecture information + { EFI_ACPI_6_2_ARM_PSCI_COMPLIANT }, // BootArchFlags + +#ifdef HEADLESS_PLATFORM + // Fixed feature flag information + { EFI_ACPI_6_2_HEADLESS }, // Fixed feature flags +#endif + + // Power management profile information + { EFI_ACPI_6_2_PM_PROFILE_ENTERPRISE_SERVER }, // PowerManagement Pro= file + + /* GIC CPU Interface information + GIC_ENTRY (CPUInterfaceNumber, Mpidr, PmuIrq, VGicIrq,=20 + EnergyEfficiency) */ { + GICC_ENTRY (0, GET_MPID (0, 0), 92, 25, 0), + GICC_ENTRY (1, GET_MPID (0, 1), 93, 25, 0), + GICC_ENTRY (2, GET_MPID (0, 2), 94, 25, 0), + GICC_ENTRY (3, GET_MPID (0, 3), 95, 25, 0), + + GICC_ENTRY (4, GET_MPID (1, 0), 96, 25, 0), + GICC_ENTRY (5, GET_MPID (1, 1), 97, 25, 0), + GICC_ENTRY (6, GET_MPID (1, 2), 98, 25, 0), + GICC_ENTRY (7, GET_MPID (1, 3), 99, 25, 0) }, + + // GIC Distributor Info + { + 0, // UINT32 GicId + FixedPcdGet64 (PcdGicDistributorBase), // UINT64 PhysicalBaseAddress + 0, // UINT32 SystemVectorBase + 3 // UINT8 GicVersion + }, + + /// GIC Re-Distributor Info + { + // UINT64 DiscoveryRangeBaseAddress + FixedPcdGet64 (PcdGicRedistributorsBase), + // UINT32 DiscoveryRangeLength + 0x00200000 + }, + + // Generic Timer Info + { + // The physical base address for the counter control frame + FVP_SYSTEM_TIMER_BASE_ADDRESS, + // The physical base address for the counter read frame + FVP_CNT_READ_BASE_ADDRESS, + // The secure PL1 timer interrupt + FixedPcdGet32 (PcdArmArchTimerSecIntrNum), + // The secure PL1 timer flags + FVP_GTDT_GTIMER_FLAGS, + // The non-secure PL1 timer interrupt + FixedPcdGet32 (PcdArmArchTimerIntrNum), + // The non-secure PL1 timer flags + FVP_GTDT_GTIMER_FLAGS, + // The virtual timer interrupt + FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), + // The virtual timer flags + FVP_GTDT_GTIMER_FLAGS, + // The non-secure PL2 timer interrupt + FixedPcdGet32 (PcdArmArchTimerHypIntrNum), + // The non-secure PL2 timer flags + FVP_GTDT_GTIMER_FLAGS + }, + + // Generic Timer Block Information + { + { + // The physical base address for the GT Block Timer structure + FVP_GT_BLOCK_CTL_BASE, + // The number of timer frames implemented in the GT Block + FVP_TIMER_FRAMES_COUNT, + // Reference token for the GT Block timer frame list + (CM_OBJECT_TOKEN)((UINT8*)&VExpressPlatRepositoryInfo + + OFFSET_OF (EDKII_PLATFORM_REPOSITORY_INFO, GTBlock0TimerInfo)) + } + }, + + // GT Block Timer Frames + { + // Frame 0 + { + 0, // UINT8 FrameNumber + FVP_GT_BLOCK_FRAME0_CTL_BASE, // UINT64 PhysicalAddressCntBase + FVP_GT_BLOCK_FRAME0_CTL_EL0_BASE, // UINT64 PhysicalAddressCntEL0Ba= se + FVP_GT_BLOCK_FRAME0_GSIV, // UINT32 PhysicalTimerGSIV + FVP_GTX_TIMER_FLAGS, // UINT32 PhysicalTimerFlags + 0, // UINT32 VirtualTimerGSIV + 0, // UINT32 VirtualTimerFlags + FVP_GTX_COMMON_FLAGS // UINT32 CommonFlags + }, + // Frame 1 + { + 1, // UINT8 FrameNumber + FVP_GT_BLOCK_FRAME1_CTL_BASE, // UINT64 PhysicalAddressCntBase + FVP_GT_BLOCK_FRAME1_CTL_EL0_BASE, // UINT64 PhysicalAddressCntEL0Ba= se + FVP_GT_BLOCK_FRAME1_GSIV, // UINT32 PhysicalTimerGSIV + FVP_GTX_TIMER_FLAGS, // UINT32 PhysicalTimerFlags + 0, // UINT32 VirtualTimerGSIV + 0, // UINT32 VirtualTimerFlags + FVP_GTX_COMMON_FLAGS // 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 + FVP_SBSA_WATCHDOG_FLAGS + }, + + // SPCR Serial Port + { + FixedPcdGet64 (PcdSerialRegisterBase), // UINT64 BaseAddre= ss + FixedPcdGet32 (PL011UartInterrupt), // UINT32 Interrupt + FixedPcdGet64 (PcdUartDefaultBaudRate), // UINT64 BaudRate + FixedPcdGet32 (PL011UartClkInHz), // UINT32 Clock + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART // UINT16 Port=20 + subtype }, // Debug Serial Port { + FixedPcdGet64 (PcdSerialDbgRegisterBase), // UINT64 BaseAddre= ss + 38, // UINT32 Interrupt + FixedPcdGet64 (PcdSerialDbgUartBaudRate), // UINT64 BaudRate + FixedPcdGet32 (PcdSerialDbgUartClkInHz), // UINT32 Clock + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART // UINT16 Port=20 + subtype }, + + // GIC ITS + { + // The GIC ITS ID. + 0, + // The physical address for the Interrupt Translation Service + 0x2f020000 + } +}; + +/** Initialize the platform configuration repository. + + @param [in] This Pointer to the Configuration Manager Protocol. + + @retval + EFI_SUCCESS Success +**/ +STATIC +EFI_STATUS +EFIAPI +InitializePlatformRepository ( + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This + ) +{ + return EFI_SUCCESS; +} + +/** Return a GT Block timer frame info list. + + @param [in] This Pointer to the Configuration Manager Protoc= ol. + @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 fou= nd. +**/ +EFI_STATUS +EFIAPI +GetGTBlockTimerFrameInfo ( + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, + IN CONST CM_OBJECT_ID CmObjectId, + IN CONST CM_OBJECT_TOKEN Token, + IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject + ) +{ + EDKII_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; + + if (Token !=3D (CM_OBJECT_TOKEN)&PlatformRepo->GTBlock0TimerInfo) { + return EFI_NOT_FOUND; + } + + CmObject->Size =3D sizeof (PlatformRepo->GTBlock0TimerInfo); + CmObject->Data =3D (VOID*)&PlatformRepo->GTBlock0TimerInfo; + return EFI_SUCCESS; +} + +/** Return a standard namespace object. + + @param [in] This Pointer to the Configuration Manager Protoc= ol. + @param [in] CmObjectId The Configuration Manager Object ID. + @param [in] Token An optional token identifying the object. I= f + 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 fou= nd. +**/ +EFI_STATUS +EFIAPI +GetStandardNameSpaceObject ( + 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_PLATFORM_REPOSITORY_INFO * PlatformRepo; + + 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; + } + PlatformRepo =3D This->PlatRepoInfo; + + switch (GET_CM_OBJECT_ID (CmObjectId)) { + HANDLE_CM_OBJECT (EStdObjCfgMgrInfo, PlatformRepo->CmInfo); + HANDLE_CM_OBJECT (EStdObjAcpiTableList, PlatformRepo->CmAcpiTableList)= ; + default: { + Status =3D EFI_NOT_FOUND; + DEBUG (( + DEBUG_ERROR, + "ERROR: Object 0x%x. Status =3D %r\n", + CmObjectId, + Status + )); + break; + } + } + + return Status; +} + +/** Return an ARM namespace object. + + @param [in] This Pointer to the Configuration Manager Protoc= ol. + @param [in] CmObjectId The Configuration Manager Object ID. + @param [in] Token An optional token identifying the object. I= f + 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 fou= nd. +**/ +EFI_STATUS +EFIAPI +GetArmNameSpaceObject ( + 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_PLATFORM_REPOSITORY_INFO * PlatformRepo; + + 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; + } + PlatformRepo =3D This->PlatRepoInfo; + + switch (GET_CM_OBJECT_ID (CmObjectId)) { + HANDLE_CM_OBJECT (EArmObjBootArchInfo, PlatformRepo->BootArchInfo);=20 +#ifdef HEADLESS_PLATFORM + HANDLE_CM_OBJECT ( + EArmObjFixedFeatureFlags, + PlatformRepo->FixedFeatureFlags + ); +#endif + HANDLE_CM_OBJECT ( + EArmObjPowerManagementProfileInfo, + PlatformRepo->PmProfileInfo + ); + HANDLE_CM_OBJECT (EArmObjGenericTimerInfo, PlatformRepo->GenericTimerI= nfo); + HANDLE_CM_OBJECT ( + EArmObjPlatformGenericWatchdogInfo, + PlatformRepo->Watchdog + ); + HANDLE_CM_OBJECT (EArmObjPlatformGTBlockInfo, PlatformRepo->GTBlockInf= o); + HANDLE_CM_OBJECT_REF_BY_TOKEN ( + EArmObjGTBlockTimerFrameInfo, + PlatformRepo->GTBlock0TimerInfo, + Token, + GetGTBlockTimerFrameInfo + ); + HANDLE_CM_OBJECT (EArmObjGicCInfo, PlatformRepo->GicCInfo); + HANDLE_CM_OBJECT (EArmObjGicDInfo, PlatformRepo->GicDInfo); + HANDLE_CM_OBJECT (EArmObjGicRedistributorInfo, PlatformRepo->GicRedist= Info); + HANDLE_CM_OBJECT ( + EArmObjSerialConsolePortInfo, + PlatformRepo->SpcrSerialPort + ); + HANDLE_CM_OBJECT (EArmObjSerialDebugPortInfo, PlatformRepo->DbgSerialP= ort); + HANDLE_CM_OBJECT (EArmObjGicItsInfo, PlatformRepo->GicItsInfo); + + 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 Protoc= ol. + @param [in] CmObjectId The Configuration Manager Object ID. + @param [in] Token An optional token identifying the object. I= f + 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 fou= nd. + @retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration Man= ager + is less than the Object size for the reque= sted + object. +**/ +EFI_STATUS +EFIAPI +GetOemNameSpaceObject ( + 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; + + 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 Protoc= ol. + @param [in] CmObjectId The Configuration Manager Object ID. + @param [in] Token An optional token identifying the object. I= f + 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 fou= nd. +**/ +EFI_STATUS +EFIAPI +ArmVExpressPlatformGetObject ( + 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; + + 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, Token, CmOb= ject); + break; + case EObjNameSpaceArm: + Status =3D GetArmNameSpaceObject (This, CmObjectId, Token, CmObject)= ; + break; + case EObjNameSpaceOem: + Status =3D GetOemNameSpaceObject (This, CmObjectId, Token, CmObject)= ; + 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 Protoc= ol. + @param [in] CmObjectId The Configuration Manager Object ID. + @param [in] Token An optional token identifying the object. I= f + 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 +ArmVExpressPlatformSetObject ( + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This, + IN CONST CM_OBJECT_ID CmObjectId, + IN CONST CM_OBJECT_TOKEN Token OPTIONAL, + IN CM_OBJ_DESCRIPTOR * CONST CmObject + ) +{ + return EFI_UNSUPPORTED; +} + +/** A structure describing the configuration manager protocol interface. +*/ +STATIC +CONST +EDKII_CONFIGURATION_MANAGER_PROTOCOL=20 +VExpressPlatformConfigManagerProtocol =3D { + CREATE_REVISION(1,0), + ArmVExpressPlatformGetObject, + ArmVExpressPlatformSetObject, + &VExpressPlatRepositoryInfo +}; + +/** + 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; + + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiConfigurationManagerProtocolGuid, + EFI_NATIVE_INTERFACE, + (VOID*)&VExpressPlatformConfigManagerProtocol + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: Failed to get Install Configuration Manager Protocol." \ + " Status =3D %r\n", + Status + )); + goto error_handler; + } + + Status =3D InitializePlatformRepository ( + &VExpressPlatformConfigManagerProtocol + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: Failed to initialize the Platform Configuration Repository."= \ + " Status =3D %r\n", + Status + )); + } + +error_handler: + return Status; +} diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationMan= agerDxe/ConfigurationManager.h b/Platform/ARM/VExpressPkg/ConfigurationMana= ger/ConfigurationManagerDxe/ConfigurationManager.h new file mode 100644 index 0000000000000000000000000000000000000000..bb457077d2329041aa5e5eaa6fe= ec6f486a0114e --- /dev/null +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager +++ Dxe/ConfigurationManager.h @@ -0,0 +1,172 @@ +/** @file + + Copyright (c) 2017 - 2018, ARM Limited. All rights reserved. + + This program and the accompanying materials are licensed and made=20 + available under the terms and conditions of the BSD License which=20 + accompanies this distribution. The full text of the license may be=20 + found at http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, =20 + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPL= IED. + + @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' } + +/** A helper macro for populating the GIC CPU information */ +#define GICC_ENTRY( \ + CPUInterfaceNumber, \ + Mpidr, \ + PmuIrq, \ + VGicIrq, \ + EnergyEfficiency \ + ) { \ + 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 */ \ + 0, /* UINT64 GICRBaseAddress */ \ + Mpidr, /* UINT64 MPIDR */ \ + EnergyEfficiency /* UINT8 ProcessorPowerEfficiencyClass*/ \ + } + +/** A helper macro for returning configuration manager objects */ +#define HANDLE_CM_OBJECT(CmObjectId, Object) \ + case CmObjectId: { \ + CmObject->Size =3D sizeof (Object); \ + CmObject->Data =3D (VOID*)&Object; \ + DEBUG (( \ + DEBUG_INFO, \ + #CmObjectId ": Ptr =3D 0x%p, Size =3D %d\n", \ + CmObject->Data, \ + CmObject->Size \ + )); \ + break; \ + } + +/** A helper macro for returning configuration manager objects + referenced by token +*/ +#define HANDLE_CM_OBJECT_REF_BY_TOKEN( \ + CmObjectId, \ + Object, \ + Token, \ + HandlerProc \ + ) \ + case CmObjectId: { \ + if (Token =3D=3D CM_NULL_TOKEN) { \ + CmObject->Size =3D sizeof (Object); \ + CmObject->Data =3D (VOID*)&Object; \ + DEBUG (( \ + DEBUG_INFO, \ + #CmObjectId ": Ptr =3D 0x%p, Size =3D %d\n", \ + CmObject->Data, \ + CmObject->Size \ + )); \ + } else { \ + Status =3D HandlerProc (This, CmObjectId, Token, CmObject); \ + DEBUG (( \ + DEBUG_INFO, \ + #CmObjectId ": Token =3D 0x%p, Ptr =3D 0x%p, Size =3D %d\n", \ + (VOID*)Token, \ + CmObject->Data, \ + CmObject->Size \ + )); \ + } \ + break; \ + } + +/** The number of CPUs +*/ +#define PLAT_CPU_COUNT 8 + +/** The number of ACPI tables to install */ +#define PLAT_ACPI_TABLE_COUNT 6 + +/** 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 + +/** A structure describing the platform configuration + manager repository information +*/ +typedef struct PlatformRepositoryInfo { + /// Configuration Manager Information + CM_STD_OBJ_CONFIGURATION_MANAGER_INFO CmInfo; + + /// List of ACPI tables + CM_STD_OBJ_ACPI_TABLE_INFO CmAcpiTableList[PLAT_ACPI_TABLE_CO= UNT]; + + /// 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 =20 + 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_COUNT]; + + /// Generic timer frame information + CM_ARM_GTBLOCK_TIMER_FRAME_INFO GTBlock0TimerInfo[PLAT_GTFRAME_COU= NT]; + + /// 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; + + /// GIC ITS information + CM_ARM_GIC_ITS_INFO GicItsInfo; +} EDKII_PLATFORM_REPOSITORY_INFO; + +#endif // CONFIGURATION_MANAGER_H__ diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationMan= agerDxe/ConfigurationManagerDxe.inf b/Platform/ARM/VExpressPkg/Configuratio= nManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf new file mode 100644 index 0000000000000000000000000000000000000000..c4c8f462b8fa8ea718589f2265a= e42953ac0a49a --- /dev/null +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager +++ Dxe/ConfigurationManagerDxe.inf @@ -0,0 +1,79 @@ +## @file +# Configuration Manager Dxe +# +# Copyright (c) 2017 - 2018, ARM Limited. All rights reserved. +# +# This program and the accompanying materials # are licensed and made=20 +available under the terms and conditions of the BSD License # which=20 +accompanies this distribution. The full text of the license may be=20 +found at # http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"=20 +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRES= S OR IMPLIED. +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D ConfigurationManagerDxe + FILE_GUID =3D 29F45677-1920-4454-94A6-CF119C9491DB + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D ConfigurationManagerDxeInitialize + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D ARM AARCH64 +# + +[Sources] + ConfigurationManager.c + +[Packages] + ArmPkg/ArmPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec + DynamicTablesPkg/DynamicTablesPkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + Platform/ARM/VExpressPkg/ArmVExpressPkg.dec + +[LibraryClasses] + ArmPlatformLib + PlatformAslTablesLib + PrintLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiRuntimeServicesTableLib + +[Protocols] + gEdkiiConfigurationManagerProtocolGuid + +[FixedPcd] + gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum + gArmTokenSpaceGuid.PcdArmArchTimerIntrNum + gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum + gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum + + gArmTokenSpaceGuid.PcdGicDistributorBase + gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase + gArmTokenSpaceGuid.PcdGicRedistributorsBase + + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate + gArmPlatformTokenSpaceGuid.PL011UartClkInHz + gArmPlatformTokenSpaceGuid.PL011UartInterrupt + + ## PL011 Serial Debug UART + gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase + gArmPlatformTokenSpaceGuid.PcdSerialDbgUartBaudRate + gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz + + # SBSA Generic Watchdog + gArmTokenSpaceGuid.PcdGenericWatchdogControlBase + gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase + gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum + +[Pcd] + +[Depex] + gEdkiiDynamicTableFactoryProtocolGuid diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationMan= agerDxe/Platform.h b/Platform/ARM/VExpressPkg/ConfigurationManager/Configur= ationManagerDxe/Platform.h new file mode 100644 index 0000000000000000000000000000000000000000..8ba32717704af8cc65d23e93aff= cc2922add0346 --- /dev/null +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager +++ Dxe/Platform.h @@ -0,0 +1,91 @@ +/** @file + + Copyright (c) 2017, ARM Limited. All rights reserved. + + This program and the accompanying materials are licensed and made=20 + available under the terms and conditions of the BSD License which=20 + accompanies this distribution. The full text of the license may be=20 + found at http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, =20 + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPL= IED. + +**/ + +#ifndef PLATFORM_H__ +#define PLATFORM_H__ + +#define ENABLE_MEM_MAPPED_TIMER + +#ifdef ENABLE_MEM_MAPPED_TIMER +#define FVP_SYSTEM_TIMER_BASE_ADDRESS 0x2A430000 +#define FVP_CNT_READ_BASE_ADDRESS 0x2A800000 +#else +#define FVP_SYSTEM_TIMER_BASE_ADDRESS 0xFFFFFFFFFFFFFFFF +#define FVP_CNT_READ_BASE_ADDRESS 0xFFFFFFFFFFFFFFFF +#endif + +// GT Block Timer +#define FVP_GT_BLOCK_CTL_BASE 0x2A810000 +#define FVP_TIMER_FRAMES_COUNT 2 + +// GT Block Timer Frames +#define FVP_GT_BLOCK_FRAME0_CTL_BASE 0x2A820000 +#define FVP_GT_BLOCK_FRAME0_CTL_EL0_BASE 0xFFFFFFFFFFFFFFFF +#define FVP_GT_BLOCK_FRAME0_GSIV 57 + +#define FVP_GT_BLOCK_FRAME1_CTL_BASE 0x2A830000 +#define FVP_GT_BLOCK_FRAME1_CTL_EL0_BASE 0xFFFFFFFFFFFFFFFF +#define FVP_GT_BLOCK_FRAME1_GSIV 58 + +#define GTDT_TIMER_EDGE_TRIGGERED \ + EFI_ACPI_6_2_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE +#define GTDT_TIMER_LEVEL_TRIGGERED 0 +#define GTDT_TIMER_ACTIVE_LOW \ + EFI_ACPI_6_2_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY +#define GTDT_TIMER_ACTIVE_HIGH 0 +#define GTDT_TIMER_SAVE_CONTEXT \ + EFI_ACPI_6_2_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY +#define GTDT_TIMER_LOSE_CONTEXT 0 + +#define FVP_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_2_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_MODE +#define GTX_TIMER_LEVEL_TRIGGERED 0 +#define GTX_TIMER_ACTIVE_LOW \ + EFI_ACPI_6_2_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_POLARITY +#define GTX_TIMER_ACTIVE_HIGH 0 + +#define FVP_GTX_TIMER_FLAGS (GTX_TIMER_ACTIVE_HIGH | \ + GTX_TIMER_LEVEL_TRIGGERED) + +#define GTX_TIMER_SECURE \ + EFI_ACPI_6_2_GTDT_GT_BLOCK_COMMON_FLAG_SECURE_TIMER +#define GTX_TIMER_NON_SECURE 0 +#define GTX_TIMER_SAVE_CONTEXT \ + EFI_ACPI_6_2_GTDT_GT_BLOCK_COMMON_FLAG_ALWAYS_ON_CAPABILITY +#define GTX_TIMER_LOSE_CONTEXT 0 + +#define FVP_GTX_COMMON_FLAGS (GTX_TIMER_SAVE_CONTEXT | GTX_TIMER_SE= CURE) + +// Watchdog +#define SBSA_WATCHDOG_EDGE_TRIGGERED \ + =20 +EFI_ACPI_6_2_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_MODE +#define SBSA_WATCHDOG_LEVEL_TRIGGERED 0 +#define SBSA_WATCHDOG_ACTIVE_LOW \ + EFI_ACPI_6_2_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_POL= ARITY +#define SBSA_WATCHDOG_ACTIVE_HIGH 0 +#define SBSA_WATCHDOG_SECURE \ + EFI_ACPI_6_2_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER +#define SBSA_WATCHDOG_NON_SECURE 0 + +#define FVP_SBSA_WATCHDOG_FLAGS (SBSA_WATCHDOG_NON_SECURE | \ + SBSA_WATCHDOG_ACTIVE_HIGH | \ + =20 +SBSA_WATCHDOG_LEVEL_TRIGGERED) + +#endif // PLATFORM_H__ + diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTable= sLib/Dsdt.asl b/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTa= blesLib/Dsdt.asl new file mode 100644 index 0000000000000000000000000000000000000000..625930db4d88d9e966eea990ea2= b293842f011ea --- /dev/null +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib +++ /Dsdt.asl @@ -0,0 +1,73 @@ +/** @file + Differentiated System Description Table Fields (DSDT) + + Copyright (c) 2014-2017, ARM Ltd. All rights reserved.
+ This program and the accompanying materials are licensed and made=20 + available under the terms and conditions of the BSD License which=20 + accompanies this distribution. The full text of the license may be=20 + found at http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, =20 + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPL= IED. + +**/ + +DefinitionBlock("DsdtTable.aml", "DSDT", 1, "ARMLTD", "ARM-VEXP", 1) { + Scope(_SB) { + // + // Processor + // + Device(CPU0) { + Name(_HID, "ACPI0007") + Name(_UID, Zero) + } + Device(CPU1) { + Name(_HID, "ACPI0007") + Name(_UID, One) + } + Device(CPU2) { + Name(_HID, "ACPI0007") + Name(_UID, 2) + } + Device(CPU3) { + Name(_HID, "ACPI0007") + Name(_UID, 3) + } + Device(CPU4) { + Name(_HID, "ACPI0007") + Name(_UID, 4) + } + Device(CPU5) { + Name(_HID, "ACPI0007") + Name(_UID, 5) + } + Device(CPU6) { + Name(_HID, "ACPI0007") + Name(_UID, 6) + } + Device(CPU7) { + Name(_HID, "ACPI0007") + Name(_UID, 7) + } + + // UART PL011 + Device(COM2) { + Name(_HID, "ARMH0011") + Name(_CID, "PL011") + Name(_UID, Zero) + + Method(_STA) { + Return(0xF) + } + + Method(_CRS, 0x0, NotSerialized) { + Name(RBUF, ResourceTemplate() { + Memory32Fixed(ReadWrite, 0x1c090000, 0x1000) + Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x25= } + }) + Return (RBUF) + } + } + + } // Scope(_SB) +} diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTable= sLib/PlatformASLTablesLib.inf b/Platform/ARM/VExpressPkg/ConfigurationManag= er/PlatformASLTablesLib/PlatformASLTablesLib.inf new file mode 100644 index 0000000000000000000000000000000000000000..9a5f3d05fbe05461756bd6198dd= 1ecd95d26ac97 --- /dev/null +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib +++ /PlatformASLTablesLib.inf @@ -0,0 +1,35 @@ +## @file +# Platform ASL Tables +# +# Copyright (c) 2017 - 2018, ARM Limited. All rights reserved. +# +# This program and the accompanying materials # are licensed and made=20 +available under the terms and conditions of the BSD License # which=20 +accompanies this distribution. The full text of the license may be=20 +found at # http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"=20 +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRES= S OR IMPLIED. +## + +[Defines] + INF_VERSION =3D 0x00010019 + BASE_NAME =3D PlatformAslTablesLib + FILE_GUID =3D 4000AEAB-C6D3-4F67-ADE3-D4B504FC164B + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PlatformAslTablesLib|DXE_DRIVER + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D ARM AARCH64 +# + +[Sources] + Dsdt.asl + +[Packages] + ArmPlatformPkg/ArmPlatformPkg.dec + MdePkg/MdePkg.dec + Platform/ARM/VExpressPkg/ArmVExpressPkg.dec -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel