From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web10.4591.1612504599844217035 for ; Thu, 04 Feb 2021 21:56:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=XXgc/lPR; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: rangasai.v.chaganty@intel.com) IronPort-SDR: rQIlBkewPDK3tKsb4U8m0ebdmrsXDivQF3uOnMZZfpCj/eQkJjpTjFGQOd+fmwCOAneImnh83a nQY00FrUOJOw== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="242887365" X-IronPort-AV: E=Sophos;i="5.81,154,1610438400"; d="scan'208";a="242887365" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2021 21:56:38 -0800 IronPort-SDR: +HqJibcvuQCOBFfP/hoTIr5dwIMQpez4wCDe3sUEJChILIbaJfd3ucCtmYe78QFVJUScG1dQ6I 3HluVzKaz1bQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,154,1610438400"; d="scan'208";a="373270571" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga002.jf.intel.com with ESMTP; 04 Feb 2021 21:56:38 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 4 Feb 2021 21:56:37 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Thu, 4 Feb 2021 21:56:37 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.108) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 4 Feb 2021 21:56:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R/E23G/l+w9AlDGNSz7izB7teJ6kgIEaAXhGMbUrIRMIPc7ebinQqKk0cUeVB0s1E+PMfeF+NKbbwkFESGbr3Ve1OklUo2qKNOncQsLS65MMNC6+AEEe7+e/AtlgpPhqVYXSY7EcOybDRelKHC29mq0IFukLyJogqgckI+metDTiQcJA7Qhq8BPHCNoQDW8RFaSILvE6ZWjCN8B8s6Ymskz14eOkE20JXdS/eHz68lDUx/cnS5TZf7axZNKQK0Ddu1Up1ZiId+StpBoGfB71ilvElC/Ly/N2OHpwbT+xb5INfssblgPqmj2LFgKFoD+dubvy/up36Y55n6tpFsft6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cACIEy0fU0B4ZSzTb9zuw+BDPs4oZDtAaFqS9NoDy14=; b=AzEGfKUEx4+PEHqgGOYFZA75Tn4D3MRx8fV9HVq5Ok1n1MpBL6+z0GeBcan5MhCZr7nDpWfcvpYsSv+BJwI9JoWwdZRZTS2cjUcC4vaXWVd0NzFg7mRkl/9uigUqaxgJKBSx+T8NSR2NyGqzsj4HaAyINr8o5vAyTaZjwbKkluvP0ZFKaZEwEDIDx8eUTa+6M5GbqIxiV3f+h1Z16qTxHny6hsLEB88tVoxCoPK9G4T2r2PNcdqesTXXWZiXQXDzWnhQ7BoTz4thuMYCc1EbNESgRD0C8yRsyHGF6jd2C8beafodSUDrne4iT84YONh5SCxRYXHbRKSmuTlINHtDEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cACIEy0fU0B4ZSzTb9zuw+BDPs4oZDtAaFqS9NoDy14=; b=XXgc/lPRRBZ5GxnEdJE2/FAHGvTowRORFOAAn5VvCxPR1FivtYWcfTJvmGi0b0pROqufj7ietCtdYgfyikHhpP4d+ssSjLyA+D4lP//wlsgEZuhfqIdAF2OlQE4dQ9kIg8NUgo2wj/JDNDhVLlkuyIFIQTj51licTnFib+sWiI8= Received: from DM6PR11MB4476.namprd11.prod.outlook.com (2603:10b6:5:201::24) by DM5PR11MB1338.namprd11.prod.outlook.com (2603:10b6:3:b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.23; Fri, 5 Feb 2021 05:56:07 +0000 Received: from DM6PR11MB4476.namprd11.prod.outlook.com ([fe80::ccd3:477b:8451:b17d]) by DM6PR11MB4476.namprd11.prod.outlook.com ([fe80::ccd3:477b:8451:b17d%7]) with mapi id 15.20.3825.021; Fri, 5 Feb 2021 05:56:07 +0000 From: "Chaganty, Rangasai V" To: "Luo, Heng" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" Subject: Re: [Patch V2 04/40] TigerlakeSiliconPkg/Cpu: Add Include headers Thread-Topic: [Patch V2 04/40] TigerlakeSiliconPkg/Cpu: Add Include headers Thread-Index: AQHW+tLfRsH5CYScyU6iIgAOzoy2kqpJEX4w Date: Fri, 5 Feb 2021 05:56:06 +0000 Message-ID: References: <20210204084919.3603-1-heng.luo@intel.com> <20210204084919.3603-4-heng.luo@intel.com> In-Reply-To: <20210204084919.3603-4-heng.luo@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [50.45.159.74] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1e97cf8c-10f6-4d3d-59f6-08d8c99abae6 x-ms-traffictypediagnostic: DM5PR11MB1338: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZE6hGPOULzakBQHAfCypT9OUMrtEet1CObOfhe27Bmk4vwftw9zHMjrlbRbTpj6yQ0h7e/TCpnt/5aA3eFGoDLV6oXn5kKfvG1FxgYKxfbMrOdS/+Els0Uhg4IPQjX2+Hd4TCHnoc0tI8PMfBkb8R2yH6ynChKJQzXD9vu6+jMbzzhROjx/VxC64kWj9HrflRf2inTbor7vPIBLwzbsovPnh9xmSbqnQ3agtMTkSfB7E/sD60P2vQiJRFkBrscnT/0kA+CKKJS0aRvxI45ln7artKQ2kQJhhCFE1BAHfrQDy+UPxnfBIMkJcEgouDmhJ7oClchbtBGHuulRQBlLH3DneThn4mXL1JY+72KHDE/6DmVL/RIHllVxtEEWKb40n59L5niB68m1OPVU3yNzxNn6EoDKR1YlTFWO5H4OuOlVXRlI4oRZY2aBZ+GAj9TMPORXnSw7hyGTpm168xY54cqbSpQCL4HrRHKg1PHGJcOHpY3oY2E19Ero8wu/8O5faSSnT8xYJ4wShNboK0OMEpBzuLdLGS9eEJfu6cNNc5qG0zCVzb1N9Vd61z1hpVUwcm+Llu5y3zm1geQLm9BXNDlkETXM69kSttEEA4mRVG+I= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4476.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(136003)(366004)(39860400002)(396003)(346002)(5660300002)(6506007)(30864003)(53546011)(33656002)(8936002)(478600001)(2906002)(8676002)(19627235002)(9686003)(966005)(7696005)(55016002)(86362001)(83380400001)(76116006)(66946007)(4326008)(66556008)(64756008)(66446008)(66476007)(110136005)(316002)(107886003)(186003)(52536014)(71200400001)(26005)(559001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?59/3rMTWSEadE0lYIKbAeUpdtzEuFXU39tOSkkAAAqvyF7y+7uaGUk7Yv+y/?= =?us-ascii?Q?1iZ3pPy4dVQs6841Bkzg6hjy2lQMHiwbkvdkX9LOudkDpAus/ZXlUQ3K7f3T?= =?us-ascii?Q?roEEbszZNrV+pO4LzTijhXgOM7Uc7uYKHxSeYbKpZZuvTLHKNgDVl4n/C+s5?= =?us-ascii?Q?b7AdkWz9MY3EiZsiAI/YUoc1VR/++fQDczczaUuZGk+dKnL3/UVkcnBYNR2E?= =?us-ascii?Q?Y9dbN4qLGIUAVZ6WjRbe8T5AYbPQzHsz192Le9arp+zArFTlk7wtX92ezmkb?= =?us-ascii?Q?GvjN8oVn2NS2fKt8iXVClaUbWUbYAkozTqafcJeF0nXx50swdXn1qrN6ETSo?= =?us-ascii?Q?OJml6AQyvr9J23HXIeSHa/Kq9wcHuuqA1vPY6MQhqkB2jAywNxxBIZgCFzyK?= =?us-ascii?Q?i6Z1k7r6GKqOfVVx3bYe8WMWzPMxrwnFw/Z4eqDVh8Za93Rhml/0OpQAmEpq?= =?us-ascii?Q?BB9N06p8Bv720B/vrRezTyeoqKS9wIw7vqvE1VAtNNmgfnT0ZiflZYdO0tFo?= =?us-ascii?Q?//KNFjY0kGp2/+n5dluDJWRvSL3eMPCcQpCjIFV2kNXt5wnc0njg9XAWBetw?= =?us-ascii?Q?JUU4IOex8oLF9aH13qCkDH2zFcElp5O/Rgf3Y80PjXzlQD32AobQx61zt3jX?= =?us-ascii?Q?/1kvQu6FK6Sd1xEDG6hZfAppjfFQ0dfVi+5THnqDZ9evKOU4DfBKOVAoQ8xY?= =?us-ascii?Q?u5OA+vPhfxbV/0hX+oZYvvsQgswM6CrEwIXStIyQ3zk1Aly5p3GIzBOuyQkc?= =?us-ascii?Q?XDpgnxh3PYnSAExjiRUfkdNu0+uHaeOjTi5zmfWJqbGk7SdLAnShMP5ilSIe?= =?us-ascii?Q?e/6RFzd5zST3sOJKJOwfSlJpyKzzYrOC5yC5NprNXXvdT3oKFfVjVmschmft?= =?us-ascii?Q?KtJ0rFxv3OhRrMduW7W4sR1b5KeEZVNcUJrKLHlnkVrq+6Lyhy8kzGLimCio?= =?us-ascii?Q?ftZOKpIJcKmBGXlwAIaxySgp32U5RtHyTfhxDqm6OXttI/NLDQ6IrpWUBEbe?= =?us-ascii?Q?iitq6ozVP/TPH6ZkoeZoqF7gGXN4xLPkEViqCmsj5KZt7JYkP4bS+hCHFVr8?= =?us-ascii?Q?/R/jIt562GlXi/2NCNCIWo7Q9l43SE73nueh2dTjPjQgZ3Lw6TXGsqMoruuu?= =?us-ascii?Q?95rugLKXmW+2t1hfNtGoXCWjd/SXYjwVLMvrChXUXiG4FBmyfRwk+5cLdjTc?= =?us-ascii?Q?rGNE1gAPHTbGx0vmtBonVsLPwn5pMNf31RanXoA/asLofD5okTOQ8d+3gwm4?= =?us-ascii?Q?++rjVSkR97AIY7YAf9OMahzBgeOfFyBHThzUSmH6Uy/mXlKFf1DYLG7k06h2?= =?us-ascii?Q?8LZs5QBReqUrz+D30K06FIsF?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4476.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e97cf8c-10f6-4d3d-59f6-08d8c99abae6 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2021 05:56:06.8981 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: D8XG65nWbMKYjq/t1dW9olZhZEBBuSSBTYnjkiZHFm7xz/9q909o5dYar+YImz0UXno48NgouEente/sDgjFQKCy5ZBhxCLWnA6XsN3jGsY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1338 Return-Path: rangasai.v.chaganty@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sai Chaganty =20 -----Original Message----- From: Luo, Heng =20 Sent: Thursday, February 04, 2021 12:49 AM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Desimone, Nathani= el L Subject: [Patch V2 04/40] TigerlakeSiliconPkg/Cpu: Add Include headers REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3171 Adds header files common to CPU modules. Cc: Sai Chaganty Cc: Nate DeSimone Signed-off-by: Heng Luo --- Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuConfig.h = | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuConfigLibPreM= emConfig.h | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuPidTestConfig= .h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuPowerMgmtBasi= cConfig.h | 226 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuPowerMgmtCust= omConfig.h | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuPowerMgmtPsys= Config.h | 36 ++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuPowerMgmtTest= Config.h | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuSecurityPreMe= mConfig.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuTestConfig.h = | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuAccess.h = | 12 ++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuDataStruct.h = | 21 +++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuPolicyCommon.h = | 23 +++++++++++++++++++++++ Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/Register/CommonMsr.h = | 18 ++++++++++++++++++ 13 files changed, 959 insertions(+) diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuC= onfig.h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuConf= ig.h new file mode 100644 index 0000000000..d837500a38 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuConfig.h @@ -0,0 +1,83 @@ +/** @file + CPU Config Block. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_CONFIG_H_ +#define _CPU_CONFIG_H_ + +#define CPU_CONFIG_REVISION 3 + +extern EFI_GUID gCpuConfigGuid; + +#pragma pack (push,1) + +/** + CPU Configuration Structure. + + Revision 1: + - Initial version. + Revision 2: + - Add SmbiosType4MaxSpeedOverride. + Revision 3: + - Add AvxDisable & Avx3Disable. +**/ +typedef struct { + CONFIG_BLOCK_HEADER Header; ///< Config Block Header + UINT32 MicrocodePatchRegionSize; + EFI_PHYSICAL_ADDRESS MicrocodePatchAddress; ///< Pointer to microcod= e patch that is suitable for this processor. + /** + Enable or Disable Advanced Encryption Standard (AES) feature. + For some countries, this should be disabled for legal reasons. + - 0: Disable + - 1: Enable + **/ + UINT32 AesEnable : 1; + /** + Enable or Disable Trusted Execution Technology (TXT) feature. + - 0: Disable + - 1: Enable + **/ + UINT32 TxtEnable : 1; + UINT32 SkipMpInit : 1; ///< For Fsp only, Silic= on Initialization will skip MP Initialization (including BSP) if enabled. F= or non-FSP, this should always be 0. + /** + Enable or Disable or Auto for PPIN Support to view Protected Processor= Inventory Number. + - 0: Disable + - 1: Enable + - 2: Auto : Feature is based on End Of Manufacturing (EOM) flag. If= EOM is set, it is disabled. + **/ + UINT32 PpinSupport : 2; + /** + Enable or Disable #AC machine check on split lock. + - 0: Disable + - 1: Enable + **/ + UINT32 AcSplitLock : 1; + /** + Enable or Disable Avx. + - 1: Disable + - 0: Enable + **/ + UINT32 AvxDisable : 1; + /** + Enable or Disable Avx3. + - 1: Disable + - 0: Enable + **/ + UINT32 Avx3Disable : 1; + UINT32 RsvdBits : 24; ///< Reserved for future= use + /** + Provide the option for platform to override the MaxSpeed field of Smbi= os Type 4. + Value 4000 means 4000MHz. + If this value is not zero, it dominates the field. + If this value is zero, CPU RC will update the field according to the m= ax radio. + default is 0. + **/ + UINT16 SmbiosType4MaxSpeedOverride; + UINT8 Reserved0[2]; ///< Reserved for future= use +} CPU_CONFIG; + +#pragma pack (pop) + +#endif // _CPU_CONFIG_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuC= onfigLibPreMemConfig.h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/Conf= igBlock/CpuConfigLibPreMemConfig.h new file mode 100644 index 0000000000..bf3f436ddd --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuConfigLi= bPreMemConfig.h @@ -0,0 +1,148 @@ +/** @file + CPU Security PreMemory Config Block. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_CONFIG_LIB_PREMEM_CONFIG_H_ +#define _CPU_CONFIG_LIB_PREMEM_CONFIG_H_ + +#define CPU_CONFIG_LIB_PREMEM_CONFIG_REVISION 6 + +extern EFI_GUID gCpuConfigLibPreMemConfigGuid; + +#define BOOT_FREQUENCY_MAX_BATTERY_PERF 0 +#define BOOT_FREQUENCY_MAX_NON_TURBO_PERF 1 +#define BOOT_FREQUENCY_TURBO_PERF 2 + +#pragma pack (push,1) + +/** + CPU Config Library PreMemory Configuration Structure. + + Revision 1: + - Initial version. + Revision 2: + - Expand the supported number of processor cores (ActiveCoreCount1). + Revision 3: + - Added PECI Sx and C10 Reset. + Revision 4: + - Added ActiveSmallCoreCount. + Revision 5: + - Added CrashLogGprs + Revision 6: + - Added ConfigTdpLevel +**/ +typedef struct { + CONFIG_BLOCK_HEADER Header; ///< Config Block Header + UINT32 HyperThreading : 1; ///< Enable or Disable Hyper Thre= ading; 0: Disable; 1: Enable. + /** + Sets the boot frequency starting from reset vector. + - 0: Maximum battery performance. + - 1: Maximum non-turbo performance + -2: Turbo performance. + @note If Turbo is selected BIOS will start in max non-turbo mode and swi= tch to Turbo mode. + **/ + UINT32 BootFrequency : 2; + /** + Number of processor cores to enable. + - 0: All cores + - 1: 1 core + - 2: 2 cores + - 3: 3 cores + **/ + UINT32 ActiveCoreCount : 3; ///< @deprecated due to core acti= ve number limitaion. + UINT32 JtagC10PowerGateDisable : 1; ///< False: JTAG is power gated i= n C10 state. True: keeps the JTAG power up during C10 and deeper power stat= es for debug purpose. 0: False<\b>; 1: True. + UINT32 BistOnReset : 1; ///< (Test) Enable or Disa= ble BIST on Reset; 0: Disable; 1: Enable. + /** + Enable or Disable Virtual Machine Extensions (VMX) feature. + - 0: Disable + - 1: Enable + **/ + UINT32 VmxEnable : 1; + /** + Processor Early Power On Configuration FCLK setting. + - 0: 800 MHz (ULT/ULX). + - 1: 1 GHz (DT/Halo). Not supported on ULT/ULX. + - 2: 400 MHz. + - 3: Reserved. + **/ + UINT32 FClkFrequency : 2; + /** + Enable or Disable CrashLog feature + - 0: Disable + - 1: Enable + **/ + UINT32 CrashLogEnable : 1; + + /** + Enable or Disable Total Memory Encryption (TME) feature. + - 0: Disable + - 1: Enable + **/ + UINT32 TmeEnable : 1; + + UINT32 DebugInterfaceEnable : 2; ///< Enable or Disable processor = debug features; 0: Disable; 1: Enable; 2: No Change. + UINT32 DebugInterfaceLockEnable : 1; ///< Lock or Unlock debug interfa= ce features; 0: Disable; 1: Enable. + + /** + Number of big cores in processor to enable. And support up to 16 cores= . + - 0: All cores + - 1: 1 core + - 2: 2 cores + - 3: 3 cores + **/ + UINT32 ActiveCoreCount1 : 4; + + /** + Enables a mailbox command to resolve rare PECI related Sx issues. + @note This should only be used on systems that observe PECI Sx issues. + - 0: Disable + - 1: Enable + **/ + UINT32 PeciSxReset : 1; + + /** + Enables the mailbox command to resolve PECI reset issues during Pkg-C10 = exit. + If Enabled, BIOS will send the CPU message to disable peci reset on C10 = exit. + The default value is 1: Enable for CML, and 0: Disable for= all other CPU's + - 0: Disable + - 1: Enable + **/ + UINT32 PeciC10Reset : 1; + + /** + Number of small cores in processor to enable. And support the enabling= of up to 63 cores. + - 0: All cores + - 1: 1 core + - 2: 2 cores + - 3: 3 cores + **/ + UINT32 ActiveSmallCoreCount : 6; + + /** + Enable or Disable CrashLog GPRs dump + - 0: Disable + - 1: Gprs Enabled, Smm Gprs Enabled + 2: Gprs Enabled, Smm Gprs Disabled + **/ + UINT32 CrashLogGprs : 2; + + UINT32 RsvdBits : 2; + + /** + CpuRatio - Max non-turbo ratio (Flexible Ratio Boot) is set to CpuRati= o. 0: Disabled If disabled, doesn't override max-non turbo ratio. + **/ + UINT8 CpuRatio; + /** + Configuration for boot TDP selection; 0: TDP Nominal; 1: TDP Do= wn; 2: TDP Up. + **/ + UINT8 ConfigTdpLevel; + UINT8 Reserved[2]; ///< Reserved for alignment + UINT32 ElixirSpringsPatchAddr; ///< Address of Elixir Springs Pa= tch(es) + UINT32 ElixirSpringsPatchSize; ///< Elixir Springs Patch(es) Siz= e. +} CPU_CONFIG_LIB_PREMEM_CONFIG; + +#pragma pack (pop) + +#endif // _CPU_CONFIG_LIB_PREMEM_CONFIG_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuP= idTestConfig.h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/= CpuPidTestConfig.h new file mode 100644 index 0000000000..4fcb92cb27 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuPidTestC= onfig.h @@ -0,0 +1,52 @@ +/** @file + CPU PID Config Block. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_PID_TEST_CONFIG_H_ +#define _CPU_PID_TEST_CONFIG_H_ + +#define CPU_PID_TEST_CONFIG_REVISION 1 + +extern EFI_GUID gCpuPidTestConfigGuid; + +#pragma pack (push,1) + +/** + PID Tuning Configuration Structure. + Domain is mapped to Kp =3D 0, Ki =3D 1, Kd =3D 2. + + Revision 1: + - Initial version. +**/ +typedef struct { + CONFIG_BLOCK_HEADER Header; ///< Config Block Header + UINT16 Ratl[3]; ///< RATL setting, in 1/= 256 units. Range is 0 - 65280 + UINT16 VrTdcVr0[3]; ///< VR Thermal Design C= urrent for VR0. In 1/256 units. Range is 0 - 65280 + UINT16 VrTdcVr1[3]; ///< VR Thermal Design C= urrent for VR1. In 1/256 units. Range is 0 - 65280 + UINT16 VrTdcVr2[3]; ///< VR Thermal Design C= urrent for VR2. In 1/256 units. Range is 0 - 65280 + UINT16 VrTdcVr3[3]; ///< VR Thermal Design C= urrent for VR3. In 1/256 units. Range is 0 - 65280 + UINT16 PbmPsysPl1Msr[3]; ///< Power Budget Manage= ment Psys PL1 MSR. In 1/256 units. Range is 0 - 65280 + UINT16 PbmPsysPl1MmioPcs[3]; ///< Power Budget Manage= ment Psys PL1 MMIO/PCS. In 1/256 units. Range is 0 - 65280 + UINT16 PbmPsysPl2Msr[3]; ///< Power Budget Manage= ment Psys PL2 MSR. In 1/256 units. Range is 0 - 65280 + UINT16 PbmPsysPl2MmioPcs[3]; ///< Power Budget Manage= ment Psys PL2 MMIO/PCS. In 1/256 units. Range is 0 - 65280 + UINT16 PbmPkgPl1Msr[3]; ///< Power Budget Manage= ment Package PL1 MSR. In 1/256 units. Range is 0 - 65280 + UINT16 PbmPkgPl1MmioPcs[3]; ///< Power Budget Manage= ment Package PL1 MMIO/PCS. In 1/256 units. Range is 0 - 65280 + UINT16 PbmPkgPl2Msr[3]; ///< Power Budget Manage= ment Package PL2 MSR. In 1/256 units. Range is 0 - 65280 + UINT16 PbmPkgPl2MmioPcs[3]; ///< Power Budget Manage= ment Package PL2 MMIO/PCS. In 1/256 units. Range is 0 - 65280 + UINT16 DdrPl1Msr[3]; ///< DDR PL1 MSR. In 1/2= 56 units. Range is 0 - 65280 + UINT16 DdrPl1MmioPcs[3]; ///< DDR PL1 MMIO/PCS. I= n 1/256 units. Range is 0 - 65280 + UINT16 DdrPl2Msr[3]; ///< DDR PL2 MSR. In 1/2= 56 units. Range is 0 - 65280 + UINT16 DdrPl2MmioPcs[3]; ///< DDR PL2 MMIO/PCS. I= n 1/256 units. Range is 0 - 65280 + /** + Enable or Disable PID Tuning programming flow. + If disabled, all other policies in this config block are ignored. + **/ + UINT8 PidTuning; + UINT8 Rsvd; ///< Reserved for DWORD = alignment. +} CPU_PID_TEST_CONFIG; + +#pragma pack (pop) + +#endif // _CPU_PID_TEST_CONFIG_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuP= owerMgmtBasicConfig.h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/Confi= gBlock/CpuPowerMgmtBasicConfig.h new file mode 100644 index 0000000000..0255d49bdf --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuPowerMgm= tBasicConfig.h @@ -0,0 +1,226 @@ +/** @file + CPU Power Management Basic Config Block. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_POWER_MGMT_BASIC_CONFIG_H_ +#define _CPU_POWER_MGMT_BASIC_CONFIG_H_ + +#define CPU_POWER_MGMT_BASIC_CONFIG_REVISION 5 + +extern EFI_GUID gCpuPowerMgmtBasicConfigGuid; + +#pragma pack (push,1) + +/** + CPU Power Management Basic Configuration Structure. + + Revision 1: + - Initial version. + Revision 2: + - Changed EnableItbm default to be disable + - Deprecated EnableItbmDriver due to Platform doesn't have ITBMT OS driv= er + Revision 3: + - Add ApplyConfigTdp for TDP initialization settings based on non-cTDP o= r cTDP + Revision 4: + - Add Hwp Lock support + Revision 5: + - Add VccInDemotionOverride and VccInDemotionMs +**/ +typedef struct { + CONFIG_BLOCK_HEADER Header; ///< Config Block Header + /** + Sets the boot frequency starting from reset vector. + - 0: Maximum battery performance. + - 1: Maximum non-turbo performance. + - 2: Turbo performance. + @note If Turbo is selected BIOS will start in max non-turbo mode and swi= tch to Turbo mode. + **/ + UINT32 BootFrequency : 2; //@deprecated + UINT32 SkipSetBootPState : 1; ///< Choose whether to s= kip SetBootPState function for all APs; 0: Do not skip; 1: Skip. + /** + Enable or Disable Intel Speed Shift Technology. + Enabling allows for processor control of P-state transitions. + 0: Disable; 1: Enable; Bit 1 is ignored. + @note Currently this feature is recommended to be enabled only on win10 + **/ + UINT32 Hwp : 2; + /** + Hardware Duty Cycle Control configuration. 0: Disabled; 1: Enabled 2-3:Reserved + HDC enables the processor to autonomously force components to enter into= an idle state to lower effective frequency. + This allows for increased package level C6 residency. + @note Currently this feature is recommended to be enabled only on win10 + **/ + UINT32 HdcControl : 2; + UINT32 PowerLimit2 : 1; ///< Enable or Disable s= hort duration Power Limit (PL2). 0: Disable; 1: Enable + UINT32 TurboPowerLimitLock : 1; ///< MSR 0x610[63] and 0= x618[63]: Locks all Turbo power limit settings to read-only; 0: Disable<= /b>; 1: Enable (Lock). + UINT32 PowerLimit3DutyCycle : 8; ///< Package PL3 Duty Cy= cle. Specifies the PL3 duty cycle percentage, Range 0-100. Default: 0. + UINT32 PowerLimit3Lock : 1; ///< Package PL3 MSR 615= h lock; 0: Disable; 1: Enable (Lock). + UINT32 PowerLimit4Lock : 1; ///< Package PL4 MSR 601= h lock; 0: Disable; 1: Enable (Lock). + /** + Tcc Offset Clamp for Runtime Average Temperature Limit (RATL) allows CPU= to throttle below P1. + For Y SKU, the recommended default for this policy is 1: Enabled,= which indicates throttling below P1 is allowed. + For all other SKUs the recommended default are 0: Disabled. + **/ + UINT32 TccOffsetClamp : 1; + UINT32 TccOffsetLock : 1; ///< Tcc Offset Lock for= Runtime Average Temperature Limit (RATL) to lock temperature target MSR 1A= 2h; 0: Disabled; 1: Enabled (Lock). + UINT32 TurboMode : 1; ///< Enable or Disable T= urbo Mode. Disable; 1: Enable + UINT32 HwpInterruptControl : 1; ///< Set HW P-State Inte= rrupts Enabled for MISC_PWR_MGMT MSR 0x1AA[7]; 0: Disable; 1: Enabl= e. + UINT32 ApplyConfigTdp : 1; ///< Switch TDP applied = setting based on non-cTDP or TDP; 0: non-cTDP; 1: cTDP. + UINT32 HwpLock : 1; ///< HWP Lock in MISC PW= R MGMT MSR 1AAh; 0: Disable; 1: Enable (Lock). + UINT32 VccInDemotionOverride : 1; ///< Enable VccIn Demoti= on Override configuration. 0: Disable; 1: Enable. + UINT32 RsvdBits : 6; ///< Reserved for future= use. + + /** + 1-Core Ratio Limit: LFM to Fused 1-Core Ratio Limit. For overclocking p= arts: LFM to Fused 1-Core Ratio Limit + OC Bins. + Note: OC Bins =3D 7 means fully unlocked, so range is LFM to 83. + - This 1-Core Ratio Limit Must be greater than or equal to 2-Core Rat= io Limit, 3-Core Ratio Limit, 4-Core Ratio Limit. + **/ + UINT8 OneCoreRatioLimit; + /** + 2-Core Ratio Limit: LFM to Fused 2-Core Ratio Limit, For overclocking p= art: LFM to Fused 2-Core Ratio Limit + OC Bins. + Note: OC Bins =3D 7 means fully unlocked, so range is LFM to 83. + - This 2-Core Ratio Limit Must be Less than or equal to 1-Core Ratio = Limit. + **/ + UINT8 TwoCoreRatioLimit; + /** + 3-Core Ratio Limit: LFM to Fused 3-Core Ratio Limit, For overclocking p= art: LFM to Fused 3-Core Ratio Limit + OC Bins. + Note: OC Bins =3D 7 means fully unlocked, so range is LFM to 83. + - This 3-Core Ratio Limit Must be Less than or equal to 1-Core Ratio = Limit. + **/ + UINT8 ThreeCoreRatioLimit; + /** + 4-Core Ratio Limit: LFM to Fused 4-Core Ratio Limit, For overclocking p= art: LFM to Fused 4-Core Ratio Limit + OC Bins. + Note: OC Bins =3D 7 means fully unlocked, so range is LFM to 83. + - This 4-Core Ratio Limit Must be Less than or equal to 1-Core Ratio = Limit. + **/ + UINT8 FourCoreRatioLimit; + /** + 5-Core Ratio Limit: LFM to Fused 5-Core Ratio Limit, For overclocking p= art: LFM to Fused 5-Core Ratio Limit + OC Bins. + Note: OC Bins =3D 7 means fully unlocked, so range is LFM to 83. + - This 5-Core Ratio Limit Must be Less than or equal to 1-Core Ratio = Limit. + **/ + UINT8 FiveCoreRatioLimit; + /** + 6-Core Ratio Limit: LFM to Fused 6-Core Ratio Limit, For overclocking p= art: LFM to Fused 6-Core Ratio Limit + OC Bins. + Note: OC Bins =3D 7 means fully unlocked, so range is LFM to 83. + - This 6-Core Ratio Limit Must be Less than or equal to 1-Core Ratio = Limit. + **/ + UINT8 SixCoreRatioLimit; + /** + 7-Core Ratio Limit: LFM to Fused 7-Core Ratio Limit, For overclocking p= art: LFM to Fused 7-Core Ratio Limit + OC Bins. + Note: OC Bins =3D 7 means fully unlocked, so range is LFM to 83. + - This 7-Core Ratio Limit Must be Less than or equal to 1-Core Ratio = Limit. + **/ + UINT8 SevenCoreRatioLimit; + /** + 8-Core Ratio Limit: LFM to Fused 8-Core Ratio Limit, For overclocking p= art: LFM to Fused 8-Core Ratio Limit + OC Bins. + Note: OC Bins =3D 7 means fully unlocked, so range is LFM to 83. + - This 8-Core Ratio Limit Must be Less than or equal to 1-Core Ratio = Limit. + **/ + UINT8 EightCoreRatioLimit; + /** + TCC Activation Offset. Offset from factory set TCC activation temperatur= e at which the Thermal Control Circuit must be activated. + TCC will be activated at (TCC Activation Temperature - TCC Activation Of= fset), in degrees Celcius. + For Y SKU, the recommended default for this policy is 10 + For all other SKUs the recommended default are 0, causing TCC to = activate at TCC Activation temperature. + @note The policy is recommended for validation purpose only. + **/ + UINT8 TccActivationOffset; + /** + Intel Turbo Boost Max Technology 3.0 + Enabling it on processors with OS support will allow OS to exploit the d= iversity in max turbo frequency of the cores. + 0: Disable; 1: Enable; + **/ + UINT8 EnableItbm : 1; + /** + @deprecated: Platform doesn't have Intel Turbo Boost Max Technology 3.0 = Driver + Enabling it will load the driver upon ACPI device with HID =3D INT3510. + 0: Disable; 1: Enable; + **/ + UINT8 EnableItbmDriver : 1; + /** + Per Core P State OS control mode + Disabling will set PCU_MISC_CONFIG (Command 0x06) Bit 31 =3D 1. When set= , the highest core request is used for all other core requests. + 0: Disable; 1: Enable; + **/ + UINT8 EnablePerCorePState : 1; + /** + HwP Autonomous Per Core P State + Disabling will set Bit 30 =3D 1, command 0x11. When set, autonomous will= request the same value + for all cores all the time. + 0: Disable; 1: Enable; + **/ + UINT8 EnableHwpAutoPerCorePstate : 1; + /** + HwP Autonomous EPP grouping. + Disabling will set Bit 29 =3D 1, command 0x11. When set, autonomous will= not necesarrily request the same value + for all cores with same EPP. + Enabling will clean Bit 29 =3D 0, command 0x11. Autonomous will request = same values for all cores with same EPP. + 0: Disable; 1: Enable; + **/ + UINT8 EnableHwpAutoEppGrouping : 1; + /** + EPB override over PECI + Enable by sending pcode command 0x2b , subcommand 0x3 to 1. + This will allow OOB EPB PECI override control. + 0: Disable; 1: Enable; + **/ + UINT8 EnableEpbPeciOverride : 1; + /** + Support for Fast MSR for IA32_HWP_REQUEST. + On systems with HwP enabled, if this feature is available as indicated b= y MSR 0x65F[0] =3D 1, + set MSR 0x657[0] =3D 1. + 0: Disable; 1: Enable; + **/ + UINT8 EnableFastMsrHwpReq : 1; + UINT8 ReservedBits1 : 1; ///< Reserved for future= use. + UINT8 MinRingRatioLimit; ///< Minimum Ring Ratio = Limit. Range from 0 to Max Turbo Ratio. 0 =3D AUTO/HW Default + UINT8 MaxRingRatioLimit; ///< Maximum Ring Ratio = Limit. Range from 0 to Max Turbo Ratio. 0 =3D AUTO/HW Default + /** + Package Long duration turbo mode power limit (PL1). + Default is the TDP power limit of processor. Units are based on POWER_MG= MT_CONFIG.CustomPowerUnit. + **/ + UINT16 PowerLimit1; + /** + Package Short duration turbo mode power limit (PL2). Allows for short ex= cursions above TDP power limit. + Default =3D 1.25 * TDP Power Limit. Units are based on POWER_MGMT_CONFIG= .CustomPowerUnit. + **/ + UINT16 PowerLimit2Power; + /** + Package PL3 power limit. PL3 is the CPU Peak Power Occurences Limit. + Default: 0. Range 0-65535. Units are based on POWER_MGMT_CONFIG.C= ustomPowerUnit. + **/ + UINT16 PowerLimit3; + /** + Package PL4 power limit. PL4 is a Preemptive CPU Package Peak Power Limi= t, it will never be exceeded. + Power is premptively lowered before limit is reached. Default: 0.= Range 0-65535. + Units are based on POWER_MGMT_CONFIG.CustomPowerUnit. + **/ + UINT16 PowerLimit4; + /** + Package Long duration turbo mode power limit (PL1) time window in second= s. + Used in calculating the average power over time. + Mobile: 28s + Desktop: 8s + Range: 0 - 128s + **/ + UINT32 PowerLimit1Time; + UINT32 PowerLimit3Time; ///< Package PL3 time wi= ndow. Range from 3ms to 64ms. + /** + Tcc Offset Time Window can range from 5ms to 448000ms for Runtime Averag= e Temperature Limit (RATL). + For Y SKU, the recommended default for this policy is 5000: 5 seconds= , For all other SKUs the recommended default are 0: Disabled + **/ + UINT32 TccOffsetTimeWindowForRatl; + /** + Customize the VccIn Demotion in ms accordingly. Values used by OEM expec= ted to be in lower end of 1-30 ms range. + Value 1 means 1ms, value 2 means 2ms, and so on. Value 0 will disable Vc= cIn Demotion knob. + It's 30ms by silicon default. + **/ + UINT32 VccInDemotionMs; +} CPU_POWER_MGMT_BASIC_CONFIG; + +#pragma pack (pop) + +#endif // _CPU_POWER_MGMT_BASIC_CONFIG_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuP= owerMgmtCustomConfig.h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/Conf= igBlock/CpuPowerMgmtCustomConfig.h new file mode 100644 index 0000000000..e1a5bcc684 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuPowerMgm= tCustomConfig.h @@ -0,0 +1,76 @@ +/** @file + CPU Power Managment Custom Config Block. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_POWER_MGMT_CUSTOM_CONFIG_H_ +#define _CPU_POWER_MGMT_CUSTOM_CONFIG_H_ + +#define CPU_POWER_MGMT_CUSTOM_CONFIG_REVISION 1 + +extern EFI_GUID gCpuPowerMgmtCustomConfigGuid; + +#pragma pack (push,1) + +/// +/// Defines the maximum number of custom ratio states supported. +/// +#define MAX_CUSTOM_RATIO_TABLE_ENTRIES 40 +#define MAX_16_CUSTOM_RATIO_TABLE_ENTRIES 16 + +/// +/// Defines the maximum number of custom ConfigTdp entries supported. +/// @warning: Changing this define would cause DWORD alignment issues in p= olicy structures. +/// +#define MAX_CUSTOM_CTDP_ENTRIES 3 + +/// +/// This structure is used to describe the custom processor ratio table de= sired by the platform. +/// +typedef struct { + UINT8 MaxRatio; ///< The maxi= mum ratio of the custom ratio table. + UINT8 NumberOfEntries; ///< The numb= er of custom ratio state entries, ranges from 2 to 40 for a valid custom ra= tio table. + UINT8 Rsvd0[2]; ///< Reserved= for DWORD alignment. + UINT32 Cpuid; ///< The CPU = ID for which this custom ratio table applies. + UINT8 StateRatio[MAX_CUSTOM_RATIO_TABLE_ENTRIES]; ///< The proc= essor ratios in the custom ratio table. + /// + /// If there are more than 16 total entries in the StateRatio table, the= n use these 16 entries to fill max 16 table. + /// @note If NumberOfEntries is 16 or less, or the first entry of this t= able is 0, then this table is ignored, + /// and up to the top 16 values from the StateRatio table is used instea= d. + /// + UINT8 StateRatioMax16[MAX_16_CUSTOM_RATIO_TABLE_ENTRIES]; +#if ((MAX_CUSTOM_RATIO_TABLE_ENTRIES + MAX_16_CUSTOM_RATIO_TABLE_ENTRIES) = % 4) + UINT8 Rsvd1[4 - ((MAX_CUSTOM_RATIO_TABLE_ENTRIES + MAX_16_CUSTOM_RATIO_= TABLE_ENTRIES) % 4)]; ///< If needed, add padding for dword alignment. +#endif +} PPM_CUSTOM_RATIO_TABLE; + +/// +/// PPM Custom ConfigTdp Settings +/// +typedef struct _PPM_CUSTOM_CTDP_TABLE { + UINT32 CustomPowerLimit1Time : 8; ///< Short term Power= Limit time window value for custom cTDP level. + UINT32 CustomTurboActivationRatio : 8; ///< Turbo Activation= Ratio for custom cTDP level. + UINT32 RsvdBits : 16; ///< Bits reserved fo= r DWORD alignment. + UINT16 CustomPowerLimit1; ///< Short term Power= Limit value for custom cTDP level. Units are based on POWER_MGMT_CONFIG.Cu= stomPowerUnit. + UINT16 CustomPowerLimit2; ///< Long term Power = Limit value for custom cTDP level. Units are based on POWER_MGMT_CONFIG.Cus= tomPowerUnit. +} PPM_CUSTOM_CTDP_TABLE; + +/** + CPU Power Management Custom Configuration Structure. + + Revision 1: + - Initial version. +**/ +typedef struct { + CONFIG_BLOCK_HEADER Header; = ///< Config Block Header + PPM_CUSTOM_RATIO_TABLE CustomRatioTable; = ///< Custom Processor Ratio Table Instance + PPM_CUSTOM_CTDP_TABLE CustomConfigTdpTable[MAX_CUSTOM_CTDP_ENTRIES]; = ///< Custom ConfigTdp Settings Instance + UINT32 ConfigTdpLock : 1; = ///< Lock the ConfigTdp mode settings from runtime changes; 0: Dis= able; 1: Enable. + UINT32 ConfigTdpBios : 1; = ///< Configure whether to load Configurable TDP SSDT; 0: Disable; 1: Enable. + UINT32 RsvdBits : 30; = ///< Reserved for future use +} CPU_POWER_MGMT_CUSTOM_CONFIG; + +#pragma pack (pop) + +#endif // _CPU_POWER_MGMT_CUSTOM_CONFIG_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuP= owerMgmtPsysConfig.h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/Config= Block/CpuPowerMgmtPsysConfig.h new file mode 100644 index 0000000000..f1ceb8f43b --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuPowerMgm= tPsysConfig.h @@ -0,0 +1,36 @@ +/** @file + CPU Power Management Psys(Platform) Config Block. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_POWER_MGMT_PSYS_CONFIG_H_ +#define _CPU_POWER_MGMT_PSYS_CONFIG_H_ + +#define CPU_POWER_MGMT_PSYS_CONFIG_REVISION 1 + +extern EFI_GUID gCpuPowerMgmtPsysConfigGuid; + +#pragma pack (push,1) + +/** + CPU Power Management Psys(Platform) Configuration Structure. + + Revision 1: + - Initial version. +**/ +typedef struct { + CONFIG_BLOCK_HEADER Header; ///< Config Block Header + UINT32 PsysPowerLimit1 : 1; ///< MSR 0x65C[15]: PL1 = Enable activates the PL1 value to limit average platform power + UINT32 PsysPowerLimit1Time : 8; ///< MSR 0x65C[23:17]: P= L1 timewindow in seconds. + UINT32 PsysPowerLimit2 : 1; ///< MSR 0x65C[47]: PL2 = Enable activates the PL2 value to limit average platform power + UINT32 RsvdBits : 22; ///< Reserved for future= use. + UINT16 PsysPowerLimit1Power; ///< MSR 0x65C[14:0]: Pl= atform PL1 power. Units are based on POWER_MGMT_CONFIG.CustomPowerUnit. + UINT16 PsysPowerLimit2Power; ///< MSR 0x65C[46:32]]: = Platform PL2 power. Units are based on POWER_MGMT_CONFIG.CustomPowerUnit. + UINT16 PsysPmax; ///< PCODE MMIO Mailbox:= Platform Power Pmax. 0 - Auto Specified in 1/8 Watt increments. 0-1= 024 Watts. Value of 800 =3D 100W. + UINT8 Rsvd[2]; ///< Reserved for future= use and config block alignment +} CPU_POWER_MGMT_PSYS_CONFIG; + +#pragma pack (pop) + +#endif // _CPU_POWER_MGMT_PSYS_CONFIG_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuP= owerMgmtTestConfig.h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/Config= Block/CpuPowerMgmtTestConfig.h new file mode 100644 index 0000000000..bd641f27c5 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuPowerMgm= tTestConfig.h @@ -0,0 +1,150 @@ +/** @file + CPU Power Management Test Config Block. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_POWER_MGMT_TEST_CONFIG_H_ +#define _CPU_POWER_MGMT_TEST_CONFIG_H_ + +#define CPU_POWER_MGMT_TEST_CONFIG_REVISION 4 + +extern EFI_GUID gCpuPowerMgmtTestConfigGuid; + +#pragma pack (push,1) + +/// +/// PPM Package C State Limit +/// +typedef enum { + PkgC0C1 =3D 0, + PkgC2, + PkgC3, + PkgC6, + PkgC7, + PkgC7s, + PkgC8, + PkgC9, + PkgC10, + PkgCMax, + PkgCpuDefault =3D 254, + PkgAuto =3D 255 +} MAX_PKG_C_STATE; + +/// +/// PPM Package C State Time Limit +/// +typedef enum { + TimeUnit1ns =3D 0, + TimeUnit32ns, + TimeUnit1024ns, + TimeUnit32768ns, + TimeUnit1048576ns, + TimeUnit33554432ns, + TimeUnitMax +} C_STATE_TIME_UNIT; + +/// +/// Custom Power Units. User can choose to enter in watts or 125 milliwatt= increments. +/// +typedef enum { + PowerUnitWatts =3D 0, ///< in Watts. + PowerUnit125MilliWatts, ///< in 125 milliwatt increments. Example: 90 po= wer units times 125 mW equals 11.250 W. + PowerUnitMax +} CUSTOM_POWER_UNIT; + +/// +/// PPM Interrupt Redirection Mode Selection +/// +typedef enum { + PpmIrmFixedPriority =3D 0, + PpmIrmRoundRobin, + PpmIrmHashVector, + PpmIrmReserved1, + PpmIrmReserved2, + PpmIrmReserved3, + PpmIrmReserved4, + PpmIrmNoChange +} PPM_IRM_SETTING; + +/** + CPU Power Management Test Configuration Structure. + + Revision 1: + - Initial version. + Revision 2: + - Add CstateLatencyControl0TimeUnit for WHL only + - Add CstateLatencyControl0Irtl for WHL only + Revision 3: + - Change C State LatencyContol to Auto as default. + Revision 4: + - Deprecate ConfigTdpLevel. Move to premem. +**/ +typedef struct { + CONFIG_BLOCK_HEADER Header; ///< Offset 0-27 Confi= g Block Header + UINT32 Eist : 1; ///< Offset 28-31 Enabl= e or Disable Intel SpeedStep Technology. 0: Disable; 1: Enable + UINT32 EnergyEfficientPState : 1; ///< Enabl= e or Disable Energy Efficient P-state will be applied in Turbo mode. Disabl= e; 1: Enable + UINT32 EnergyEfficientTurbo : 1; ///< Enabl= e or Disable Energy Efficient Turbo, will be applied in Turbo mode. Disable= ; 1: Enable + UINT32 TStates : 1; ///< Enabl= e or Disable T states; 0: Disable; 1: Enable. + UINT32 BiProcHot : 1; ///< Enabl= e or Disable Bi-Directional PROCHOT#; 0: Disable; 1: Enable. + UINT32 DisableProcHotOut : 1; ///< Enabl= e or Disable PROCHOT# signal being driven externally; 0: Disable; 1: Ena= ble. + UINT32 ProcHotResponse : 1; ///< Enabl= e or Disable PROCHOT# Response; 0: Disable; 1: Enable. + UINT32 DisableVrThermalAlert : 1; ///< Enabl= e or Disable VR Thermal Alert; 0: Disable; 1: Enable. + UINT32 EnableAllThermalFunctions : 1; ///< Enabl= e or Disable Thermal Reporting through ACPI tables; 0: Disable; 1: Enabl= e. + UINT32 ThermalMonitor : 1; ///< Enabl= e or Disable Thermal Monitor; 0: Disable; 1: Enable. + UINT32 Cx : 1; ///< Enabl= e or Disable CPU power states (C-states). 0: Disable; 1: Enable + UINT32 PmgCstCfgCtrlLock : 1; ///< If en= abled, sets MSR 0xE2[15]; 0: Disable; 1: Enable. + UINT32 C1e : 1; ///< Enabl= e or Disable Enhanced C-states. 0: Disable; 1: Enable + UINT32 C1AutoDemotion : 1; ///< Enabl= e or Disable C6/C7 auto demotion to C1. 0: Disabled; 1: C1 Auto demotion= + UINT32 C1UnDemotion : 1; ///< Enabl= e or Disable C1UnDemotion. 0: Disabled; 1: C1 Auto undemotion + UINT32 C3AutoDemotion : 1; ///< [Coff= eeLake Only] Enable or Disable C6/C7 auto demotion to C3 0: Disabled; 1= : C3 Auto demotion + UINT32 C3UnDemotion : 1; ///< [Coff= eeLake Only] Enable or Disable C3UnDemotion. 0: Disabled; 1: C3 Auto und= emotion + UINT32 PkgCStateDemotion : 1; ///< Enabl= e or Disable Package Cstate Demotion. Disable; 1: Enable [WhiskeyLak= e] Disable; 1: Enable + UINT32 PkgCStateUnDemotion : 1; ///< Enabl= e or Disable Package Cstate UnDemotion. Disable; 1: Enable [WhiskeyL= ake] Disable; 1: Enable + UINT32 CStatePreWake : 1; ///< Enabl= e or Disable CState-Pre wake. Disable; 1: Enable + UINT32 TimedMwait : 1; ///< Enabl= e or Disable TimedMwait Support. Disable; 1: Enable + UINT32 CstCfgCtrIoMwaitRedirection : 1; ///< Enabl= e or Disable IO to MWAIT redirection; 0: Disable; 1: Enable. + UINT32 ProcHotLock : 1; ///< If en= abled, sets MSR 0x1FC[23]; 0: Disable; 1: Enable. + UINT32 RaceToHalt : 1; ///< Enabl= e or Disable Race To Halt feature; 0: Disable; 1: Enable . RTH will = dynamically increase CPU frequency in order to enter pkg C-State faster to = reduce overall power. (RTH is controlled through MSR 1FC bit 20) + UINT32 ConfigTdpLevel : 8; ///< @depr= ecated. Move to premem phase. + UINT16 CstateLatencyControl1Irtl; ///< Offset 32-33 Inter= rupt Response Time Limit of LatencyContol1 MSR 0x60B[9:0].0 is Auto. + UINT16 CstateLatencyControl2Irtl; ///< Offset 34-35 Inter= rupt Response Time Limit of LatencyContol2 MSR 0x60C[9:0].0 is Auto. + UINT16 CstateLatencyControl3Irtl; ///< Offset 36-37 Inter= rupt Response Time Limit of LatencyContol3 MSR 0x633[9:0].0 is Auto. + UINT16 CstateLatencyControl4Irtl; ///< Offset 38-39 Inter= rupt Response Time Limit of LatencyContol4 MSR 0x634[9:0].0 is Auto. + UINT16 CstateLatencyControl5Irtl; ///< Offset 40-41 Inter= rupt Response Time Limit of LatencyContol5 MSR 0x635[9:0].0 is Auto. + // Due to the removal of CstateLatencyControl0Irtl, PkgCStateLimit is no= t aligned to 32-bit address. + UINT8 Rsvd1[2]; ///< Offset 42-43 Reser= ved for config block alignment. + MAX_PKG_C_STATE PkgCStateLimit; ///< Offset 44 This = field is used to set the Max Pkg Cstate. Default set to Auto which limits t= he Max Pkg Cstate to deep C-state. + /** + @todo: The following enums have to be replaced with policies. + **/ + C_STATE_TIME_UNIT Reserved; ///< Offset 45 Reser= ved for config block alignment. + C_STATE_TIME_UNIT CstateLatencyControl1TimeUnit; ///< Offset 46 TimeU= nit for Latency Control1 MSR 0x60B[12:10]; 2: 1024ns. + C_STATE_TIME_UNIT CstateLatencyControl2TimeUnit; ///< Offset 47 TimeU= nit for Latency Control2 MSR 0x60C[12:10]; 2: 1024ns. + C_STATE_TIME_UNIT CstateLatencyControl3TimeUnit; ///< Offset 48 TimeU= nit for Latency Control3 MSR 0x633[12:10]; 2: 1024ns. + C_STATE_TIME_UNIT CstateLatencyControl4TimeUnit; ///< Offset 49 TimeU= nit for Latency Control4 MSR 0x634[12:10]; 2: 1024ns. + C_STATE_TIME_UNIT CstateLatencyControl5TimeUnit; ///< Offset 50 TimeU= nit for Latency Control5 MSR 0x635[12:10]; 2: 1024ns. + /** + Offset 51 Default power unit in watts or in 125 milliwatt increments. + - 0: PowerUnitWatts. + - 1: PowerUnit125MilliWatts. + **/ + CUSTOM_POWER_UNIT CustomPowerUnit; + /** + Offset 52 Interrupt Redirection Mode Select. + - 0: Fixed priority. //Default under CNL. + - 1: Round robin. + - 2: Hash vector. + - 4: PAIR with fixed priority. //Default under KBL, not available und= er CNL. + - 5: PAIR with round robin. //Not available under CNL. + - 6: PAIR with hash vector. //Not available under CNL. + - 7: No change. + **/ + PPM_IRM_SETTING PpmIrmSetting; + // Move the padding to previous offset to align the structure at 32-bit = address. + UINT8 Rsvd[4]; ///< Offset 53-56 Reserv= ed for future use and config block alignment +} CPU_POWER_MGMT_TEST_CONFIG; + +#pragma pack (pop) + +#endif // _CPU_POWER_MGMT_TEST_CONFIG_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuS= ecurityPreMemConfig.h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/Confi= gBlock/CpuSecurityPreMemConfig.h new file mode 100644 index 0000000000..24614fe497 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuSecurity= PreMemConfig.h @@ -0,0 +1,63 @@ +/** @file + CPU Security PreMemory Config Block. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_SECURITY_PREMEM_CONFIG_H_ +#define _CPU_SECURITY_PREMEM_CONFIG_H_ + +#define CPU_SECURITY_PREMEM_CONFIG_REVISION 1 + +extern EFI_GUID gCpuSecurityPreMemConfigGuid; + +#pragma pack (push,1) + +/** + CPU Security PreMemory Configuration Structure. + + Revision 1: + - Initial version. +**/ +typedef struct { + CONFIG_BLOCK_HEADER Header; ///< Config Block Heade= r + UINT32 PrmrrSize; ///< PRMRR Size.Soft= ware Control: 0x0 32MB: 0x2000000, 64MB: 0x4000000, 128 MB: 0x8000000,= 256 MB: 0x10000000, 512 MB: 0x20000000 + UINT16 BiosSize; ///< Flash information = for BIOS Guard: BIOS Size in KB. + UINT8 Reserved[2]; ///< Reserved for futur= e use +/** + Enable or Disable BIOS Guard; 0: Disable; 1: Enable. + - This is an optional feature and can be opted out. + - If this policy is set to Disabled, the policies in the BIOS_GUARD_CO= NFIG will be ignored. + - If PeiBiosGuardLibNull is used, this policy will have no effect. +**/ + UINT32 BiosGuard : 1; + UINT32 BiosGuardToolsInterface : 1; ///< BIOS Guard Tools = Interface; 0: Disable, 1:Enable +/** + Enable or Disable Software Guard Extensions; 0: Disable; 1: Enab= le. + - This is an optional feature and can be opted out. + - If this policy is set to Disabled, the policies in the CPU_SGX_CONFI= G will be ignored. + - If BaseSoftwareGuardLibNull is used, this policy will have no effect= . +**/ + UINT32 EnableSgx : 1; +/** + Enable or Disable Trusted Execution Technology; 0: Disable; 1: E= nable. + - This is an optional feature and can be opted out. + - If this policy is set to Disabled, the policies in the CPU_TXT_PREME= M_CONFIG will be ignored. + - If PeiTxtLibNull is used, this policy will have no effect. +**/ + UINT32 Txt : 1; + UINT32 SkipStopPbet : 1; ///< (Test) Ski= p Stop PBET Timer; 0: Disable; 1: Enable. + /// + /// (Test) This policy indicates whether or not BIOS should alloc= ate PRMRR memory for C6DRAM power gating feature. + /// - 0: Don't allocate any PRMRR memory for C6DRAM power gating featur= e. + /// - 1: Allocate PRMRR memory for C6DRAM power gating feature. + /// + UINT32 EnableC6Dram : 1; + UINT32 ResetAux : 1; ///< (Test) Res= et Auxiliary content, 0: Disabled, 1: Enabled + UINT32 TxtAcheckRequest : 1; ///< (Test) Ach= eckRequest 0: Disabled, 1: Enabled. When Enabled, it will call Achec= k regardless of crashcode value + UINT32 RsvdBits : 24; ///< Reserved for futu= re use +} CPU_SECURITY_PREMEM_CONFIG; + +#pragma pack (pop) + +#endif // _CPU_SECURITY_CONFIG_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuT= estConfig.h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/Cpu= TestConfig.h new file mode 100644 index 0000000000..ee946290e0 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/ConfigBlock/CpuTestConf= ig.h @@ -0,0 +1,51 @@ +/** @file + CPU Test Config Block. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_TEST_CONFIG_H_ +#define _CPU_TEST_CONFIG_H_ + +#define CPU_TEST_CONFIG_REVISION 2 + +extern EFI_GUID gCpuTestConfigGuid; + +#pragma pack (push,1) + +/** + CPU Test Configuration Structure. + + Revision 1: + - Initial version. + Revision 2: + - Removed Voltage Optimization feature. +**/ +typedef struct { + CONFIG_BLOCK_HEADER Header; ///< Config Block Header + UINT32 MlcStreamerPrefetcher : 1; ///< Enab= le or Disable MLC Streamer Prefetcher; 0: Disable; 1: Enable. + UINT32 MlcSpatialPrefetcher : 1; ///< Enab= le or Disable MLC Spatial Prefetcher; 0: Disable; 1: Enable. + UINT32 MonitorMwaitEnable : 1; ///< Enab= le or Disable Monitor /MWAIT instructions; 0: Disable; 1: Enable. + UINT32 MachineCheckEnable : 1; ///< Enab= le or Disable initialization of machine check registers; 0: Disable; 1: = Enable. + UINT32 ProcessorTraceOutputScheme : 1; ///< Cont= rol on Processor Trace output scheme; 0: Single Range Output; 1: ToP= A Output. + UINT32 ProcessorTraceEnable : 1; ///< Enab= le or Disable Processor Trace feature; 0: Disable; 1: Enable. + UINT32 ThreeStrikeCounterDisable : 1; ///< Disa= ble Three strike counter; 0: FALSE; 1: TRUE. + UINT32 RsvdBits : 25; ///< Res= erved for future use + /** + Base address of memory region allocated for Processor Trace. + Processor Trace requires 2^N alignment and size in bytes per thread, = from 4KB to 128MB. + - NULL: Disable + **/ + EFI_PHYSICAL_ADDRESS ProcessorTraceMemBase; + /** + Length in bytes of memory region allocated for Processor Trace. + Processor Trace requires 2^N alignment and size in bytes per thread, = from 4KB to 128MB. + - 0: Disable + **/ + UINT32 ProcessorTraceMemLength; + UINT8 Reserved0[4]; +} CPU_TEST_CONFIG; + +#pragma pack (pop) + +#endif // _CPU_TEST_CONFIG_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuAccess.h b/Si= licon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuAccess.h new file mode 100644 index 0000000000..5d5e4df071 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuAccess.h @@ -0,0 +1,12 @@ +/** @file + Macros to simplify and abstract the interface to CPU configuration. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPUACCESS_H_ +#define _CPUACCESS_H_ + +#include "CpuDataStruct.h" + +#endif diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuDataStruct.h = b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuDataStruct.h new file mode 100644 index 0000000000..ba9a840e54 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuDataStruct.h @@ -0,0 +1,21 @@ +/** @file + This file declares various data structures used in CPU reference code. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _CPU_DATA_STRUCT_H +#define _CPU_DATA_STRUCT_H + +/// +/// Structure to hold the return value of AsmCpuid instruction +/// +typedef struct { + UINT32 RegEax; ///< Value of EAX. + UINT32 RegEbx; ///< Value of EBX. + UINT32 RegEcx; ///< Value of ECX. + UINT32 RegEdx; ///< Value of EDX. +} EFI_CPUID_REGISTER; + +#endif diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuPolicyCommon.= h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuPolicyCommon.h new file mode 100644 index 0000000000..1178f68d0c --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/CpuPolicyCommon.h @@ -0,0 +1,23 @@ +/** @file + CPU Policy Structure definition which will contain several config blocks= during runtime. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ +#ifndef _CPU_POLICY_COMMON_H_ +#define _CPU_POLICY_COMMON_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // _CPU_POLICY_COMMON_H_ diff --git a/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/Register/CommonM= sr.h b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/Register/CommonMsr.h new file mode 100644 index 0000000000..a2cd1db1d6 --- /dev/null +++ b/Silicon/Intel/TigerlakeSiliconPkg/Cpu/Include/Register/CommonMsr.h @@ -0,0 +1,18 @@ + +/** @file + CommonMsr.h + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _COMMONMSR_h +#define _COMMONMSR_h +#include + +/** + Special Chipset Usage MSR +**/ +#define MSR_SPCL_CHIPSET_USAGE 0x000001FE + +#endif /* _COMMONMSR_h */ --=20 2.24.0.windows.2