From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.9017.1625731702252436541 for ; Thu, 08 Jul 2021 01:08:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=HHBTOYuj; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: zhichao.gao@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10038"; a="196740093" X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="196740093" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2021 01:08:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="457807656" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga008.jf.intel.com with ESMTP; 08 Jul 2021 01:08:15 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Thu, 8 Jul 2021 01:08:03 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) 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.2242.10; Thu, 8 Jul 2021 01:08:03 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Thu, 8 Jul 2021 01:08:03 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) 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.2242.4; Thu, 8 Jul 2021 01:08:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ob3h21jkX7rbX29HHMlnif+4mtK4DO5S9wFf6e4FL6g2+Or2dB+G6rEU6wxY1fGPOAM76LsVJZbDZHBH9gBsOmfo7wmNI4IO7Z9C6f8A9p+Eaf+r+IelBVITUyGCOtI6ki1CdmJ0ogX7T9AENP49TlUYVNmN4z6BK8yrZNyLKISHbZi5JyQJYpr7tguqNaXYLHIs0VMePhY1Dv00gtkTXKdgzeZ2bb7heiYHXIYF6hSp2zblcrLJYqV2VgHi2V6ItLdiP33ANBG/H2QKp0a/bMpFqBu79j1vxqqFQvdf5EvBTxrYaPrQEi2hxLSU9Y04IZAKUOLHSe8tZKC7iQGOeQ== 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-SenderADCheck; bh=73rDftu5B4DBb6apGSd0ndayayolvwe9D551w+xurUQ=; b=Y4H6Dcb3yHACbRNVfczkbx/9Se58Q/QnPlLgw/23S0xwfDSAzDtA5kv66ce/AxGlJfWoYxvaBCYGlNJIG7wH74hkf/5ECaostxLUSj4vigOTNN/tBrZxDWxHwB0uHlhuA+WnvQ+yFk/T1GQu4i3yTRd8Kc2qlvhUzhwZE4qxtuXCULhiv2vkttkehs8XvgsIUT1qyHxnLEYqPphcMVF5Cg0XbW0XZnPD8JXyX3wCs2H11VvJbBAFLdUOPP7rzsgWAg6jRXV98BVx+v/9CJ0o4Ol/sy1eXPJ9E63uFfgVgucWshGTpGh39h6fR1sMCXNRG2yn0z+jQXYJ8S5OyvMZNQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=73rDftu5B4DBb6apGSd0ndayayolvwe9D551w+xurUQ=; b=HHBTOYujGNAVLUtbfU5ayO/RbWKjOQ47NjYfiC2T/rK3ZeP9elk1GRz7+4vgywzoMTH3YxB5lDRJUe0iBY3LaoWXDZ/w9zs1Qht1GPZZKylN0pSayHlLNr588aQghXmrBWXvp7s0JS/Ab+zBygu3puJTnpcCCDQcwGAXti1esb0= Received: from DM4PR11MB5277.namprd11.prod.outlook.com (2603:10b6:5:388::23) by DM5PR11MB1242.namprd11.prod.outlook.com (2603:10b6:3:14::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.31; Thu, 8 Jul 2021 08:08:01 +0000 Received: from DM4PR11MB5277.namprd11.prod.outlook.com ([fe80::9879:11f5:9ea4:754b]) by DM4PR11MB5277.namprd11.prod.outlook.com ([fe80::9879:11f5:9ea4:754b%8]) with mapi id 15.20.4308.021; Thu, 8 Jul 2021 08:08:01 +0000 From: "Gao, Zhichao" To: "devel@edk2.groups.io" , "gjb@semihalf.com" CC: "leif@nuviainc.com" , "ardb+tianocore@kernel.org" , "Samer.El-Haj-Mahmoud@arm.com" , "sunny.Wang@arm.com" , "mw@semihalf.com" , "upstream@semihalf.com" , "pete@akeo.ie" , "Wang, Jian J" , "Wu, Hao A" , "Bi, Dandan" , "Dong, Eric" Subject: Re: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib. Thread-Topic: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib. Thread-Index: AQHXclQdz781pAZl906uiDN8i1EvWKs4uzwQ Date: Thu, 8 Jul 2021 08:08:01 +0000 Message-ID: References: <20210706104432.1239133-1-gjb@semihalf.com> <20210706104432.1239133-2-gjb@semihalf.com> In-Reply-To: <20210706104432.1239133-2-gjb@semihalf.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dc51927d-6063-4921-0349-08d941e78187 x-ms-traffictypediagnostic: DM5PR11MB1242: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dw66gjElYI6wjVquby5htKp4ZY3WIi6OkMMq9TZFXyDxvGNqSDbOEMLffY0iaNy3KGsUPrdmzf75sGVrnQjhj4gFalCI5tWq/b0AoGFT1W5MK6brk7tmpX2TdN92in4HRnAkEQfE0aWN9gwVCRWGqz5m3EhcBECd6WW8yE32+wwF8Kriz2itoGic90c6ThvytyL++nYgP4saGDoHskKcmIE96FQVUrk81uYAqSLVJ02pPHU96YhRocdq8CJ+9vJSiFPKbStBDmFVQmEW3jkiKFd5vrgObJbqLsJleUzZpKmrL9F4O4mhBbtv6fiYmbBzyiacloRdh5APyOVNX7oYRcBK/02ouK55laicgLW8mAgs6ssqW1/PwR5JGXkkOuGKRgqFZUE4hzJT0mV2UUyOSzTKYA9e3AwxEX/FHc75FE58mq6zeb9LnXBjGbZ6FX31Sj/gNfGlqCMip7M1NI55k1jND9r5yygI9mnpMbTCtc2Jez7vVT9zHeZoHKmsnbxJSEi8nJqpZphaJV9680p13ie7Czz+VgFeinAmTFViZCGDkj4CKjOn5X2efKIF+L6kzvFYxNmq/41lNBzWb6b0oK7+zoYoNWsUcoZj/Tj7mlZ1/2QasRghnHrldun5wRz5W5g3EHJ3qLwKk9JvfunJLK4A1YBlYk7v9bY8f0vxaPfbIVopdLTcNJA/RCvYg5S+XgwJVOYqQSbW/C2rJIlzWZP5mBz+21g1zKMnupp6zSr93dqONVtGL8dZad+mDeW4gP2tpcZIBFsBNVUeAALhsjbMZdzwrGoVYLUR+A3vkCkbe04uGET8YmG+6yxIqvBX x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5277.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(366004)(346002)(376002)(136003)(39860400002)(396003)(5660300002)(186003)(478600001)(52536014)(9686003)(55016002)(66446008)(66476007)(966005)(66946007)(71200400001)(66556008)(64756008)(76116006)(26005)(8676002)(83380400001)(33656002)(2906002)(8936002)(7696005)(122000001)(6506007)(30864003)(53546011)(38100700002)(86362001)(107886003)(316002)(54906003)(4326008)(110136005)(44824005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rMLNyHES9W+ZT8+/oiMMVxIm2QH/y7Vf63qlgeHP83LEUjKvaPlam5FD3wg2?= =?us-ascii?Q?1KITVYRkuAz39H16c8lfKO4k5yEIhjFI3gSe+9qdN5uXFxM2DWOG5HWZvrPZ?= =?us-ascii?Q?UJTW10Zw09i3m/BnhNu08pfmO9X5vISlIwLyaJyuVLC03xc6Cq4JqhdIT/3N?= =?us-ascii?Q?PHh5f2qxK4ijKnB0fJQO68VwuyCU+4MS8uAJMZSeqDwK2pEzH35fRV1GNetL?= =?us-ascii?Q?p6vXhJCYbSV0Cxeaq9t0heY/YjjWf/7JVgwu7sMIt5HbCQAxOjOKuEr6YtkS?= =?us-ascii?Q?/gHNhl8FgQVXQdygwMxHUDgsbz5JfLC3abcjJnaU0Oit6bKP1YWpC5WHgctM?= =?us-ascii?Q?YqfGPCMtjcyPw+8NvcHlf0Wch7ka7J0jI8//00NPZjPAi/EOKbX/gPwBkgmb?= =?us-ascii?Q?apdGMAA1ZB1UQOMLK3m1JKYpx9e2DmTVB7JUGhPZV76FULyOuF9atWylcYCD?= =?us-ascii?Q?oW3tXEDujrmSJZ0DQAafCmxtUBCKCgFV0QRbAe24TojhEfWRl5RvI5c6eVfa?= =?us-ascii?Q?39l8jLqZ2J+Iaf25aLMsVRlEBe0vHEYN99bAhCriNWcBaWinDQiuD9GyrfoW?= =?us-ascii?Q?yd5JrqO3uTmqQhFGEBUlvUxk+yeao2VDi0btyikg/2e/ldDQ36V1ouO5jlbd?= =?us-ascii?Q?LOit6f2eT3Dv4vkPTYxobiI07tN586LAUj1tefPv5yYmjCKqaJ7ZSO8NO2MA?= =?us-ascii?Q?4A8AzNVjQgVPxU6dyxLPeaPUKlMPQiMpicGrPaIuQDp/sjPmqWEaHsZeaedw?= =?us-ascii?Q?JPDWOcgN9bAyAmJuc8cgetCFyY8K7hrxFv23D8WgiiIKb1IUmBrrwJP4ZB54?= =?us-ascii?Q?hRTqQC3ew7fHTUah+2jLfSnkuZgUTKB0elecPryIGqjag4mSFzeuD5q3LGOe?= =?us-ascii?Q?neindmDj4qGFXZfeMsPv/tNIZJBoLKMEJigz6kIRjEGmHqLfvwbC8pkQyS6X?= =?us-ascii?Q?4ivbcuJt0Zl/e2egCDZ4S7R730OgJ8iRTYb7ei9lEMt1hUKbNbKLCNgIjbNL?= =?us-ascii?Q?EVmMq7Lt49L3KAt70k4dBotjRcMNg3Dl3kMssDPIvTE6AWooU6yAC9SjLMab?= =?us-ascii?Q?LaUvoK+yTofo3pUKk04a2j7V3naRuCxfRLgCW/1yUR3WOMbKYo5W5YUDbvq1?= =?us-ascii?Q?LHIg0SapIHQ0BCGqo+BgD6j2/iRJdenmo4t1qfvQVnsQadJqDmyPjLEOW448?= =?us-ascii?Q?mdRDInGDWEcDzO81bsrZ9gHYwNYaxwhjzzmsirLOVbGa2NqBc9Sq8hBfgTWT?= =?us-ascii?Q?u9cDmt1E4KEDoqf3xijvHBhBCAuVDbRL4iYE+PMMAiDghC8hj7cNExNMoDCO?= =?us-ascii?Q?jhpcY0IyajW7ch08A7VLD4EI?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5277.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc51927d-6063-4921-0349-08d941e78187 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2021 08:08:01.3197 (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: pmlWg0QjZ1nXFoArx/X1dYm+7DXW0zcZJXNv/sDYqGk+R+ISTDHwAsKZbqa5OP503geq3PNH8SxUs9uBE3ladA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1242 Return-Path: zhichao.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable See below comments. > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of > Grzegorz Bernacki > Sent: Tuesday, July 6, 2021 6:45 PM > To: devel@edk2.groups.io > Cc: leif@nuviainc.com; ardb+tianocore@kernel.org; Samer.El-Haj- > Mahmoud@arm.com; sunny.Wang@arm.com; mw@semihalf.com; > upstream@semihalf.com; pete@akeo.ie; Wang, Jian J > ; Wu, Hao A ; Bi, Dandan > ; Dong, Eric ; Grzegorz > Bernacki ; Sunny Wang > Subject: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: Add > BootDiscoveryPolicyUiLib. >=20 > This library extends Boot Maintenance Menu and allows to select Boot > Discovery Policy. When choice is made BootDiscoveryPolicy variable is se= t. > Platform code can use this variable to decide which class of device shal= l be > connected. >=20 > Signed-off-by: Grzegorz Bernacki > Reviewed-by: Sunny Wang > --- > MdeModulePkg/MdeModulePkg.dec = | 6 + >=20 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib. > inf | 52 +++++++ > MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h = | 22 > +++ >=20 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib. > c | 160 ++++++++++++++++++++ >=20 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib. > uni | 16 ++ >=20 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib > Strings.uni | 29 ++++ >=20 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib > Vfr.Vfr | 44 ++++++ > 7 files changed, 329 insertions(+) > create mode 100644 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib. > inf > create mode 100644 MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h > create mode 100644 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib. > c > create mode 100644 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib. > uni > create mode 100644 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib > Strings.uni > create mode 100644 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib > Vfr.Vfr >=20 > diff --git a/MdeModulePkg/MdeModulePkg.dec > b/MdeModulePkg/MdeModulePkg.dec index ad84421cf3..4e1c291768 > 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -425,6 +425,9 @@ > ## Include/UniversalPayload/SerialPortInfo.h > gUniversalPayloadSerialPortInfoGuid =3D { 0xaa7e190d, 0xbe21, 0x4409, > { 0x8e, 0x67, 0xa2, 0xcd, 0xf, 0x61, 0xe1, 0x70 } } >=20 > + ## GUID used for Boot Discovery Policy FormSet guid and related varia= bles. > + gBootDiscoveryPolicyMgrFormsetGuid =3D { 0x5b6f7107, 0xbb3c, 0x4660, = { > + 0x92, 0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } } > + > [Ppis] > ## Include/Ppi/AtaController.h > gPeiAtaControllerPpiGuid =3D { 0xa45e60d1, 0xc719, 0x44aa, { 0x= b0, 0x7a, > 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }} > @@ -1600,6 +1603,9 @@ > # @Prompt Console Output Row of Text Setup >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x40 > 00000e >=20 > + ## Specify the Boot Discovery Policy settings > + > gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy|2|UINT32|0x4 > 0000 > + 00f > + > [PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.AARCH64] >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20|UI > NT32|0x0001004c >=20 > diff --git > a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi > b.inf > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi > b.inf > new file mode 100644 > index 0000000000..1fb4d43caa > --- /dev/null > +++ > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyU > +++ iLib.inf > @@ -0,0 +1,52 @@ > +## @file > +# Library for BDS phase to use Boot Discovery Policy # # Copyright > +(c) 2021, ARM Ltd. All rights reserved.
# Copyright (c) 2021, > +Semihalf All rights reserved.
# SPDX-License-Identifier: > +BSD-2-Clause-Patent # ## > + > +[Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D BootDiscoveryPolicyUiLib > + MODULE_UNI_FILE =3D BootDiscoveryPolicyUiLib.uni > + FILE_GUID =3D BE73105A-B13D-4B57-A41A-463DBD15FE= 10 > + MODULE_TYPE =3D DXE_DRIVER > + VERSION_STRING =3D 1.0 > + LIBRARY_CLASS =3D NULL|DXE_DRIVER UEFI_APPLICATION > + CONSTRUCTOR =3D BootDiscoveryPolicyUiLibConstructo= r > + DESTRUCTOR =3D BootDiscoveryPolicyUiLibDestructor > +# > +# The following information is for reference only and not required by t= he > build tools. > +# > +# VALID_ARCHITECTURES =3D IA32 X64 AARCH64 > +# > + > +[Sources] > + BootDiscoveryPolicyUiLib.c > + BootDiscoveryPolicyUiLibStrings.uni > + BootDiscoveryPolicyUiLibVfr.Vfr > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + > +[LibraryClasses] > + DevicePathLib > + BaseLib > + UefiRuntimeServicesTableLib > + UefiBootServicesTableLib > + DebugLib > + HiiLib > + UefiLib > + BaseMemoryLib > + > +[Guids] > + gBootDiscoveryPolicyMgrFormsetGuid > + > +[Pcd] > + gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy ## > PRODUCES > + > +[Depex] > + gEfiHiiDatabaseProtocolGuid AND gPcdProtocolGuid > diff --git a/MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h > b/MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h > new file mode 100644 > index 0000000000..8eb0968a16 > --- /dev/null > +++ b/MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h > @@ -0,0 +1,22 @@ > +/** @file > + Definition for structure & defines exported by Boot Discovery Policy > +UI > + > + Copyright (c) 2021, ARM Ltd. All rights reserved.
Copyright (c) > + 2021, Semihalf All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef _BOOT_DISCOVERY_POLICY_UI_LIB_H_ #define > +_BOOT_DISCOVERY_POLICY_UI_LIB_H_ > + > +#define BDP_CONNECT_MINIMAL 0 /* Do not connect any additional > devices */ > +#define BDP_CONNECT_NET 1 > +#define BDP_CONNECT_ALL 2 > + > +#define BOOT_DISCOVERY_POLICY_MGR_FORMSET_GUID { 0x5b6f7107, > 0xbb3c, > +0x4660, { 0x92, 0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } } > + > +#define BOOT_DISCOVERY_POLICY_VAR L"BootDiscoveryPolicy" > + > +#endif > diff --git > a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi > b.c > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi > b.c > new file mode 100644 > index 0000000000..6814d0bb8f > --- /dev/null > +++ > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyU > +++ iLib.c > @@ -0,0 +1,160 @@ > +/** @file > + Boot Discovery Policy UI for Boot Maintenance menu. > + > + Copyright (c) 2021, ARM Ltd. All rights reserved.
Copyright (c) > + 2021, Semihalf All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include #include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +/// > +/// HII specific Vendor Device Path definition. > +/// > +typedef struct { > + VENDOR_DEVICE_PATH VendorDevicePath; > + EFI_DEVICE_PATH_PROTOCOL End; > +} HII_VENDOR_DEVICE_PATH; > + > +extern unsigned char BootDiscoveryPolicyUiLibVfrBin[]; > + > +EFI_HII_HANDLE mBPHiiHandle =3D NULL; > +EFI_HANDLE mBPDriverHandle =3D NULL; > + > +STATIC HII_VENDOR_DEVICE_PATH mVendorDevicePath =3D { > + { > + { > + HARDWARE_DEVICE_PATH, > + HW_VENDOR_DP, > + { > + (UINT8)(sizeof (VENDOR_DEVICE_PATH)), > + (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8) > + } > + }, > + BOOT_DISCOVERY_POLICY_MGR_FORMSET_GUID > + }, > + { > + END_DEVICE_PATH_TYPE, > + END_ENTIRE_DEVICE_PATH_SUBTYPE, > + { > + (UINT8)(END_DEVICE_PATH_LENGTH), > + (UINT8)((END_DEVICE_PATH_LENGTH) >> 8) > + } > + } > +}; > + > +/** > + > + Initialize Boot Maintenance Menu library. > + > + @param ImageHandle The image handle. > + @param SystemTable The system table. > + > + @retval EFI_SUCCESS Install Boot manager menu success. > + @retval Other Return error status.gBPDisplayLibGuid > + > +**/ > +EFI_STATUS > +EFIAPI > +BootDiscoveryPolicyUiLibConstructor ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_STATUS Status; > + UINTN Size; > + UINT32 BootDiscoveryPolicy; > + > + Size =3D sizeof (UINT32); > + Status =3D gRT->GetVariable ( > + BOOT_DISCOVERY_POLICY_VAR, > + &gBootDiscoveryPolicyMgrFormsetGuid, > + NULL, > + &Size, > + &BootDiscoveryPolicy > + ); > + if (EFI_ERROR (Status)) { > + Status =3D PcdSet32S (PcdBootDiscoveryPolicy, PcdGet32 > (PcdBootDiscoveryPolicy)); > + ASSERT_EFI_ERROR (Status); > + } I don't understand the above check. Seems the value of the variable is not= used and the Pcd value is not changed. Thanks, Zhichao > + > + Status =3D gBS->InstallMultipleProtocolInterfaces ( > + &mBPDriverHandle, > + &gEfiDevicePathProtocolGuid, > + &mVendorDevicePath, > + NULL > + ); > + if (EFI_ERROR (Status)) { > + return Status; > + } > + > + // > + // Publish our HII data > + // > + mBPHiiHandle =3D HiiAddPackages ( > + &gBootDiscoveryPolicyMgrFormsetGuid, > + mBPDriverHandle, > + BootDiscoveryPolicyUiLibVfrBin, > + BootDiscoveryPolicyUiLibStrings, > + NULL > + ); > + if (mBPHiiHandle =3D=3D NULL) { > + gBS->UninstallMultipleProtocolInterfaces ( > + mBPDriverHandle, > + &gEfiDevicePathProtocolGuid, > + &mVendorDevicePath, > + NULL > + ); > + > + return EFI_OUT_OF_RESOURCES; > + } > + > + return EFI_SUCCESS; > +} > + > +/** > + Destructor of Boot Maintenance menu library. > + > + @param ImageHandle The firmware allocated handle for the EFI image= . > + @param SystemTable A pointer to the EFI System Table. > + > + @retval EFI_SUCCESS The destructor completed successfully. > + @retval Other value The destructor did not complete successfully. > + > +**/ > +EFI_STATUS > +EFIAPI > +BootDiscoveryPolicyUiLibDestructor ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + > + if (mBPDriverHandle !=3D NULL) { > + gBS->UninstallProtocolInterface ( > + mBPDriverHandle, > + &gEfiDevicePathProtocolGuid, > + &mVendorDevicePath > + ); > + mBPDriverHandle =3D NULL; > + } > + > + if (mBPHiiHandle !=3D NULL) { > + HiiRemovePackages (mBPHiiHandle); > + mBPHiiHandle =3D NULL; > + } > + > + return EFI_SUCCESS; > +} > diff --git > a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi > b.uni > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi > b.uni > new file mode 100644 > index 0000000000..89231bc2d7 > --- /dev/null > +++ > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyU > +++ iLib.uni > @@ -0,0 +1,16 @@ > +// /** @file > +// Boot Discovery Policy UI module. > +// > +// Copyright (c) 2021, ARM Ltd. All rights reserved.
// Copyright > +(c) 2021, Semihalf All rights reserved.
// // > +SPDX-License-Identifier: BSD-2-Clause-Patent // // **/ > + > + > +#string STR_MODULE_ABSTRACT > +#language en-US "Boot Discovery Policy UI module." > + > +#string STR_MODULE_DESCRIPTION > +#language en-US "Boot Discovery Policy UI module." > diff --git > a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi > bStrings.uni > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi > bStrings.uni > new file mode 100644 > index 0000000000..736011c9bb > --- /dev/null > +++ > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyU > +++ iLibStrings.uni > @@ -0,0 +1,29 @@ > +// *++ > +// > +// Copyright (c) 2021, ARM Ltd. All rights reserved.
// Copyright > +(c) 2021, Semihalf All rights reserved.
// > +SPDX-License-Identifier: BSD-2-Clause-Patent // // Module Name: > +// > +// BootDiscoveryPolicyUiLibStrings.uni > +// > +// Abstract: > +// > +// String definitions for Boot Discovery Policy UI. > +// > +// --*/ > + > +/=3D# > + > + > +#langdef en-US "English" > + > +#string STR_FORM_BDP_MAIN_TITLE #language en-US "Boot Discovery > Policy" > + > +#string STR_FORM_BDP_CONN_MIN #language en-US "Minimal" > + > +#string STR_FORM_BDP_CONN_NET #language en-US "Connect > Network Devices" > + > +#string STR_FORM_BDP_CONN_ALL #language en-US "Connect All > Devices" > + > diff --git > a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi > bVfr.Vfr > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi > bVfr.Vfr > new file mode 100644 > index 0000000000..0de87ec34f > --- /dev/null > +++ > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyU > +++ iLibVfr.Vfr > @@ -0,0 +1,44 @@ > +///** @file > +// > +// Formset for Boot Discovery Policy UI // // Copyright (c) 2021, ARM > +Ltd. All rights reserved.
// Copyright (c) 2021, Semihalf All > +rights reserved.
// // SPDX-License-Identifier: > +BSD-2-Clause-Patent // //**/ > + > +#include > +#include "Guid/BootDiscoveryPolicy.h" > +#include > + > +typedef struct { > + UINT32 BootDiscoveryPolicy; > +} BOOT_DISCOVERY_POLICY_VARSTORE_DATA; > + > +formset > + guid =3D BOOT_DISCOVERY_POLICY_MGR_FORMSET_GUID, > + title =3D STRING_TOKEN(STR_FORM_BDP_MAIN_TITLE), > + help =3D STRING_TOKEN(STR_FORM_BDP_MAIN_TITLE), > + classguid =3D EFI_IFR_BOOT_MAINTENANCE_GUID, > + > + efivarstore BOOT_DISCOVERY_POLICY_VARSTORE_DATA, > + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | > EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE, > + name =3D BootDiscoveryPolicy, > + guid =3D BOOT_DISCOVERY_POLICY_MGR_FORMSET_GUID; > + > + form formid =3D 0x0001, > + title =3D STRING_TOKEN(STR_FORM_BDP_MAIN_TITLE); > + > + oneof varid =3D BootDiscoveryPolicy.BootDiscoveryPolicy, > + prompt =3D STRING_TOKEN(STR_FORM_BDP_MAIN_TITLE), > + help =3D STRING_TOKEN(STR_FORM_BDP_MAIN_TITLE), > + flags =3D NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED, > + option text =3D STRING_TOKEN(STR_FORM_BDP_CONN_MIN), value =3D > BDP_CONNECT_MINIMAL, flags =3D DEFAULT; > + option text =3D STRING_TOKEN(STR_FORM_BDP_CONN_NET), value =3D > BDP_CONNECT_NET, flags =3D 0; > + option text =3D STRING_TOKEN(STR_FORM_BDP_CONN_ALL), value =3D > + BDP_CONNECT_ALL, flags =3D 0; endoneof; > + > + endform; > +endformset; > -- > 2.25.1 >=20 >=20 >=20 >=20 >=20