From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web12.2695.1641618760749275025 for ; Fri, 07 Jan 2022 21:12:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=anqytTN0; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=000704d8ca=abner.chang@hpe.com) Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 2083hrjj015592 for ; Sat, 8 Jan 2022 05:12:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pps0720; bh=cKJ87e19YxdZpAgGsXsfNEfJ6uuvaf8YQvnMExzZR2Q=; b=anqytTN00jdu5TZQ6tuVIS3HdRm72y++KX7h3Kx5vG9HaZe08QDXjnsT4XGPA6KnTbFO +dAmo8cWch6ZsE20svh4DOgbWhzskgU2u7DaqENtwmYbMMA/3wVQM8KTZN/8nbxm6VTO CdyEd/A4FHR0A2WxL0JLrxt+0XHRYJHdz2n1Vc3JeK/CL7QUWeQqR/rhtFKvnaH5Qry0 2pMlgM+HFYaXLquSGxtxlqs6sedtdo2jg/y62Paw7MFxqbjY9Kw06SOnMLloDv9ytHcl 5W/PM+xwZM4gVPwrTtgC6KAD2SkDuf2tvvUhda+l0MjTK2FIfl7rNpyseHV97fjX3cHW Ow== Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3df1qw8ky6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 08 Jan 2022 05:12:39 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 14A026D for ; Sat, 8 Jan 2022 05:12:39 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 5DB9139; Sat, 8 Jan 2022 05:12:38 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com Subject: [PATCH 18/79] PlatformPkg/Library: Platform Boot Manager library. Date: Sat, 8 Jan 2022 12:10:38 +0800 Message-Id: <20220108041121.16005-17-abner.chang@hpe.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220108041121.16005-1-abner.chang@hpe.com> References: <20220108041121.16005-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: O1j6f2kQmDm019cDhkMJzDtGfoddqT2r X-Proofpoint-GUID: O1j6f2kQmDm019cDhkMJzDtGfoddqT2r X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-08_01,2022-01-07_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 mlxscore=0 phishscore=0 malwarescore=0 clxscore=1015 suspectscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201080036 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable (This is migrated from edk2-platforms:Platform/RISC-V) Common Platform Boot Manager library for RISC-V platform. Signed-off-by: Abner Chang Co-authored-by: Gilbert Chen Reviewed-by: Leif Lindholm Cc: Leif Lindholm Cc: Gilbert Chen --- .../PlatformBootManagerLib.inf | 61 +++++ .../PlatformBootManager.h | 117 +++++++++ .../PlatformBootManager.c | 243 ++++++++++++++++++ .../PlatformBootManagerLib/PlatformData.c | 49 ++++ .../PlatformBootManagerLib/Strings.uni | 28 ++ 5 files changed, 498 insertions(+) create mode 100644 Platform/RISC-V/PlatformPkg/Library/PlatformBootManager= Lib/PlatformBootManagerLib.inf create mode 100644 Platform/RISC-V/PlatformPkg/Library/PlatformBootManager= Lib/PlatformBootManager.h create mode 100644 Platform/RISC-V/PlatformPkg/Library/PlatformBootManager= Lib/PlatformBootManager.c create mode 100644 Platform/RISC-V/PlatformPkg/Library/PlatformBootManager= Lib/PlatformData.c create mode 100644 Platform/RISC-V/PlatformPkg/Library/PlatformBootManager= Lib/Strings.uni diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Pla= tformBootManagerLib.inf b/Platform/RISC-V/PlatformPkg/Library/PlatformBootM= anagerLib/PlatformBootManagerLib.inf new file mode 100644 index 0000000000..afba07573f --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBo= otManagerLib.inf @@ -0,0 +1,61 @@ +## @file=0D +# Include all platform action which can be customized by IBV/OEM.=0D +#=0D +# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +[Defines]=0D + INF_VERSION =3D 0x0001001b=0D + BASE_NAME =3D PlatformBootManagerLib=0D + FILE_GUID =3D 7DDA7916-6139-4D46-A415-30E854AF3BC7= =0D + MODULE_TYPE =3D DXE_DRIVER=0D + VERSION_STRING =3D 1.0=0D + LIBRARY_CLASS =3D PlatformBootManagerLib|DXE_DRIVER=0D +=0D +#=0D +# The following information is for reference only and not required by the = build tools.=0D +#=0D +# VALID_ARCHITECTURES =3D RISCV64=0D +#=0D +=0D +[Sources]=0D + PlatformData.c=0D + PlatformBootManager.c=0D + PlatformBootManager.h=0D + Strings.uni=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D + MdeModulePkg/MdeModulePkg.dec=0D + Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec=0D +=0D +[LibraryClasses]=0D + BaseLib=0D + UefiBootServicesTableLib=0D + UefiRuntimeServicesTableLib=0D + UefiLib=0D + UefiBootManagerLib=0D + PcdLib=0D + PlatformMemoryTestLib=0D + PlatformUpdateProgressLib=0D + DxeServicesLib=0D + MemoryAllocationLib=0D + DevicePathLib=0D + HiiLib=0D + PrintLib=0D +=0D +[Guids]=0D +=0D +[Protocols]=0D + gEfiGenericMemTestProtocolGuid ## CONSUMES=0D + gEfiGraphicsOutputProtocolGuid ## CONSUMES=0D +=0D +[Pcd]=0D + gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand=0D + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootlogoOnlyEnable=0D diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Pla= tformBootManager.h b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManage= rLib/PlatformBootManager.h new file mode 100644 index 0000000000..58c363a48b --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBo= otManager.h @@ -0,0 +1,117 @@ +/**@file=0D + Head file for BDS Platform specific code=0D +=0D +Copyright (c) 2016, Hewlett Packard Enterprise Development LP. All rights = reserved.
=0D +Copyright (c) 2015, Intel Corporation. All rights reserved.
=0D +=0D +SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#ifndef PLATFORM_BOOT_MANAGER_H_=0D +#define PLATFORM_BOOT_MANAGER_H_=0D +=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +typedef struct {=0D + EFI_DEVICE_PATH_PROTOCOL *DevicePath;=0D + UINTN ConnectType;=0D +} PLATFORM_CONSOLE_CONNECT_ENTRY;=0D +=0D +extern PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[];=0D +=0D +#define gEndEntire \=0D + { \=0D + END_DEVICE_PATH_TYPE,\=0D + END_ENTIRE_DEVICE_PATH_SUBTYPE,\=0D + END_DEVICE_PATH_LENGTH,\=0D + 0\=0D + }=0D +=0D +#define CONSOLE_OUT BIT0=0D +#define CONSOLE_IN BIT1=0D +#define STD_ERROR BIT2=0D +=0D +//D3987D4B-971A-435F-8CAF-4967EB627241=0D +#define EFI_SERIAL_DXE_GUID \=0D + { 0xD3987D4B, 0x971A, 0x435F, { 0x8C, 0xAF, 0x49, 0x67, 0xEB, 0x62, 0x72= , 0x41 } }=0D +=0D +typedef struct {=0D + VENDOR_DEVICE_PATH Guid;=0D + UART_DEVICE_PATH Uart;=0D + VENDOR_DEVICE_PATH TerminalType;=0D + EFI_DEVICE_PATH_PROTOCOL End;=0D +} SERIAL_CONSOLE_DEVICE_PATH;=0D +=0D +/**=0D + Use SystemTable Conout to turn on video based Simple Text Out consoles. = The=0D + Simple Text Out screens will now be synced up with all non video output = devices=0D +=0D + @retval EFI_SUCCESS UGA devices are back in text mode and synced up.= =0D +=0D +**/=0D +EFI_STATUS=0D +PlatformBootManagerDisableQuietBoot (=0D + VOID=0D + );=0D +=0D +/**=0D + Perform the memory test base on the memory test intensive level,=0D + and update the memory resource.=0D +=0D + @param Level The memory test intensive level.=0D +=0D + @retval EFI_STATUS Success test all the system memory and update=0D + the memory resource=0D +=0D +**/=0D +EFI_STATUS=0D +PlatformBootManagerMemoryTest (=0D + IN EXTENDMEM_COVERAGE_LEVEL Level=0D + );=0D +=0D +/**=0D +=0D + Show progress bar with title above it. It only works in Graphics mode.=0D +=0D +=0D + @param TitleForeground Foreground color for Title.=0D + @param TitleBackground Background color for Title.=0D + @param Title Title above progress bar.=0D + @param ProgressColor Progress bar color.=0D + @param Progress Progress (0-100)=0D + @param PreviousValue The previous value of the progress.=0D +=0D + @retval EFI_STATUS Success update the progress bar=0D +=0D +**/=0D +EFI_STATUS=0D +PlatformBootManagerShowProgress (=0D + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,=0D + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,=0D + IN CHAR16 *Title,=0D + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,=0D + IN UINTN Progress,=0D + IN UINTN PreviousValue=0D + );=0D +=0D +#endif // _PLATFORM_BOOT_MANAGER_H=0D diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Pla= tformBootManager.c b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManage= rLib/PlatformBootManager.c new file mode 100644 index 0000000000..82cd311df5 --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBo= otManager.c @@ -0,0 +1,243 @@ +/** @file=0D + This file include all platform actions=0D +=0D +Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights = reserved.
=0D +Copyright (c) 2015, Intel Corporation. All rights reserved.
=0D +=0D +SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include "PlatformBootManager.h"=0D +=0D +=0D +EFI_GUID mUefiShellFileGuid =3D { 0x7C04A583, 0x9E3E, 0x4f1c, {0xAD, 0x65,= 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1}};=0D +=0D +/**=0D + Perform the platform diagnostic, such like test memory. OEM/IBV also=0D + can customize this function to support specific platform diagnostic.=0D +=0D + @param MemoryTestLevel The memory test intensive level=0D + @param QuietBoot Indicate if need to enable the quiet boot=0D +=0D +**/=0D +VOID=0D +PlatformBootManagerDiagnostics (=0D + IN EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel,=0D + IN BOOLEAN QuietBoot=0D + )=0D +{=0D + EFI_STATUS Status;=0D +=0D + //=0D + // Here we can decide if we need to show=0D + // the diagnostics screen=0D + // Notes: this quiet boot code should be remove=0D + // from the graphic lib=0D + //=0D + if (QuietBoot) {=0D +=0D + //=0D + // Perform system diagnostic=0D + //=0D + Status =3D PlatformBootManagerMemoryTest (MemoryTestLevel);=0D + return;=0D + }=0D +=0D + //=0D + // Perform system diagnostic=0D + //=0D + Status =3D PlatformBootManagerMemoryTest (MemoryTestLevel);=0D +}=0D +=0D +/**=0D + Return the index of the load option in the load option array.=0D +=0D + The function consider two load options are equal when the=0D + OptionType, Attributes, Description, FilePath and OptionalData are equal= .=0D +=0D + @param Key Pointer to the load option to be found.=0D + @param Array Pointer to the array of load options to be found.=0D + @param Count Number of entries in the Array.=0D +=0D + @retval -1 Key wasn't found in the Array.=0D + @retval 0 ~ Count-1 The index of the Key in the Array.=0D +**/=0D +INTN=0D +PlatformFindLoadOption (=0D + IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,=0D + IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,=0D + IN UINTN Count=0D + )=0D +{=0D + UINTN Index;=0D +=0D + for (Index =3D 0; Index < Count; Index++) {=0D + if ((Key->OptionType =3D=3D Array[Index].OptionType) &&=0D + (Key->Attributes =3D=3D Array[Index].Attributes) &&=0D + (StrCmp (Key->Description, Array[Index].Description) =3D=3D 0) &&= =0D + (CompareMem (Key->FilePath, Array[Index].FilePath, GetDevicePathSi= ze (Key->FilePath)) =3D=3D 0) &&=0D + (Key->OptionalDataSize =3D=3D Array[Index].OptionalDataSize) &&=0D + (CompareMem (Key->OptionalData, Array[Index].OptionalData, Key->Op= tionalDataSize) =3D=3D 0)) {=0D + return (INTN) Index;=0D + }=0D + }=0D +=0D + return -1;=0D +}=0D +=0D +VOID=0D +PlatformRegisterFvBootOption (=0D + EFI_GUID *FileGuid,=0D + CHAR16 *Description,=0D + UINT32 Attributes=0D + )=0D +{=0D + EFI_STATUS Status;=0D + UINTN OptionIndex;=0D + EFI_BOOT_MANAGER_LOAD_OPTION NewOption;=0D + EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions;=0D + UINTN BootOptionCount;=0D + MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode;=0D + EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;=0D + EFI_DEVICE_PATH_PROTOCOL *DevicePath;=0D +=0D + Status =3D gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageProtocolGu= id, (VOID **) &LoadedImage);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D + EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid);=0D + DevicePath =3D AppendDevicePathNode (=0D + DevicePathFromHandle (LoadedImage->DeviceHandle),=0D + (EFI_DEVICE_PATH_PROTOCOL *) &FileNode=0D + );=0D +=0D + Status =3D EfiBootManagerInitializeLoadOption (=0D + &NewOption,=0D + LoadOptionNumberUnassigned,=0D + LoadOptionTypeBoot,=0D + Attributes,=0D + Description,=0D + DevicePath,=0D + NULL,=0D + 0=0D + );=0D + if (!EFI_ERROR (Status)) {=0D + BootOptions =3D EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOp= tionTypeBoot);=0D +=0D + OptionIndex =3D PlatformFindLoadOption (&NewOption, BootOptions, BootO= ptionCount);=0D +=0D + if (OptionIndex =3D=3D -1) {=0D + Status =3D EfiBootManagerAddLoadOptionVariable (&NewOption, (UINTN) = -1);=0D + ASSERT_EFI_ERROR (Status);=0D + }=0D + EfiBootManagerFreeLoadOption (&NewOption);=0D + EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);=0D + }=0D +}=0D +=0D +/**=0D + Do the platform specific action before the console is connected.=0D +=0D + Such as:=0D + Update console variable;=0D + Register new Driver#### or Boot####;=0D + Signal ReadyToLock event.=0D +**/=0D +VOID=0D +EFIAPI=0D +PlatformBootManagerBeforeConsole (=0D + VOID=0D + )=0D +{=0D + UINTN Index;=0D + EFI_STATUS Status;=0D + EFI_INPUT_KEY Enter;=0D + EFI_INPUT_KEY F2;=0D + EFI_BOOT_MANAGER_LOAD_OPTION BootOption;=0D +=0D + //=0D + // Update the console variables.=0D + //=0D + for (Index =3D 0; gPlatformConsole[Index].DevicePath !=3D NULL; Index++)= {=0D + DEBUG ((DEBUG_INFO, "Check gPlatformConsole %d\n", Index));=0D + if ((gPlatformConsole[Index].ConnectType & CONSOLE_IN) =3D=3D CONSOLE_= IN) {=0D + Status =3D EfiBootManagerUpdateConsoleVariable (ConIn, gPlatformCons= ole[Index].DevicePath, NULL);=0D + DEBUG ((DEBUG_INFO, "CONSOLE_IN variable set %s : %r\n", ConvertDevi= cePathToText (gPlatformConsole[Index].DevicePath, FALSE, FALSE), Status));= =0D + }=0D +=0D + if ((gPlatformConsole[Index].ConnectType & CONSOLE_OUT) =3D=3D CONSOLE= _OUT) {=0D + Status =3D EfiBootManagerUpdateConsoleVariable (ConOut, gPlatformCon= sole[Index].DevicePath, NULL);=0D + DEBUG ((DEBUG_INFO, "CONSOLE_OUT variable set %s : %r\n", ConvertDev= icePathToText (gPlatformConsole[Index].DevicePath, FALSE, FALSE), Status));= =0D + }=0D +=0D + if ((gPlatformConsole[Index].ConnectType & STD_ERROR) =3D=3D STD_ERROR= ) {=0D + Status =3D EfiBootManagerUpdateConsoleVariable (ErrOut, gPlatformCon= sole[Index].DevicePath, NULL);=0D + DEBUG ((DEBUG_INFO, "STD_ERROR variable set %r", Status));=0D + }=0D + }=0D +=0D + //=0D + // Register ENTER as CONTINUE key=0D + //=0D + Enter.ScanCode =3D SCAN_NULL;=0D + Enter.UnicodeChar =3D CHAR_CARRIAGE_RETURN;=0D + EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);=0D + //=0D + // Map F2 to Boot Manager Menu=0D + //=0D + F2.ScanCode =3D SCAN_F2;=0D + F2.UnicodeChar =3D CHAR_NULL;=0D + EfiBootManagerGetBootManagerMenu (&BootOption);=0D + EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumb= er, 0, &F2, NULL);=0D + //=0D + // Register UEFI Shell=0D + //=0D + PlatformRegisterFvBootOption (&mUefiShellFileGuid, L"UEFI Shell", LOAD_O= PTION_ACTIVE);=0D +}=0D +=0D +/**=0D + Do the platform specific action after the console is connected.=0D +=0D + Such as:=0D + Dynamically switch output mode;=0D + Signal console ready platform customized event;=0D + Run diagnostics like memory testing;=0D + Connect certain devices;=0D + Dispatch aditional option roms.=0D +**/=0D +VOID=0D +EFIAPI=0D +PlatformBootManagerAfterConsole (=0D + VOID=0D + )=0D +{=0D + EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black;=0D + EFI_GRAPHICS_OUTPUT_BLT_PIXEL White;=0D +=0D + Black.Blue =3D Black.Green =3D Black.Red =3D Black.Reserved =3D 0;=0D + White.Blue =3D White.Green =3D White.Red =3D White.Reserved =3D 0xFF;=0D +=0D + EfiBootManagerConnectAll ();=0D + EfiBootManagerRefreshAllBootOption ();=0D +=0D + PlatformBootManagerDiagnostics (QUICK, TRUE);=0D +=0D + PrintXY (10, 10, &White, &Black, L"F2 to enter Boot Manager Menu. = ");=0D + PrintXY (10, 30, &White, &Black, L"Enter to boot directly.");=0D +}=0D +=0D +/**=0D + The function is called when no boot option could be launched,=0D + including platform recovery options and options pointing to applications= =0D + built into firmware volumes.=0D +=0D + If this function returns, BDS attempts to enter an infinite loop.=0D +**/=0D +VOID=0D +EFIAPI=0D +PlatformBootManagerUnableToBoot (=0D + VOID=0D + )=0D +{=0D + return;=0D +}=0D diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Pla= tformData.c b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Pl= atformData.c new file mode 100644 index 0000000000..3208051e16 --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformDa= ta.c @@ -0,0 +1,49 @@ +/**@file=0D + Defined the platform specific device path which will be filled to=0D + ConIn/ConOut variables.=0D +=0D +Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights = reserved.
=0D +Copyright (c) 2015, Intel Corporation. All rights reserved.
=0D +=0D +SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include "PlatformBootManager.h"=0D +=0D +//=0D +// Platform specific serial device path=0D +//=0D +SERIAL_CONSOLE_DEVICE_PATH gSerialConsoleDevicePath0 =3D {=0D + {=0D + { HARDWARE_DEVICE_PATH, HW_VENDOR_DP, { sizeof (VENDOR_DEVICE_PATH), 0= } },=0D + EFI_SERIAL_DXE_GUID // Use the driver's GUID=0D + },=0D + {=0D + { MESSAGING_DEVICE_PATH, MSG_UART_DP, { sizeof (UART_DEVICE_PATH), 0} = },=0D + 0, // Reserved=0D + 115200, // BaudRate=0D + 8, // DataBits=0D + 1, // Parity=0D + 1 // StopBits=0D + },=0D + {=0D + { MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, { sizeof (VENDOR_DEVICE_PATH),= 0} },=0D + DEVICE_PATH_MESSAGING_PC_ANSI=0D + },=0D + { END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { sizeof (EFI_DE= VICE_PATH_PROTOCOL), 0 } }=0D +};=0D +=0D +//=0D +// Predefined platform default console device path=0D +//=0D +PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] =3D {=0D + {=0D + (EFI_DEVICE_PATH_PROTOCOL *) &gSerialConsoleDevicePath0,=0D + CONSOLE_OUT | CONSOLE_IN=0D + },=0D + {=0D + NULL,=0D + 0=0D + }=0D +};=0D diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Str= ings.uni b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Strin= gs.uni new file mode 100644 index 0000000000..357cced6d7 --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/Strings.uni @@ -0,0 +1,28 @@ +///** @file=0D +//=0D +// String definitions for PlatformBootManagerLib.=0D +//=0D +// Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rig= hts reserved.
=0D +// Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
= =0D +//=0D +// SPDX-License-Identifier: BSD-2-Clause-Patent=0D +//=0D +//**/=0D +=0D +/=3D#=0D +=0D +#langdef en-US "English"=0D +#langdef fr-FR "Fran=C3=A7ais"=0D +=0D +#string STR_PERFORM_MEM_TEST #language en-US "Perform memory te= st (ESC to skip)"=0D + #language fr-FR "Ex=C3=A9cute l'ex= amen de m=C3=A9moire (ESC pour sauter)"=0D +#string STR_MEMORY_TEST_PERCENT #language en-US "% of the system m= emory tested OK"=0D + #language fr-FR "% de la m=C3=A9mo= ire de syst=C3=A8me essay=C3=A9e D'ACCORD"=0D +#string STR_ESC_TO_SKIP_MEM_TEST #language en-US "Press ESC key to = skip memory test"=0D + #language fr-FR "Appuie sur ESC sa= uter examen de m=C3=A9moire"=0D +#string STR_MEM_TEST_COMPLETED #language en-US " bytes of system = memory tested OK\r\n"=0D + #language fr-FR " octets dela m=C3= =A9moire de syst=C3=A8me essay=C3=A9e D'ACCORD\r\n"=0D +#string STR_SYSTEM_MEM_ERROR #language en-US "System encounters= memory errors"=0D + #language fr-FR "le Syst=C3=A8me r= encontre les erreurs de m=C3=A9moire"=0D +#string STR_START_BOOT_OPTION #language en-US "Start boot option= "=0D + #language fr-FR "l'option de botte= de D=C3=A9but"=0D --=20 2.31.1