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 E3CB2AC17C4 for ; Wed, 2 Aug 2023 20:25:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=tffHseXJNZmW9vtsswr5LRUxS4Pqi5OjrVj9lOacsIc=; 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=1691007957; v=1; b=hnECJ6zSJxKLWkosp40B8wlrKHUDIKz0EFuxWX757YZTUK1n/FcvSdHa9dnh/XZKkDaT3uIQ Z0snbhKcHnjUmUu1R5j0ap/OHVsSVgmmCPdvfeDn7XVsnEAUbTf196+aYoJRiL0LTQ5+3a4CL36 JsmQ6OrUq7aoITEcvOUk8ny0= X-Received: by 127.0.0.2 with SMTP id i0h6YY7687511xqdjqmOOC69; Wed, 02 Aug 2023 13:25:57 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.6919.1691007956536838010 for ; Wed, 02 Aug 2023 13:25:56 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="354606135" X-IronPort-AV: E=Sophos;i="6.01,250,1684825200"; d="scan'208";a="354606135" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 13:25:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="732496737" X-IronPort-AV: E=Sophos;i="6.01,250,1684825200"; d="scan'208";a="732496737" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga007.fm.intel.com with ESMTP; 02 Aug 2023 13:25:55 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 2 Aug 2023 13:25:55 -0700 X-Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 2 Aug 2023 13:25:54 -0700 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 2 Aug 2023 13:25:54 -0700 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.174) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Wed, 2 Aug 2023 13:25:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jOuTx7kgpXRgngyqZnaa7tCrnrRsbjqSxEIrIuBYCX+bXypDEm1zRHGq1keITPvPFb+IoDdW+nFmp/bWCQM9am7gZEsAfz1JNqQWLOUllCqnfU0kz3u/lSigRWzqQ3m7a8ML5/UL6n3jvczVFPsJcYF0JmdA3i3FSrg591rtphBKpjlLcRKOPeYfZ4fWI0Phea6s7TeXI+GFZigknSPt1NtqDXcyeQLYZvux3viFIvwq1U1KxCdm1oknBGaq8l1oLCVaiP5vmgqGQ9/9UmJcel2zBZYNV4nhA9QssFNzkH1e0IlJzC2j1S531cTa+k3jX9aNCIicpUR5K1x2NUi//A== 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=SFQS4/rYSiskbzLTBr1eX6DJpKYKvftRC/20wHlN8sc=; b=czaSh6B8MVsRJiL3ipE6FLIQ3q4W56JeXvz8elIQLnjwtFnSNnR1VQdqgOkuUYJPRwob1Gbyei2gVBaTjhWbdWA8+buoJPQ4bj4OsLGda7b8paO8yrZJFhyI7ymPx5OnlQHflnF9y3LHNuP5LKfzUDzwOqQyjhMwPDrdSGTeY/1ULea9vLrqtdTdp7Zajy+mc5/z7GeQoB3WmJhCGG2B+/Lj5so6bnsUqu4DsEho6sSOxt8ZM5HZhaTuiRPXkrzt8sOCw2edCnrG9K02wws01CKSp7rffEb+1BtLpjdkNLmVFsDpcRI6tzTaOOQbZVC4eCbmbvd/w0kdv9iQ/MJ5tA== 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 MW4PR11MB5776.namprd11.prod.outlook.com (2603:10b6:303:183::9) by BL1PR11MB5977.namprd11.prod.outlook.com (2603:10b6:208:384::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.47; Wed, 2 Aug 2023 20:25:41 +0000 X-Received: from MW4PR11MB5776.namprd11.prod.outlook.com ([fe80::5842:74bc:4aaf:a4fb]) by MW4PR11MB5776.namprd11.prod.outlook.com ([fe80::5842:74bc:4aaf:a4fb%7]) with mapi id 15.20.6631.046; Wed, 2 Aug 2023 20:25:41 +0000 From: "Chaganty, Rangasai V" To: "Kasbekar, Saloni" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Oram, Isaac W" , "Chuang, Rosen" Subject: Re: [edk2-devel] [PATCH v2 4/6] AlderlakeOpenBoardPkg: Add ACPI module Thread-Topic: [PATCH v2 4/6] AlderlakeOpenBoardPkg: Add ACPI module Thread-Index: AQHZxMYNtGhpIJ2ly06Gs1eiKcUFAK/XdW6g Date: Wed, 2 Aug 2023 20:25:41 +0000 Message-ID: References: <6d497bd984f8a16be98d96042f3efea130be8a9c.1690391944.git.saloni.kasbekar@intel.com> <647aaf6d7cfbd488058c08abf989eb8182def7a0.1690391944.git.saloni.kasbekar@intel.com> In-Reply-To: <647aaf6d7cfbd488058c08abf989eb8182def7a0.1690391944.git.saloni.kasbekar@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5776:EE_|BL1PR11MB5977:EE_ x-ms-office365-filtering-correlation-id: 592166c5-64e9-4253-4d3d-08db9396a44f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: bmaGd0AjVi5IZ9dZ6id/98apKskaaDYi6OxNLYaPuD24kcV0GV6kbO/UNMdeO7oCu9lolZNEDbNM8SdfRV4sWPdZ6GeV6Bd+tRCq5rdarqO2ZLc/vwk+YRYVAd/1MLEPFE2RNLQu9ZTzgrSiqhrOzwGXITNbOhMEbYhISbBZE3BwCMoOT9GWzJbUQ1SpQPYqcMhbLD+icYx/7VMrSOPzoiBvLai5p78NJ0zlvHdN+NWwY6xfaxILaRl6yYpcTJSZbij1UnhsimHFB6JlqujxvaSPiKWcFKF3aZfSSQcyH1/7xofOXqDKsl+EbCBYX3aNsl6nH2dRy+uQam4y5HoL6esxOx1+++9k7AlvCJ1IzXcW+AsadAo48HINItpJAZxvT3vcPjvEBqEILAvJqastXzilu9H4KV/j6afz5sQmVylcg0Gimimnh9N3fxdI4OySCx1z0cK6SEUQQw8lIN2i0KGHbdOKvY++pC4hVGZakPK6PNZ+P1lm14M+xJNd+9Z/j8sDvGKfnOemOEoDliY+aOzlX4wz2M3FpcwmqOxbeFMAxeibp3NPDDTTsU9vfxS6BZNx40cQ/cdTgmFJkGJRh7we3aYoifmNQUyQKSjtgzP4hGLLq31bwsuY+fBaMaDxhIqNJ3b2VxMxFXeOh8VfnQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?B/8PxQi59zhHhTyYZSxcjmU6hBW5w0EpEBhYufDqLnbvUHLiBoJj9200axjn?= =?us-ascii?Q?SBU6TxoG63T4mEGfQRPwRn2DyCKuh/149pkeKxGygfCCVxmYg07mnnzJReQj?= =?us-ascii?Q?m3IQ4Lka7OrvWk577b5sHLsB4f4VxEG3Jano32786PyhGWFXdVVmLBvATRkx?= =?us-ascii?Q?sHAXlfUcBG79vaH+fPpY5/iHSQaLBRgtGCyz5K0rwvciJoGSlqoO91kgBGyJ?= =?us-ascii?Q?G7vU3dgtj0yvyNAQYTWvr4R2zPMe3bkf/pTsi+pdfP8YVKMSasDolxQtT8u+?= =?us-ascii?Q?2gXFHFmC59Ganq64SK26lqBPg/gL84te84UP5s7Pddy6IbYcbcI5JNd1Dwcx?= =?us-ascii?Q?Sy/Zfmbte8WgSd2OVV9+55WcOZjoeuBbFV1S2Acve0vcitpbWQGbvJcGba0h?= =?us-ascii?Q?nx/klokSGtLTCO+s98peeeaWmBD8/dSl68RE7XKfb4EGY0wy1rght57RO2gc?= =?us-ascii?Q?OIZzF9OmZrSneEcmu6CEDGWEKL41BlLQATUJDl2AaRXO04Gg+3/xZc2blnCg?= =?us-ascii?Q?pN3ROxZi1VNp4rEzEcz6A8tPYxGJ1jhKzuI0vvzt9yIIojhnGu590SOfP4yj?= =?us-ascii?Q?sFVCWUgFt9z3a8AYyG/ruMg4AAnT4EVfifnq5p58mNiM8WZOdPtUvhIfwiWk?= =?us-ascii?Q?eT5I38lQOs1zl79B6dmxeqxxG5+1Ouyz731bZLaspVPp1VP/vuoKIEmR67lA?= =?us-ascii?Q?+pNrfAjL6BNKgcnanAY8T20hTJFkX24s8b30R+8C3cAtzBRu7t4Oi9S8+xYI?= =?us-ascii?Q?MXS40hbk9Y9l2uUNy3P4wmHxbDyTsU+825TrFP09Jr6XIl8NeRwsMtamihOn?= =?us-ascii?Q?DeOMGZl3Ai1kvRPIQQQve87Lj2qHdWpVTOsexKNOT5pANiLcFTaL5uk8Kzw9?= =?us-ascii?Q?cJoOtP/Ee5aDyIJ2oMiDYxkm9lnCV/yX68iWxU7DK8sfSC/GRBgSqFkhNiBS?= =?us-ascii?Q?UdUMVCAZZEpzWNINIYuZ+ERXdieij39jUuC6Wg4sVvUs3VNhH9wD7ZF0P+ZI?= =?us-ascii?Q?Qwk6U0/Nwp0c31KRF7uLgBujOuGS5d49AeQQerp+G0irnENdbqx8hcocKcC2?= =?us-ascii?Q?CKJHU6r7WGpj6vZ124afh4NZjNVb4iCuBNk+rwoASgaMKWFkdlsqsQkr5lHy?= =?us-ascii?Q?U5KjKS+Ie+8gci0uJTRR6bHnXopjYFQSmL5QkIgwTxPQpW/dJSZ7CQxIimbr?= =?us-ascii?Q?NEy5Giu3vINRYrVHCbE+EhMLNpBEOz4ZfCTpV2jaStQeULYsXz3ziyAyr/bJ?= =?us-ascii?Q?VfITez9yUmEKDtiBzWcSnp9dk82awiad84yRomtGZOrRpL/c29dZWeJgKkHb?= =?us-ascii?Q?Ux9Iq40FEriPnRhF6NkarIluZkeJpeOErvWfDOPmRbIGMYgtAbZyvz/o1k19?= =?us-ascii?Q?QU+2zv9ErpcqLuaLHQV/Kl2ok+qJxOGoj7Ka6bRZiU9hlb1njhAQeot5X4Dr?= =?us-ascii?Q?1f0Qg9n3cMI44ouKZHSqzXASevjhAV+ziFStrDCPqGC9oSkUZWF93JzLn5Km?= =?us-ascii?Q?51YtVkhsMsjhNhQAKPpcEqbYWBdbblstQFkPiF7rLd+z0yp8Q5oce9JW1t3I?= =?us-ascii?Q?zdlILkF4IbXF0qX5KI1NCoT31swvbe3zw+53KMwA504cLv0TYYmRAuqatreG?= =?us-ascii?Q?AA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5776.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 592166c5-64e9-4253-4d3d-08db9396a44f X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2023 20:25:41.3543 (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: qQz3tY20V/jgw7GBB56heyX/yG0TwOyWL9brm1qV351Qydkkgo9WRFMRv6RuCM04uYA/qBMRo5wZKgB7gSPnLXffJQFx9U0tuRT6hb/MslY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5977 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,rangasai.v.chaganty@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: OPAfoVAKu9nCwtQREjU0XMvEx7686176AA= 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=hnECJ6zS; 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 Reviewed-by: Sai Chaganty -----Original Message----- From: Kasbekar, Saloni =20 Sent: Tuesday, August 01, 2023 3:18 PM To: devel@edk2.groups.io Cc: Kasbekar, Saloni ; Chaganty, Rangasai V ; Desimone, Nathaniel L ; Oram, Isaac W ; Chuang, Rosen Subject: [PATCH v2 4/6] AlderlakeOpenBoardPkg: Add ACPI module Adds the MinDsdt driver Cc: Sai Chaganty Cc: Nate DeSimone Cc: Isaac Oram Cc: Rosen Chuang Signed-off-by: Saloni Kasbekar --- .../Acpi/MinDsdt/MinDsdt.asl | 68 +++++ .../Acpi/MinDsdt/MinDsdt.c | 232 ++++++++++++++++++ .../Acpi/MinDsdt/MinDsdt.inf | 48 ++++ 3 files changed, 348 insertions(+) create mode 100644 Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDs= dt.asl create mode 100644 Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDs= dt.c create mode 100644 Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDs= dt.inf diff --git a/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.asl = b/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.asl new file mode 100644 index 0000000000..be110145bc --- /dev/null +++ b/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.asl @@ -0,0 +1,68 @@ +/** @file + ACPI minimum DSDT table + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +DefinitionBlock ( + "DSDT.aml", + "DSDT", + 0x01, // DSDT revision. + // A Revision field value greater than or equal to 2 signifies tha= t integers + // declared within the Definition Block are to be evaluated as 64-= bit values + "INTEL ", // OEM ID (6 byte string) + "MIN ",// OEM table ID (8 byte string) + 0x00 // OEM version of DSDT table (4 byte Integer) +) + +// BEGIN OF ASL SCOPE +{ + Scope(\_SB) { + =20 +//--------------------------------------------------------------------- +------ + // Begin PCI tree object scope + //----------------------------------------------------------------------= ----- + Device(PCI0) { // PCI Bridge "Host Bridge" + Name(_HID, EISAID("PNP0A08")) // Indicates PCI Express/PCI-X Mode2 h= ost hierarchy + Name(_CID, EISAID("PNP0A03")) // To support legacy OS that doesn't u= nderstand the new HID + Name(_SEG, 0) + Method(^BN00, 0){ return(0x0000) } // Returns default Bus number fo= r Peer PCI busses. Name can be overriden with control method placed directl= y under Device scope + Method(_BBN, 0){ return(BN00()) } // Bus number, optional for the Ro= ot PCI Bus + Name(_UID, 0x0000) // Unique Bus ID, optional + Name(BUF0,ResourceTemplate() + { + // + // PCI Configuration Registers ( 0x0CF8 - 0x0CFF ) + // + Io(Decode16,0x0CF8,0x0CF8,1,0x08) + // + // PCI MMIO space + // + DWordMemory(ResourceProducer,PosDecode,MinFixed,MaxFixed,NonCachea= ble, + ReadWrite,0x00,0x00,0x00,0x00,0x00,,,PM01) + }) + Method(_CRS,0,Serialized) + { + // + // Create pointers to Memory Sizing values. + // + CreateDwordField(BUF0, ^PM01._MIN,M1MN) + CreateDwordField(BUF0, ^PM01._MAX,M1MX) + CreateDwordField(BUF0, ^PM01._LEN,M1LN) + + // + // Set Memory Size Values. TLUD represents bits 31:20 of phyical + // TOM, so shift these bits into the correct position and fix up + // the Memory Region available to PCI. + // + Subtract (FixedPcdGet32(PcdPciReservedMemLimit),FixedPcdGet32(PcdP= ciReservedMemBase),M1LN) + Store (FixedPcdGet32(PcdPciReservedMemBase), M1MN) + Subtract (FixedPcdGet32(PcdPciReservedMemLimit), 1, M1MX) + + Return(BUF0) + } + } + } +}// End of ASL File + diff --git a/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.c b/= Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.c new file mode 100644 index 0000000000..08709a43cd --- /dev/null +++ b/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.c @@ -0,0 +1,232 @@ +/** @file + Min DSDT Driver + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// +// Function implementations +// + +/** + Locate the first instance of a protocol. If the protocol requested=20 +is an + FV protocol, then it will return the first FV that contains the ACPI=20 +table + storage file. + + @param[in] Protocol The protocol to find. + @param[in] FfsGuid The FFS that contains the ACPI table. + @param[out] Instance Return pointer to the first instance of t= he protocol. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_NOT_FOUND The protocol could not be located. + @retval EFI_OUT_OF_RESOURCES There are not enough resources to find the= protocol. +**/ +EFI_STATUS +LocateSupportProtocol ( + IN EFI_GUID *Protocol, + IN EFI_GUID *FfsGuid, + OUT VOID **Instance + ) +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + EFI_FV_FILETYPE FileType; + UINT32 FvStatus; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINTN Size; + UINTN Index; + + // + // Locate protocol. + // + Status =3D gBS->LocateHandleBuffer ( + ByProtocol, + Protocol, + NULL, + &NumberOfHandles, + &HandleBuffer + ); + if (EFI_ERROR (Status)) { + // + // Defined errors at this time are not found and out of resources. + // + return Status; + } + + // + // Looking for FV with ACPI storage file // for (Index =3D 0; Index <= =20 + NumberOfHandles; Index++) { + + // + // Get the protocol on this handle + // This should not fail because of LocateHandleBuffer + // + Status =3D gBS->HandleProtocol ( + HandleBuffer[Index], + Protocol, + Instance + ); + ASSERT_EFI_ERROR (Status); + + // + // See if it has the ACPI storage file + // + Size =3D 0; + FvStatus =3D 0; + Status =3D ((EFI_FIRMWARE_VOLUME2_PROTOCOL *) (*Instance))->ReadFile ( + *Instance, + FfsGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + if (Status =3D=3D EFI_SUCCESS) { + break; + } + } + + // + // Our exit status is determined by the success of the previous=20 + operations // If the protocol was found, Instance already points to it. + // + // + // Free any allocated buffers + // + FreePool (HandleBuffer); + + return Status; +} + +/** + Publish ACPI table from FV. + + @param[in] FfsGuid The FFS that contains the ACPI table. + + @retval EFI_SUCCESS The function completed successfully. +**/ +EFI_STATUS +PublishAcpiTablesFromFv ( + IN EFI_GUID *FfsGuid + ) +{ + EFI_STATUS Status; + EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol; + EFI_ACPI_COMMON_HEADER *CurrentTable; + UINT32 FvStatus; + UINTN Size; + UINTN TableHandle; + INTN Instance; + EFI_ACPI_TABLE_PROTOCOL *AcpiTable; + + Instance =3D 0; + TableHandle =3D 0; + CurrentTable =3D NULL; + FwVol =3D NULL; + + Status =3D gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID= =20 + **)&AcpiTable); ASSERT_EFI_ERROR (Status); + + // + // Locate the firmware volume protocol // Status =3D=20 + LocateSupportProtocol ( + &gEfiFirmwareVolume2ProtocolGuid, + FfsGuid, + (VOID **) &FwVol + ); + ASSERT_EFI_ERROR (Status); + + // + // Read tables from the storage file. + // + + while (Status =3D=3D EFI_SUCCESS) { + Status =3D FwVol->ReadSection ( + FwVol, + FfsGuid, + EFI_SECTION_RAW, + Instance, + (VOID **) &CurrentTable, + &Size, + &FvStatus + ); + + if (!EFI_ERROR (Status)) { + + // + // Add the table + // + TableHandle =3D 0; + Status =3D AcpiTable->InstallAcpiTable ( + AcpiTable, + CurrentTable, + CurrentTable->Length, + &TableHandle + ); + ASSERT_EFI_ERROR (Status); + + // + // Increment the instance + // + Instance++; + CurrentTable =3D NULL; + } + } + + // + // Finished + // + return EFI_SUCCESS; +} + +/** + ACPI Platform driver installation function. + + @param[in] ImageHandle Handle for this drivers loaded image protocol= . + @param[in] SystemTable EFI system table. + + @retval EFI_SUCCESS The driver installed without error. + @retval EFI_ABORTED The driver encountered an error and could not= complete installation of + the ACPI tables. + +**/ +EFI_STATUS +EFIAPI +InstallMinDsdt ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + Status =3D PublishAcpiTablesFromFv (&gEfiCallerIdGuid); =20 + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} diff --git a/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.inf = b/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.inf new file mode 100644 index 0000000000..f257140754 --- /dev/null +++ b/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.inf @@ -0,0 +1,48 @@ +### @file +# Component information file for Minimal DSDT module # +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +# @par Glossary: +### + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D MinDsdt + FILE_GUID =3D 8EB04370-482C-4505-AA27-7EB226A5729F + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D InstallMinDsdt + +[Sources.common] + MinDsdt.c + MinDsdt.asl + +[Packages] + MdePkg/MdePkg.dec + MinPlatformPkg/MinPlatformPkg.dec + +[LibraryClasses] + UefiDriverEntryPoint + BaseLib + DebugLib + PcdLib + UefiBootServicesTableLib + UefiRuntimeServicesTableLib + BaseMemoryLib + MemoryAllocationLib + +[Protocols] + gEfiAcpiTableProtocolGuid ## CONSUMES + gEfiFirmwareVolume2ProtocolGuid ## CONSUMES + +[Pcd] + gMinPlatformPkgTokenSpaceGuid.PcdPciReservedMemBase + gMinPlatformPkgTokenSpaceGuid.PcdPciReservedMemLimit + +[Depex] + gEfiAcpiTableProtocolGuid AND + gEfiFirmwareVolume2ProtocolGuid + -- 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 (#107474): https://edk2.groups.io/g/devel/message/107474 Mute This Topic: https://groups.io/mt/100494314/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-