X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPlatformPkg%2FBds%2FBdsEntry.c;h=62e8236e844ab6337af37a213e1f90963f4cb1fb;hp=8a7a357b0ffb2a6335ab718ca9ec8c43678e5857;hb=09eb2dc3e88317266b4f037799d6856638224db3;hpb=643ec0e7c1633c1970a154fa6bdada6eb1d3daa2 diff --git a/ArmPlatformPkg/Bds/BdsEntry.c b/ArmPlatformPkg/Bds/BdsEntry.c index 8a7a357b0f..62e8236e84 100644 --- a/ArmPlatformPkg/Bds/BdsEntry.c +++ b/ArmPlatformPkg/Bds/BdsEntry.c @@ -83,13 +83,17 @@ EFI_STATUS GetEnvironmentVariable ( return EFI_SUCCESS; } -VOID InitializeConsole ( +EFI_STATUS +InitializeConsole ( VOID ) { EFI_STATUS Status; UINTN NoHandles; EFI_HANDLE *Buffer; + BOOLEAN AllDriversConnected; + + AllDriversConnected = FALSE; // // Now we need to setup the EFI System Table with information about the console devices. @@ -97,6 +101,12 @@ VOID InitializeConsole ( // consoles at the same time // Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleTextOutProtocolGuid, NULL, &NoHandles, &Buffer); + if (EFI_ERROR (Status)) { + BdsConnectAllDrivers(); + AllDriversConnected = TRUE; + Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleTextOutProtocolGuid, NULL, &NoHandles, &Buffer); + } + if (!EFI_ERROR (Status)) { // Use the first SimpleTextOut we find and update the EFI System Table gST->ConsoleOutHandle = Buffer[0]; @@ -107,9 +117,16 @@ VOID InitializeConsole ( gST->StdErr = gST->ConOut; FreePool (Buffer); - } + } else { + return Status; + } Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleTextInProtocolGuid, NULL, &NoHandles, &Buffer); + if (EFI_ERROR (Status) && !AllDriversConnected) { + BdsConnectAllDrivers(); + Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleTextInProtocolGuid, NULL, &NoHandles, &Buffer); + } + if (!EFI_ERROR (Status)) { // Use the first SimpleTextIn we find and update the EFI System Table gST->ConsoleInHandle = Buffer[0]; @@ -117,7 +134,11 @@ VOID InitializeConsole ( ASSERT_EFI_ERROR (Status); FreePool (Buffer); + } else { + return Status; } + + return EFI_SUCCESS; } EFI_STATUS @@ -238,7 +259,8 @@ BdsEntry ( PERF_END (NULL, "DXE", NULL, 0); PERF_START (NULL, "BDS", NULL, 0); - InitializeConsole(); + Status = InitializeConsole(); + ASSERT_EFI_ERROR(Status); while (1) { // Get the Linux Kernel Device Path from Environment Variable