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.web12.2644.1627948889034778250 for ; Mon, 02 Aug 2021 17:01:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=dmgko8A+; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: hao.a.wu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10064"; a="193837340" X-IronPort-AV: E=Sophos;i="5.84,290,1620716400"; d="scan'208";a="193837340" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2021 17:01:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,290,1620716400"; d="scan'208";a="669554614" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga005.fm.intel.com with ESMTP; 02 Aug 2021 17:01:27 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Mon, 2 Aug 2021 17:01:27 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Mon, 2 Aug 2021 17:01:26 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Mon, 2 Aug 2021 17:01:26 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.177) 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.2242.10; Mon, 2 Aug 2021 17:01:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RwT+KieqfCtMVMELDwWqeWucuhX62ljAu/NbnND2lvAJL5XWksBaWoUSnvZzusEvBxhSsTcRJVAy9sWn3OudsRc/u++gSFI/AvaxDbWDCagx+a23BnrD0Xe9o6HZ1Ur1oZQTfHeiDzF12lg7vKIPqxSYsfTgDFCo8z8WWEd2Ghn461qQ907m6kKy0Sxvx6Du7SZQdUW8Uagv3j0yygxA4LzGJOCfs+ysFk2kwDnrIaTyviQt8tjHIv75R0xuZHilplVgPTR1CI7qYl724Qlm3gXQcRoZj8MciYvTxewVV6Ao0ag9kdynApizgrfzJ4gLwvMCbvN+7GSQPtOugklsTA== 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=Mp70mV/vzIojeK0EAENvrM9LyB2tbL1b7mZ+IzERyD4=; b=InsYEz4OHL7+HLBKT3lcC8gPXCBUMYJxEL9aOSx6c45nlKG6u/JP/6e5RpV7SVwsi+B1j/2af0M4orAF5et8xSccCud0mvrZ+GPHPSSv2Gn8UFmrrhlRLAcvgWi1tK1rXyQJIANSSN9JIVyTUruGeV17Tghrg9E275F8LHmlUkcBVISSNgh7vquevoKsvNuHMLOWY0WVKeiQzzTGnArIxR3VwIv0zXwNULVpzJH5Sq+V/ttgQqre5zqaF3NDPUUq3m2iGvxvbYb/pLV4HUBTs4UEWvTHcFwO8ywTwAX5mF7vkH0OPvhiNJrrcYjFdZN29NNtL1opGgN+4D4Q2mPGgw== 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=Mp70mV/vzIojeK0EAENvrM9LyB2tbL1b7mZ+IzERyD4=; b=dmgko8A+wdMU5eKd9qXk8rVIMIsu9704+HeA8e/KRDbCN+fH24Lc+Tx7mezQpmNu6b8QnBU6qq0frgRBtIim23oXPyjPms6AzSvCqTgKJSAsKLkTDtZenuG0rwa4pmh/Wdb/9ua/DguXUPLZhNOst86IERFYygNHHNL2DXt0vIc= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR1101MB2161.namprd11.prod.outlook.com (2603:10b6:405:52::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.25; Tue, 3 Aug 2021 00:01:24 +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; Tue, 3 Aug 2021 00:01:24 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "gjb@semihalf.com" , "Gao, Zhichao" , "sunny.Wang@arm.com" CC: "leif@nuviainc.com" , "ardb+tianocore@kernel.org" , "Samer.El-Haj-Mahmoud@arm.com" , "mw@semihalf.com" , "upstream@semihalf.com" , "pete@akeo.ie" , "Wang, Jian J" , "Bi, Dandan" , "Dong, Eric" Subject: Re: [edk2-devel] [PATCH v5 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib. Thread-Topic: [edk2-devel] [PATCH v5 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib. Thread-Index: AQHXh5iX1MKuxKMPS0+4eHjOFZaBiatg4aGg Date: Tue, 3 Aug 2021 00:01:24 +0000 Message-ID: References: <20210802121837.2913575-1-gjb@semihalf.com> <20210802121837.2913575-2-gjb@semihalf.com> In-Reply-To: <20210802121837.2913575-2-gjb@semihalf.com> 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: 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: 057484e5-85b5-4548-ce84-08d95611d5ad x-ms-traffictypediagnostic: BN6PR1101MB2161: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rf0Fe5kith8dc6avlFClJwRW2W35Pg0osFFjE4e/qAtoax4pA8wMxfPBz/2JyqH3Rf/V5zRSe+iTWC5iaLIihJRmUh1gKiimNGuA/fEZpLIqf3ibLiSL4El1GRqIj9KK0NorezFK+xi7mqrJ5D+I6bIo5DqK6cz2mOrdEqJKpai4D9zDVn4DGaetHyGhXo17v3D+dl7an7QodA17artkj6Eo2XrlMNZ+j9LsWL35BcPAr8tHB9LN0eS2xKZ5mPDq5HtFlBp8xj7nyVl07CIRD7QsWVKWmzSZpVjaudiFq4DkhUJY2RNhX+itfqA0a4cCrfpB9os+3Ga8oykjVwPptxQNUUCtariEfz4pe4wHhKlKr/82NURX9wK+tqGZ5VEqQ66oee2Jb3vjFEIyhiuPgYMw2L4SldE9bDSQzbeeH6FsVvxjg8s8AW8/TJwgD+pC3NiZd6yj4zjOk3JrpRn4M5S0gcriMI/W0gKbMk8FRjUf0ta58x7QSS1cyfuvGDDNBCn5GaiQuskZ8TXv5lqCzKpoxnszYb5JwvBI2fL8O7pHbsGqrVcBgt9wC0hRyY+kzAkuhF1Nm1gmBhDx9+G00/pCQdLdhhlATND18CUz6i+eX7kVX12RUdTHOpHUGCAyfCSbuGr71buPGAsLmKsqWVACM8Pv9IHHYKsNXO4q6r5W9jPFyaEbMlO/qWe5GmztYeGILGA5wcLt9WkBMa4MvJmjuuPIlBjV5Yf7cjl+/2so5OBnDFudRx4K/Sw+Y7PSumUpi+gT8zz0OT+37nD544QXC5xW1Dl61vvlhD8uBR9kiw7hmtz0LcCdebzIFeE1ZjjplhBh0RystXk/x0AgVILkX10hHiwd6RowyGvfBxI= 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)(346002)(366004)(39860400002)(376002)(136003)(396003)(2906002)(30864003)(186003)(107886003)(8676002)(7696005)(9686003)(6506007)(53546011)(26005)(71200400001)(4326008)(8936002)(966005)(55016002)(478600001)(33656002)(122000001)(38100700002)(64756008)(66446008)(316002)(66476007)(66556008)(66946007)(76116006)(83380400001)(110136005)(54906003)(86362001)(38070700005)(5660300002)(52536014)(44824005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?isGkcEjCWfcb7fXesuckhcPot9d6unRZkEazO/NmEDX7ze6+l5rhEB0H2ztu?= =?us-ascii?Q?V9y0K+gxolg5E+wbfM3wVwBiCkZE0BvI+2kzk0PJmf99OGa9BTMnEVw4wueC?= =?us-ascii?Q?GVZnPdqCaz2/ptVm1lk6qgmM+Enwj/09vjsItBrroXG/oOsyzWINLhbbd8pM?= =?us-ascii?Q?vCvtiKOsS2Qb4X22s7qnS/O2V5X619UHw72d8cAUd5DeDiQyrAFZDaXpww9p?= =?us-ascii?Q?nvn3pOpX7YIF38GTrWrgbOhCgmh6aZ8t5Et9xsUqA4BCKjfj+N9hS+a+HmC1?= =?us-ascii?Q?BKX/EdENfSlnY9fmivvFkoetV+G2L2t4rl7cC4ZO6OGFdd5RBCD6UvpTCWNE?= =?us-ascii?Q?RH5JfrHxtJBgGBLThQpGkFfyGiVnyZtHjrp4RyAE4uDt+Ya+W1Sibc7M8tG3?= =?us-ascii?Q?8Sm1uj2xV39k3AjjGhd9bKPi8rz6NKga6TL6+rWkVlKcjKUF8V0f8NcA6zta?= =?us-ascii?Q?odMGtZIfLBKixOLBUDEcwIm6MsnWMaFdzicAq3eQHe572/oSZJ8AJ/0J6Lq3?= =?us-ascii?Q?Pt7i6hbdlvbUdCsg6HyQggX2gmTz3g8dOa+fnVO+ZlfqNCnS2mSOg8A3tq8N?= =?us-ascii?Q?oYHfAIWD+MyLrh7pq7jCKmI9nEiTn5sO0AyCa2hI8LfMs3LJqzY03QRHOP9f?= =?us-ascii?Q?B5Ym/9BnlIDFjH21Ira25O0GDEIsn3JrqZ9CYyotSKeaM2ijz6sCeUAHAp/b?= =?us-ascii?Q?eJ6OTxON8hoBX8ESd5BZUprSf+xe9EQ6V9r2+o7CVBzgWZNIsFMT5H6pePu6?= =?us-ascii?Q?iL/02e0f6MQY0JSZvg/KrzOSVeqSpWeD+jYjXxbGzZhff6dxxejh5h8Fps0d?= =?us-ascii?Q?pkUwZ8AVZ+aViDJ3nH5+J8VqaVnyYtWdktLHsfgLgJi0xO8J9NrcrhjRqMaE?= =?us-ascii?Q?VuYy8qEGbfY80EPtNvBRUFZkDIEHjXMY7obBRJAyZRz+z5KJ/paNr1GeGocu?= =?us-ascii?Q?Z2mKnMvk+qEoh9CHOmgUYccn9nZDzoW80RinPLMi5IngCD5XR/7mPTN5ABtr?= =?us-ascii?Q?3xdZ+fMn6afmCgdgGjGdtxiZgQh+G9Gu/bYAYjM/irApmDZ2bWuEsFeygQON?= =?us-ascii?Q?Tu+cTctnBmeV/YLeP74otlMn42vZaSOO+4i43/T7S7KD60igP51H1xJrZxpx?= =?us-ascii?Q?CZyyBETWW/tEsBhhTzB7hhBePcxqkHFavxBtBEH5Lqwg3MunodJ3QKKHwHvz?= =?us-ascii?Q?GvTPOdoyDjJefRdy3NTDz/7Kpcqd+DLMSlQV2utPIeTJV/JfVMgrWkPQAgmS?= =?us-ascii?Q?OoB0VoJft4JTT1E9xz5TCPGYaAzaxVQC7Lok360H/AC4yJd9y8gru0cCPoUe?= =?us-ascii?Q?bWRIDlUSjektrm0o34E5a+EW?= 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: 057484e5-85b5-4548-ce84-08d95611d5ad X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Aug 2021 00:01:24.7117 (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: Hm5wtqw0S2/itNVRLBjPvvCfz+jfMS5191jYBVTcJMvzupUbnErWx8HqDAJjyLFTcJHzjEDlIIB4AobWzsDW6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2161 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 Thanks Greg, the new patch pass all the merging tests: https://github.com/t= ianocore/edk2/pull/1858. Hello Zhichao and Sunny Wang, Do you have comments for this new version of the patch? If not, I will kee= p your 'R-b' tags from V4. Thanks in advance. Best Regards, Hao Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Grzegorz > Bernacki > Sent: Monday, August 2, 2021 8:19 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 ; Gao, > Zhichao > Subject: [edk2-devel] [PATCH v5 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: Zhichao Gao > --- > MdeModulePkg/MdeModulePkg.dec = | 9 ++ > MdeModulePkg/MdeModulePkg.dsc = | 2 + > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.= inf > | 52 +++++++ > MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h = | 22 > +++ > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.= c > | 160 ++++++++++++++++++++ >=20 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.u= ni > | 18 +++ >=20 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibSt= ri > ngs.uni | 29 ++++ >=20 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibVf= r. > Vfr | 44 ++++++ > 8 files changed, 336 insertions(+) > create mode 100644 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.i= nf > create mode 100644 MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h > create mode 100644 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.c > create mode 100644 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.u= ni > create mode 100644 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibSt= ri > ngs.uni > create mode 100644 > MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibVf= r. > 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 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,12 @@ > # @Prompt Console Output Row of Text Setup >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x40000 > 00e >=20 > + ## Specify the Boot Discovery Policy settings # To support > + configuring from setup page, this PCD should be overridden in DynamicH= ii type > in its platform .dsc: > + # > + > gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy|L"BootDiscoveryP > + olicy"|gBootDiscoveryPolicyMgrFormsetGuid|0 > + # @Prompt Boot Discovery Policy > + > + > gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy|2|UINT32|0x4000 > 0 > + 00f > + > [PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.AARCH64] >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20|UINT3 > 2|0x0001004c >=20 > diff --git a/MdeModulePkg/MdeModulePkg.dsc > b/MdeModulePkg/MdeModulePkg.dsc index 132fb36d95..b1d8346186 100644 > --- a/MdeModulePkg/MdeModulePkg.dsc > +++ b/MdeModulePkg/MdeModulePkg.dsc > @@ -220,6 +220,7 @@ > MdeModulePkg/Logo/Logo.inf > MdeModulePkg/Logo/LogoDxe.inf > MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf > + > + MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib > + .inf >=20 > MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceMan > agerUiLib.inf > MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf > MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf > @@ -341,6 +342,7 @@ > MdeModulePkg/Application/UiApp/UiApp.inf{ > >=20 > NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf > + > + NULL|MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicy > + UiLib.inf > NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf >=20 > NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenan > ceManagerUiLib.inf > } > diff --git > a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib= .i > nf > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib= .i > nf > 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..06e38921a0 > --- /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/BootDiscoveryPolicyUiLib= . > c > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib= . > c > new file mode 100644 > index 0000000000..615958799c > --- /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 UINT8 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/BootDiscoveryPolicyUiLib= . > uni > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib= . > 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/BootDiscoveryPolicyUiLib= S > trings.uni > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib= S > trings.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 Networ= k > Devices" > + > +#string STR_FORM_BDP_CONN_ALL #language en-US "Connect All > Devices" > + > diff --git > a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib= V > fr.Vfr > b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib= V > fr.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