From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.9011.1644994085618103019 for ; Tue, 15 Feb 2022 22:48:06 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=k663eGqp; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644994085; x=1676530085; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ZxQEDryTQ4Q/Tln/7F+eXXY1sQLey2P1fidgkxRNhUM=; b=k663eGqpBrLJfhvAEbou5cLi9p5hlriawnLr17Og35ungI/E9wSYjshF mzhY9qK9e4mLeTWrbzoaq9jcgOOANMqu9AVIDcRuiEHh/58u6PxANZa7w Z6bOIXZcYIaFKFvvAyr4hrIYp4bACXfO9WLnMKmK2IlLPte7GsBovYwV/ 9IDwGoVWRoR/oYyveiSMsSMel5Ci6uM9z1ryJI+it9yzhO5tPZmdhx4lv h6e/nYI8sw12Z2j/QJhQsFH11uWINdjAfTju2Py2tKuUY/Z9NLfdzPtYh yNVsUbtVha8DhpHDrFP2+pNDh2kzjNhet0qkrFLHfw9h6oXI/rI5c8gEC g==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="250274845" X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="250274845" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 22:48:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="544751896" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga008.jf.intel.com with ESMTP; 15 Feb 2022 22:48:04 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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.2308.20; Tue, 15 Feb 2022 22:48:03 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 15 Feb 2022 22:48:03 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) 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; Tue, 15 Feb 2022 22:48:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VIQlCDP4n72eqyBpWhg8YDq2YGlNZBzKatfVHCVVQzcXUSyk8Fo392MTR0ftJJuzNFY4KwNoMC0GKQ3+yu2zlf7JJIyRQtCYJh1FrpJJYCjZJaVyHoqjwlgnwAPgAaW9jsLzd/gQtLlDsmn/Y4mEIiakS4+vrf9LUiNwXG5RfAfkt781VVa1+Y1l0UJQ2PTB+0R79REvXRzMD/tYo3CCRjF9jj/TaSJ/XhSh27yEBbZv+Wqy5AGp6Ekh2j3WoYb4U4OVcFvqSG0eHsFGCOksMHF15forIIQvtmzAwIAnn3NkPNPtMVLJcysIYeGx/6aqahNRSlhbxD9j95sYlETLvw== 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=oWf5OqPxavF9swnlpQqWtYdwnxufsvNfLhdSvo6OeHU=; b=lGolUbiSnKR5k4CRduNDePxHisP/68LeYtu6+aBmEu7eonoaUxRwe8b3zGo4wdgO5KSR4kBvmVSt0syC8xpgegy/aEPfhF8B52R8+hP8OT0mcuNinAPcyk4x/ojnMwTdBmg0DBYL7svZOjiFTDYMtp5xpzazrNpRaUTq6ASl+UY8EcbJMEnUgQXqHUxo6u2rdda6fEKknkTmuG8kkMyTxLr4rEN4d609GWXz76Yy+UJa+zOmoAI5jSoVyjLdpfPaDuWGsLRiqYzzmErDrZil1BAnw9amiCoXEqy/wHGMiqDt8UuHbt0X0r0d2ur+8K1sXg2iEjqmEeeWbBlO18OkwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by MN2PR11MB4239.namprd11.prod.outlook.com (2603:10b6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.17; Wed, 16 Feb 2022 06:47:56 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::e0fb:ec1d:4e67:375f]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::e0fb:ec1d:4e67:375f%8]) with mapi id 15.20.4975.019; Wed, 16 Feb 2022 06:47:56 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Rhodes, Sean" CC: "Dong, Guo" , Matt DeVillier , "Ma, Maurice" , "You, Benjamin" Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add PlatformGopPolicy Thread-Topic: [edk2-devel] [PATCH] UefiPayloadPkg: Add PlatformGopPolicy Thread-Index: AQHYHsz9QUSoHhpNWE6PUqSGX27SV6yVxBVQ Date: Wed, 16 Feb 2022 06:47:56 +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: 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: 35c56a0b-57fc-4fe4-8316-08d9f1184368 x-ms-traffictypediagnostic: MN2PR11MB4239:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3631; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HS9ePdak6VipmBqVz0mALqMsW7/C3P7EayJG6mEP7Yp7ejANfCpA1dtCwuM1nm5xMBC5aeyjzVc+5qTc15YNB+oFdF7Coj++bAAt7C7KCKfnlv8HfV2HLJFja/I8/eoTQ9im8osIvvAXpEkCiTL5UYva8cQkOyw9B1IaiQIuECbg3AV5HDoXjwHjRdtBpSc7eoJcxSLeWhg/j3PcRjty9g+FDhDvL/aAARBWwQQf4KnX/pxBkTH4+dN683Ci1aWtnL86lgxz84qM6QVkaf0HkDo10TJO0vQoNx956Trnv8nd9YR0coCDRYdQsQaXBccWyjO/I/C8BMsC4Vd+iWTIyo6kV/o8h5/hiYhZMxnWVKjopwQq5iEdwuz0Q64ANVKiNtb95zZqmDakaA8oDHHChwDG4ann3zTrqeAgMDdEsQ0Cd1Yh7h/PC4zHMnFb9SptxEb9med5f2HOR0S43hOlYQtc2ddzhJPmEGRYUUQWMQVsn0S32SxaRBfZ4uf9ma48oVNspgGzamWt5wdzlx1zkyhHMxcCfWKy0QgZ1vbUdRFucprai2EMlkB5sq5qZW0I9XSSbxz4KLEbogV2C8IEWa4PTowPWmXCRuWfFrmeF4gNDbkB2vVVhlAmaLy8LnbMnuXoIqAKWWU3MJAHNG/WaPQQCyeDBHvZ1ZjcO05dHwj83H7Tohwy8j/4PTTaO9vO4ZFNeDRdqWTpXCWJV5HDHwiise/xMwFdJ8pj8gXoCGCWb2oSHhYJa9FZiVZAzbYDDYpdCxabesEn+ExASnvy1S0MEPHPMfCNwt7wacOUV6QaYO+FDjcYeev7lWNsrGvvq8F5D+F5T1IPRESBwbvZ/SIAU/UZj7SFn+VU2Yl3VGg= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(107886003)(8936002)(54906003)(7696005)(53546011)(9686003)(33656002)(26005)(64756008)(66946007)(316002)(82960400001)(19627235002)(66556008)(52536014)(76116006)(186003)(66476007)(8676002)(122000001)(83380400001)(86362001)(66446008)(4326008)(38100700002)(110136005)(2906002)(38070700005)(6506007)(5660300002)(71200400001)(966005)(508600001)(55016003)(44824005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dHwFOqDnGcoZXo/ZSQRfqDL6C5GENJL9b4cM/1uexyI/g4PNUvMk8DWAJpnW?= =?us-ascii?Q?zFOjLqdGiuDJu3ZzC8o1yVwgPHHqSt0tifM3rsH+Tr46UMfDOZvt9UU1KfF8?= =?us-ascii?Q?w/eBSGvkjp+F3PD1CwpqbSPFd76WkneOJJDgOYsPQACErl+AdiuqWmPJgKQQ?= =?us-ascii?Q?gezHR4otmAKTZRMbfplleTy+AhrAz4Z4/djbUWKrxGvBEL0zSQkJ06PwEZrd?= =?us-ascii?Q?y7U1XEdsHtAar4hRWD+t0e5WE0M+qxz+AN65290HywEWjrKuscVLSf5ncc5e?= =?us-ascii?Q?MGMqjUjbHFJ+Sb4MtAweN9WWZwdFcUQcY3ETRPtw+7dxmCLH/WMF3dh4tupP?= =?us-ascii?Q?CLORbSnNa5bSXpjnIEDxQUaLCjTJYXj9UJ6LC6pxRRsc6fDfhSEDDW24pJhK?= =?us-ascii?Q?wR9so78RyKsOMpkX3plfZr1oPQLm4o3dX1b/iZSYzuxdb7372hdGRLPyIyQ9?= =?us-ascii?Q?lX8M/nvNOCXWhmrD2fIrx+C278Mt5GLwqDf0vl24/+lvNlZpFC34Jx/4GiR4?= =?us-ascii?Q?sNcQC0JH7LavXk20C6WjEmLIekwZDWVFFPiQQ+q8K71/vekJP6kBknJFK4FB?= =?us-ascii?Q?Sp0Rv0Xo3zE7Wsrwehqy1BsldXnCpHxeRaHhZj9mpN5tOJ+z3JQDD49RqnCb?= =?us-ascii?Q?5lUD+iy6z96PgtEz0p91VpGBpTTh03IhOWQ2QIvFZ/VQrCH1LhGnXcy88c00?= =?us-ascii?Q?1OECnXYXLtLPmLi8psiJ0Y6xPQMTUaJm5Xf7I/oE0WuCXi8pMe74eESqoKO5?= =?us-ascii?Q?B7vsqxj8fud8PO5TNZyED2FW85mBdXIUxm/h2FoafmBZMX+QarLY3vyYisVh?= =?us-ascii?Q?UsmGv+d/+sptRgBT20Cei71LeEWycLswZ7TvOOQdTCzGce0xgeBxqoTHCZo1?= =?us-ascii?Q?qKDIeXy1Stf+FRG5dGt2Sy5E/VLEMSSXE9LfUyA+xU9zYUUmF4G05DVwlqNT?= =?us-ascii?Q?RdN9/3eGwym11Byvrr2EjdOdZJJx2y1aK2qWUUTMYsjTrGp9nwje/BZ5QOh0?= =?us-ascii?Q?umatniZoTw1QYA5uPZWad++x0PMenI0YUzZQYPWw7MJMaabEdEly1fjTpHXm?= =?us-ascii?Q?r+0zxEyoUsa3qZhr51WLJ6wv4BRAIt/tU3SGp9G/dVE+axYtfe3aXAgaom/e?= =?us-ascii?Q?tpwQUtXC3h6Ky15mejqkCsuoXS6MZ9LhoJ3swxCEgYC2VD83Hw6CeTpFWLcU?= =?us-ascii?Q?YQquEn/is442CYPufYykmNrsmIEruXQsXrHxAeyhSxu8ZXYOQQtsILM6qlkm?= =?us-ascii?Q?+9h/6ocbF8GBmm2fAu7cytZe4U/Y2qo0t9pjJ0yNY9c6OiDPRLdwhW2aj85Y?= =?us-ascii?Q?sQKqiTw+0huQZkR+kYyM0PIANdMQpOupCGiT6t7IuoEGevu8vapBUqwDTERD?= =?us-ascii?Q?PBS9l8dai/8dB/yL3NWXWPntqGYQRROpeW+X8NKiN7GRhBiHKszUdYDTlWqJ?= =?us-ascii?Q?DES/aMeYVrNbzoW/GVxjiiJrsGowZ/bpPjdIfAt8hYLOtLQunttm52ZG/eJr?= =?us-ascii?Q?uCBYMYh6/DbWYmx8xMF9f0j+bCoVKqLMgTVe5S1KXLaHuyLLpSgXXatdZi0V?= =?us-ascii?Q?ZMaCQlT31LIjksf47Lbm4UDsnKwugwiGfLHL1D2ATVLwSMevUufLfJqTJnIS?= =?us-ascii?Q?/bnWa7915HcIbVsLiy6GrAo=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35c56a0b-57fc-4fe4-8316-08d9f1184368 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2022 06:47:56.0817 (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: V/cpKH/QDWQoeZGDtaxFIlwiCD6xdBeP1jw6vE+qR2BNKvEQzmVrXiut78NKz1nXZ5YsuhSUqxwM8xvXKYC5QQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4239 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable gPlatformGOPPolicyGuid is installed by this driver. Then who is producing G= OP? Thanks, Ray -----Original Message----- From: devel@edk2.groups.io On Behalf Of Sean Rhodes Sent: Friday, February 11, 2022 6:24 AM 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/1712937 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray.ni@intel.com] -=3D-=3D-=3D-=3D-=3D-=3D