From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.9009.1625732155387983387 for ; Thu, 08 Jul 2021 01:15:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=w8FwIDbG; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: zhichao.gao@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10038"; a="196640427" X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="196640427" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2021 01:15:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="628414955" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga005.jf.intel.com with ESMTP; 08 Jul 2021 01:15:52 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) 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:15:51 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX609.amr.corp.intel.com (10.22.229.22) 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:15:51 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx604.amr.corp.intel.com (10.22.229.17) 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:15:51 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) by edgegateway.intel.com (134.134.137.102) 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:15:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RxFaA7mRxQHFUwfeQMpM/LZVQMFOQL+wRg2g77xqhjskqnlm9Jl0qZhnJxsr+PAMYKgFu7bshM8Syd7QiXnxmOPIuZKmglQUesSOEZV2hmzXkDYt8kHzhtkVrWytKd8h57StJyCOZaoQoBk7l3qjLdPJIJXm/9ToaZ0k/Z4X8jZvBrqdva+ubjvrzZtrDt9rOcj5ey4cilWL5moFRulyRhs6ipbeiXV/CN+C24J9f7L4K7GuTYe/Vd/hcrac82A8af8iU6TC/Lpofn5FSkxZgjEqtMLzEz5cRjT/6142ZctcWHGcLAUB28lWowLENT9aEKMLKDif1Dw97lOY9XxqkA== 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=+wfeR+8kPIqCECxDWSQgnwXzbPuQd/xOFL3mso32Mc0=; b=cr1Yb1pZ45PieCsUZrnMbX5Grh0yDDHnQ93/SB7tNY5frpC9k6RsfUgjkGwtxHUQszmIBJ7amgJykSFckbshWXET2KUH9sT/33+nCF5TZVloXbYg+YiNzMYMlWelr7uG043LF1UZhs2phGeOxKemgWlNU1dNxWkIMH2D5EuPOId8cL4mabKScDj/HyUcArpUYjHjktWDDY7+jvDlhTT+igrJXmtnq/Kgnbq9s+9nG7314lhQbDPmJzGMURh5AtgkGPsCUG2Oh//QrLkKB5XkTMhI8heQvDRyvmT6/iDWkGl0SpgWLTJ65hOJhHbQ4tSLKoBgXybauzTSwVScxJt7tw== 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=+wfeR+8kPIqCECxDWSQgnwXzbPuQd/xOFL3mso32Mc0=; b=w8FwIDbG8Uxt4WnoPwZFPhQWmLxjFgWrRsjzobp4UCzX+b2xarO67BFfJoCkTJOn4YkseNPYf2V3BiRktBVtqVa0sK7pFlgf/lE+KeBLgtgBNPXBI628xR/ezp54x4et6ickMMOXSdcph1syNC6wdayaf4LqcLdN0VDR0MHSfs8= Received: from DM4PR11MB5277.namprd11.prod.outlook.com (2603:10b6:5:388::23) by DM6PR11MB3514.namprd11.prod.outlook.com (2603:10b6:5:61::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20; Thu, 8 Jul 2021 08:15:49 +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:15:49 +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] [edk2-platforms PATCH v2 1/2] Platform/RaspberryPi: Enable Boot Discovery Policy. Thread-Topic: [edk2-devel] [edk2-platforms PATCH v2 1/2] Platform/RaspberryPi: Enable Boot Discovery Policy. Thread-Index: AQHXclQe0cOAG/ugukanQtVeyFZq8as4vBfg Date: Thu, 8 Jul 2021 08:15:49 +0000 Message-ID: References: <20210706104432.1239133-1-gjb@semihalf.com> <20210706104432.1239133-3-gjb@semihalf.com> In-Reply-To: <20210706104432.1239133-3-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: e0fa6db4-5951-4d2e-7854-08d941e89898 x-ms-traffictypediagnostic: DM6PR11MB3514: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mQd1urVbDgk+nZHYcQuDL8uLCTpjl7ljEAG2eJUk9YAcL8Tygv6geUUdXaDsn6IGLwtlilRJHyaULOJ5ob7CGKvasgJ2hgbPVlf7nylvWHq6Sn/YKUenvYTFSuiD9d3A5y0K0Rv2k3akVLHKSfnCtBg1EnIxg+ePV3HmTIpj6pkd1m4llDK6QlyXp6eIrRz0rKfNJuGbyuVpy0EfIZbsHylbfl8IayX02ZWDZGStk3e2h5VaSpGPXKaefvP/V3v7llOZPEzjPltnA6fhr6SVRz98H7BbybGfOeEnslh57D53fan6Py4MywPEQiQ8UjBZD10EGvC81FqiWEGIGQXw6FcDigS26183q4wNJm4rhz0+TZCCx0PHirHSDnUtrAooPxCCbjf9bhfRR6MP9N1VsIIt4XYGA3H2s0KGgum7oeRPjeQ3ow/F4B5r7cFxg6tORy2R8bH9ef5VER8B26jSYFztTQxz5FimS0JBHRvnrNjoVT5Zp5OAvzsKiJ+NJyxFkVs8LJv8Ej9BIXhkCOE+KY0qKI5Gep8qszuhLLWHI40Ndj1Ls40ksi+9KTfFKXosP+r3vYVr5oiB/p5zkWKxBg9qpZ+p4q53ZXCJHmxqAekMQCzW0efXb68EFBV89wFCOS3mKpGiGekDl1LVCPEKU3CaKvnr53rS5D8s0lKcPKcNIwdygiuw8ZH/CqGKmiIYlQN+wqTLPdYBwIbTaVrtjlMbDxjttEZQ3K8JF84bW17d1l7Z/pFdd5W+jhG8x7fHPAgl9uo5S5MFz4SQBuu/wA== 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:(346002)(376002)(136003)(366004)(39860400002)(396003)(122000001)(38100700002)(966005)(86362001)(478600001)(19627235002)(9686003)(107886003)(52536014)(83380400001)(55016002)(7696005)(64756008)(66446008)(8676002)(66476007)(66556008)(53546011)(66946007)(26005)(76116006)(8936002)(6506007)(110136005)(54906003)(186003)(2906002)(316002)(71200400001)(4326008)(5660300002)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?coo4EcBy+b+0f4iV3tGxHj+xKxLtzewN/0hqFQ31c1sPu3s1485o89KbcLY2?= =?us-ascii?Q?jtD55ournWBx4WgzHPnKH1Bx3K0RCkLmSdxtLIzYtuqQim2ITNaPzyV3FSoQ?= =?us-ascii?Q?qLHmweKE21yrwLSnfe2+81xKhiyQj90vHMaHJjoUiD6sXw9XMJ/aSMcJ3kb9?= =?us-ascii?Q?UBK2QWQ/kWmVcp5qHwLMC82Ciadh69+w+c397MMw7sOSUr8QZH7xW9MsASg6?= =?us-ascii?Q?9Kkb9eywvx1zmclS4HI+x12ojtCSW8EuIHJn9p6mE+IFGHy3AMBZXIGVsqRK?= =?us-ascii?Q?2bP0aRTfeTDEpJHGJdtwUsxcWkfAONOEIQ3gJI9R0W/bfV8GtcXorHNEImgt?= =?us-ascii?Q?7kw8d7mVcxe9JlIhMu8yw5YsC9DagsfM7AnRW7pvSjR7+3BpOjI+KhWbD9Si?= =?us-ascii?Q?FtxV9DrPyqirjrBnajSx3xC4LhhPMEcSG9eRfIyDLAXIRoSLxsxYQ3Qpt23L?= =?us-ascii?Q?pszypYgz8rdB01PGUj0+Z9c2PL2EoyTKPMObgljhIF7CyCeTjkOUTAkQPcMC?= =?us-ascii?Q?e7LvvdDnbw4PuHTBkUgwSUYk9MC2NEO699+eQbChU0KGX4C8EVjLD6HGFsrz?= =?us-ascii?Q?zKsi0ubepbuIVC6JD8l0loE/GwaSeXJbEoJEXhreCRAmbu8FRls7BdnzOE4Q?= =?us-ascii?Q?0tXKZjFozkJIifkc3f2FZiKaDzbKHYOlraZ2HeiMTPirzlPFpOVR3Wt+W8A4?= =?us-ascii?Q?H1y4fj+qcHdpiASTs0lcGKspn2r5E2dTpGwAXLGTjeQ2nWz+vlCgbRFZ6/Cd?= =?us-ascii?Q?1Z/k6Gq+wRM9hmQmZ5T4ToxOnJsWaj+bE8n3aLHA1fMsHM9zMj+BOwXaQHHJ?= =?us-ascii?Q?3nfzM3FWD9VSfYI0aYVROXi4BStDkLpJVxLdHp6+uUoERC9dwDTgqTygzMVn?= =?us-ascii?Q?8MqHS4+naKCLyLRJBx39xVo1tJLTtMY6M4E1PnGS0n5/Boc0iZQYCt1DovsF?= =?us-ascii?Q?u5jObsqxC18r9ho7Rm8UYrsGz4izC98AH40Hs0wjxUtKB3Umudxat01JJbFz?= =?us-ascii?Q?No9ovx0bZ0xc17yk5ucsJFuxFTaR5Yk+KxPChd9mkjFQNohUrqTcMiazrA0p?= =?us-ascii?Q?wcDFLkWuxpX+IFaLO2UfZNKhFBg924b/V2WG1JLn8THXOIg02SMz9RO33/9W?= =?us-ascii?Q?Blj7NevefV7okt82ZtJi2e/emqyl5uAaUoihhHPgzceYREvcIMNYoQt9rtZ4?= =?us-ascii?Q?4I8PPMDOjnVkcJIGgbjtv7Zmxh6XwpJa5Ds8lmih15plIBqPCdw5GUvlJvNK?= =?us-ascii?Q?rY1s1L5tMiU7f9VzC6vhg5j/wdFTjQDSFb1L1xhPLg1bJac6/ab7CyaufvFA?= =?us-ascii?Q?aT8GtVGH8YRpcXqMypyR+L4z?= 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: e0fa6db4-5951-4d2e-7854-08d941e89898 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2021 08:15:49.6867 (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: 7zAp+vnl+DMhhPZT8FdQbf7O4Os4my7gaGx0NXy5heIBmo+ThS11U0JzCAYUNACEOpdaWEbcQyigjrNaCT5XlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3514 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] [edk2-platforms PATCH v2 1/2] Platform/RaspberryPi= : > Enable Boot Discovery Policy. >=20 > This commit modify platform boot to check the value of BootDiscoveryPoli= cy > variable and use BootPolicyManager Protocol to connect devices specified= by > the variable. >=20 > Signed-off-by: Grzegorz Bernacki > Reviewed-by: Sunny Wang > --- > Platform/RaspberryPi/RPi4/RPi4.dsc = | 3 + > Platform/RaspberryPi/RPi4/RPi4.fdf = | 1 + >=20 > Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManag > erLib.inf | 5 ++ > Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > | 90 ++++++++++++++++++++ > 4 files changed, 99 insertions(+) >=20 > diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc > b/Platform/RaspberryPi/RPi4/RPi4.dsc > index fd73c4d14b..8b9beac64a 100644 > --- a/Platform/RaspberryPi/RPi4/RPi4.dsc > +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc > @@ -555,6 +555,7 @@ >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|L"Columns"|gRasp > berryPiTokenSpaceGuid|0x0|80 >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|L"Rows"|gRaspb > erryPiTokenSpaceGuid|0x0|25 >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|L"Rows"|gRaspberryPi > TokenSpaceGuid|0x0|25 > + > + > gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy|L"BootDiscove > ryP > + olicy"|gBootDiscoveryPolicyMgrFormsetGuid|0 >=20 > [PcdsDynamicDefault.common] > # > @@ -682,6 +683,7 @@ > # > # Bds > # > + > MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.i > nf > MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf > MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf > MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf > @@ -690,6 +692,7 @@ > Platform/RaspberryPi/Drivers/LogoDxe/LogoDxe.inf > MdeModulePkg/Application/UiApp/UiApp.inf { > > + > + > NULL|MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolic > y > + UiLib.inf >=20 > NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf > NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf >=20 > NULL|Platform/RaspberryPi/Library/PlatformUiAppLib/PlatformUiAppLib.inf > diff --git a/Platform/RaspberryPi/RPi4/RPi4.fdf > b/Platform/RaspberryPi/RPi4/RPi4.fdf > index 1e13909a57..371197a93e 100644 > --- a/Platform/RaspberryPi/RPi4/RPi4.fdf > +++ b/Platform/RaspberryPi/RPi4/RPi4.fdf > @@ -253,6 +253,7 @@ READ_LOCK_STATUS =3D TRUE > # > # Bds > # > + INF > + > MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.i > nf > INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf > INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf > INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf > diff --git > a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootMan > agerLib.inf > b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootMan > agerLib.inf > index fbf510ab96..4ef2f791ae 100644 > --- > a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootMan > agerLib.inf > +++ > b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootMa > +++ nagerLib.inf > @@ -61,11 +61,13 @@ > gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType >=20 > [Pcd] > + gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy > gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut > gRaspberryPiTokenSpaceGuid.PcdSdIsArasan > gRaspberryPiTokenSpaceGuid.PcdBootPolicy >=20 > [Guids] > + gBootDiscoveryPolicyMgrFormsetGuid > gEfiFileInfoGuid > gEfiFileSystemInfoGuid > gEfiFileSystemVolumeLabelInfoIdGuid > @@ -73,8 +75,11 @@ > gEfiTtyTermGuid > gUefiShellFileGuid > gEfiEventExitBootServicesGuid > + gEfiBootManagerPolicyNetworkGuid > + gEfiBootManagerPolicyConnectAllGuid >=20 > [Protocols] > + gEfiBootManagerPolicyProtocolGuid > gEfiDevicePathProtocolGuid > gEfiGraphicsOutputProtocolGuid > gEfiLoadedImageProtocolGuid > diff --git > a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > index d081fdae63..4bfa906921 100644 > --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > @@ -6,6 +6,7 @@ > * Copyright (c) 2015-2016, Red Hat, Inc. > * Copyright (c) 2014-2021, ARM Ltd. All rights reserved. > * Copyright (c) 2004-2016, Intel Corporation. All rights reserved. > + * Copyright (c) 2021, Semihalf All rights reserved. > * > * SPDX-License-Identifier: BSD-2-Clause-Patent > * > @@ -19,10 +20,12 @@ > #include #include > #include > +#include > #include > #include > #include > #include > +#include > #include > #include > #include > @@ -598,6 +601,88 @@ PlatformBootManagerBeforeConsole ( > FilterAndProcess (&gEfiUsb2HcProtocolGuid, NULL, Connect); } >=20 > +/** > + Connect device specified by BootDiscoverPolicy variable and refresh > + Boot order for newly discovered boot device. > + > + @retval EFI_SUCCESS Devices connected succesfully or connection > + not required. > + @retval others Return values from GetVariable(), LocateProtoco= l() > + and ConnectDeviceClass(). > +--*/ > +STATIC > +EFI_STATUS > +BootDiscoveryPolicyHandler ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + UINT32 DiscoveryPolicy; > + UINTN Size; > + EFI_BOOT_MANAGER_POLICY_PROTOCOL *BMPolicy; > + EFI_GUID *Class; > + > + Size =3D sizeof (DiscoveryPolicy); > + Status =3D gRT->GetVariable ( > + BOOT_DISCOVERY_POLICY_VAR, > + &gBootDiscoveryPolicyMgrFormsetGuid, > + NULL, > + &Size, > + &DiscoveryPolicy > + ); > + if (Status =3D=3D EFI_NOT_FOUND) { > + Status =3D PcdSet32S (PcdBootDiscoveryPolicy, PcdGet32 > (PcdBootDiscoveryPolicy)); Why need this Pcd statement? > + if (Status =3D=3D EFI_NOT_FOUND) { > + return EFI_SUCCESS; > + } else if (EFI_ERROR (Status)) { > + return Status; > + } > + } else if (EFI_ERROR (Status)) { > + return Status; > + } > + > + if (DiscoveryPolicy =3D=3D BDP_CONNECT_MINIMAL) { If the Status is EFI_NOT_FOUND at GetVariable, then the above DiscoveryPol= icy is uninitialized. Maybe you need to use the Pcd value if GetVariable failed. Thanks, Zhichao > + return EFI_SUCCESS; > + } > + > + switch (DiscoveryPolicy) { > + case BDP_CONNECT_NET: > + Class =3D &gEfiBootManagerPolicyNetworkGuid; > + break; > + case BDP_CONNECT_ALL: > + Class =3D &gEfiBootManagerPolicyConnectAllGuid; > + break; > + default: > + DEBUG (( > + DEBUG_INFO, > + "%a - Unexpected DiscoveryPolicy (0x%x). Run Minimal Discovery > Policy\n", > + __FUNCTION__, > + DiscoveryPolicy > + )); > + return EFI_SUCCESS; > + } > + > + Status =3D gBS->LocateProtocol ( > + &gEfiBootManagerPolicyProtocolGuid, > + NULL, > + (VOID **)&BMPolicy > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a - Failed to locate > gEfiBootManagerPolicyProtocolGuid - %r\n", __FUNCTION__, Status)); > + return Status; > + } > + > + Status =3D BMPolicy->ConnectDeviceClass (BMPolicy, Class); if > + (EFI_ERROR (Status)){ > + DEBUG ((DEBUG_ERROR, "%a - ConnectDeviceClass returns - %r\n", > __FUNCTION__, Status)); > + return Status; > + } > + > + EfiBootManagerRefreshAllBootOption(); > + > + return EFI_SUCCESS; > +} > + > /** > Do the platform specific action after the console is ready > Possible things that can be done in PlatformBootManagerAfterConsole: > @@ -644,6 +729,11 @@ PlatformBootManagerAfterConsole ( > DEBUG ((DEBUG_INFO, "Boot Policy is Fast Boot. Skip connecting all > devices\n")); > } >=20 > + Status =3D BootDiscoveryPolicyHandler (); if (EFI_ERROR(Status)) { > + DEBUG ((DEBUG_INFO, "Error applying Boot Discovery Policy:%r\n", > + Status)); } > + > Status =3D gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL, > (VOID**)&EsrtManagement); > if (!EFI_ERROR (Status)) { > EsrtManagement->SyncEsrtFmp (); > -- > 2.25.1 >=20 >=20 >=20 >=20 >=20