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 682E0941BEC for ; Fri, 4 Aug 2023 18:08:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=WWGkWV8Ull6fWAnm0uZl21uJ5LY3AhWIogOuTaqn8Vk=; 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=1691172496; v=1; b=d05xkVZhmmS/VbWU3p0UXA1Wqet7kda9NLi5DoMFsHegVAVyUmOZBVzqjSpyMxMYAmbBBIeK 32fiGSHYc6P6R3Sg2jmZVOqR6wi3AEiB6QfdaQUKBaLtEWY10QlQQCPCBu3K2tRbdH3rHZEJ9ti RjtqQz9xPWKPvScg/XXwEzpE= X-Received: by 127.0.0.2 with SMTP id 99xBYY7687511xG2yTzFF9C4; Fri, 04 Aug 2023 11:08:16 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.1858.1691110094391168687 for ; Thu, 03 Aug 2023 17:48:14 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="372781349" X-IronPort-AV: E=Sophos;i="6.01,253,1684825200"; d="scan'208";a="372781349" X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 17:48:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="729848124" X-IronPort-AV: E=Sophos;i="6.01,253,1684825200"; d="scan'208";a="729848124" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga002.jf.intel.com with ESMTP; 03 Aug 2023 17:48:13 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.27; Thu, 3 Aug 2023 17:48:13 -0700 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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 via Frontend Transport; Thu, 3 Aug 2023 17:48:13 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.47) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Thu, 3 Aug 2023 17:48:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H8nx5dcTQN+VqbJdcd3NqrpThbTxReoAByWvzt0lh7nrBOS351ogg2iecZJGUn/N8hTl/JbrCWvXqn/P/AYWtknMaBcI84Qx8yO6hAhVuK7d7XNWW3rSD56kGRFErHI69WcJUCawEP3KG8zQLVgMVb0pgXfXGWmb81+QxUgKqKtKe7Mw6zuRUXyySWhTvi43wu1Pjy4Xc8EMDn9RB/L/UZcfhnLndYVQvVOByKGA9pCIxfR2GIbWxgZp3uUlyso2b1wSCPgud8PwD/t9wBlu4genahLJzdvVix1GhkDyKnPeLnmLffGB8mB4SEaZ8Pj7bWUKl/h7Aza+mPaoNUjRgA== 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=w3xuci5JdtWomHQdNDYLmiHEhGya1qWPo6ZRM62Q7L8=; b=X1zqzUDA3PCeKQGHqjfMO6A8PeCZBo6ae5VHcgWpAOISajcY0t1XwzGwVh7rjgRMjzlYO2Jej39jkyoVo7NkyrI1a8czWwLWUXfj7mbuWIqgT5v+kXyMuIOfeekIqiPt27L4SOVfJh7Z7ApNhlvz6iV43OFHmvQlJ8VWtDYeP3h9E3qGaMCSa7QlMk1dRgDmL5/w+IhvWc1rlqU56uAmYSaRgE1JhZqPsMcvIpClG0FQsOeIdUDDX4cZjaZKX3qDGzeQ0rtFFQD7IGYKIanoBWy2sOWM+HXAEW1NtFKzrd9qpEeacYthVwYgqno4KMadTOYBoa+qfROz5bEHuAoGrQ== 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 PH0PR11MB5626.namprd11.prod.outlook.com (2603:10b6:510:ee::15) by CH3PR11MB8237.namprd11.prod.outlook.com (2603:10b6:610:154::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 00:48:11 +0000 X-Received: from PH0PR11MB5626.namprd11.prod.outlook.com ([fe80::68a8:9cc5:ec4d:ca44]) by PH0PR11MB5626.namprd11.prod.outlook.com ([fe80::68a8:9cc5:ec4d:ca44%7]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 00:48:11 +0000 From: "Chuang, Rosen" To: "Kasbekar, Saloni" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" , "Desimone, Nathaniel L" , "Oram, Isaac W" Subject: Re: [edk2-devel] [PATCH v2 4/6] AlderlakeOpenBoardPkg: Add ACPI module Thread-Topic: [PATCH v2 4/6] AlderlakeOpenBoardPkg: Add ACPI module Thread-Index: AQHZxMYNyzClUVM190a4Ieedt4dBRq/ZURzw Date: Fri, 4 Aug 2023 00:48:11 +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: PH0PR11MB5626:EE_|CH3PR11MB8237:EE_ x-ms-office365-filtering-correlation-id: 0822ccab-1d2f-44c2-5338-08db94847a87 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: n5p4X7uJPs2lrXXA/7Slxo/TTCCF1V7ZNguFFy+QIWX5PnRIiIvl19wknILvfAQ+Tm45PE1mRKXNSzgbyUusL168PkRmsfERXr3NIyhvS1B9RIDsSZ9tIgxveKGTBQ/cZ2lFiXT7znzRfTS92GTTrW65h8iRdVzz0A8uqkjwfuBAXmTdYHj7jv41HbMqfcAfHh2NlpvZwsrDwQV2WeP4R6UlS2MN/yTYqFTbbytP9GvYKJSPTZwQMjaKROedIs2n/patgUKRo39/gnXljru96b5SqZjvM2K+Q0HqYrh4qge20qLJx1/qXowW8nOZoamE3y2fweO0IpGFRHLA74aQoHnfQ9fUOTha3jUIsn6Pg/v3yVmaUgsVwAlmuVFVTkEJZB55oDzN8wDxneoynswGFqMOBqADu03xdeRHl9ETThm6csXHc0oiRUfMWHAkLHCFjt0Csx2rzjpQtacLq62mnspzOCygB1EibRWXvsJzBs4Ykq8BdgUYeux+kAe/vsAU0NkzWFEegbiLiN1sn48Iajp6a1vHIKGvGcgIsCmuoNlc3q0GfksOgmz6h9ru2YygtueGhy79HGF0fT0aWJ506HEvYgtdkDDg6ZidbJm5RMbGDq0TQQp+7PhnJgDlFHsftaJaLa9KSxrcI6WJgRpUjQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?aJDlOjtFnzaxjsD+/37T0jOVbezL1NjUKUeheM6iDFlyUCQiwkw7rytBJMKU?= =?us-ascii?Q?neUONDl56bnUeydukGQFIRIusyDLY0gZherp2UqG7TOZaSwGwFTx2yLYt6Ig?= =?us-ascii?Q?w8/KKhNQcoEh1Yf+AeoZr46+mCOdoecEVHYBRHJFq9xTbh4f3fDjxSJgmGEH?= =?us-ascii?Q?cxj/4vTVpRje9q2RPIoXA3YDCFiMreorpfEQzFoWCfs9hVI17V7OVfQQQD4/?= =?us-ascii?Q?xZNg4hZKWcmrcLhGSqgk/pWCXjUVPFzPLk6ckB545x4mPuIIw958LHnbTpD2?= =?us-ascii?Q?xwTSj1zrD975eAMgLUdvyZLTICKlOQ+C/SON+s+F6vhtS47+cQ8vGUMDNA3W?= =?us-ascii?Q?+MPlb2Gc1YvFv4bT67LEh8NkEqUsaDyA6iWOLIpmbuW+1h3Us2p0IjgPzECJ?= =?us-ascii?Q?1iMbtMM2MXMYKSnavJvR2fW6mS9jw064xIVzjXwaczvG7CNqJR5lqr/3734x?= =?us-ascii?Q?Lqyl/WPd8E7lKcBv9xhjOz+ZRwetvhVvZd7d8ZPZ32MVrwZRoq+z3HUbdcxC?= =?us-ascii?Q?ItQeFCDXHmSkU4I0Jltk0flK77rYLK7thP01O2J57g0wKcV/3L/r7MK7+e+9?= =?us-ascii?Q?DFR94G2nBTADUBMvQItr/LA/R9kAdQVQlW+fGfmujOn+Vr2Ys6u7Pw5SvUC1?= =?us-ascii?Q?sxw5Dhl4nZlNGpxQMGqreZTzZJh3m07Q7e1BsNJOuyBQvQOL7jszfNj0Rvgw?= =?us-ascii?Q?4w67wj8MHVpq1uZOyjLmmxkVkdYYAIcaMLCdJHKA9eBDe6PX9Nnc1LN/ODsC?= =?us-ascii?Q?k8gkA5Ni4YuoqC0H65CbfCtENCKYLroS621275NYJuD4zcRVGEy0WZY8i9Ii?= =?us-ascii?Q?zEpTuU3sZwTRm/DI+lxHmKU9AweYTF0+kJCKXxIkbPSTN3GgfIrvV9XabwCx?= =?us-ascii?Q?Q4pC0fR3fuK/U4JWSVPb+VmKhPy6RK/fz7qpf+8yZI4ex2IE+Nx6itCCspsN?= =?us-ascii?Q?BcesLaVsEXQ9uKgebx8eb48s4P8B05HjsfnJhju7h4PSK3VxbPiqfQ+O5DA1?= =?us-ascii?Q?8mJLPDfILOjRPap+nzyQZHlbkNAWnj0FlXeC2mmksMJAc45hxVfK4o122owE?= =?us-ascii?Q?RNDr/Qxe/egAYK6FvziN0lQd5511uGV26JTwm/s1PDRFmtmOxTmXAOIS0nnK?= =?us-ascii?Q?ildrnUAhUq0u3G4UpBjCHzrifLMVVYXluUR4JsJn++82t5McWfmjZFwNX6yI?= =?us-ascii?Q?adRks0Ad7QsXGrFNiwkKB2Rp6m0FpLaNbOYEWuXk04jiRb5ziaK8gC0brvnv?= =?us-ascii?Q?Eup5j2pRDbASyNrKJRKZG/q8AOfdBNre+/XG8GHs9shB/KWEn5ZqS++730Zd?= =?us-ascii?Q?vxYCHTVExtfsBcXvwB6yj5GG2hFjjIPUX5MiKIkwYhq24utyVA6+ccKKpzwM?= =?us-ascii?Q?N7ijHXxCyhFr+OQZ3PtcjI/plZFjAoBhmj5d592S8Ns8MX1x/tyZK6fkzlIi?= =?us-ascii?Q?kAlZ0bqwHghvegCehyqmVzvw0kM+1xql4+ltih0GGzF1oCk0DGnNHkb2lW+L?= =?us-ascii?Q?SDgnjPj9DwYC9TIbMT7Dxcq1mSDoYWkblcLKMci7JxtYN3KjIfvApbLOGQe1?= =?us-ascii?Q?ANI+WUvPaNzqw5YraAwzXjTa0oMIYGQh90iwQOwQ?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5626.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0822ccab-1d2f-44c2-5338-08db94847a87 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Aug 2023 00:48:11.4770 (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: /S8U2J+whvoPYa4W+TnS9UGnqvtF1nQ5rXYE1NSebg252Na/zJ3J+VZ6fF73bfw0AbpaTndVJXMQxRMjONfuWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB8237 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,rosen.chuang@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: vV3h0ZRSEOpgLDdCTQaAaWNJx7686176AA= 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=d05xkVZh; 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: Rosen Chuang < rosen.chuang@intel.com> -----Original Message----- From: Kasbekar, Saloni =20 Sent: Wednesday, August 2, 2023 6:18 AM 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 (#107582): https://edk2.groups.io/g/devel/message/107582 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-