From nobody Thu May 2 02:08:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508534659690463.7722144475915; Fri, 20 Oct 2017 14:24:19 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 04F64202E5CFB; Fri, 20 Oct 2017 14:20:36 -0700 (PDT) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 254902034C0B7 for ; Fri, 20 Oct 2017 14:20:33 -0700 (PDT) Received: by mail-wm0-x244.google.com with SMTP id k4so245558wmc.1 for ; Fri, 20 Oct 2017 14:24:13 -0700 (PDT) Received: from localhost.localdomain ([154.145.244.244]) by smtp.gmail.com with ESMTPSA id f16sm1730264wra.75.2017.10.20.14.24.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Oct 2017 14:24:10 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=E3kw4VMRaENVxt1vvPuaD9ddqyN4OLvz4K7e/Y1gy7g=; b=TXgTVcB236PB5xZau9WlWn0DoL8ZF4TS5cUba+6Zjqm7kz92X0N4R1HMPt2bnygz0K 8GVTldXwY2L+hCW0elDkwVm4eG205BPaDFdUOxUvJZ4IeHW1I5YTgqYiH/hVjWHeapIX 6c8s5i0JQHdG2C0dYfAjfiTNHw4aWlk47Ovts= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=E3kw4VMRaENVxt1vvPuaD9ddqyN4OLvz4K7e/Y1gy7g=; b=tLPiXHRQQ85QUw3QYOq7ig6frmmAGm6f66FmCN/ZTxg9g3p/KFDsuky5MVKcj/JQ+S WWlnw+/2uCkey/DSdnzK6YuCjbOM/3udA4GvN52saDsIQ8PDrM29UWv06QU6XiIxodkQ txSCAyVa3OgjCUBvyCk1K8HkRHlpgeos9vPh50bI8MbqE1pDjHg2358zDtxNoShSKLBC /8NeWwY30iXV+Nq5o8KKR0pfrFNNI24EXOREnhVYC9qIe7uFVDv4jiXsu7RRABWhVBwZ AOYxmwM2SeU3TahsUUdL0sP1r3XRRHcco2mLSKvZbvYLQTrrMhodTdFaxFqqRjj13M/4 pu9g== X-Gm-Message-State: AMCzsaXnbQVrg9Vjah356jHH/PjkmYxiQQ0ltLF83ZiDyZFP1iusxmB3 r0NjvKZ+NjuoVPPWaNXas4McCSBULJ8= X-Google-Smtp-Source: ABhQp+T1OBR7exFFvoQZvTMJFFZxBhDXAhSVTn5f/KOaheVyRDCYYu1gyK8oPUXzw4d2N6gv30Wllw== X-Received: by 10.28.50.200 with SMTP id y191mr114100wmy.74.1508534651686; Fri, 20 Oct 2017 14:24:11 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 20 Oct 2017 22:24:04 +0100 Message-Id: <20171020212404.6497-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH v3] EmbeddedPkg: add driver to set graphical/serial console preference X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lersek@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Linux on ARM/arm64 will infer from the presence of a /chosen/stdout-path DT property or of a SPCR ACPI table that the primary console is the serial port, even if a graphical console is available as well. So let's introduce a driver that allows the user to set a preference between graphical and serial if both are available. If the preference is set to 'Graphical', and any GOP protocol instances have been installed by the time the ReadyToBoot event is signalled, remove the DT property and/or the SPCR table entirely. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- v3: - as suggested by Laszlo, move all logic into the OnReadyToBoot event callback so there is no need to register protocol notification handle= rs to look for the SDT protocol - fixed overly long lines in license blocks v2: - use protocol register notify for gEfiAcpiSdtProtocolGuid, this is necessary because we may be loaded before the driver that produces it, and we cannot Depex on it either (because it is optional) - add missing changes to .dec and Include/ files EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c | 293 ++++++++++++++= ++++++ EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.h | 31 +++ EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf | 62 +++++ EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefHii.uni | 27 ++ EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefHii.vfr | 51 ++++ EmbeddedPkg/EmbeddedPkg.dec | 3 + EmbeddedPkg/Include/Guid/ConsolePrefFormSet.h | 23 ++ 7 files changed, 490 insertions(+) diff --git a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c b/Embedded= Pkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c new file mode 100644 index 000000000000..996d1a6036b9 --- /dev/null +++ b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c @@ -0,0 +1,293 @@ +/** @file +* +* Copyright (c) 2017, Linaro, Ltd. All rights reserved. +* +* This program and the accompanying materials are licensed and made avail= able +* under the terms and conditions of the BSD License which accompanies this +* distribution. The full text of the license may be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +* +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ConsolePrefDxe.h" + +#define SPCR_SIG EFI_ACPI_2_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIG= NATURE + +extern UINT8 ConsolePrefHiiBin[]; +extern UINT8 ConsolePrefDxeStrings[]; + +typedef struct { + VENDOR_DEVICE_PATH VendorDevicePath; + EFI_DEVICE_PATH_PROTOCOL End; +} HII_VENDOR_DEVICE_PATH; + +STATIC HII_VENDOR_DEVICE_PATH mConsolePrefDxeVendorDevicePath =3D { + { + { + HARDWARE_DEVICE_PATH, + HW_VENDOR_DP, + { + (UINT8) (sizeof (VENDOR_DEVICE_PATH)), + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) + } + }, + CONSOLE_PREF_FORMSET_GUID + }, + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + (UINT8) (END_DEVICE_PATH_LENGTH), + (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8) + } + } +}; + +STATIC EFI_EVENT mReadyToBootEvent; + +STATIC +EFI_STATUS +InstallHiiPages ( + VOID + ) +{ + EFI_STATUS Status; + EFI_HII_HANDLE HiiHandle; + EFI_HANDLE DriverHandle; + + DriverHandle =3D NULL; + Status =3D gBS->InstallMultipleProtocolInterfaces (&DriverHandle, + &gEfiDevicePathProtocolGuid, + &mConsolePrefDxeVendorDevicePath, + NULL); + if (EFI_ERROR (Status)) { + return Status; + } + + HiiHandle =3D HiiAddPackages (&gConsolePrefFormSetGuid, + DriverHandle, + ConsolePrefDxeStrings, + ConsolePrefHiiBin, + NULL); + + if (HiiHandle =3D=3D NULL) { + gBS->UninstallMultipleProtocolInterfaces (DriverHandle, + &gEfiDevicePathProtocolGuid, + &mConsolePrefDxeVendorDevicePath, + NULL); + return EFI_OUT_OF_RESOURCES; + } + return EFI_SUCCESS; +} + +STATIC +VOID +RemoveDtStdoutPath ( + VOID +) +{ + VOID *Dtb; + INT32 Node; + INT32 Error; + EFI_STATUS Status; + + Status =3D EfiGetSystemConfigurationTable (&gFdtTableGuid, &Dtb); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, "%a: could not retrieve DT blob - %r\n", __FUNCTIO= N__, + Status)); + return; + } + + Node =3D fdt_path_offset (Dtb, "/chosen"); + if (Node < 0) { + return; + } + + Error =3D fdt_delprop (Dtb, Node, "stdout-path"); + if (Error) { + DEBUG ((DEBUG_INFO, "%a: Failed to delete 'stdout-path' property: %a\n= ", + __FUNCTION__, fdt_strerror (Error))); + } +} + +STATIC +VOID +RemoveSpcrTable ( + VOID + ) +{ + EFI_ACPI_SDT_PROTOCOL *Sdt; + EFI_ACPI_TABLE_PROTOCOL *AcpiTable; + EFI_STATUS Status; + UINTN TableIndex; + EFI_ACPI_SDT_HEADER *TableHeader; + EFI_ACPI_TABLE_VERSION TableVersion; + UINTN TableKey; + + Status =3D gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, + (VOID **)&AcpiTable); + if (EFI_ERROR (Status)) { + return; + } + + Status =3D gBS->LocateProtocol (&gEfiAcpiSdtProtocolGuid, NULL, (VOID **= )&Sdt); + if (EFI_ERROR (Status)) { + return; + } + + TableIndex =3D 0; + TableKey =3D 0; + TableHeader =3D NULL; + + do { + Status =3D Sdt->GetAcpiTable (TableIndex++, &TableHeader, &TableVersio= n, + &TableKey); + if (EFI_ERROR (Status)) { + break; + } + + if (TableHeader->Signature !=3D SPCR_SIG) { + continue; + } + + Status =3D AcpiTable->UninstallAcpiTable (AcpiTable, TableKey); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "%a: failed to uninstall SPCR table - %r\n", + __FUNCTION__, Status)); + } + break; + } while (TRUE); +} + +STATIC +VOID +OnReadyToBoot ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + CONSOLE_PREF_VARSTORE_DATA ConsolePref; + UINTN BufferSize; + EFI_STATUS Status; + VOID *Gop; + + BufferSize =3D sizeof (ConsolePref); + Status =3D gRT->GetVariable (CONSOLE_PREF_VARIABLE_NAME, + &gConsolePrefFormSetGuid, NULL, &BufferSize, &ConsolePre= f); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, + "%a: variable '%s' could not be read - bailing!\n", __FUNCTION__, + CONSOLE_PREF_VARIABLE_NAME)); + return; + } + + if (ConsolePref.Console =3D=3D CONSOLE_PREF_SERIAL) { + DEBUG ((DEBUG_INFO, + "%a: serial console preferred - doing nothing\n", __FUNCTION__)); + return; + } + + // + // Check if any GOP instances exist: if so, disable stdout-path and SPCR + // + Status =3D gBS->LocateProtocol (&gEfiGraphicsOutputProtocolGuid, NULL, &= Gop); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, + "%a: no GOP instances found - doing nothing (%r)\n", __FUNCTION__, + Status)); + return; + } + + RemoveDtStdoutPath (); + RemoveSpcrTable (); +} + +/** + The entry point for ConsolePrefDxe driver. + + @param[in] ImageHandle The image handle of the driver. + @param[in] SystemTable The system table. + + @retval EFI_ALREADY_STARTED The driver already exists in system. + @retval EFI_OUT_OF_RESOURCES Fail to execute entry point due to lack = of + resources. + @retval EFI_SUCCES All the related protocols are installed = on + the driver. + +**/ +EFI_STATUS +EFIAPI +ConsolePrefDxeEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + CONSOLE_PREF_VARSTORE_DATA ConsolePref; + UINTN BufferSize; + + // + // Get the current console preference from the ConsolePref variable. + // + BufferSize =3D sizeof (ConsolePref); + Status =3D gRT->GetVariable (CONSOLE_PREF_VARIABLE_NAME, + &gConsolePrefFormSetGuid, NULL, &BufferSize, &ConsolePre= f); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, + "%a: no console preference found, defaulting to graphical\n", + __FUNCTION__)); + ConsolePref.Console =3D CONSOLE_PREF_GRAPHICAL; + } + + if (!EFI_ERROR (Status) && + ConsolePref.Console !=3D CONSOLE_PREF_GRAPHICAL && + ConsolePref.Console !=3D CONSOLE_PREF_SERIAL) { + DEBUG ((DEBUG_WARN, "%a: invalid value for %s, defaulting to graphical= \n", + __FUNCTION__, CONSOLE_PREF_VARIABLE_NAME)); + ConsolePref.Console =3D CONSOLE_PREF_GRAPHICAL; + Status =3D EFI_INVALID_PARAMETER; // trigger setvar below + } + + // + // Write the newly selected value back to the variable store. + // + if (EFI_ERROR (Status)) { + ZeroMem (&ConsolePref.Reserved, sizeof (ConsolePref.Reserved)); + Status =3D gRT->SetVariable (CONSOLE_PREF_VARIABLE_NAME, + &gConsolePrefFormSetGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (ConsolePref), &ConsolePref); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: gRT->SetVariable () failed - %r\n", + __FUNCTION__, Status)); + return Status; + } + } + + Status =3D gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_CALLBACK, + OnReadyToBoot, NULL, &gEfiEventReadyToBootGuid, + &mReadyToBootEvent); + ASSERT_EFI_ERROR (Status); + + return InstallHiiPages (); +} diff --git a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.h b/Embedded= Pkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.h new file mode 100644 index 000000000000..8315e739d3b3 --- /dev/null +++ b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.h @@ -0,0 +1,31 @@ +/** @file +* +* Copyright (c) 2017, Linaro Limited. All rights reserved. +* +* This program and the accompanying materials are licensed and made avail= able +* under the terms and conditions of the BSD License which accompanies this +* distribution. The full text of the license may be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +* +**/ + +#ifndef __CONSOLE_PREF_DXE_H__ +#define __CONSOLE_PREF_DXE_H__ + +#include +#include + +#define CONSOLE_PREF_GRAPHICAL 0x0 +#define CONSOLE_PREF_SERIAL 0x1 + +#define CONSOLE_PREF_VARIABLE_NAME L"ConsolePref" + +typedef struct { + UINT8 Console; + UINT8 Reserved[3]; +} CONSOLE_PREF_VARSTORE_DATA; + +#endif diff --git a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf b/Embedd= edPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf new file mode 100644 index 000000000000..d8b412b9200a --- /dev/null +++ b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf @@ -0,0 +1,62 @@ +## @file +# +# Copyright (c) 2017, Linaro, Ltd. All rights reserved.
+# +# This program and the accompanying materials are licensed and made +# available under the terms and conditions of the BSD License which +# accompanies this distribution. The full text of the license may be +# found at http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR +# IMPLIED. +# +## + +[Defines] + INF_VERSION =3D 0x00010019 + BASE_NAME =3D ConsolePrefDxe + FILE_GUID =3D bbe2668c-0efc-46fb-9137-4f2da8f419f3 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D ConsolePrefDxeEntryPoint + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 ARM AARCH64 +# + +[Sources] + ConsolePrefDxe.c + ConsolePrefHii.vfr + ConsolePrefHii.uni + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + BaseLib + DebugLib + FdtLib + HiiLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + UefiRuntimeServicesTableLib + +[Guids] + gConsolePrefFormSetGuid + gFdtTableGuid + gEfiEventReadyToBootGuid + +[Protocols] + gEfiAcpiTableProtocolGuid + gEfiAcpiSdtProtocolGuid + gEfiGraphicsOutputProtocolGuid + +[Depex] + gEfiVariableArchProtocolGuid AND + gEfiVariableWriteArchProtocolGuid diff --git a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefHii.uni b/Embedd= edPkg/Drivers/ConsolePrefDxe/ConsolePrefHii.uni new file mode 100644 index 000000000000..947cf70a4849 --- /dev/null +++ b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefHii.uni @@ -0,0 +1,27 @@ +/** @file +* +* Copyright (c) 2017, Linaro, Ltd. All rights reserved. +* +* This program and the accompanying materials are licensed and made avail= able +* under the terms and conditions of the BSD License which accompanies this +* distribution. The full text of the license may be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +* +**/ + +#langdef en-US "English" + +#string STR_FORM_SET_TITLE #language en-US "Console Preference= Selection" +#string STR_FORM_SET_TITLE_HELP #language en-US "Press to c= hoose between graphical and serial console." + +#string STR_MAIN_FORM_TITLE #language en-US "Console Preference= Selection" +#string STR_NULL_STRING #language en-US "" + +#string STR_CONSOLE_PREF_SELECT_PROMPT #language en-US "Preferred console" +#string STR_CONSOLE_PREF_SELECT_HELP #language en-US "Select the preferr= ed console if both graphical and serial are available." + +#string STR_CONSOLE_PREF_GRAPHICAL #language en-US "Graphical" +#string STR_CONSOLE_PREF_SERIAL #language en-US "Serial" diff --git a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefHii.vfr b/Embedd= edPkg/Drivers/ConsolePrefDxe/ConsolePrefHii.vfr new file mode 100644 index 000000000000..a1e603abf0ce --- /dev/null +++ b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefHii.vfr @@ -0,0 +1,51 @@ +/** @file +* +* Copyright (c) 2017, Linaro, Ltd. All rights reserved. +* +* This program and the accompanying materials are licensed and made avail= able +* under the terms and conditions of the BSD License which accompanies this +* distribution. The full text of the license may be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +* +**/ + +#include "ConsolePrefDxe.h" + +// +// EFI Variable attributes +// +#define EFI_VARIABLE_NON_VOLATILE 0x00000001 +#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 +#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 +#define EFI_VARIABLE_READ_ONLY 0x00000008 + +formset + guid =3D CONSOLE_PREF_FORMSET_GUID, + title =3D STRING_TOKEN(STR_FORM_SET_TITLE), + help =3D STRING_TOKEN(STR_FORM_SET_TITLE_HELP), + classguid =3D EFI_HII_PLATFORM_SETUP_FORMSET_GUID, + + efivarstore CONSOLE_PREF_VARSTORE_DATA, + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLAT= ILE, // EFI variable attributes + name =3D ConsolePref, + guid =3D CONSOLE_PREF_FORMSET_GUID; + + form formid =3D 0x1000, + title =3D STRING_TOKEN(STR_MAIN_FORM_TITLE); + + oneof varid =3D ConsolePref.Console, + prompt =3D STRING_TOKEN(STR_CONSOLE_PREF_SELECT_PROMPT), + help =3D STRING_TOKEN(STR_CONSOLE_PREF_SELECT_HELP), + flags =3D NUMERIC_SIZE_1 | INTERACTIVE, + option text =3D STRING_TOKEN(STR_CONSOLE_PREF_GRAPHICAL), value = =3D CONSOLE_PREF_GRAPHICAL, flags =3D DEFAULT; + option text =3D STRING_TOKEN(STR_CONSOLE_PREF_SERIAL), value =3D C= ONSOLE_PREF_SERIAL, flags =3D 0; + endoneof; + + subtitle text =3D STRING_TOKEN(STR_NULL_STRING); + + endform; + +endformset; diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 151b1d503dee..52482af13aeb 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -67,6 +67,9 @@ [Guids.common] # File GUID for default DTB image embedded in the firmware volume gDtPlatformDefaultDtbFileGuid =3D { 0x25462cda, 0x221f, 0x47df, { 0xac, = 0x1d, 0x25, 0x9c, 0xfa, 0xa4, 0xe3, 0x26 } } =20 + # HII form set GUID for ConsolePrefDxe driver + gConsolePrefFormSetGuid =3D { 0x2d2358b4, 0xe96c, 0x484d, { 0xb2, 0xdd, = 0x7c, 0x2e, 0xdf, 0xc7, 0xd5, 0x6f } } + [Protocols.common] gHardwareInterruptProtocolGuid =3D { 0x2890B3EA, 0x053D, 0x1643, { 0xAD= , 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } } gHardwareInterrupt2ProtocolGuid =3D { 0x32898322, 0x2da1, 0x474a, { 0xba= , 0xaa, 0xf3, 0xf7, 0xcf, 0x56, 0x94, 0x70 } } diff --git a/EmbeddedPkg/Include/Guid/ConsolePrefFormSet.h b/EmbeddedPkg/In= clude/Guid/ConsolePrefFormSet.h new file mode 100644 index 000000000000..f3cca1d15dfa --- /dev/null +++ b/EmbeddedPkg/Include/Guid/ConsolePrefFormSet.h @@ -0,0 +1,23 @@ +/** @file +* +* Copyright (c) 2017, Linaro Limited. All rights reserved. +* +* This program and the accompanying materials are licensed and made avail= able +* under the terms and conditions of the BSD License which accompanies this +* distribution. The full text of the license may be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +* +**/ + +#ifndef __CONSOLE_PREF_FORMSET_H__ +#define __CONSOLE_PREF_FORMSET_H__ + +#define CONSOLE_PREF_FORMSET_GUID \ + { 0x2d2358b4, 0xe96c, 0x484d, { 0xb2, 0xdd, 0x7c, 0x2e, 0xdf, 0xc7, 0xd5= , 0x6f } } + +extern EFI_GUID gConsolePrefFormSetGuid; + +#endif --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel