From nobody Sun Apr 28 23:50:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78513+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78513+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1627906734; cv=none; d=zohomail.com; s=zohoarc; b=FJd+h6292xE/6TkzrsuRCQGnxa6KDIntNDPZ/iraowmwhA7QaA5qpzLn3z1NbkMjdu4ToEzO7CxZe/mNrVfLcomqGgLQpchBNw39o4eSG5ZpiQGd+DDF78D7yh4c5Xmsi/4r+y5W/VmC+1e3BuNr8ZtBWZI+Ia5zn3gEovjRiwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627906734; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=vKjFqgEHzKzI2JnH2M/lre06T+Rznbiccw9eSeEMXoo=; b=jHZp/mtXmBK/zTDbOjgREgGhdEPX2ggNzUwhvqfr8/Rm7kou+vnvvOGhSCI/6IiWdQquxHkXi+ApIg/Qdax1iv0ukqLmvYhN5USvq7ZnMF/5Jn/b66MtQoHgM2f+FRxprlVJP6PGJJ8QsgrFSi6uwEllw83bGuEdxwEzgBpeFJI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78513+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1627906734736231.767947547865; Mon, 2 Aug 2021 05:18:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id YpU4YY1788612xr1ZWJoCkie; Mon, 02 Aug 2021 05:18:54 -0700 X-Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by mx.groups.io with SMTP id smtpd.web10.19061.1627906733131950687 for ; Mon, 02 Aug 2021 05:18:53 -0700 X-Received: by mail-lj1-f169.google.com with SMTP id h11so23582976ljo.12 for ; Mon, 02 Aug 2021 05:18:52 -0700 (PDT) X-Gm-Message-State: aK0BNrV2ePQryK4B9hO0SVGAx1787277AA= X-Google-Smtp-Source: ABdhPJz4jO+lgEP84USGmsh+8CrO1n1raL4N/4MLz+s1HhUfTfNjeofWm6hoUsxRwPzAOOefXEuepQ== X-Received: by 2002:a2e:881a:: with SMTP id x26mr11091779ljh.101.1627906731156; Mon, 02 Aug 2021 05:18:51 -0700 (PDT) X-Received: from gilgamesh.lab.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id p14sm647879lfa.117.2021.08.02.05.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 05:18:50 -0700 (PDT) From: "Grzegorz Bernacki" 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, jian.j.wang@intel.com, hao.a.wu@intel.com, dandan.bi@intel.com, eric.dong@intel.com, Grzegorz Bernacki , Zhichao Gao Subject: [edk2-devel] [PATCH v5 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib. Date: Mon, 2 Aug 2021 14:18:35 +0200 Message-Id: <20210802121837.2913575-2-gjb@semihalf.com> In-Reply-To: <20210802121837.2913575-1-gjb@semihalf.com> References: <20210802121837.2913575-1-gjb@semihalf.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gjb@semihalf.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1627906734; bh=I7tHZ46Wg0eLzzDv4myMbMvPGtRV8wU0XzvQNlALlqU=; h=Cc:Date:From:Reply-To:Subject:To; b=S8tApL5dpi+qHoGiF3d3EB+6FtHr9U0dJymAnZ5KYX+3xcvhwHZA1WrsTtT1Mvjzppa Rib53Mmd7BplmP4JhpZsc7Y09jgfccJe7WLo0LfQYMLCJNixPiw0ImwNKSzuTN8JDJcO0 QvcIPNO3q+/2KtzKEyOujYiF8wBRVGp7MCA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1627906736371100004 Content-Type: text/plain; charset="utf-8" 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. 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 ++++++++++++++++++++ MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.uni= | 18 +++ MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibStri= ngs.uni | 29 ++++ MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibVfr.= Vfr | 44 ++++++ 8 files changed, 336 insertions(+) create mode 100644 MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDisco= veryPolicyUiLib.inf create mode 100644 MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h create mode 100644 MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDisco= veryPolicyUiLib.c create mode 100644 MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDisco= veryPolicyUiLib.uni create mode 100644 MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDisco= veryPolicyUiLibStrings.uni create mode 100644 MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDisco= veryPolicyUiLibVfr.Vfr 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 variable= s. + gBootDiscoveryPolicyMgrFormsetGuid =3D { 0x5b6f7107, 0xbb3c, 0x4660, { 0= x92, 0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } } + [Ppis] ## Include/Ppi/AtaController.h gPeiAtaControllerPpiGuid =3D { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0,= 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }} @@ -1600,6 +1603,12 @@ # @Prompt Console Output Row of Text Setup gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x4000000e =20 + ## Specify the Boot Discovery Policy settings + # To support configuring from setup page, this PCD should be overridden = in DynamicHii type in its platform .dsc: + # gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy|L"BootDiscoveryP= olicy"|gBootDiscoveryPolicyMgrFormsetGuid|0 + # @Prompt Boot Discovery Policy + gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy|2|UINT32|0x4000000f + [PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.AARCH64] gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20|UINT32|0= x0001004c =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.i= nf MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerU= iLib.inf MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf @@ -341,6 +342,7 @@ MdeModulePkg/Application/UiApp/UiApp.inf{ NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf + NULL|MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPoli= cyUiLib.inf NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc= eManagerUiLib.inf } diff --git a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPol= icyUiLib.inf b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryP= olicyUiLib.inf new file mode 100644 index 0000000000..1fb4d43caa --- /dev/null +++ b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi= b.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-463DBD15FE10 + 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 the = 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, 0x46= 60, { 0x92, 0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } } + +#define BOOT_DISCOVERY_POLICY_VAR L"BootDiscoveryPolicy" + +#endif diff --git a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPol= icyUiLib.c b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPol= icyUiLib.c new file mode 100644 index 0000000000..615958799c --- /dev/null +++ b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi= b.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 (PcdBootDiscove= ryPolicy)); + 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/BootDiscoveryPol= icyUiLib.uni b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryP= olicyUiLib.uni new file mode 100644 index 0000000000..eea3ca6c8d --- /dev/null +++ b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi= b.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/BootDiscoveryPol= icyUiLibStrings.uni b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDis= coveryPolicyUiLibStrings.uni new file mode 100644 index 0000000000..736011c9bb --- /dev/null +++ b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi= bStrings.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 Po= licy" + +#string STR_FORM_BDP_CONN_MIN #language en-US "Minimal" + +#string STR_FORM_BDP_CONN_NET #language en-US "Connect Network D= evices" + +#string STR_FORM_BDP_CONN_ALL #language en-US "Connect All Devic= es" + diff --git a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPol= icyUiLibVfr.Vfr b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscove= ryPolicyUiLibVfr.Vfr new file mode 100644 index 0000000000..0de87ec34f --- /dev/null +++ b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLi= bVfr.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_A= CCESS | 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_CON= NECT_MINIMAL, flags =3D DEFAULT; + option text =3D STRING_TOKEN(STR_FORM_BDP_CONN_NET), value =3D BDP_CON= NECT_NET, flags =3D 0; + option text =3D STRING_TOKEN(STR_FORM_BDP_CONN_ALL), value =3D BDP_CON= NECT_ALL, flags =3D 0; + endoneof; + + endform; +endformset; --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78513): https://edk2.groups.io/g/devel/message/78513 Mute This Topic: https://groups.io/mt/84609666/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 23:50:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78514+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78514+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1627906735; cv=none; d=zohomail.com; s=zohoarc; b=HF7UnD9oWgYIZ2M281xQJ2tTpYVOzvHJAzuDQcPiAg/lSOKkbmkTm+8jb63mS23rWicV/YR6lfQlf6QmfbLmnlsu5BADBJa+fVQ+8jxjal0dYltzXZcIi9Z70k4dLo00IDI1MVVRJyViZkGyCqBCOvN8gCh1f2SIU6i+9iRTUaw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627906735; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Zxw6htOL+OOMuIxzqSUD5sy1gNTa0dZ/xOUugnCk6QY=; b=YxGXVQ0DvRN40gYyzGGZlGAfhf62MyBi4/csFbAHBy00wKrx0En1DtDgObmqO+TOEL+onv3HOafOR/RAnSkzdkoDN7PI7EpNMIvkNxgIJpgHPJwrdwQd5e5r8zWxKY9vL4NRoCHR/4x0fV0qpw1C63TkNIw63Q1MAXnlfS2TJbU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78514+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1627906735410917.3688233979252; Mon, 2 Aug 2021 05:18:55 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id eBfbYY1788612xVUpMeZlCkp; Mon, 02 Aug 2021 05:18:55 -0700 X-Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by mx.groups.io with SMTP id smtpd.web11.18880.1627906733979059570 for ; Mon, 02 Aug 2021 05:18:54 -0700 X-Received: by mail-lj1-f172.google.com with SMTP id u20so23702208ljo.0 for ; Mon, 02 Aug 2021 05:18:53 -0700 (PDT) X-Gm-Message-State: I39UyPV0LmsOMBKsjuqrWq9Gx1787277AA= X-Google-Smtp-Source: ABdhPJxLx05d143OD39jE02lv53NxSw38fsksHi0UoznJlNC3L7VY7+2rDGQizveKrsEFYuXSrNz6g== X-Received: by 2002:a05:651c:1108:: with SMTP id d8mr11207904ljo.127.1627906732137; Mon, 02 Aug 2021 05:18:52 -0700 (PDT) X-Received: from gilgamesh.lab.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id p14sm647879lfa.117.2021.08.02.05.18.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 05:18:51 -0700 (PDT) From: "Grzegorz Bernacki" 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, jian.j.wang@intel.com, hao.a.wu@intel.com, dandan.bi@intel.com, eric.dong@intel.com, Grzegorz Bernacki , Sunny Wang Subject: [edk2-devel] [edk2-platforms PATCH v5 1/2] Platform/RaspberryPi: Enable Boot Discovery Policy. Date: Mon, 2 Aug 2021 14:18:36 +0200 Message-Id: <20210802121837.2913575-3-gjb@semihalf.com> In-Reply-To: <20210802121837.2913575-1-gjb@semihalf.com> References: <20210802121837.2913575-1-gjb@semihalf.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gjb@semihalf.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1627906735; bh=b1795wcwvG0UDtEsGYY7f085maEgPfeP+5kBfipxYQY=; h=Cc:Date:From:Reply-To:Subject:To; b=l+itrorEjaPr8na6sd0owE6Gi10eMTmXCSpXSsfnkRTwdUrXkpkpWT6iVZO6Zvs4ewn CdC/Pe3KAk5K0JMxRSMZeWOiEdzqu2jCNKu1OkSgmTL2v2awKzY2Mn4ntTLPwbuQmy25/ dtI3RTXGxNjeZxWPyq6RQRKxmNQPT+Xdipo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1627906736635100010 Content-Type: text/plain; charset="utf-8" This commit modify platform boot to check the value of BootDiscoveryPolicy variable and use BootPolicyManager Protocol to connect devices specified by the variable. Signed-off-by: Grzegorz Bernacki Reviewed-by: Sunny Wang Reviewed-by: Pete Batard Tested-by: Pete Batard --- Platform/RaspberryPi/RPi4/RPi4.dsc = | 3 + Platform/RaspberryPi/RPi4/RPi4.fdf = | 1 + Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib= .inf | 5 ++ Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c = | 91 ++++++++++++++++++++ 4 files changed, 100 insertions(+) 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 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|L"Columns"|gRaspberryPiTo= kenSpaceGuid|0x0|80 gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|L"Rows"|gRaspberryPiTok= enSpaceGuid|0x0|25 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|L"Rows"|gRaspberryPiTokenSpa= ceGuid|0x0|25 + gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy|L"BootDiscoveryPol= icy"|gBootDiscoveryPolicyMgrFormsetGuid|0 =20 [PcdsDynamicDefault.common] # @@ -682,6 +683,7 @@ # # Bds # + MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.inf 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/BootDiscoveryPoli= cyUiLib.inf NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf 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.inf 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/PlatformBo= otManagerLib.inf b/Platform/RaspberryPi/Library/PlatformBootManagerLib/Plat= formBootManagerLib.inf index fbf510ab96..4ef2f791ae 100644 --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManag= erLib.inf +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManag= erLib.inf @@ -61,11 +61,13 @@ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType =20 [Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy=20 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..d944d1a38d 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,89 @@ 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(), 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 (PcdBootDiscove= ryPolicy)); + DiscoveryPolicy =3D PcdGet32 (PcdBootDiscoveryPolicy); + 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) { + 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 Pol= icy\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 gEfiBootManagerPolicyProto= colGuid - %r\n", __FUNCTION__, Status)); + return Status; + } + + Status =3D BMPolicy->ConnectDeviceClass (BMPolicy, Class); + if (EFI_ERROR (Status)){ + DEBUG ((DEBUG_ERROR, "%a - ConnectDeviceClass returns - %r\n", __FUNCT= ION__, 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 +730,11 @@ PlatformBootManagerAfterConsole ( DEBUG ((DEBUG_INFO, "Boot Policy is Fast Boot. Skip connecting all dev= ices\n")); } =20 + Status =3D BootDiscoveryPolicyHandler (); + if (EFI_ERROR(Status)) { + DEBUG ((DEBUG_INFO, "Error applying Boot Discovery Policy:%r\n", Statu= s)); + } + Status =3D gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL, (VOI= D**)&EsrtManagement); if (!EFI_ERROR (Status)) { EsrtManagement->SyncEsrtFmp (); --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78514): https://edk2.groups.io/g/devel/message/78514 Mute This Topic: https://groups.io/mt/84609667/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 23:50:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78515+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78515+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1627906736; cv=none; d=zohomail.com; s=zohoarc; b=OpmMyA9cNW8F3UIjuDIdX3LB1rJfQizeoNJMzg37frTSSa24hszABZdNNcakHrs5s16XJhJTRcw7iDfEcyogOoBm/MhayVkn2wd5AUsqlraUv+6/taBMQy9LhUMoKdSuw8uJLZN2lQLWu2Dip3uV99738GUTeXtKUc7Xoi6LAtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627906736; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Yk5ziW4BaQqb69Xxh+bsz2cBU1E6qbFxtboMFSA3Lt8=; b=gOL5xyy91gUnTSszodr58Dqh0HXxP/Cn/El194xQjgC63Rk9mfnjFJZj7EQX/rdyMj9m25E/0WY9UzKet9lor+2daGaW3bX2Xr2QwG79lkv9UYW+pTnqqQ6LLPy3nBRH0bK5xwVp2SorsiE2fhMmMZNy5DEQGXuIY87AB++UOuA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78515+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1627906736348936.1622960822277; Mon, 2 Aug 2021 05:18:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id BBR7YY1788612xk4RqZtYXcc; Mon, 02 Aug 2021 05:18:56 -0700 X-Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by mx.groups.io with SMTP id smtpd.web10.19062.1627906735090221439 for ; Mon, 02 Aug 2021 05:18:55 -0700 X-Received: by mail-lf1-f44.google.com with SMTP id m13so33300615lfg.13 for ; Mon, 02 Aug 2021 05:18:54 -0700 (PDT) X-Gm-Message-State: j4puRfBqduQcocEhBKqZzO7Yx1787277AA= X-Google-Smtp-Source: ABdhPJx0dyrXarNFU6s0Em5vhMPJRUYg7er1rQZuR9GeQlbXKtASV8rnHdQh2VXZ+Ff1zLKMz6ZuVw== X-Received: by 2002:a05:6512:1295:: with SMTP id u21mr800782lfs.622.1627906733151; Mon, 02 Aug 2021 05:18:53 -0700 (PDT) X-Received: from gilgamesh.lab.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id p14sm647879lfa.117.2021.08.02.05.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 05:18:52 -0700 (PDT) From: "Grzegorz Bernacki" 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, jian.j.wang@intel.com, hao.a.wu@intel.com, dandan.bi@intel.com, eric.dong@intel.com, Grzegorz Bernacki , Sunny Wang Subject: [edk2-devel] [edk2-platforms PATCH v5 2/2] Revert "Platform/RaspberryPi: Setup option for disabling Fast Boot" Date: Mon, 2 Aug 2021 14:18:37 +0200 Message-Id: <20210802121837.2913575-4-gjb@semihalf.com> In-Reply-To: <20210802121837.2913575-1-gjb@semihalf.com> References: <20210802121837.2913575-1-gjb@semihalf.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gjb@semihalf.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1627906736; bh=bYoh0RTpwFgeTl6yDKUhmTyywjgMDCBYAEUoe32Sb7U=; h=Cc:Date:From:Reply-To:Subject:To; b=OiIAPfuXqf2YOiXiq47qO4ncXrcXuNHQZUXNOO1vrGbY/delPl85TCAAUZwx/ZteUfx XNKU9hVDxmAND9Liru91xpcYN0mS+2Npb3TY4KWjzbj5GlWvvoQfXpJfwbwo+CHqbkLSC cCytOb46elncM8Vh+QT/y+451LXQhJ8vjw0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1627906737569100013 Content-Type: text/plain; charset="utf-8" This reverts commit efdc159ef7c9f15581a0f63d755a1530ff475156. This commit is not longer required as Boot Discovery Policy has been implemented for RPi. Signed-off-by: Grzegorz Bernacki Reviewed-by: Sunny Wang --- Platform/RaspberryPi/RaspberryPi.dec = | 2 -- Platform/RaspberryPi/RPi3/RPi3.dsc = | 9 +-------- Platform/RaspberryPi/RPi4/RPi4.dsc = | 9 +-------- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf = | 3 +-- Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib= .inf | 1 - Platform/RaspberryPi/Include/ConfigVars.h = | 12 +----------- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr = | 16 +--------------- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c = | 11 +---------- Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c = | 15 ++------------- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni = | 10 +--------- 10 files changed, 9 insertions(+), 79 deletions(-) diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/Ra= spberryPi.dec index f1dd8ac0ed..2ca25ff9e6 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -2,7 +2,6 @@ # # Copyright (c) 2016, Linaro, Ltd. All rights reserved. # Copyright (c) 2017-2018, Andrei Warkentin -# Copyright (c) 2021, ARM Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -71,5 +70,4 @@ gRaspberryPiTokenSpaceGuid.PcdFanTemp|0|UINT32|0x0000001D gRaspberryPiTokenSpaceGuid.PcdPlatformResetDelay|0|UINT32|0x0000001E gRaspberryPiTokenSpaceGuid.PcdMmcEnableDma|0|UINT32|0x0000001F - gRaspberryPiTokenSpaceGuid.PcdBootPolicy|0|UINT32|0x00000020 gRaspberryPiTokenSpaceGuid.PcdUartInUse|1|UINT32|0x00000021 diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index 53825bcf62..b6e3372c61 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -1,6 +1,6 @@ # @file # -# Copyright (c) 2011 - 2021, ARM Limited. All rights reserved. +# Copyright (c) 2011 - 2020, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. # Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved. # Copyright (c) 2017 - 2018, Andrei Warkentin @@ -512,13 +512,6 @@ gRaspberryPiTokenSpaceGuid.PcdFanOnGpio|L"FanOnGpio"|gConfigDxeFormSetGu= id|0x0|0 gRaspberryPiTokenSpaceGuid.PcdFanTemp|L"FanTemp"|gConfigDxeFormSetGuid|0= x0|0 =20 - # - # Boot Policy - # 0 - Fast Boot - # 1 - Full Discovery (Connect All) - # - gRaspberryPiTokenSpaceGuid.PcdBootPolicy|L"BootPolicy"|gConfigDxeFormSet= Guid|0x0|1 - # # Reset-related. # diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index 8b9beac64a..07f36e7f1b 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -1,6 +1,6 @@ # @file # -# Copyright (c) 2011 - 2021, ARM Limited. All rights reserved. +# Copyright (c) 2011 - 2020, ARM Limited. All rights reserved. # Copyright (c) 2017 - 2018, Andrei Warkentin # Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. @@ -528,13 +528,6 @@ gRaspberryPiTokenSpaceGuid.PcdFanOnGpio|L"FanOnGpio"|gConfigDxeFormSetGu= id|0x0|0 gRaspberryPiTokenSpaceGuid.PcdFanTemp|L"FanTemp"|gConfigDxeFormSetGuid|0= x0|60 =20 - # - # Boot Policy - # 0 - Fast Boot - # 1 - Full Discovery (Connect All) - # - gRaspberryPiTokenSpaceGuid.PcdBootPolicy|L"BootPolicy"|gConfigDxeFormSet= Guid|0x0|1 - # # Reset-related. # diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf b/Platfor= m/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf index 597e1b4205..4bb2d08550 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf @@ -2,7 +2,7 @@ # # Component description file for the RasbperryPi DXE platform config driv= er. # -# Copyright (c) 2019 - 2021, ARM Limited. All rights reserved. +# Copyright (c) 2019 - 2020, ARM Limited. All rights reserved. # Copyright (c) 2018 - 2020, Andrei Warkentin # # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -93,7 +93,6 @@ gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB gRaspberryPiTokenSpaceGuid.PcdFanOnGpio gRaspberryPiTokenSpaceGuid.PcdFanTemp - gRaspberryPiTokenSpaceGuid.PcdBootPolicy gRaspberryPiTokenSpaceGuid.PcdUartInUse =20 [Depex] diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBo= otManagerLib.inf b/Platform/RaspberryPi/Library/PlatformBootManagerLib/Plat= formBootManagerLib.inf index 4ef2f791ae..c047364b28 100644 --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManag= erLib.inf +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManag= erLib.inf @@ -64,7 +64,6 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy=20 gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut gRaspberryPiTokenSpaceGuid.PcdSdIsArasan - gRaspberryPiTokenSpaceGuid.PcdBootPolicy =20 [Guids] gBootDiscoveryPolicyMgrFormsetGuid diff --git a/Platform/RaspberryPi/Include/ConfigVars.h b/Platform/Raspberry= Pi/Include/ConfigVars.h index 9ef62b7a6e..142317985a 100644 --- a/Platform/RaspberryPi/Include/ConfigVars.h +++ b/Platform/RaspberryPi/Include/ConfigVars.h @@ -1,7 +1,7 @@ /** @file * * Copyright (c) 2020, Andrei Warkentin - * Copyright (c) 2020 - 2021, ARM Limited. All rights reserved. + * Copyright (c) 2020, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -143,14 +143,4 @@ typedef struct { UINT32 EnableDma; } MMC_EMMC_DMA_VARSTORE_DATA; =20 -#define FAST_BOOT 0 -#define FULL_DISCOVERY 1 -typedef struct { - /* - * 0 - Fast Boot - * 1 - Full Discovery (Connect All) - */ - UINT32 BootPolicy; -} BOOT_POLICY_VARSTORE_DATA; - #endif /* CONFIG_VARS_H */ diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index 759db6212f..fa34eab809 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -1,7 +1,7 @@ /** @file * * Copyright (c) 2018 Andrei Warkentin - * Copyright (c) 2020 - 2021, ARM Limited. All rights reserved. + * Copyright (c) 2020, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -116,11 +116,6 @@ formset name =3D DisplayEnableSShot, guid =3D CONFIGDXE_FORM_SET_GUID; =20 - efivarstore BOOT_POLICY_VARSTORE_DATA, - attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, - name =3D BootPolicy, - guid =3D CONFIGDXE_FORM_SET_GUID; - form formid =3D 1, title =3D STRING_TOKEN(STR_FORM_SET_TITLE); subtitle text =3D STRING_TOKEN(STR_NULL_STRING); @@ -195,14 +190,6 @@ formset option text =3D STRING_TOKEN(STR_ADVANCED_SYSTAB_DT), value = =3D SYSTEM_TABLE_MODE_DT, flags =3D DEFAULT; endoneof; =20 - oneof varid =3D BootPolicy.BootPolicy, - prompt =3D STRING_TOKEN(STR_BOOT_POLICY_PROMPT), - help =3D STRING_TOKEN(STR_BOOT_POLICY_HELP), - flags =3D NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED, - option text =3D STRING_TOKEN(STR_FAST_BOOT), value =3D FAST_BO= OT , flags =3D 0; - option text =3D STRING_TOKEN(STR_FULL_DISCOVERY), value =3D FU= LL_DISCOVERY, flags =3D DEFAULT; - endoneof; - #if (RPI_MODEL =3D=3D 4) grayoutif NOT ideqval SystemTableMode.Mode =3D=3D SYSTEM_TABLE_MOD= E_ACPI; oneof varid =3D FanOnGpio.Enabled, @@ -233,7 +220,6 @@ formset minsize =3D 0, maxsize =3D ASSET_TAG_STR_MAX_LEN, endstring; - endform; =20 form formid =3D 0x1003, diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index cf9880bd20..9e78cb47ad 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -1,6 +1,6 @@ /** @file * - * Copyright (c) 2019 - 2021, ARM Limited. All rights reserved. + * Copyright (c) 2019 - 2020, ARM Limited. All rights reserved. * Copyright (c) 2018 - 2020, Andrei Warkentin * * SPDX-License-Identifier: BSD-2-Clause-Patent @@ -286,15 +286,6 @@ SetupVariables ( ); } =20 - Size =3D sizeof (UINT32); - Status =3D gRT->GetVariable (L"BootPolicy", - &gConfigDxeFormSetGuid, - NULL, &Size, &Var32); - if (EFI_ERROR (Status)) { - Status =3D PcdSet32S (PcdBootPolicy, PcdGet32 (PcdBootPolicy)); - ASSERT_EFI_ERROR (Status); - } - Size =3D sizeof (UINT32); Status =3D gRT->GetVariable (L"SdIsArasan", &gConfigDxeFormSetGuid, diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm= .c b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c index d944d1a38d..c8305ce4f5 100644 --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c @@ -4,7 +4,7 @@ * Copyright (c) 2017-2018, Andrei Warkentin * Copyright (c) 2016, Linaro Ltd. All rights reserved. * Copyright (c) 2015-2016, Red Hat, Inc. - * Copyright (c) 2014-2021, ARM Ltd. All rights reserved. + * Copyright (c) 2014-2020, ARM Ltd. All rights reserved. * Copyright (c) 2004-2016, Intel Corporation. All rights reserved. * Copyright (c) 2021, Semihalf All rights reserved. * @@ -28,11 +28,10 @@ #include #include #include -#include =20 #include "PlatformBm.h" =20 -#define BOOT_PROMPT L"ESC (setup), F1 (shell), ENTER (boot)\n" +#define BOOT_PROMPT L"ESC (setup), F1 (shell), ENTER (boot)" =20 #define DP_NODE_LEN(Type) { (UINT8)sizeof (Type), (UINT8)(sizeof (Type) >>= 8) } =20 @@ -720,16 +719,6 @@ PlatformBootManagerAfterConsole ( Print (BOOT_PROMPT); } =20 - // - // Connect the rest of the devices if the boot polcy is set to Full disc= overy - // - if (PcdGet32 (PcdBootPolicy) =3D=3D FULL_DISCOVERY) { - DEBUG ((DEBUG_INFO, "Boot Policy is Full Discovery. Connect all device= s\n")); - EfiBootManagerConnectAll (); - } else if (PcdGet32 (PcdBootPolicy) =3D=3D FAST_BOOT) { - DEBUG ((DEBUG_INFO, "Boot Policy is Fast Boot. Skip connecting all dev= ices\n")); - } - Status =3D BootDiscoveryPolicyHandler (); if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "Error applying Boot Discovery Policy:%r\n", Statu= s)); diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni index 81761d64bb..466fa852cb 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni @@ -1,7 +1,7 @@ /** @file * * Copyright (c) 2018, Andrei Warkentin - * Copyright (c) 2020 - 2021, ARM Limited. All rights reserved. + * Copyright (c) 2020, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -60,14 +60,6 @@ #string STR_ADVANCED_ASSET_TAG_PROMPT #language en-US "Asset Tag" #string STR_ADVANCED_ASSET_TAG_HELP #language en-US "Set the system Asse= t Tag" =20 -#string STR_BOOT_POLICY_PROMPT #language en-US "Boot Policy" -#string STR_BOOT_POLICY_HELP #language en-US "When Fast Boot is s= elected, only required devices will be discovered for reducing " - "the boot time. " - "When Full Discovery= is selected, all the devices will be discovered for some " - "scenarios such as s= ystem deployment and diagnostic tests." -#string STR_FAST_BOOT #language en-US "Fast Boot" -#string STR_FULL_DISCOVERY #language en-US "Full Discovery" - /* * MMC/SD configuration. */ --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78515): https://edk2.groups.io/g/devel/message/78515 Mute This Topic: https://groups.io/mt/84609668/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-