X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Vlv2TbltDevicePkg%2FLibrary%2FPlatformBdsLib%2FBdsPlatform.c;h=e42e82b678b592eb956480a600682b5b62e347ab;hp=580d774d293f5d2981b8373e65f3eb6516c278af;hb=33aaf8d71faf09b1535b147a7a72782020d28b84;hpb=04d8d8835e87155f2c50ab39225bae504dee2c5d diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c index 580d774d29..e42e82b678 100644 --- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c +++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c @@ -27,7 +27,7 @@ Abstract: #include "SetupMode.h" #include #include -#include +#include #include #include #include @@ -217,7 +217,7 @@ ShellImageCallback ( // BDS Platform Functions // /** - Platform Bds init. Incude the platform firmware vendor, revision + Platform Bds init. Include the platform firmware vendor, revision and so crc check. @param VOID @@ -313,7 +313,7 @@ GetGopDevicePath ( } // - // Try to connect this handle, so that GOP dirver could start on this + // Try to connect this handle, so that GOP driver could start on this // device and create child handles with GraphicsOutput Protocol installed // on them, then we get device paths of these child handles and select // them as possible console device. @@ -430,7 +430,7 @@ GetGopDevicePath ( // In current implementation, we only enable one of the child handles // as console device, i.e. sotre one of the child handle's device // path to variable "ConOut" - // In futhure, we could select all child handles to be console device + // In future, we could select all child handles to be console device // *GopDevicePath = TempDevicePath; } @@ -783,7 +783,7 @@ UpdateConsoleResolution( Connect the predefined platform default console device. Always try to find and enable the vga device if have. - @param PlatformConsole Predfined platform default console device array. + @param PlatformConsole Predefined platform default console device array. @retval EFI_SUCCESS Success connect at least one ConIn and ConOut device, there must have one ConOut device is @@ -822,7 +822,7 @@ PlatformBdsConnectConsole ( if (VarConout == NULL || VarConin == NULL) { // // Have chance to connect the platform default console, - // the platform default console is the minimue device group + // the platform default console is the minimum device group // the platform should support // while (PlatformConsole[Index].DevicePath != NULL) { @@ -869,7 +869,7 @@ PlatformBdsConnectConsole ( } /** - Connect with predeined platform connect sequence, + Connect with predefined platform connect sequence, the OEM/IBV can customize with their own connect sequence. @param None. @@ -1571,7 +1571,7 @@ PlatformBdsLibEnumerateAllBootOption ( /** - The function will excute with as the platform policy, current policy + The function will execute with as the platform policy, current policy is driven by boot mode. IBV/OEM can customize this code for their specific policy action. @@ -1795,7 +1795,7 @@ PlatformBdsPolicyBehavior ( TcgPhysicalPresenceLibProcessRequest(); #endif #ifdef FTPM_ENABLE - TrEEPhysicalPresenceLibProcessRequest(NULL); + Tcg2PhysicalPresenceLibProcessRequest(NULL); #endif if (EsrtManagement != NULL) { @@ -1872,9 +1872,9 @@ PlatformBdsPolicyBehavior ( PlatformBdsConnectConsole (gPlatformConsole); PlatformBdsDiagnostics (EXTENSIVE, FALSE, BaseMemoryTest); - DEBUG((EFI_D_INFO, "ProcessCapsules Before EndOfDxe......\n")); + DEBUG((DEBUG_INFO, "ProcessCapsules Before EndOfDxe......\n")); ProcessCapsules (); - DEBUG((EFI_D_INFO, "ProcessCapsules Done\n")); + DEBUG((DEBUG_INFO, "ProcessCapsules Done\n")); // // Close boot script and install ready to lock @@ -1901,9 +1901,9 @@ PlatformBdsPolicyBehavior ( EsrtManagement->SyncEsrtFmp(); } - DEBUG((EFI_D_INFO, "ProcessCapsules After ConnectAll......\n")); + DEBUG((DEBUG_INFO, "ProcessCapsules After ConnectAll......\n")); ProcessCapsules(); - DEBUG((EFI_D_INFO, "ProcessCapsules Done\n")); + DEBUG((DEBUG_INFO, "ProcessCapsules Done\n")); break; case BOOT_IN_RECOVERY_MODE: @@ -2005,7 +2005,7 @@ FULL_CONFIGURATION: TcgPhysicalPresenceLibProcessRequest(); #endif #ifdef FTPM_ENABLE - TrEEPhysicalPresenceLibProcessRequest(NULL); + Tcg2PhysicalPresenceLibProcessRequest(NULL); #endif if (EsrtManagement != NULL) { @@ -2411,6 +2411,12 @@ ShowProgressHotKey ( EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background; EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color; UINT32 GpioValue; + CHAR16 *TmpStr1; + CHAR16 *TmpStr2; + CHAR16 *TmpStr3; + UINTN TmpStrSize; + VOID *Buffer; + UINTN Size; if (TimeoutDefault == 0) { return EFI_TIMEOUT; @@ -2434,10 +2440,76 @@ ShowProgressHotKey ( SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0); SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff); + TmpStr2 = NULL; + TmpStr3 = NULL; + + // + // Check if the platform is using test key. + // + Status = GetSectionFromAnyFv( + PcdGetPtr(PcdEdkiiRsa2048Sha256TestPublicKeyFileGuid), + EFI_SECTION_RAW, + 0, + &Buffer, + &Size + ); + if (!EFI_ERROR(Status)) { + if ((Size == PcdGetSize(PcdRsa2048Sha256PublicKeyBuffer)) && + (CompareMem(Buffer, PcdGetPtr(PcdRsa2048Sha256PublicKeyBuffer), Size) == 0)) { + TmpStr2 = L"WARNING: Recovery Test Key is used.\r\n"; + if (DebugAssertEnabled()) { + DEBUG ((DEBUG_INFO, "\n\nWARNING: Recovery Test Key is used.\n")); + } else { + SerialPortWrite((UINT8 *)"\n\nWARNING: Recovery Test Key is used.", sizeof("\n\nWARNING: Recovery Test Key is used.")); + } + PcdSetBoolS(PcdTestKeyUsed, TRUE); + } + FreePool(Buffer); + } + Status = GetSectionFromAnyFv( + PcdGetPtr(PcdEdkiiPkcs7TestPublicKeyFileGuid), + EFI_SECTION_RAW, + 0, + &Buffer, + &Size + ); + if (!EFI_ERROR(Status)) { + if ((Size == PcdGetSize(PcdPkcs7CertBuffer)) && + (CompareMem(Buffer, PcdGetPtr(PcdPkcs7CertBuffer), Size) == 0)) { + TmpStr3 = L"WARNING: Capsule Test Key is used.\r\n"; + if (DebugAssertEnabled()) { + DEBUG ((DEBUG_INFO, "\n\nWARNING: Capsule Test Key is used.\r\n")); + } else { + SerialPortWrite((UINT8 *)"\n\nWARNING: Capsule Test Key is used.", sizeof("\n\nWARNING: Capsule Test Key is used.")); + } + PcdSetBoolS(PcdTestKeyUsed, TRUE); + } + FreePool(Buffer); + } + // // Clear the progress status bar first // - TmpStr = L"Start boot option, Press or to enter setup page."; + TmpStr1 = L"Start boot option, Press or to enter setup page.\r\n"; + TmpStrSize = StrSize(TmpStr1); + if (TmpStr2 != NULL) { + TmpStrSize += StrSize(TmpStr2); + } + if (TmpStr3 != NULL) { + TmpStrSize += StrSize(TmpStr3); + } + TmpStr = AllocatePool (TmpStrSize); + if (TmpStr == NULL) { + TmpStr = TmpStr1; + } else { + StrCpyS(TmpStr, TmpStrSize/sizeof(CHAR16), TmpStr1); + if (TmpStr2 != NULL) { + StrCatS(TmpStr, TmpStrSize/sizeof(CHAR16), TmpStr2); + } + if (TmpStr3 != NULL) { + StrCatS(TmpStr, TmpStrSize/sizeof(CHAR16), TmpStr3); + } + } PlatformBdsShowProgress (Foreground, Background, TmpStr, Color, 0, 0); TimeoutRemain = TimeoutDefault; @@ -2838,7 +2910,7 @@ PlatformBdsConnectSimpleConsole ( if (VarConout == NULL || VarConin == NULL) { // // Have chance to connect the platform default console, - // the platform default console is the minimue device group + // the platform default console is the minimum device group // the platform should support // while (PlatformConsole[Index].DevicePath != NULL) {