From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (EUR01-VE1-obe.outbound.protection.outlook.com [40.107.14.78]) by mx.groups.io with SMTP id smtpd.web09.59744.1629315838163041604 for ; Wed, 18 Aug 2021 12:43:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=hsalcWkT; spf=pass (domain: arm.com, ip: 40.107.14.78, mailfrom: samer.el-haj-mahmoud@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fh8ojoQ/DW/cQbiutYRrqHhUM9zdjeKtPevbMMHTq6c=; b=hsalcWkTso0KpWp75mvj0fdk60UFmTbA8d0EVwW3yCUa28whS7h7jt5zZK8xPwQFvJfzfuiYtCKlSL77HFVp7ffGQuyGzv4zOYZnq0bMGmzl3wZkMYo3MfZaX+3S69wh7y3i4Gyu4yAaLg+PKIleGLgN4uyRuv/BIpdFM7hPq7E= Received: from AM5PR04CA0023.eurprd04.prod.outlook.com (2603:10a6:206:1::36) by DB7PR08MB3019.eurprd08.prod.outlook.com (2603:10a6:5:24::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Wed, 18 Aug 2021 19:43:55 +0000 Received: from AM5EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:1:cafe::dd) by AM5PR04CA0023.outlook.office365.com (2603:10a6:206:1::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Wed, 18 Aug 2021 19:43:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT006.mail.protection.outlook.com (10.152.16.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Wed, 18 Aug 2021 19:43:53 +0000 Received: ("Tessian outbound 6ba9ec11d42b:v103"); Wed, 18 Aug 2021 19:43:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: adf5ef751fa4c5dc X-CR-MTA-TID: 64aa7808 Received: from 0581d0a0648f.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A717983B-2C17-4DA3-AD94-9BB989C39899.1; Wed, 18 Aug 2021 19:43:47 +0000 Received: from FRA01-MR2-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0581d0a0648f.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 18 Aug 2021 19:43:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XZru3mpTj4uC8SMxRqNDygUADGPNF81Y2q77ciLHFDzjt1KlWQCRNSws85hIfnO5g3sPbPOmG7nqQl+oENDMZ2rR6y64LTkodqnyZndTqmiCJ9n2vsPEMpfgFeX2rauwQyi93RBn1lAXqhN3HTdHRoOwV/rqPsNlF/r8v9cQ7sFfbPaOeb30zBH0Z4lexqX/etIaCkRm57p6uuo/H3tNqGQQPUtPt09whiAJDtKFPOTK1WIsBW18/YMBa89pd1muploPMG5htN3/ovh9c05CutaPJRCt3am+8AjzDH39QyOcrN+XMK1CkUf2eEFxetFsY8Max1dLqVGmLkO7DqvAuw== 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=fh8ojoQ/DW/cQbiutYRrqHhUM9zdjeKtPevbMMHTq6c=; b=PHozZd9hl66u+do9RQW+fhbejksJgi85BwNejg6Gix9/xe4ZfcUIVecr3cmi6docDUqZD38/FkDLvlMQLYEXQaWbYPzYk7U7rHUj7bpuER3TGWybmCZ4lVfP8l8O53VZYAxshTqPHoDO6lvLavo8ia+seqT+VdqG68ffvcplaLd+BEnl8fnjm46nU95/ZV0/o22+Hxz+37OHs41goUnsd4HO9OqoZoSv+lxca1cgjgqA5jOmXR/HeDvZFwx06XkcumfjlVQMBhSw3Wsczb4dmW7KGf+aoRs9xaPmmg2AmH0VoRGTefC9GxXNtQ/dm8OE7Ja+R+5zdNteWb750zVw6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fh8ojoQ/DW/cQbiutYRrqHhUM9zdjeKtPevbMMHTq6c=; b=hsalcWkTso0KpWp75mvj0fdk60UFmTbA8d0EVwW3yCUa28whS7h7jt5zZK8xPwQFvJfzfuiYtCKlSL77HFVp7ffGQuyGzv4zOYZnq0bMGmzl3wZkMYo3MfZaX+3S69wh7y3i4Gyu4yAaLg+PKIleGLgN4uyRuv/BIpdFM7hPq7E= Received: from PAXPR08MB6987.eurprd08.prod.outlook.com (2603:10a6:102:1df::15) by PR2PR08MB4779.eurprd08.prod.outlook.com (2603:10a6:101:1e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Wed, 18 Aug 2021 19:43:41 +0000 Received: from PAXPR08MB6987.eurprd08.prod.outlook.com ([fe80::8888:874d:364:7237]) by PAXPR08MB6987.eurprd08.prod.outlook.com ([fe80::8888:874d:364:7237%5]) with mapi id 15.20.4415.024; Wed, 18 Aug 2021 19:43:41 +0000 From: "Samer El-Haj-Mahmoud" To: Grzegorz Bernacki , "devel@edk2.groups.io" CC: "leif@nuviainc.com" , "ardb+tianocore@kernel.org" , Sunny Wang , "mw@semihalf.com" , "upstream@semihalf.com" , Sami Mujawar , Samer El-Haj-Mahmoud Subject: Re: [edk2-platforms PATCH v2] ArmPkg: Enable boot discovery policy for ARM package. Thread-Topic: [edk2-platforms PATCH v2] ArmPkg: Enable boot discovery policy for ARM package. Thread-Index: AQHXkob6PWJj9CjiqUuCApcY3PC2qKt5rZNQ Date: Wed, 18 Aug 2021 19:43:41 +0000 Message-ID: References: <20210816100927.3548826-1-gjb@semihalf.com> In-Reply-To: <20210816100927.3548826-1-gjb@semihalf.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: semihalf.com; dkim=none (message not signed) header.d=none;semihalf.com; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: c6cfb6b9-ac8c-4d8a-9918-08d9628082d5 x-ms-traffictypediagnostic: PR2PR08MB4779:|DB7PR08MB3019: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:2043;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: i9CQK2DJB/K78wiI08TtiWlNivUzz4uenfS7ZBsdxGCoYp34QjLR9ZT9VtRJCCrDSmgkFleg2sU7ahOZkMUJjBqCAtX6huxLYj/XQiyMISimInhREpU2ex4aH4ysXBENrNNLqLSLvd6vSG9bm1zaME4XegwN4zEbGiPF1d7RqMoaL5OlUFq/hAaB2cy8eFoE2W0lX1FBQgtOdye2xB3e4NXeFqtEMG3yayOwFWAeVavUJheT0rPG3MA6ZV/KLMM+dcFG74wh3FZi9phDSxptlKOSTaoVqSkjUbzHZqKDUuI+tDAIJH3oO6lw2dgFfodI7VBspYvewfPCPvOIXpSqdUJHFGsVqOxMS7d6go5VDStJqAUz38hJVkKM/ifSGj365IWlnjL5PHOvsSGZ6MgVDKU5dCdCWjkIDEhEGqpWY5mk/Yl2dbVAqiUSNUmCabg+KxFjryTVsQ5+8MNiF5fxTAkMZILnS6WLZ1wZsatadxc86cA/2IRioKtJ79iJkfjwAcY52LvTvQhI7ACdsnXI0DJJBN55sqvISHqc1HckwIt993eYxGn4Cn113PhCsSvCCsKa5W41IogOnpMxjrAARViJS6GlxCQOuKiASJb9dQ9yY4WwzBfcLc9HhFtC1W4vYNM7VKybYiXV8UBhYR29RGI6sc5f/EEnUM1FjeVWrP3tgEAy/VJhBwOgSwq/1CBsqYsetkgKnNRfp+D7Do0oZg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6987.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(8936002)(8676002)(316002)(2906002)(83380400001)(33656002)(86362001)(38100700002)(122000001)(53546011)(6506007)(54906003)(71200400001)(5660300002)(4326008)(110136005)(55016002)(52536014)(7696005)(508600001)(66946007)(76116006)(186003)(64756008)(66446008)(66476007)(66556008)(38070700005)(9686003)(26005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?QMDqIjJJPOIR/8I8ezJuNjG/CKQUpY1LP0IhWDzK9eG9u0MYaCT3W5XStIR5?= =?us-ascii?Q?RiWL0FO0LU1xhybmHpwcyDjkdDBOv2tcUO0MNiXQJ+9Cmd6Tx/g5FPirP7tc?= =?us-ascii?Q?eXD7A1fFkA3SW0jREpRYsm1rORkdVq5J4+J57/erjZc/hzcdBSxijuzttYuW?= =?us-ascii?Q?jwpKPwOZKjBFc6MDLBHM5Rj6yKgswn4lK6Edxr1g0jiyWFHYG45ae94Ekv/K?= =?us-ascii?Q?wdvnxOUrDJYEDUVKfVsdcxxiZELdZ5Dnw7fvYhoFUtpX3TjibamcEySJ3OCk?= =?us-ascii?Q?1q1FWfOx/N6SR92484AQ0AIqX+0t8PhzghdjkUJjeN19HWcEmCQsiEwZegNE?= =?us-ascii?Q?1/zk85NxlmHe33eLwQgerVi2oAEbp0Oo7Z29GOwpBkk0OtJuKRezOonlu50s?= =?us-ascii?Q?GmbwsJX/Uw5mbcmr3pX/CTJ8fi6pG/5E5RzvsJe0yKju7Ltr8RX3p0Mfaxms?= =?us-ascii?Q?V85DTSM4owhO1qJG65QeSuc+GqmcylDhhlguH3qZeUY0HxuUYTl5jK6y9fV6?= =?us-ascii?Q?MCKFU3Nh5vTJVVX7C3YAjFF3eCATPGpVLECdWIME8/rHbm/uP0vdC66Z3Aen?= =?us-ascii?Q?lNXpRjYL770gRAvRRe9ujarNdaATY5wO+h8FFpRDeI5Kyzd57Yx0Tmqzhqzn?= =?us-ascii?Q?6PIGJlvVVQEmlR1elAdgdyNIZ+7SO9K+Zl7ChQDhPsznIWzh1Km0QJDokCa+?= =?us-ascii?Q?4w7g5hi7iGxRVggaCOZXvd974hRdCxxFJe2aIpKgcYPErCn5ohGmfcTqVv59?= =?us-ascii?Q?dJsj0ws0SsI94lP9gUpLWQclF6KZpkZgw+RDRsp1+fqeMo9KnG5MVaVSwF3Y?= =?us-ascii?Q?SF5ZPbQ8MCohYHRyYrelLyzpcYM3FZGTh+ujQPM0Yv41MAjJHvRr1p9nq8hw?= =?us-ascii?Q?2fXBigUQjHaS0AR/vXGyhKmVZX7lWyZeFGMerS7MTbDaXUSP2PR6nIomRR8n?= =?us-ascii?Q?jbWEpluNSunPkvUPIaVZQSbKErb2hEo5jg222OnkncixqBWcazSVt1AbbXn/?= =?us-ascii?Q?oIWIhqfwWtrSvo6zteWyjLSpOlUTniNqrk9mXXYLBlF246XP30Hw4oVi5u7R?= =?us-ascii?Q?1bPlLDTnm6petRQvhApndUmjktl9PVcXkKTUD/P5n3gLcGVv6TOd2/ZRfB90?= =?us-ascii?Q?QuYdNVhaNQejZa8NGgt+RRzMA/YhZ7H8/c4xVoHE3bhkuUYCNfJ7xfCnNmjB?= =?us-ascii?Q?tkqFaIOH9FOpz1cNN7YmkoOuv4BkHoUdubIoqOOG/osro/ZEz6HopRZekTFE?= =?us-ascii?Q?y3SMK4CKfM2mj3yqe0aegR5Xsj2w6DAe3Ppw+9CEI++8I9KzbSxYjzjxQq+n?= =?us-ascii?Q?JfP5cIFjWtOX92VW+GLHRgtx?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4779 Original-Authentication-Results: semihalf.com; dkim=none (message not signed) header.d=none;semihalf.com; dmarc=none action=none header.from=arm.com; Return-Path: Samer.El-Haj-Mahmoud@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b9cedc96-e519-4d33-63f8-08d962807b6b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8ZAGvsS9GQOd7odQjVyUIlKe6QanmHHNxPmyU9fp9vOEO8iLxLTzQYNFhGSDincdPMtGmNPclpJ+1ryqWI7L6E/p7oPDyT+UVPvQDd4w4YYzXnS0ghNq/a3fxDxHeaApL3fHHl0NOq5TRB9hZrB06gOf+UGOfvF8d1lxEQ1UEOeUCg40TlAFEqWNZkzoDqx0v1Yq4n1nhydXdOcQ+yg2LSOo75srtOXIHiD1geMMWgqXfOynUTqOvOlNv3aLRJ+5LxD+5OCKd58lR/bRjGspm6gEkrqkVKrEjl51iuiaa7JocvkmU1vAV9ZOYrKZSFobdYBi8CV2JosNoTivZS1PCrGaFJ8dh/gcYuMEoUd3FiipaeZhZ5+eEe5tu9Db1iSOb3ehg023kjIFogWwgPRewRRs/W4BQ2v1KcpdU3hw6ucmm7VQ1LfFCy2Nfqz5INL4AA2hBe/+Gh9KWPc4zQ3YEuYFp2ZFgTy9zJ9jYaghitbdPMFcH9x8LNOY82/K+5h0F0ARyKTOeyvtMuLSDixKmFYDejHkdtHqU4HDY8o7SnxZsflpl5fYusAqvQL0mtCqlcS5UBDgVOIv+UhVJO8NR9dt3KcH7xMUfTuqErS6yw2FGd+HJwSzWftI6ugnO3kahQk56xQcD7v2ucaq3UbcXoP+LRYqDWgMKvjHteBhkhGlKyxlxW2tvR4MWFmp5q25i4zs0agosxPSvitfyAWlaw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(396003)(136003)(39850400004)(376002)(346002)(46966006)(36840700001)(83380400001)(316002)(86362001)(54906003)(33656002)(26005)(9686003)(55016002)(110136005)(478600001)(82740400003)(82310400003)(6506007)(70586007)(52536014)(4326008)(186003)(5660300002)(336012)(36860700001)(81166007)(7696005)(47076005)(8936002)(2906002)(356005)(8676002)(70206006)(53546011);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2021 19:43:53.9328 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6cfb6b9-ac8c-4d8a-9918-08d9628082d5 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3019 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable + Sami for ArmPkg review > -----Original Message----- > From: Grzegorz Bernacki > Sent: Monday, August 16, 2021 6:09 AM > 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; > Grzegorz Bernacki > Subject: [edk2-platforms PATCH v2] ArmPkg: Enable boot discovery policy f= or > ARM package. > > This commit adds code which check BootDiscoveryPolicy variable and > calls Boot Policy Manager Protocol to connect device specified by > the variable. To enable that mechanism for platform > EfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy PCD must be > added to DSC file and BootDiscoveryPolicyUiLib should be added to > UiApp libraries. > > Signed-off-by: Grzegorz Bernacki > --- > ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 5 > + > ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 96 > +++++++++++++++++++- > 2 files changed, 100 insertions(+), 1 deletion(-) > > diff --git > a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > index 353d7a967b..86751b45f8 100644 > --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > +++ > b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > @@ -65,11 +65,15 @@ > > [Pcd] > gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut > + gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy > > [Guids] > + gBootDiscoveryPolicyMgrFormsetGuid > gEdkiiNonDiscoverableEhciDeviceGuid > gEdkiiNonDiscoverableUhciDeviceGuid > gEdkiiNonDiscoverableXhciDeviceGuid > + gEfiBootManagerPolicyNetworkGuid > + gEfiBootManagerPolicyConnectAllGuid > gEfiFileInfoGuid > gEfiFileSystemInfoGuid > gEfiFileSystemVolumeLabelInfoIdGuid > @@ -79,6 +83,7 @@ > > [Protocols] > gEdkiiNonDiscoverableDeviceProtocolGuid > + gEfiBootManagerPolicyProtocolGuid > gEfiDevicePathProtocolGuid > gEfiGraphicsOutputProtocolGuid > gEfiLoadedImageProtocolGuid > diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > index 5ceb23d822..ef5c323743 100644 > --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > @@ -2,9 +2,10 @@ > Implementation for PlatformBootManagerLib library class interfaces. > > Copyright (C) 2015-2016, Red Hat, Inc. > - Copyright (c) 2014 - 2019, ARM Ltd. All rights reserved.
> + Copyright (c) 2014 - 2021, ARM Ltd. All rights reserved.
> Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
> Copyright (c) 2016, Linaro Ltd. All rights reserved.
> + Copyright (c) 2021, Semihalf All rights reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -19,6 +20,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -27,6 +29,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -703,6 +706,91 @@ HandleCapsules ( > > #define VERSION_STRING_PREFIX L"Tianocore/EDK2 firmware version " > > +/** > + This functions checks the value of BootDiscoverPolicy variable and > + connect devices of class specified by that variable. Then it refreshes > + Boot order for newly discovered boot device. > + > + @retval EFI_SUCCESS Devices connected successfully or connection > + not required. > + @retval others Return values from GetVariable(), LocateProtocol= () > + 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)); > + if (Status =3D=3D EFI_NOT_FOUND) { > + return EFI_SUCCESS; > + } else if (EFI_ERROR (Status)) { > + return Status; > + } > + DiscoveryPolicy =3D PcdGet32 (PcdBootDiscoveryPolicy); > + } else if (EFI_ERROR (Status)) { > + return Status; > + } > + > + if (DiscoveryPolicy =3D=3D BDP_CONNECT_MINIMAL) { > + 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_INFO, "%a - Failed to locate > gEfiBootManagerPolicyProtocolGuid." > + "Driver connect will be skipped.\n", __FUNCTION__)); > + 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: > @@ -753,6 +841,12 @@ PlatformBootManagerAfterConsole ( > } > } > > + // > + // Connect device specified by BootDiscoverPolicy variable and > + // refresh Boot order for newly discovered boot devices > + // > + BootDiscoveryPolicyHandler (); > + > // > // On ARM, there is currently no reason to use the phased capsule > // update approach where some capsules are dispatched before EndOfDxe > -- > 2.25.1 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease 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.