From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.1962.1644875998620128619 for ; Mon, 14 Feb 2022 13:59:58 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=O7rcn48J; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: guo.dong@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644875998; x=1676411998; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=YOm1OdOptiLayorQCeWztwNwg76on38bDZC0n+3JX4U=; b=O7rcn48J/Jsc7gYMWBEIQvCDXIbdkRCCrKbRfpP1dDfANt//FBAMa6pT Vk0nsFMQOvUrw8cOG5Mi2749FL+wSJ0R0Ro7XMQ5WZKNC13piKj3XcNQQ zDzJcS790qrU8/s/2keZ0BhALD6dQBH7PjIk1n9zXxvxIS7A3sDdBmbcB iV26yUrZCIu9S+4Y8tdQG3ZiaJgLQFTTHserFKswKClpuN7MOgZBlStnQ LSUybR7Xlsqi81BFZ7bW8MTd7XPKgANLFLWwoJyp0WfXtx/6idinsJxs6 0IiUysLSauHf6anL7k+USnArjAaTYkJocKJP37dgRj4tLRlmdWC/05yXw g==; X-IronPort-AV: E=McAfee;i="6200,9189,10258"; a="230831372" X-IronPort-AV: E=Sophos;i="5.88,368,1635231600"; d="scan'208";a="230831372" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 13:59:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,368,1635231600"; d="scan'208";a="624462141" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by FMSMGA003.fm.intel.com with ESMTP; 14 Feb 2022 13:59:57 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 14 Feb 2022 13:59:57 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 14 Feb 2022 13:59:56 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 14 Feb 2022 13:59:56 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.43) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 14 Feb 2022 13:59:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kHpwX9pKE2/ybVQhRu935qd2qGH8CAO0nVyfTITEj+zGoGskv48CdUxBZ+X02fvfr5iG/LpVQ5gvwlnsVth2q/J88GcB9Ceo05qMX9jQRx+vX9eMNZ//7OXTuWgKUEDrewlvwo2p26Y9uNbK1ihaXpeIdpVPVsS6KthYO0jcaI9URc10ER0DOVCXwMoJ0Au7MLVF9/hwgEPj6tshdrsQcZZtXNFhdO82anrC5h9luhM9igwJvX8cQQdxyd43gnpmbihA0d80mcO3jIljpWnSFQV4EqVNJhc+wm3U/XdN5u0CopxIFllJZrK/xHxk0biIWS3psnMkyeeN6nYf9GrV0A== 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=PmOH0D98pU1WtaiyAHhPJpr3vNXn0MLj6U9Esx5xVi4=; b=Nnw6E4pJ7E9knQu7c9PtBl4O2Ja2GSCkbVO2x7a60Ep8/e39HpBiJTGuIrDJd5W44K3U0uOPT+bw5Ywp52rk9zxZJYqvBs4QIfALnB6rwh1dW4ybIY7os7fSUG2GB9G1VfWK0RBB0XyX2r4erO4l532X7u4HYpVI69LKX7EUuSTwyAv9gz+GMY6h/FUqlvWIC3izrGd4QO8daFR+STrTSfExMWderjXoCECvGNW4whNHltkQ3ORJwNV1DK9risVGeJYaBOjc0Q1MJ3Y1bkmFMOChFwlyPpAYvisIU0oO5RIVwWq2D+oGYKbjf3auzeA3bztxEQ7iCUafpOPbR5jouQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from BYAPR11MB3622.namprd11.prod.outlook.com (2603:10b6:a03:fe::30) by SN6PR11MB2768.namprd11.prod.outlook.com (2603:10b6:805:62::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.15; Mon, 14 Feb 2022 21:59:54 +0000 Received: from BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::c461:5de1:9cf:23cf]) by BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::c461:5de1:9cf:23cf%7]) with mapi id 15.20.4975.019; Mon, 14 Feb 2022 21:59:54 +0000 From: "Guo Dong" To: "devel@edk2.groups.io" , "Rhodes, Sean" CC: Matt DeVillier , "Ni, Ray" , "Ma, Maurice" , "You, Benjamin" Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add PlatformGopPolicy Thread-Topic: [edk2-devel] [PATCH] UefiPayloadPkg: Add PlatformGopPolicy Thread-Index: AQHYHsz/bVWhY5twQEi3+eAyHirurayTnh0A Date: Mon, 14 Feb 2022 21:59:54 +0000 Message-ID: References: <61b8da797bacd4d2fa4708e042765c8d157b1e71.1644531852.git.sean@starlabs.systems> In-Reply-To: <61b8da797bacd4d2fa4708e042765c8d157b1e71.1644531852.git.sean@starlabs.systems> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a140b943-cd04-48f1-ccd2-08d9f0055550 x-ms-traffictypediagnostic: SN6PR11MB2768:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zsHB6mBvNjyHp6oPJLIoaMSRHYAxtCxKXXXlvGaR2elDtCbDo7qMV5Z7EcEmB09nUscrCW/x9rZhbHtR7V3l20JFsdiVrTs2de2+NCzhfxWTV/IdZ1b9Fbp0wUZV2bv8q1hB8yhVVEAdliQvkWLC5FMp0Dz9w1JWWEfMFN+GGvgZtuBFXCVg2yj1puM1ZZZbdjFcIOEJZIpoHODheXKJMpel7p1PrznBaAgi+XX5CaquKJ7jI8kPpe2k1oJMhNkLW5E36qM67dEIShLqfPe8liBmd9Hz82zuXYJGLut8lqraVV6QAMcozmW1RV8HpMKpeOWDwG/hWIA6Avfx5IaR/RnOT87NAvK896HdiICFi2T482aBXbqeia8YlpsOEhRsXY7hcV1jRrxb/BqCZIodUR5i4qYT1zYgF3Aj0fxW83NBA/Djn1haT3BmLe4mi+ytFFzYrFR0afkoTi8inw4QvJAfPdIajmCpQBlIZp/ZObKCQCA2BxfMp6wTHHNDxGTBWlPFHVe9im1Kg2iez24fVTgx7C+Bt751WQzIbisKXZieJo0TNV3lzfrim7Ku6VG6jncakU5U+VWKBf3CYBnfT5LfBtAfnob59iWUYzj4JxiLhuFsKnFzM6gSOzXGQYPGNW2O5jXRaiNrB8T++0FWhOXlTNDS9w5OkmkkCVhfivrislEOyWKDZgvU8Ndn7NJVlZVP4gMM3uxH6xIUsQFJkxpvfjSpnp4yR8HSzsFFWJ+KX08dJgPH4fR9j3kDv+fUa2W7Uts4RJ7pHXFrUcYTP0HrBC7JqfBZ1zmeVp1PrIH2DdgcWBvCMX77N5IhI3bXO7v2edXMvoNpNBfBmMqtl3K7ZOcLtflWQEOTHmb5wNQ= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3622.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(8936002)(38100700002)(110136005)(2906002)(54906003)(19627235002)(26005)(186003)(33656002)(316002)(38070700005)(122000001)(6506007)(55016003)(7696005)(53546011)(966005)(107886003)(52536014)(71200400001)(9686003)(83380400001)(5660300002)(4326008)(86362001)(508600001)(66476007)(66446008)(66946007)(8676002)(82960400001)(76116006)(66556008)(64756008)(44824005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1YBhvY9AGOXRF3R+z0Xd7aoGBNw9Ygw9UesCB+wS2Sczy99+hbtU+kH7HZTh?= =?us-ascii?Q?u9lf0+gRlrdjGxxaQEirXR87mKfcKbOAuwIBYaK43MrtmnzQAe/WAGsqi9lw?= =?us-ascii?Q?1LgLdLmakIkKxTPEWzXIcaTFgPFIihwy0Dbo7ZQWDuBhXJ5O9NrpgncC6LtL?= =?us-ascii?Q?Y/JRGZe9XRpJoSXP/365KRLCvWQ4f70wlmTUzGvmE+h2IM19bNErEL4LZb0J?= =?us-ascii?Q?ziY9MoFU1rfCYjjiPnTe7D8OL3KFlgsUqvwVCYR1o4YSmH8YmEJIQqwDc1lW?= =?us-ascii?Q?nyvRmCWCBO7V/fFbxYbd9xTqgdcO2qphAIWjppp+iN0mP0mDJxSPJp/mtsVy?= =?us-ascii?Q?Bamv6DLkq9vQDsrHFzYhBztECApPMMAhw+E2xmRWIItBTGX1tcLl0Q48QAVN?= =?us-ascii?Q?p6a3tElinW7I0ULW1qiaj9o7wHuNP48Y8w5KyLheaqceNRMnhkVm2XVW4YUT?= =?us-ascii?Q?lHYGKosgTzPSrFZp9YqPNx4KKyvnN5VXZNOAyYCBWK0IWJCjw0DZnJ5zM912?= =?us-ascii?Q?bFTINmuWgZULsd9c+Q+bck3JDILK8li+KpvS5PT8Yk1fTO8yPdRf2wwUhzQT?= =?us-ascii?Q?EE/nkKmrNKJU9x/FOZrLHHdtmAUbR1c+2nwbBykD5FNfzAwNBFfIrdnevkq7?= =?us-ascii?Q?VWa4S8mJ5IniIlZuA84BryMrLvAClD55hOmEl62WRwcvuWnxDP8St9GGH5S6?= =?us-ascii?Q?ST8uR0IPFap953S3uZrP3wp+H74FU10XK+d/0OGzD3XEq9GW1kmn8UOqdJhu?= =?us-ascii?Q?3MBr1PRL0p3q3SBCQtei2sIPQRchdFrekhcGQSv29aw5yaF1D4RU4BrwQrqQ?= =?us-ascii?Q?SO9hClhjMUUa4MG57WexlDTtGuapo2ZajtHvkP1kkgYo/p4PpO5vQ+5t/SXE?= =?us-ascii?Q?eeXRLSLK2LkVtq5BT7cWfMf6/NIyVc7qJlhoVkp3vh3oemvYbmCvBNjhK/TB?= =?us-ascii?Q?bbw1sqjdrN1DIOGof2adxoD/5n4SSvOcIUq5RJ09lgY3XGixEs3N17ncTeCr?= =?us-ascii?Q?CWVdbGQ52sHwD9G7GiwZB0gXsr+hzw1U0FLqbxJZtVRp71RmrypJIF88s+mo?= =?us-ascii?Q?/flKleAnFuFDbtDQyLbKHYNpy2PXn4ewK3B0ViDhmggqzStKLROUnuJP/9N/?= =?us-ascii?Q?mraY8stH2Uep/l6sgz7bCAIsfAK9+I1pfkVgqiolQWp0W/QFEL+DMh3+QdId?= =?us-ascii?Q?JQfHqX9SRpfmBEEML9EqqEiNtPCc5s8dQmSH5FjQY8oky4GUvfizCPQqeEJr?= =?us-ascii?Q?oyuLuIalmsS8xyp240S0V+grG1v+/mLE1K0i1WYpHmn543mbbm04kgRVWi6g?= =?us-ascii?Q?Ya2Q1sNK8MeMghICNZBBoZcG7jFODlD5F+JR+n6eakh5mJ7nfW7b4fPevBO3?= =?us-ascii?Q?EPRKZgv/i7vzyHDIWuhv4zRJXij7i2wQWECym7jBX77ItHpqT/oEMsVPEsC5?= =?us-ascii?Q?8oa90DCOZEnKgcoYcHI1Ldp1LDgY8+hmoS4H/vXVWOLBOlJQMcHr24Fnx88M?= =?us-ascii?Q?QCk4/SF4v5Oc+RYz1ROF0WQeOW4O3n+7ENiZUdXfPxu9/KndtYWyRHSF7ctK?= =?us-ascii?Q?CO5gsp+YrZzfscQu/j9EYfdPfxlFB4V27kCuq8QRm7AJ+S4P+Ay8NlGB29Hw?= =?us-ascii?Q?zg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3622.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a140b943-cd04-48f1-ccd2-08d9f0055550 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Feb 2022 21:59:54.4622 (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: jY+Qz+f6oehelGtlla4BSW56iLzyqAsWME4jjDM69ecdA3g8ddjlqyFMlChTifeQJYflDpAcdBAKnLTsCo/wDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2768 Return-Path: guo.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable + SECTION PE32 =3D UefiPayloadPkg/IntelGopDriver.efi I didn't see file IntelGopDriver.efi in this patch while this file is added= into FDF file. Is this a generic GOP driver that could work on different platform? Thanks, Guo -----Original Message----- From: devel@edk2.groups.io On Behalf Of Sean Rhodes Sent: Thursday, February 10, 2022 3:24 PM To: devel@edk2.groups.io Cc: Dong, Guo ; Matt DeVillier ; Ni, Ray ; Ma, Maurice ; You, Be= njamin Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Add PlatformGopPolicy From: Matt DeVillier Add PlatformGopPolicy to use external GOP driver Cc: Guo Dong Cc: Ray Ni Cc: Maurice Ma Cc: Benjamin You Signed-off-by: Matt DeVillier --- .../PlatformGopPolicy/PlatformGopPolicy.c | 161 ++++++++++++++++++ .../PlatformGopPolicy/PlatformGopPolicy.h | 62 +++++++ .../PlatformGopPolicy/PlatformGopPolicy.inf | 47 +++++ UefiPayloadPkg/UefiPayloadPkg.dsc | 5 + UefiPayloadPkg/UefiPayloadPkg.fdf | 14 ++ 5 files changed, 289 insertions(+) create mode 100644 UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.c create mode 100644 UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.h create mode 100644 UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.inf diff --git a/UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.c b/UefiPay= loadPkg/PlatformGopPolicy/PlatformGopPolicy.c new file mode 100644 index 0000000000..31c61d967e --- /dev/null +++ b/UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.c @@ -0,0 +1,161 @@ +/** @file + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include "PlatformGopPolicy.h" + +#include +#include + +PLATFORM_GOP_POLICY_PROTOCOL mPlatformGOPPolicy; + +/** + The function will execute with as the platform policy, and gives + the Platform Lid Status. IBV/OEM can customize this code for their speci= fic + policy action. + + @param CurrentLidStatus Gives the current LID Status + + @retval EFI_SUCCESS. +**/ +EFI_STATUS +EFIAPI +GetPlatformLidStatus ( + OUT LID_STATUS *CurrentLidStatus + ) +{ + *CurrentLidStatus =3D LidOpen; + + return EFI_SUCCESS; +} + +/** + The function will execute and gives the Video Bios Table Size and Addres= s. + + @param VbtAddress Gives the Physical Address of Video BIOS Table + + @param VbtSize Gives the Size of Video BIOS Table + + @retval EFI_STATUS. +**/ +EFI_STATUS +EFIAPI +GetVbtData ( + OUT EFI_PHYSICAL_ADDRESS *VbtAddress, + OUT UINT32 *VbtSize + ) +{ + EFI_STATUS Status; + UINTN FvProtocolCount; + EFI_HANDLE *FvHandles; + EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; + UINTN Index; + UINT32 AuthenticationStatus; + + UINT8 *Buffer; + UINTN VbtBufferSize; + + Buffer =3D 0; + FvHandles =3D NULL; + + if ((VbtAddress =3D=3D NULL) || (VbtSize =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + Status =3D gBS->LocateHandleBuffer ( + ByProtocol, + &gEfiFirmwareVolume2ProtocolGuid, + NULL, + &FvProtocolCount, + &FvHandles + ); + + if (!EFI_ERROR (Status)) { + for (Index =3D 0; Index < FvProtocolCount; Index++) { + Status =3D gBS->HandleProtocol ( + FvHandles[Index], + &gEfiFirmwareVolume2ProtocolGuid, + (VOID **)&Fv + ); + VbtBufferSize =3D 0; + Status =3D Fv->ReadSection ( + Fv, + &gBmpImageGuid, + EFI_SECTION_RAW, + 0, + (void **)&Buffer, + &VbtBufferSize, + &AuthenticationStatus + ); + + if (!EFI_ERROR (Status)) { + *VbtAddress =3D (EFI_PHYSICAL_ADDRESS)(UINTN)Buffer; + *VbtSize =3D (UINT32)VbtBufferSize; + Status =3D EFI_SUCCESS; + break; + } + } + } else { + Status =3D EFI_NOT_FOUND; + } + + if (FvHandles !=3D NULL) { + gBS->FreePool (FvHandles); + FvHandles =3D NULL; + } + + return Status; +} + +/** + Entry point for the Platform GOP Policy Driver. + + @param ImageHandle Image handle of this driver. + @param SystemTable Global system service table. + + @retval EFI_SUCCESS Initialization complete. + @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initialize= the driver. +**/ +EFI_STATUS +EFIAPI +PlatformGOPPolicyEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) + +{ + EFI_STATUS Status; + + Status =3D EFI_SUCCESS; + + gBS =3D SystemTable->BootServices; + + gBS->SetMem ( + &mPlatformGOPPolicy, + sizeof (PLATFORM_GOP_POLICY_PROTOCOL), + 0 + ); + + mPlatformGOPPolicy.Revision =3D PLATFORM_GOP_POLICY_PROTOCOL= _REVISION_01; + mPlatformGOPPolicy.GetPlatformLidStatus =3D GetPlatformLidStatus; + mPlatformGOPPolicy.GetVbtData =3D GetVbtData; + + // + // Install protocol to allow access to this Policy. + // + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &ImageHandle, + &gPlatformGOPPolicyGuid, + &mPlatformGOPPolicy, + NULL + ); + + return Status; +} diff --git a/UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.h b/UefiPay= loadPkg/PlatformGopPolicy/PlatformGopPolicy.h new file mode 100644 index 0000000000..a8ac0be1b8 --- /dev/null +++ b/UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.h @@ -0,0 +1,62 @@ +/** @file + The header file for Platform GPO. + +Copyright (c) 2021, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef PLATFORM_GOP_POLICY_PROTOCOL_H_ +#define PLATFORM_GOP_POLICY_PROTOCOL_H_ + +#define EFI_PLATFORM_GOP_POLICY_PROTOCOL_GUID \ + { 0xec2e931b, 0x3281, 0x48a5, 0x81, 0x7, 0xdf, 0x8a, 0x8b, 0xed, 0x3c, 0= x5d } + +#define EFI_BMP_IMAGE_GUID \ + { 0x878AC2CC, 0x5343, 0x46F2, 0xB5, 0x63, 0x51, 0xF8, 0x9D, 0xAF, 0x56, = 0xBA } + +#define PLATFORM_GOP_POLICY_PROTOCOL_REVISION_01 0x01 +#define PLATFORM_GOP_POLICY_PROTOCOL_REVISION_02 x0222 + +#pragma pack(1) + +typedef enum { + LidClosed, + LidOpen, + LidStatusMax +} LID_STATUS; + +typedef enum { + Docked, + UnDocked, + DockStatusMax +} DOCK_STATUS; + +typedef EFI_STATUS \ +(EFIAPI *GET_PLATFORM_LID_STATUS) ( + OUT LID_STATUS *CurrentLidStatus + ); + +typedef EFI_STATUS \ +(EFIAPI *GET_VBT_DATA) ( + OUT EFI_PHYSICAL_ADDRESS *VbtAddress, + OUT UINT32 *VbtSize + ); + +#pragma pack() + +typedef struct _PLATFORM_GOP_POLICY_PROTOCOL { + UINT32 Revision; + GET_PLATFORM_LID_STATUS GetPlatformLidStatus; + GET_VBT_DATA GetVbtData; +} PLATFORM_GOP_POLICY_PROTOCOL; + +// +// Extern the GUID for protocol users. +// +extern EFI_GUID gPlatformGOPPolicyGuid; + +extern EFI_GUID gBmpImageGuid; + +#endif + diff --git a/UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.inf b/UefiP= ayloadPkg/PlatformGopPolicy/PlatformGopPolicy.inf new file mode 100644 index 0000000000..cdcdc86e2e --- /dev/null +++ b/UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.inf @@ -0,0 +1,47 @@ +## @file +# Module for using VBT for GOP. +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PlatformGOPPolicy + FILE_GUID =3D 9737D7CA-D869-45e5-A5EF-75D9438688DE + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D PlatformGOPPolicyEntryPoint + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D X64 +# + +[Sources.common] + PlatformGopPolicy.h + PlatformGopPolicy.c + +[Packages] + MdePkg/MdePkg.dec + UefiPayloadPkg/UefiPayloadPkg.dec + +[LibraryClasses] + BaseLib + DebugLib + UefiDriverEntryPoint + UefiRuntimeServicesTableLib + +[Guids] + gBmpImageGuid + +[Protocols] + gEfiFirmwareVolume2ProtocolGuid + gPlatformGOPPolicyGuid + +[Depex] + gEfiVariableArchProtocolGuid + diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index 1ce96a51c1..cb050b7269 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -33,6 +33,7 @@ DEFINE UNIVERSAL_PAYLOAD =3D FALSE DEFINE SECURITY_STUB_ENABLE =3D TRUE DEFINE SMM_SUPPORT =3D FALSE + DEFINE USE_PLATFORM_GOP =3D FALSE # # SBL: UEFI payload for Slim Bootloader # COREBOOT: UEFI payload for coreboot @@ -666,7 +667,11 @@ !if $(DISABLE_SERIAL_TERMINAL) =3D=3D FALSE MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf !endif +!if $(USE_PLATFORM_GOP) =3D=3D TRUE + UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.inf +!else UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutputDxe.inf +!endif !if $(PERFORMANCE_MEASUREMENT_ENABLE) MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerf= ormanceDxe.inf !endif diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayload= Pkg.fdf index c7b04978ad..ca3196256e 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.fdf +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf @@ -187,7 +187,21 @@ INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/= GraphicsConsoleDxe.inf !if $(DISABLE_SERIAL_TERMINAL) =3D=3D FALSE INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf !endif +!if $(USE_PLATFORM_GOP) =3D=3D TRUE +INF UefiPayloadPkg/PlatformGopPolicy/PlatformGopPolicy.inf +FILE DRIVER =3D FF0C8745-3270-4439-B74F-3E45F8C77064 { + SECTION DXE_DEPEX_EXP =3D {gPlatformGOPPolicyGuid} + SECTION PE32 =3D UefiPayloadPkg/IntelGopDriver.efi + SECTION UI =3D "IntelGopDriver" +} + +FILE FREEFORM =3D 878AC2CC-5343-46F2-B563-51F89DAF56BA { + SECTION RAW =3D UefiPayloadPkg/vbt.bin + SECTION UI =3D "IntelGopVbt" +} +!else INF UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutputDxe.inf +!endif =20 # # SCSI/ATA/IDE/DISK Support --=20 2.32.0 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#86594): https://edk2.groups.io/g/devel/message/86594 Mute This Topic: https://groups.io/mt/89057277/1781375 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.dong@intel.com] -=3D-=3D-=3D-=3D-=3D-=3D