From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.16011.1627878945354070971 for ; Sun, 01 Aug 2021 21:35:45 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=orcdTk5Z; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: hao.a.wu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10063"; a="192975994" X-IronPort-AV: E=Sophos;i="5.84,287,1620716400"; d="scan'208";a="192975994" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2021 21:35:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,287,1620716400"; d="scan'208";a="440419272" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga007.fm.intel.com with ESMTP; 01 Aug 2021 21:35:44 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.2242.10; Sun, 1 Aug 2021 21:35:43 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Sun, 1 Aug 2021 21:35:43 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) 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.10; Sun, 1 Aug 2021 21:35:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CRANpBhFUAn1hHTwfasteODvMGu+dlXxEJpxyaM3no6W/mBrGajLc8sbuR7jDkoojGJEk7bLDhLUndTNBilwVTAxRJkZRLXRV8CzA6HwFvrrsInAYvC+UzKSlqBTpS7uRIjM9zKroTnxO6BTx8VAcOGV64itf+pRW/0RnBUE36L0hcmWH+sbX5OHZfDkSvvZFwk4HwWAZM4HGeViN0tvUpEHd76NgoDtOJ226fW+eVMYVSKQW9tai+d1Fb11mSF2k0IT4TjkIaCcZedTcZcKmRyv1BVWezW7mMtRHYO0v/XbDTLoV4AW29aK3zXp/0miqKJW/I4AVXYdf5wYxjaBdg== 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=T61mV5okYi1hfFaKvIZtvKU5cgnrZ1f4Z20Qgu2fERM=; b=Wd+tmdxhY7oJqKa1x56buDEpRkTqY6/kLRGCqJYsmjIKAxkud5WSvAjxGBAQsf6EbHf79/8NNx0ZpI3bQYEbI9Qyo/j6WPRgRSz1gmqNJis5N6s98/zMT5163PoK3vYWh/b+8X43vwsnYiKutgLFCbsyW9ZGEPfffhNp9TeOIuqJktsRJRlQ1qkVK4jpfiqhuAeCUu77VLSAGBBUgj3pyXCRF9wzAdYtG6Wv8kl7k9JDyXRmLruWOnhwsdkMnO4N/51ba28yeECjGRdeg+t9al1amrj2eo2o1bRh01GgLERFaPdDL1/WZ2TIyYC+XaJ8kcK1dkGnd8Prn7k6M5TbTg== 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=T61mV5okYi1hfFaKvIZtvKU5cgnrZ1f4Z20Qgu2fERM=; b=orcdTk5Z4zbZP/LZQVr53/itbVyH2bNc5A7tbEEyCw2LpvwgoiD+vzODZfwWvrwvCcchptY5tNTibmbt/zb66nvE7ZxgZ6n9J35eChVETi/JOCp/qhfz2ZSnh3Z21AVdu7zBUIlWWgYW1zKOPBP0CL30UFX/Y1FXVSQpOcpU4aQ= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN8PR11MB3665.namprd11.prod.outlook.com (2603:10b6:408:91::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.22; Mon, 2 Aug 2021 04:35:41 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::cd58:25ce:5017:619d]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::cd58:25ce:5017:619d%5]) with mapi id 15.20.4373.026; Mon, 2 Aug 2021 04:35:41 +0000 From: "Wu, Hao A" To: Sunny Wang , "Gao, Zhichao" , Grzegorz Bernacki , "devel@edk2.groups.io" , "Wang, Jian J" CC: "leif@nuviainc.com" , "ardb+tianocore@kernel.org" , Samer El-Haj-Mahmoud , "mw@semihalf.com" , "upstream@semihalf.com" , "pete@akeo.ie" , "Bi, Dandan" , "Dong, Eric" , "Ni, Ray" Subject: Re: [PATCH v4 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib. Thread-Topic: [PATCH v4 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib. Thread-Index: AQHXfs1zX7DpFYpfIE+Os26YKwwQ06tfm8EAgAAVNZA= Date: Mon, 2 Aug 2021 04:35:41 +0000 Message-ID: References: <20210722074425.2274716-1-gjb@semihalf.com> <20210722074425.2274716-2-gjb@semihalf.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 97c60e7a-267b-470c-d74a-08d9556efc15 x-ms-traffictypediagnostic: BN8PR11MB3665: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UQWiO8YGgT1ebt8+24d1+BkbR9pA5Fx/MOubtGvaFBfYVOdxYNsKuVPwd6lACqcZtFNgndREA5Dr/PjINufHRg2YOt4rAVsv9y61tswuk8Eu/N08Ybwz3kDgcLseJiOR1fd8WD8blUncXFwZRvbCMig+o0Q8dE8z/AHcGY6eKtO6hobOUrmmVf9GD6X0AtIMhQyNFOR6b7RMkk3+JUW7EvlZFccHeahaipUCsfNiLVpFpTc5fUvjybPHx8fJTXT6ixeRzBOIttyiWYFn0ARQKRRpkAyU74Yi9fRk28A+GnRvR9JSAEQAeJk9Y3w6K42oW9HzWzMSYuGxP6uGa/gFhbhbqZdtNOXhK6LYn+6AJeT+1HnZ9uato6PIVFZp5w94ZhTIpLr6jfNtN4D2bIvP2SokzjrKGrEviQ3c0vv2WU+W57MdMMj+0dEuARlqSosOoJ6q7LQVhDr4XVUv51SeBR3yY5Xw+mhAnkbmCbaPKvecAK231dMJ3iCOfvBnDl63k5RBAGOigPnXTBVYH4d5mwSF8WSOT00Mb7flcMiKD+0rKgu9rVHAb4fCU91OCZypqcNHMK37xUO6qc1DaIOA1rV17wiuNChTjd4wYfn0l8UNEdZp1Ua49V3vMpHWpdvxPqN6fctDIioy39DH6apndTxhBQmeQmR5X/sQezG3XuMvCDe4l8p1b5qQV/ygcLLTUlQZY84A/uH4JrP5hrm4XxWfOMd6Qg9L3YXuEyKVUYbysW5UqVx0md76evfHkw+n9kQL+QyRrfEnfCfmZ4nW2i6lFVokOKTV97XEriN/wGaelXFoO75KhBqkGhyXWNpYPSP8zK7Qcev4Q9xhe517y1IqSVigINi7HbRL0WfEMJk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(4636009)(366004)(66556008)(26005)(52536014)(4326008)(2906002)(66476007)(53546011)(64756008)(6506007)(71200400001)(66946007)(66446008)(76116006)(55016002)(38100700002)(7696005)(5660300002)(86362001)(38070700005)(107886003)(122000001)(33656002)(316002)(9686003)(8936002)(186003)(966005)(83380400001)(30864003)(508600001)(54906003)(6636002)(8676002)(110136005)(44824005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jQYpd2HtWHM5eB8eCM+84FXhK6SgrmwNWWMafEu8E9GFoNLqoqXa+NQA0ifg?= =?us-ascii?Q?xXPjX9vAeqZ5Unk7hqOJdkF017jCfeeARslq89ebQWD2nl8vKAeNTTI6gLSO?= =?us-ascii?Q?GC8NpPgczwhiLVfGCrXACFGuT0B4woxCx6d1qNIp8XT1edlvdQYEUNuGRZ2O?= =?us-ascii?Q?bA4797RIfIueu9mtC7DmTnh4/Sk39VJ7RPgzm3OAW1AHqXqgANjzt1Jno0FA?= =?us-ascii?Q?H9IbruG4LhFuh/SkAoOm+/OMgNOmwMwapYEd3alzHsmidfY1hxKQuzGQXEah?= =?us-ascii?Q?fW9i5CoO8uhZZ5m3xWjeRfzyYrdt7iG342Of0wGtR/9JztSDpnRF9bIQLDmO?= =?us-ascii?Q?kWamjXop1hldht6hIHwunQ/OPehkQ/+aRAZLY5EopKjsXPFeJdtsfX0zpTND?= =?us-ascii?Q?mRqPbNINlcsbsd9YB5oAsLIaPW4s5UZq+S7j0oSfyeIBgl2tCWLBKKUqoDL2?= =?us-ascii?Q?QoJc9rYYYeicqXp90iFFDhjkpig9U8Vv4kUiQ3XrBYmWXYgWbTVbwi706Ip3?= =?us-ascii?Q?cBpEq8VI1W1sPGeZyJZFX6wXlijGDd1FuprcqQn5xMyY0vD5CV2nX3GdToWY?= =?us-ascii?Q?owx2BKLFtrbK3Yt14KQZnpi9crKqi6OCmLa3e7hCUU3LlaUVhjgoMFot5vbZ?= =?us-ascii?Q?iM7KoPKxZFv2p2rNXA8PWnjwrgUx0RX3RdAKLbBMiNQOxCApxvEyoLdMsi2u?= =?us-ascii?Q?ryjmQDTfmWwza0T6Dbc6zEVeQBXUFHe5I3AiXexZRsHF9VBtNGoOdDdLYgQX?= =?us-ascii?Q?xuaLT9oMFFEv4JdJIY4twWD+rZJdTTgp85yX0PXxclOhAnCkfWe+cCzThZgy?= =?us-ascii?Q?FDBLRNf3eR3jMdQi9WCVV4tsLZ5aPaDtPMwkWmbNvYUjN5IuOL/qGJoIjMOg?= =?us-ascii?Q?qXIwk1sz37mzW2ILxOAMYDPj09kvv/GxgoV9RL9kQaktjtK6EKPsvArccss1?= =?us-ascii?Q?fovFZ0gzxc+1PcMSXdDfBHiF8FKm/5glTPrTcXwHFP/YUZzL75DNl3PBqAe/?= =?us-ascii?Q?/ODGfpSy4YuRuZZRia7UyZ4/+ySGD9DfX91uk/hLGdn0iqQQOMmUJSqvAt2R?= =?us-ascii?Q?Ikgh21NWe3rpC2SpprOSSLCWsQ0dkSHqUToVlcEDhIK0PjdMMSRTctHWjDh1?= =?us-ascii?Q?fdgXs9AcgBW6zDbQtMB3SLvAvqlMF/6XJpOBJ88rkJHarZDywqUzp6OfehlC?= =?us-ascii?Q?CioAFXze09aAswiedNYyIQRQoj/059N2cvKJ03pJYjOlQnvDX6YTX+0r5OOB?= =?us-ascii?Q?XiqWtaei2TKEop2x64zslDqQrp07asw9tQD6IBPOc7YjQK0LNde72mwtSwLq?= =?us-ascii?Q?w2AIapriHoF3JRLiMiKPIPq7?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97c60e7a-267b-470c-d74a-08d9556efc15 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2021 04:35:41.2649 (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: e3dBVYqlmK/vKJp5Cm9R5+pXE+o847c4atZApkzEC7MlKEfldYtvBan03Bkk03J1nLJYhftbtVhZ0ngw76ZsfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3665 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Sunny Wang > Sent: Monday, August 2, 2021 11:16 AM > To: Grzegorz Bernacki ; devel@edk2.groups.io; Wang, > Jian J ; Wu, Hao A > Cc: leif@nuviainc.com; ardb+tianocore@kernel.org; Samer El-Haj-Mahmoud > ; mw@semihalf.com; > upstream@semihalf.com; pete@akeo.ie; Bi, Dandan ; > Dong, Eric ; Gao, Zhichao ; > Sunny Wang ; Ni, Ray > Subject: RE: [PATCH v4 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib. >=20 > Hi Hao, Jian, and MdeModulePkg maintainers, >=20 > Could you help merge this patch? This patch already got Reviewed-by from > Zhichao and me. If we still need to get others' reviews, feel free to let= us > know. Really sorry for the slow response. Pull request created at: https://github.com/tianocore/edk2/pull/1855 By the way, I do not see an explicit 'Reviewed-by' tag from you for this V4= patch, so I will treat the above statement as your 'R-b' tag for this patc= h. Thanks you and Zhichao for the reviewing effort. Best Regards, Hao Wu > By the way, we do have an edk2-platform change below that is waiting for > this patch to get merged first, and will have more patches based on this = to be > sent out to solve some deployment and testing problems caused by Fast > boot on ARM platforms. > - https://edk2.groups.io/g/devel/message/78072 >=20 > Best Regards, > Sunny Wang >=20 > -----Original Message----- > From: Grzegorz Bernacki > Sent: Thursday, July 22, 2021 3:44 PM > To: devel@edk2.groups.io > Cc: leif@nuviainc.com; ardb+tianocore@kernel.org; Samer El-Haj-Mahmoud > ; Sunny Wang > ; mw@semihalf.com; upstream@semihalf.com; > pete@akeo.ie; jian.j.wang@intel.com; hao.a.wu@intel.com; > dandan.bi@intel.com; eric.dong@intel.com; Grzegorz Bernacki > ; Zhichao Gao > Subject: [PATCH v4 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 set= . > Platform code can use this variable to decide which class of device shall= be > connected. >=20 > Signed-off-by: Grzegorz Bernacki > Reviewed-by: Zhichao Gao > --- > MdeModulePkg/MdeModulePkg.dec = | 9 ++ >=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 | 18 +++ >=20 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib > Strings.uni | 29 ++++ >=20 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib > Vfr.Vfr | 44 ++++++ > 7 files changed, 334 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..133e04ee86 > 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 variab= les. > + gBootDiscoveryPolicyMgrFormsetGuid =3D { 0x5b6f7107, 0xbb3c, 0x4660, { > + 0x92, 0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } } > + > [Ppis] > ## Include/Ppi/AtaController.h > gPeiAtaControllerPpiGuid =3D { 0xa45e60d1, 0xc719, 0x44aa, { 0xb= 0, 0x7a, > 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }} > @@ -1600,6 +1603,12 @@ > # @Prompt Console Output Row of Text Setup >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x40 > 00000e >=20 > + ## Specify the Boot Discovery Policy settings # To support > + configuring from setup page, this PCD should be overridden in DynamicHi= i > type in its platform .dsc: > + # > + > gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy|L"BootDiscove > ryP > + olicy"|gBootDiscoveryPolicyMgrFormsetGuid|0 > + # @Prompt Boot Discovery Policy > + > + > 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-463DBD15FE1= 0 > + MODULE_TYPE =3D DXE_DRIVER > + VERSION_STRING =3D 1.0 > + LIBRARY_CLASS =3D NULL|DXE_DRIVER UEFI_APPLICATION > + CONSTRUCTOR =3D BootDiscoveryPolicyUiLibConstructor > + DESTRUCTOR =3D BootDiscoveryPolicyUiLibDestructor > +# > +# The following information is for reference only and not required by th= e > 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); > + } > + > + 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..eea3ca6c8d > --- /dev/null > +++ > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyU > +++ iLib.uni > @@ -0,0 +1,18 @@ > +// /** @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 > IMPORTANT NOTICE: The contents of this email and any attachments are > confidential and may also be privileged. If you are not the intended reci= pient, > please notify the sender immediately and do not disclose the contents to = any > other person, use it for any purpose, or store or copy the information in= any > medium. Thank you.