From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id ACFD57803CD for ; Fri, 15 Sep 2023 23:57:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=cI/hlEZdBbfUO4flH4Q5Ah/OgrL8rcaTz1lZShVcw6A=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1694822221; v=1; b=Emahso2P8U11533i6brYLy8+iFC26YV6uKiCwWag86ETVtBglF1ernRt9wRmdbq/vgkDgm// glJDHC4pUyJ3Tsk5u2g8Iz6T80vjViMDE3gNJ4j5m7MKTecLuWJNQiuP/y94oOg23MiZY4ZB5kh JEmBaxtPGItQhedUY00oPanI= X-Received: by 127.0.0.2 with SMTP id 7hVMYY7687511xPFOzJzdY9m; Fri, 15 Sep 2023 16:57:01 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.3152.1694822217337272558 for ; Fri, 15 Sep 2023 16:57:00 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10834"; a="378276949" X-IronPort-AV: E=Sophos;i="6.02,150,1688454000"; d="scan'208";a="378276949" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2023 16:57:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10834"; a="694893248" X-IronPort-AV: E=Sophos;i="6.02,150,1688454000"; d="scan'208";a="694893248" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Sep 2023 16:57:00 -0700 X-Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Fri, 15 Sep 2023 16:56:59 -0700 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Fri, 15 Sep 2023 16:56:59 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.43) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Fri, 15 Sep 2023 16:56:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kXSntZtf0hdOQgYc9IAamuRcdJRXYpXIowkFZAUc++ai6Q+gBESgf+xLeKAq15tSuvH0nWQI7rwqAqWzrzG1JzQjHRrrnr6187gBfXDd2AzSUsjZfRLCnZ5ai/bzcUceMChR5NeH4JbR4s77Y3GMiTI+0zrDGbhw4wVN4GhUwPsrIeTw8YmsF68uopcZdBnkHuQduIuKorAXTw6IPQyCPM+uHS7b12EIs/w6869VuXSM7Iw+i9hCbTg7ntfkXDA86A+z0lf+JUJias9UdIP0XwzD5OgvcdsSQoht7BACkAzH1bjw4zbdA/PhQfBM3pRrVh2IzOrmDCy2Uz7rkVzZQQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bwJA81Os5TLzpbjEb96pg2totORC9RunhlhjYCYiO9A=; b=CPDUj9RJRYhODNWBODo6jmVb6WebcSY0E2mdXCzL1O+VFskf0e1GTxGr9T1cX4ovT66bqVB5Z3seNpswciaB/Kh51krbZnrPb4+28I8vRM0EjfsDYHDGGeXnLlAsnFRi+OAuA35Rf5iJ33ZW6I7PRtvOlwfSwkRYDEUyvjGQj6liwVlwnkm3qc4z6MoKAX1cc8Y60w/D4ieRUn/dFN5z7h5eJW/GhYz01lYCZuVkhVoFD18YydsVPqxi6Vjqz/jusTgoDui802iRL8LrO5Aupruq+1X/Pq7kJml+ASyVJrmsUxtnYOrUwF7KJj27685surjYESy0u4jeaN+HvlDVJQ== 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 X-Received: from MW4PR11MB5821.namprd11.prod.outlook.com (2603:10b6:303:184::5) by IA1PR11MB6540.namprd11.prod.outlook.com (2603:10b6:208:3a0::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.31; Fri, 15 Sep 2023 23:56:57 +0000 X-Received: from MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::89db:ecf0:29f5:9f3c]) by MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::89db:ecf0:29f5:9f3c%4]) with mapi id 15.20.6768.029; Fri, 15 Sep 2023 23:56:57 +0000 From: "Nate DeSimone" To: "Kasbekar, Saloni" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" , "Chuang, Rosen" Subject: Re: [edk2-devel] [PATCH v2 08/10] AlderlakeSiliconPkg/Fru: Add AdlCpu Fru Thread-Topic: [PATCH v2 08/10] AlderlakeSiliconPkg/Fru: Add AdlCpu Fru Thread-Index: AQHZ54+Tf5e7uf3L1UavFtrjAq2gsLAckX2Q Date: Fri, 15 Sep 2023 23:56:57 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5821:EE_|IA1PR11MB6540:EE_ x-ms-office365-filtering-correlation-id: 242b1012-99d4-45e9-e9bc-08dbb64771d4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 0YNn/SChnknfNvVw4ysOuDF/nIRi1wu4c83FJMakJAr1cclhhjzu6j2WAnZ8GJetynBo+64u3z1aNXtpdT0PjGst2IQrJ6zt/SVuYJBeGtZBDqn513/zaKDyDHT4tTCTkvCKXC//5x+MzZxGWTRyAY3jsgfm/0QNAGpAP6K/UsFOlPuDNQzSxst6gJRkPtd9Uj+AIz0cZ87b8R6tRt5mxr88WXuuLxhacyOh1acRiBZv2jqqcEbN/0/g4mrGCkmrNhJG+FF0Mh2UpSFDPrOmXDfHi/Ngh/AX4jWapwp8GAP5d4kCKsmZYgAhAJ4wCN5VFmMMbzhsKuACjnJFVx05ZATdqBKQIiNt0a2F81vPdDQW3VottK9YzXPyfC8kzhFn1cAaumVx7fDf/pQeNSe1+aWSrx9Aw2nM3bEsTZBKKwBKlgSzvz8UzGggCNWCwnYxJBAtLzWf1jbiu0c8LBPis7WzAm1ukZaKfoAyTVIZ7WDsIy6hpIYQ5m+9Cdo5uUOyngZ3zYae3p3z/LKtdCTzJpa9xDe4UCnqNBQM1Afcf9Yc1I0PclPSbJy4OGhHzFdxPlpcmydMT3SLzmhMZLsfOBVHMtuV2tqk0PSdSpvUZ8KEtcBctrqKsBkrFe/y57Vx x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dYn8Vux39SuwkaJP3zSFHBS2e4uR1ATtuyukPQYxAoU7ZAFrCCjYeMn1Vwl8?= =?us-ascii?Q?jv3CfOSoHvGISphNLv+wdDPk4OP2kz0pjWI2z/8zu5KBC5xqrrkjSLwDX/yR?= =?us-ascii?Q?++fbCsuv4foPpMve/RvOUKSfJUjPptsxG9QaUMWjGhVBkh345Ldt+fY9NZuu?= =?us-ascii?Q?yr8k4koBnzKF0emiCff1XOTqXPg7cEf/3W9SwKHsQQN3HFFxpzP/TkSMbAjg?= =?us-ascii?Q?tfJLiJ3EsB1BEFag52WmQOC19shP/QorJ3T67ix1e21uXsdbLi/FePwipBTI?= =?us-ascii?Q?gZ5yRdG9afO2Ip8pvZKpH5AG7vCs2QsivDLHukbDiOMHoXeQYZkJJPDNaXrD?= =?us-ascii?Q?BaUqfVViiWJHnkavBBKTZAh6/7c2dcKzw00opPyOm1nLAfN/F2C+fEUDJkHE?= =?us-ascii?Q?RFolEeRZWyJ6boDeFdIyIpcp7Q97kACcAIy9ualyAkCMvsbXfbY6tKA6tXiS?= =?us-ascii?Q?F8WTXKjmwIi3aVQrUyL3AcqIbZWfWVvbmulqXnWv/t+KzWWZ2DvmygusIzYP?= =?us-ascii?Q?j9B2WattsEv3GwiwemYbeXVfQRx4hw4xy0mDraH/KIo0QmM5vHrS/bkXIWAL?= =?us-ascii?Q?eU4Un21T/XXbIYSHkaAUW8Y/musZ9lxMRl2mIpumF77DyZxfaO6r2aODFEtX?= =?us-ascii?Q?mYMRxqnTFTBBYGQrY+BmzZ5MAT3Wgmv2T5rz+SoiOSOQcAKukkOepsO49WiZ?= =?us-ascii?Q?gBX44w6cRIUa2jvLp6Qo2mh9Gmu1bCP+dEnLWbM3o4hI+HTTpN15pRADpMLg?= =?us-ascii?Q?Pm8seWNqlRqUBL01p3+cxbSePG/51AkluqdtNz9bO0M0p1jnOLKy8m1o3v1y?= =?us-ascii?Q?KIZYCSeXtVeN5CuAknbMFvB9JRa7RDYD8HpbVND93B/db3sfBAYH6sWYIiAn?= =?us-ascii?Q?KhTrnxgZFnchaT07Fy/+K24k571nJPsmw79ozqzxgEwfP+e2NBtNnNQmegGs?= =?us-ascii?Q?QLjQ9xLj2RV2ud2g0jbj3GnMBHN/ee47f2D466hcZpAfxn+DyI6KUPZ48i9f?= =?us-ascii?Q?a/UYVGxWbRN8kgW03m3VuY+zrl8SPH1hFl0R8+lyP4qqIBOqlFAjw1o65cmJ?= =?us-ascii?Q?WcnZeBQyhFR1yMLqM0DDipAOc4euq98YeMmSo5LB6arYqgaFJsCQD8+XDmdf?= =?us-ascii?Q?qW9x1S24+EdRtxBmfQ+wfgKMyyb8gV4wpkHSIxSKiqz8F7sohry/sfr9G6Go?= =?us-ascii?Q?5x4TX6sE7hxQaQjjIlOWKlQfp1yJlg8YRYuN9HF4b8BPu0d7NvCj/y8cwisE?= =?us-ascii?Q?4OznLj86TiR921oOXSHhn/K5l1YPDlylzaoiL4AbMOQoYQh31Tg3mmT63Zq4?= =?us-ascii?Q?Z2bTlcRaLvSpnqAmAC6nOGXwhJ/oSqM32YVWjTYtsjdkFi8ww3GwK45tspq7?= =?us-ascii?Q?/3By3l4TgnqN4V34yVLP8aSSx42tvR9XDFnUoXHTzJZSfatLefJzt+TTvNus?= =?us-ascii?Q?JZOnU64MfceZVXFdKi8RtGRAi2a0hUXdZGEtWJu3kjvvGCufubySlT9vVbE/?= =?us-ascii?Q?DP4gOr26ceQkRFQ97MD8J4LHv5ODncexoF5prAbGlAfXd4v+lbORjs8rfcS4?= =?us-ascii?Q?M3rhmhHUfuJUhHS9ehz2JF53uqxM+LneJSQ+ynvrduHZI2SvuhyEqEqRvDet?= =?us-ascii?Q?1w=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 242b1012-99d4-45e9-e9bc-08dbb64771d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Sep 2023 23:56:57.1534 (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: ZqkB6TS9j6zWQjwr9dVwdYXsGvoDsDLIFKx4nnB1KoHp5yutsjA/YZNHBgfYLl0JFXcmMNCXeJKrAk6joDM2njC4IeVeQ+11uJ9JQg2BVGQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6540 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nathaniel.l.desimone@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: RwILbvdaZc76RCJnlli3gCNDx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Emahso2P; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Acked-by: Nate DeSimone -----Original Message----- From: Kasbekar, Saloni =20 Sent: Thursday, September 14, 2023 9:46 PM To: devel@edk2.groups.io Cc: Kasbekar, Saloni ; Chaganty, Rangasai V ; Desimone, Nathaniel L ; Chuang, Rosen Subject: [PATCH v2 08/10] AlderlakeSiliconPkg/Fru: Add AdlCpu Fru Adds the following modules: - AdlCpu/CpuPcieRp - AdlCpu/Include - AdlCpu/IncludePrivate - AdlCpu/LibraryPrivate - AdlCpu/PeiReportCpuHob - AdlCpu DSCs Cc: Sai Chaganty Cc: Nate DeSimone Cc: Rosen Chuang Signed-off-by: Saloni Kasbekar --- .../Fru/AdlCpu/CommonLib.dsc | 9 + .../CpuPcieInfoFruLib.c | 87 ++++++++++ .../PeiDxeSmmCpuPcieInfoFruLib.inf | 39 +++++ .../AlderlakeSiliconPkg/Fru/AdlCpu/DxeLib.dsc | 8 + .../Fru/AdlCpu/Include/CpuGenInfo.h | 42 +++++ .../Include/Library/CpuPcieInfoFruLib.h | 45 +++++ .../Include/Register/SaRegsHostBridge.h | 64 +++++++ .../AdlCpu/IncludePrivate/CpuGenInfoFruLib.h | 44 +++++ .../AdlCpu/Incl= udePrivate/Register/IgdRegs.h | 34 ++++ .../BaseCpuInfoFruLib/BaseCpuInfoFruLib.c | 164 ++++++++++++++++++ .../BaseCpuInfoFruLib/BaseCpuInfoFruLib.inf | 29 ++++ .../PeiReportCpuHobLib/PeiReportCpuHobLib.c | 22 +++ .../PeiReportCpuHobLib/PeiReportCpuHobLib.inf | 26 +++ 13 files changed, 613 insertions(+) create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/CommonLib.= dsc create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/CpuPcieRp/= Library/PeiDxeSmmCpuPcieInfoFruLib/CpuPcieInfoFruLib.c create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/CpuPcieRp/= Library/PeiDxeSmmCpuPcieInfoFruLib/PeiDxeSmmCpuPcieInfoFruLib.inf create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/DxeLib.dsc create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/Cp= uGenInfo.h create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/Li= brary/CpuPcieInfoFruLib.h create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/Re= gister/SaRegsHostBridge.h create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/IncludePri= vate/CpuGenInfoFruLib.h create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/IncludePri= vate/Register/IgdRegs.h create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/LibraryPri= vate/BaseCpuInfoFruLib/BaseCpuInfoFruLib.c create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/LibraryPri= vate/BaseCpuInfoFruLib/BaseCpuInfoFruLib.inf create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/PeiReportC= puHob/Library/PeiReportCpuHobLib/PeiReportCpuHobLib.c create mode 100644 Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/PeiReportC= puHob/Library/PeiReportCpuHobLib/PeiReportCpuHobLib.inf diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/CommonLib.dsc b/S= ilicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/CommonLib.dsc new file mode 100644 index 0000000000..35a3cce916 --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/CommonLib.dsc @@ -0,0 +1,9 @@ +## @file +# Component description file for the AlderLake CPU Common FRU libraries. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +CpuPcieInfoFruLib|$(PLATFORM_SI_PACKAGE)/Fru/AdlCpu/CpuPcieRp/Library/P +CpuPcieInfoFruLib|eiDxeSmmCpuPcieInfoFruLib/PeiDxeSmmCpuPcieInfoFruLib. +CpuPcieInfoFruLib|inf +CpuInfoFruLib|$(PLATFORM_SI_PACKAGE)/Fru/AdlCpu/LibraryPrivate/BaseCpuI +CpuInfoFruLib|nfoFruLib/BaseCpuInfoFruLib.inf diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/CpuPcieRp/Library= /PeiDxeSmmCpuPcieInfoFruLib/CpuPcieInfoFruLib.c b/Silicon/Intel/AlderlakeSi= liconPkg/Fru/AdlCpu/CpuPcieRp/Library/PeiDxeSmmCpuPcieInfoFruLib/CpuPcieInf= oFruLib.c new file mode 100644 index 0000000000..277b73fe67 --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/CpuPcieRp/Library/Pei +++ DxeSmmCpuPcieInfoFruLib/CpuPcieInfoFruLib.c @@ -0,0 +1,87 @@ +/** @file + CPU PCIe information library. + + All function in this library is available for PEI, DXE, and SMM, But=20 + do not support UEFI RUNTIME environment call. + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include=20 + #include #include=20 + #include #include=20 + #include =20 +#include #include + +/** + Get Maximum CPU Pcie Root Port Number + + @retval Maximum CPU Pcie Root Port Number **/ +UINT8 +GetMaxCpuPciePortNum ( + VOID + ) +{ + switch (GetCpuSku ()) { + case EnumCpuUlt: + return CPU_PCIE_ULT_MAX_ROOT_PORT; + case EnumCpuUlx: + return CPU_PCIE_ULX_MAX_ROOT_PORT; + default: + return CPU_PCIE_ULT_MAX_ROOT_PORT; + } +} + +/** + Get CPU Pcie Root Port Device and Function Number by Root Port=20 +physical Number + + @param[in] RpNumber Root port physical number. (0-based) + @param[out] RpDev Return corresponding root port device = number. + @param[out] RpFun Return corresponding root port functio= n number. + + @retval EFI_SUCCESS Root port device and function is retri= eved + @retval EFI_INVALID_PARAMETER RpNumber is invalid +**/ +EFI_STATUS +EFIAPI +GetCpuPcieRpDevFun ( + IN UINTN RpNumber, + OUT UINTN *RpDev, + OUT UINTN *RpFun + ) +{ + if (RpNumber > GetMaxCpuPciePortNum ()) { + DEBUG ((DEBUG_ERROR, "GetCpuPcieRpDevFun invalid RpNumber %x", RpNumbe= r)); + ASSERT (FALSE); + return EFI_INVALID_PARAMETER; + } + + switch (RpNumber) { + case 0: + *RpDev =3D 6; + *RpFun =3D 0; + break; + case 1: + *RpDev =3D 1; + *RpFun =3D 0; + break; + case 2: + if (GetCpuSku () =3D=3D EnumCpuTrad) { + *RpDev =3D 1; + *RpFun =3D 1; + } else { + *RpDev =3D 6; + *RpFun =3D 2; + } + break; + default: + *RpDev =3D 6; + *RpFun =3D 0; + break; + } + return EFI_SUCCESS; +} diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/CpuPcieRp/Library= /PeiDxeSmmCpuPcieInfoFruLib/PeiDxeSmmCpuPcieInfoFruLib.inf b/Silicon/Intel/= AlderlakeSiliconPkg/Fru/AdlCpu/CpuPcieRp/Library/PeiDxeSmmCpuPcieInfoFruLib= /PeiDxeSmmCpuPcieInfoFruLib.inf new file mode 100644 index 0000000000..f850f1a5f1 --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/CpuPcieRp/Library/Pei +++ DxeSmmCpuPcieInfoFruLib/PeiDxeSmmCpuPcieInfoFruLib.inf @@ -0,0 +1,39 @@ +## @file +# CPU PCIe information library for TigerLake PCH. +# +# All function in this library is available for PEI, DXE, and SMM, #=20 +But do not support UEFI RUNTIME environment call. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + + +[Defines] +INF_VERSION =3D 0x00010017 +BASE_NAME =3D PeiDxeSmmCpuPcieInfoFruLib +FILE_GUID =3D 59CA5352-ED46-4449-BF1C-0D0074C4D5B1 +VERSION_STRING =3D 1.0 +MODULE_TYPE =3D BASE +LIBRARY_CLASS =3D CpuPcieInfoFruLib + + +[LibraryClasses] +IoLib +BaseLib +DebugLib +PrintLib +PciSegmentLib +PchPcrLib +PmcPrivateLib +PcdLib +ConfigBlockLib +CpuPlatformLib + +[Packages] +MdePkg/MdePkg.dec +AlderlakeSiliconPkg/SiPkg.dec + +[Sources] +CpuPcieInfoFruLib.c + diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/DxeLib.dsc b/Sili= con/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/DxeLib.dsc new file mode 100644 index 0000000000..644230484e --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/DxeLib.dsc @@ -0,0 +1,8 @@ +# @file +# Component description file for the AlderLake CPU DXE FRU libraries. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## +DxeGraphicsPolicyLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Graphics/LibraryPri +DxeGraphicsPolicyLib|vate/DxeGraphicsPolicyLib/DxeGraphicsPolicyLib.inf +DxeIgdOpRegionInitLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Graphics/LibraryPr +DxeIgdOpRegionInitLib|ivate/DxeIgdOpRegionInitLib/DxeIgdOpRegionInitLib +DxeIgdOpRegionInitLib|.inf diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/CpuGenInf= o.h b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/CpuGenInfo.h new file mode 100644 index 0000000000..482316829d --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/CpuGenInfo.h @@ -0,0 +1,42 @@ +/** @file + Header file for Cpu Information + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #ifndef=20 +_CPU_GEN_INFO_H_ #define _CPU_GEN_INFO_H_ + +#include + +// +// Processor Definitions +// +#define CPUID_FULL_FAMILY_MODEL_ALDERLAKE_MOBILE 0x000906A0 + +/// +/// Enums for CPU Stepping IDs +/// +typedef enum { + + /// + /// AlderLake Mobile Steppings(ULT) + /// + EnumAdlJ0 =3D 0, + EnumAdlK0 =3D 2, + EnumAdlL0 =3D 3, + + /// + /// AlderLake Mobile Steppings(ULX) + /// + EnumAdlQ0 =3D 1, + EnumAdlR0 =3D 4, + EnumAdlS0 =3D 5, + + + /// + /// Max Stepping + /// + EnumCpuSteppingMax =3D CPUID_FULL_STEPPING } CPU_STEPPING; #endif diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/Library/C= puPcieInfoFruLib.h b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/L= ibrary/CpuPcieInfoFruLib.h new file mode 100644 index 0000000000..9dafa98631 --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/Library/CpuPc +++ ieInfoFruLib.h @@ -0,0 +1,45 @@ +/** @file + Header file for CpuPcieInfoFruLib. + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #ifndef=20 +_CPU_PCIE_INFO_FRU_LIB_H_ #define _CPU_PCIE_INFO_FRU_LIB_H_ + +#include + +#define CPU_PCIE_MAX_ROOT_PORTS 4 +#define CPU_PCIE_MAX_CONTROLLERS 3 + +#define CPU_PCIE_ULT_MAX_ROOT_PORT 3 +#define CPU_PCIE_ULX_MAX_ROOT_PORT 1 + +/** + Get CPU Maximum Pcie Root Port Number + + @retval PcieMaxRootPort Pch Maximum Pcie Root Port Number +**/ +UINT8 +GetMaxCpuPciePortNum ( + VOID + ); + +/** + Get CPU Pcie Root Port Device and Function Number by Root Port=20 +physical Number + + @param[in] RpNumber Root port physical number. (0-based) + @param[out] RpDev Return corresponding root port device = number. + @param[out] RpFun Return corresponding root port functio= n number. + + @retval EFI_SUCCESS Root port device and function is retri= eved + @retval EFI_INVALID_PARAMETER RpNumber is invalid +**/ +EFI_STATUS +EFIAPI +GetCpuPcieRpDevFun ( + IN UINTN RpNumber, + OUT UINTN *RpDev, + OUT UINTN *RpFun + ); +#endif // _CPU_PCIE_INFO_FRU_LIB_H_ diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/Register/= SaRegsHostBridge.h b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/R= egister/SaRegsHostBridge.h new file mode 100644 index 0000000000..be4bba3283 --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/Include/Register/SaRe +++ gsHostBridge.h @@ -0,0 +1,64 @@ +/** @file + Register names for Host Bridge block + Conventions: + - Prefixes: + - Definitions beginning with "R_" are registers + - Definitions beginning with "B_" are bits within registers + - Definitions beginning with "V_" are meaningful values of bits within= the registers + - Definitions beginning with "S_" are register sizes + - Definitions beginning with "N_" are the bit position + - In general, SA registers are denoted by "_SA_" in register names + - Registers / bits that are different between SA generations are denoted= by + "_SA_[generation_name]_" in register/bit names. e.g., "_SA_HSW_" + - Registers / bits that are different between SKUs are denoted by "_[SKU= _name]" + at the end of the register/bit names + - Registers / bits of new devices introduced in a SA generation will be = just named + as "_SA_" without [generation_name] inserted. + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #ifndef=20 +_SA_REGS_HOST_BRIDGE_H_ #define _SA_REGS_HOST_BRIDGE_H_ + +#define SA_SEG_NUM 0x00 +// +// DEVICE 0 (Memory Controller Hub) +// +#define SA_MC_BUS 0x00 +#define SA_MC_DEV 0x00 +#define SA_MC_FUN 0x00 +#define R_SA_MC_DEVICE_ID 0x02 + +// +// AlderLake CPU Mobile SA Device IDs B0:D0:F0 // +#define V_SA_DEVICE_ID_MB_ULT_1 0x4641 ///< AlderLake P (6+8+GT) SA D= ID +#define V_SA_DEVICE_ID_MB_ULT_2 0x4649 ///< AlderLake P (6+4(f)+GT) S= A DID +#define V_SA_DEVICE_ID_MB_ULT_3 0x4621 ///< AlderLake P (4(f)+8+GT) S= A DID +#define V_SA_DEVICE_ID_MB_ULT_4 0x4609 ///< AlderLake P (2(f)+4(f)+GT= ) SA DID +#define V_SA_DEVICE_ID_MB_ULT_5 0x4601 ///< AlderLake P (2+8+GT) SA D= ID +#define V_SA_DEVICE_ID_MB_ULT_6 0x4661 ///< AlderLake P (6+8+2) SA DI= D +#define V_SA_DEVICE_ID_MB_ULT_7 0x4629 ///< AlderLake P (4+4+1) SA DI= D +#define V_SA_DEVICE_ID_MB_ULT_8 0x4619 ///< AlderLake P (1+4+GT) SA D= ID +#define V_SA_DEVICE_ID_MB_ULT_9 0x4659 ///< AlderLake P (1+8+GT) SA D= ID +#define V_SA_DEVICE_ID_MB_ULT_10 0x4645 ///< AlderLake P (6+6+GT) SA D= ID +/// +/// Description: +/// The SMRAMC register controls how accesses to Compatible SMRAM spaces = are treated. The Open, Close and Lock bits function only when G_SMRAME bit= is set to 1. Also, the Open bit must be reset before the Lock bit is set. +/// +#define R_SA_SMRAMC (0x88) + +/// +/// Description: +/// This register contains the Top of low memory address. +/// +#define R_SA_TOLUD (0xbc) +/// +/// Description of TOLUD (20:31) +/// This register contains bits 31 to 20 of an address one byte above the= maximum DRAM memory below 4G that is usable by the operating system. Addre= ss bits 31 down to 20 programmed to 01h implies a minimum memory size of 1M= B. Configuration software must set this value to the smaller of the followi= ng 2 choices: maximum amount memory in the system minus ME stolen memory pl= us one byte or the minimum address allocated for PCI memory. Address bits 1= 9:0 are assumed to be 0_0000h for the purposes of address comparison. The H= ost interface positively decodes an address towards DRAM if the incoming ad= dress is less than the value programmed in this register. +/// The Top of Low Usable DRAM is the lowest address above both Graphics = Stolen memory and Tseg. BIOS determines the base of Graphics Stolen Memory = by subtracting the Graphics Stolen Memory Size from TOLUD and further decre= ments by Tseg size to determine base of Tseg. All the Bits in this register= are locked in LT mode. +/// This register must be 1MB aligned when reclaim is enabled. +/// +#define B_SA_TOLUD_TOLUD_MASK (0xfff00000) +#endif diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/IncludePrivate/Cp= uGenInfoFruLib.h b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/IncludePriv= ate/CpuGenInfoFruLib.h new file mode 100644 index 0000000000..5ad7bf4982 --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/IncludePrivate/CpuGen +++ InfoFruLib.h @@ -0,0 +1,44 @@ + /** @file + This file contains Cpu Information for specific generation. + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #ifndef=20 +_CPU_GEN_INFO_FRU_LIB_H_ #define _CPU_GEN_INFO_FRU_LIB_H_ #include=20 + #include #include + +/// +/// Used to identify the CPU used for programming with the VR override=20 +table /// typedef enum { + EnumUnknownCpuId =3D 0, + EnumMinCpuId =3D 1, + + /// + /// ADL P + /// + EnumAdlP15Watt282fCpuId =3D 0x30, + EnumAdlP28Watt482fCpuId =3D 0x31, + EnumAdlP28Watt682fCpuId =3D 0x32, + EnumAdlP45Watt682fCpuId =3D 0x35, + EnumAdlP15Watt142fCpuId =3D 0x36, + EnumAdlP15Watt242fCpuId =3D 0x37, + EnumAdlP45Watt482fCpuId =3D 0x38, + EnumAdlP45Watt442fCpuId =3D 0x39, + EnumAdlP28Watt442fCpuId =3D 0x3A, + EnumAdlP28Watt282fCpuId =3D 0x3B, + EnumAdlP28Watt242fCpuId =3D 0x3C, + EnumAdlP28Watt142fCpuId =3D 0x3D, + EnumAdlP45Watt242fCpuId =3D 0x3E, + EnumAdlP28Watt182fCpuId =3D 0x3F, + EnumAdlP28Watt662fCpuId =3D 0x40, + EnumAdlP28Watt642fCpuId =3D 0x41, + EnumAdlP45Watt642fCpuId =3D 0x42, + EnumAdlPMaxCpuId =3D EnumAdlP45Watt642fCpuId, + +} CPU_IDENTIFIER; + +#endif // _CPU_GEN_INFO_FRU_LIB_H_ diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/IncludePrivate/Re= gister/IgdRegs.h b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/IncludePriv= ate/Register/IgdRegs.h new file mode 100644 index 0000000000..289b293b32 --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/IncludePrivate/Regist +++ er/IgdRegs.h @@ -0,0 +1,34 @@ +/** @file + Register names for IGD block + Conventions: + - Prefixes: + - Definitions beginning with "R_" are registers + - Definitions beginning with "B_" are bits within registers + - Definitions beginning with "V_" are meaningful values of bits within= the registers + - Definitions beginning with "S_" are register sizes + - Definitions beginning with "N_" are the bit position + - In general, SA registers are denoted by "_SA_" in register names + - Registers / bits that are different between SA generations are denoted= by + "_SA_[generation_name]_" in register/bit names. e.g., "_SA_HSW_" + - Registers / bits that are different between SKUs are denoted by "_[SKU= _name]" + at the end of the register/bit names + - Registers / bits of new devices introduced in a SA generation will be = just named + as "_SA_" without [generation_name] inserted. + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #ifndef=20 +_IGD_REGS_H_ #define _IGD_REGS_H_ + +/// +/// Device 2 Register Equates +/// +// +// The following equates must be reviewed and revised when the specificati= on is ready. +// +#define IGD_BUS_NUM 0x00 +#define IGD_DEV_NUM 0x02 +#define IGD_FUN_NUM 0x00 + +#endif diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/LibraryPrivate/Ba= seCpuInfoFruLib/BaseCpuInfoFruLib.c b/Silicon/Intel/AlderlakeSiliconPkg/Fru= /AdlCpu/LibraryPrivate/BaseCpuInfoFruLib/BaseCpuInfoFruLib.c new file mode 100644 index 0000000000..d93048eb6e --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/LibraryPrivate/BaseCp +++ uInfoFruLib/BaseCpuInfoFruLib.c @@ -0,0 +1,164 @@ +/** @file + This file contains the Cpu Information for specific generation. + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include=20 + #include #include=20 + #include #include=20 + #include #include=20 + #include =20 +#include #include =20 +#include #include #include=20 + #include + + +STATIC CONST CHAR8 mAdlCpuFamilyString[] =3D "AlderLake"; typedef struct= =20 +{ + UINT32 CPUID; + UINT8 CpuSku; + CHAR8 *String; +} CPU_REV; + +typedef struct { + CPU_IDENTIFIER CpuIdentifier; + UINT8 SupportedCores; + UINT8 SupportedAtomCores; +} CPU_CORE_COUNT; + +GLOBAL_REMOVE_IF_UNREFERENCED CONST CPU_REV mProcessorRevisionTable[] =3D= { + {CPUID_FULL_FAMILY_MODEL_ALDERLAKE_MOBILE + EnumAdlJ0, EnumCpuUlt, = "J0"}, + {CPUID_FULL_FAMILY_MODEL_ALDERLAKE_MOBILE + EnumAdlK0, EnumCpuUlt, = "K0"}, + {CPUID_FULL_FAMILY_MODEL_ALDERLAKE_MOBILE + EnumAdlL0, EnumCpuUlt, = "L0"}, + {CPUID_FULL_FAMILY_MODEL_ALDERLAKE_MOBILE + EnumAdlQ0, EnumCpuUlt, = "Q0"}, + {CPUID_FULL_FAMILY_MODEL_ALDERLAKE_MOBILE + EnumAdlR0, EnumCpuUlt, = "R0"}, + {CPUID_FULL_FAMILY_MODEL_ALDERLAKE_MOBILE + EnumAdlQ0, EnumCpuUlx, = "Q0"}, + {CPUID_FULL_FAMILY_MODEL_ALDERLAKE_MOBILE + EnumAdlR0, EnumCpuUlx, = "R0"}, + {CPUID_FULL_FAMILY_MODEL_ALDERLAKE_MOBILE + EnumAdlS0, EnumCpuUlx, = "S0"} +}; + +/// +/// PowerLimits Override table for all SKUs. Non-cTDP parts would have '0'= data for TDP level information. +/// +GLOBAL_REMOVE_IF_UNREFERENCED PPM_OVERRIDE_TABLE=20 +mPowerLimitsOverrideTable[] =3D { /// +/// CpuIdentifier TDP MSR PL1 MSR PL2 TdpUp= TdpUp TdpNominal TdpNominal TdpDown TdpDown MSR MSR = Disablefvm +/// PL1 PL2 PL1 = PL2 PL1 PL2 PL1 PL2 PL4 = PL4 + {EnumAdlP15Watt282fCpuId, 1500, 1500, 5500, 0, = 5500, 0, 5500, 0, 5500, 12300, = 0}, /// 15W 282 ADL-P + {EnumAdlP15Watt142fCpuId, 1500, 1500, 5500, 0, = 5500, 0, 5500, 0, 5500, 12300, = 0}, /// 15W 142 ADL-P + {EnumAdlP15Watt242fCpuId, 1500, 1500, 5500, 0, = 5500, 0, 5500, 0, 5500, 12300, = 0}, /// 15W 242 ADL-P + {EnumAdlP28Watt282fCpuId, 2800, 2800, 6400, 0, = 6400, 0, 6400, 0, 6400, 9000, = 0}, /// 28W 282 ADL-P + {EnumAdlP28Watt482fCpuId, 2800, 2800, 6400, 0, = 6400, 0, 6400, 0, 6400, 9000, = 0}, /// 28W 482 ADL-P + {EnumAdlP28Watt682fCpuId, 2800, 2800, 6400, 0, = 6400, 0, 6400, 0, 6400, 14000, = 0}, /// 26W 682 ADL-P + {EnumAdlP28Watt142fCpuId, 2800, 2800, 6400, 0, = 6400, 0, 6400, 0, 6400, 9000, = 0}, /// 28W 142 ADL-P + {EnumAdlP28Watt242fCpuId, 2800, 2800, 6400, 0, = 6400, 0, 6400, 0, 6400, 9000, = 0}, /// 28W 242 ADL-P + {EnumAdlP28Watt442fCpuId, 2800, 2800, 6400, 0, = 6400, 0, 6400, 0, 6400, 9000, = 0}, /// 28W 442 ADL-P + {EnumAdlP28Watt182fCpuId, 2800, 2800, 6400, 0, = 6400, 0, 6400, 0, 6400, 9000, = 0}, /// 28W 182 ADL-P + {EnumAdlP28Watt642fCpuId, 2800, 2800, 6400, 0, = 6400, 0, 6400, 0, 6400, 14000, = 0}, /// 26W 682 ADL-P + {EnumAdlP28Watt662fCpuId, 2800, 2800, 6400, 0, = 6400, 0, 6400, 0, 6400, 14000, = 0}, /// 26W 682 ADL-P + {EnumAdlP45Watt682fCpuId, 4500, 4500, 11500, 0, = 11500, 0, 11500, 0, 11500, 21500, = 0}, /// 45W 682 ADL-P + {EnumAdlP45Watt242fCpuId, 4500, 4500, 9500, 0, = 9500, 0, 9500, 0, 9500, 12500, = 0}, /// 45W 242 ADL-P + {EnumAdlP45Watt482fCpuId, 4500, 4500, 9500, 0, = 9500, 0, 9500, 0, 9500, 12500, = 0}, /// 45W 482 ADL-P + {EnumAdlP45Watt442fCpuId, 4500, 4500, 9500, 0, = 9500, 0, 9500, 0, 9500, 12500, = 0}, /// 45W 442 ADL-P + {EnumAdlP45Watt642fCpuId, 4500, 4500, 11500, 0, = 11500, 0, 11500, 0, 11500, 21500, = 0}, /// 45W 642 ADL-P +}; + +GLOBAL_REMOVE_IF_UNREFERENCED CONST CPU_CORE_COUNT mCpuCoreCountMappingT= able[] =3D { + { EnumAdlP15Watt282fCpuId, 2, 8}, + { EnumAdlP28Watt282fCpuId, 2, 8}, + { EnumAdlP28Watt482fCpuId, 4, 8}, + { EnumAdlP28Watt682fCpuId, 6, 8}, + { EnumAdlP45Watt682fCpuId, 6, 8}, + { EnumAdlP45Watt482fCpuId, 4, 8}, + { EnumAdlP45Watt442fCpuId, 4, 4}, + { EnumAdlP28Watt442fCpuId, 4, 4}, + { EnumAdlP15Watt142fCpuId, 1, 4}, + { EnumAdlP28Watt142fCpuId, 1, 4}, + { EnumAdlP15Watt242fCpuId, 2, 4}, + { EnumAdlP28Watt242fCpuId, 2, 4}, + { EnumAdlP45Watt242fCpuId, 2, 4}, + { EnumAdlP45Watt642fCpuId, 6, 4}, + { EnumAdlP28Watt182fCpuId, 1, 8}, + { EnumAdlP28Watt642fCpuId, 6, 4}, + { EnumAdlP28Watt662fCpuId, 6, 6}, +}; + +/** + Return CPU Sku + + @param[in] UINT32 CpuFamilyModel + @param[in] UINT16 CpuDid + + @retval UINT8 CPU Sku +**/ +UINT8 +GetCpuSkuInfo ( + IN UINT32 CpuFamilyModel, + IN UINT16 CpuDid + ) +{ + UINT8 CpuType; + BOOLEAN SkuFound; + + SkuFound =3D TRUE; + CpuType =3D EnumCpuUnknown; + + switch (CpuFamilyModel) { + case CPUID_FULL_FAMILY_MODEL_ALDERLAKE_MOBILE: + switch (CpuDid) { + case V_SA_DEVICE_ID_MB_ULT_1: // AlderLake P (6+8+GT) + case V_SA_DEVICE_ID_MB_ULT_2: // AlderLake P (6+4(f)+GT) + case V_SA_DEVICE_ID_MB_ULT_3: // AlderLake P (4(f)+8+GT) + case V_SA_DEVICE_ID_MB_ULT_4: // AlderLake P (2(f)+4(f)+GT) + case V_SA_DEVICE_ID_MB_ULT_5: // AlderLake P (2+8+GT) + case V_SA_DEVICE_ID_MB_ULT_6: // AlderLake P (2+4(f)+GT) + case V_SA_DEVICE_ID_MB_ULT_7: // AlderLake P (4+4(f)+GT) + case V_SA_DEVICE_ID_MB_ULT_8: // AlderLake P (1+4+GT) SA DID + case V_SA_DEVICE_ID_MB_ULT_9: // AlderLake P (1+8+GT) SA DID + case V_SA_DEVICE_ID_MB_ULT_10: // AlderLake P (6+6+GT) SA DID + CpuType =3D EnumCpuUlt; + break; + default: + SkuFound =3D FALSE; + break; + } + break; + default: + SkuFound =3D FALSE; + break; + } + + if (!SkuFound) { + DEBUG ((DEBUG_ERROR, "Unsupported CPU SKU, Device ID: 0x%02X, CPUID: 0= x%08X!\n", CpuDid, CpuFamilyModel)); + ASSERT (FALSE); + } + + return CpuType; +} + + +/** + This function returns the supported Physical Address Size + + @retval returns the supported Physical Address Size. +**/ +UINT8 +GetMaxPhysicalAddressSizeFru ( + VOID + ) +{ + // + // Even though CPUID Leaf CPUID_VIR_PHY_ADDRESS_SIZE (0x80000008) MAX_PA= will report 46. + // For ADL BIOS will return Memory expansion 39 bit (0 - 38) + MKTME (Bi= ts 39-41 must be zero - 3 bit hole in the middle) 42-45 bit is MKTME Keys. + // + return 39; +} + + diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/LibraryPrivate/Ba= seCpuInfoFruLib/BaseCpuInfoFruLib.inf b/Silicon/Intel/AlderlakeSiliconPkg/F= ru/AdlCpu/LibraryPrivate/BaseCpuInfoFruLib/BaseCpuInfoFruLib.inf new file mode 100644 index 0000000000..22bcbdf43c --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/LibraryPrivate/BaseCp +++ uInfoFruLib/BaseCpuInfoFruLib.inf @@ -0,0 +1,29 @@ +## @file +# This file contains the Cpu Information for specific generation. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + + +[Defines] +INF_VERSION =3D 0x00010017 +BASE_NAME =3D BaseCpuInfoFruLib +FILE_GUID =3D 72E44627-C719-4B2D-8C5D-963E167E5AAC +VERSION_STRING =3D 1.0 +MODULE_TYPE =3D BASE +LIBRARY_CLASS =3D CpuInfoFruLib + +[LibraryClasses] +BaseLib +DebugLib +PchInfoLib + +[Packages] +MdePkg/MdePkg.dec +UefiCpuPkg/UefiCpuPkg.dec +AlderlakeSiliconPkg/SiPkg.dec + +[Sources] +BaseCpuInfoFruLib.c + diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/PeiReportCpuHob/L= ibrary/PeiReportCpuHobLib/PeiReportCpuHobLib.c b/Silicon/Intel/AlderlakeSil= iconPkg/Fru/AdlCpu/PeiReportCpuHob/Library/PeiReportCpuHobLib/PeiReportCpuH= obLib.c new file mode 100644 index 0000000000..7ea605a05b --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/PeiReportCpuHob/Libra +++ ry/PeiReportCpuHobLib/PeiReportCpuHobLib.c @@ -0,0 +1,22 @@ +/** @file + + Source code file for Report CPU HOB library. + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ + +#include +#include +#include + +VOID +ReportCpuHob ( + VOID + ) +{ + /// + /// Create a CPU hand-off information + /// + BuildCpuHob (GetMaxPhysicalAddressSize (), 16); } diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/PeiReportCpuHob/L= ibrary/PeiReportCpuHobLib/PeiReportCpuHobLib.inf b/Silicon/Intel/AlderlakeS= iliconPkg/Fru/AdlCpu/PeiReportCpuHob/Library/PeiReportCpuHobLib/PeiReportCp= uHobLib.inf new file mode 100644 index 0000000000..0ba4744eea --- /dev/null +++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlCpu/PeiReportCpuHob/Libra +++ ry/PeiReportCpuHobLib/PeiReportCpuHobLib.inf @@ -0,0 +1,26 @@ +### @file +# Component information file for the Report CPU HOB library. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x00010017 + BASE_NAME =3D PeiReportCpuHobLib + FILE_GUID =3D F19AA754-CE24-448D-B755-1F939B00C23D + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D PEIM + LIBRARY_CLASS =3D ReportCpuHobLib + +[LibraryClasses] + BaseLib + HobLib + CpuPlatformLib + +[Packages] + MdePkg/MdePkg.dec + AlderlakeSiliconPkg/SiPkg.dec + +[Sources] + PeiReportCpuHobLib.c -- 2.36.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108744): https://edk2.groups.io/g/devel/message/108744 Mute This Topic: https://groups.io/mt/101373952/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-