]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtualizationPkg: PlatformIntelBdsLib: remove ties to ARM BDS
authorLaszlo Ersek <lersek@redhat.com>
Wed, 25 Feb 2015 17:53:55 +0000 (17:53 +0000)
committerlersek <lersek@Edk2>
Wed, 25 Feb 2015 17:53:55 +0000 (17:53 +0000)
In this patch we remove all dependencies on ARM BDS libraries. We also
remove empty and/or unneeded functions, includes, etc.

PlatformIntelBdsLib "goes back to basics" temporarily -- there are no
consoles configured, and it's practically not possible to interact with
the user interface. Bisection remains available in the sense that
"ArmVirtualizationQemu.dsc" continues to build and should boot preexistent
boot options, but user interaction does regress temporarily.

The reason for this is that it's preferable to keep this patch and the
next one separate for readability's sake -- they amount to a rewrite from
scratch.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16923 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc
ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.h
ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf

index d3384a7dc1b355d738cfb1a96a8ee020d5fa0205..1547273956ebd06de6d172e01caf2635199d8cc9 100644 (file)
   gArmPlatformTokenSpaceGuid.PcdDefaultBootType|0\r
 \r
   #\r
-  # Use the serial console (ConIn & ConOut), the USB keyboard (ConIn), and the\r
-  # Graphic driver (ConOut).\r
+  # Settings for ARM BDS -- use the serial console (ConIn & ConOut).\r
   #\r
-  # For the PCI VGA device path to work, you must start QEMU with the option\r
-  # '-device VGA,addr=01.0' (see "Pci(0x1,0x0)").\r
-  #\r
-  # For the USB keyboard device path to work, the following QEMU options are\r
-  # needed (see "docs/usb2.txt" and "docs/ich9-ehci-uhci.cfg"):\r
-  #\r
-  # -device ich9-usb-ehci1,multifunction=on,addr=1d.7,id=ehci\r
-  # -device ich9-usb-uhci1,multifunction=on,addr=1d.0,masterbus=ehci.0,firstport=0\r
-  # -device ich9-usb-uhci2,multifunction=on,addr=1d.1,masterbus=ehci.0,firstport=2\r
-  # -device ich9-usb-uhci3,multifunction=on,addr=1d.2,masterbus=ehci.0,firstport=4\r
-  # -device usb-kbd,bus=ehci.0\r
-  #\r
-  # Note the match between addr=1d.7 and Pci(0x1D,0x7).\r
-  #\r
-  gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100();PciRoot(0x0)/Pci(0x1,0x0)/AcpiAdr(0x80010100)"\r
-  gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100();PciRoot(0x0)/Pci(0x1D,0x7)/USB(0x0,0x0)"\r
+  gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"\r
+  gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()"\r
   gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut|3\r
 \r
   #\r
index 6501539976f5033d34ba481588536b26988c552a..16c1d83089eed984aa75d1113126cb22ea39de68 100644 (file)
 \r
 **/\r
 \r
-#include "IntelBdsPlatform.h"\r
-\r
+#include <Library/PlatformBdsLib.h>\r
 #include <Library/QemuBootOrderLib.h>\r
 \r
+#include "IntelBdsPlatform.h"\r
+\r
 //\r
 // BDS Platform Functions\r
 //\r
@@ -34,146 +35,6 @@ PlatformBdsInit (
 {\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-GetConsoleDevicePathFromVariable (\r
-  IN  CHAR16*             ConsoleVarName,\r
-  IN  CHAR16*             DefaultConsolePaths,\r
-  OUT EFI_DEVICE_PATH**   DevicePaths\r
-  )\r
-{\r
-  EFI_STATUS                Status;\r
-  UINTN                     Size;\r
-  EFI_DEVICE_PATH_PROTOCOL* DevicePathInstances;\r
-  EFI_DEVICE_PATH_PROTOCOL* DevicePathInstance;\r
-  CHAR16*                   DevicePathStr;\r
-  CHAR16*                   NextDevicePathStr;\r
-  EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL  *EfiDevicePathFromTextProtocol;\r
-\r
-  Status = GetGlobalEnvironmentVariable (ConsoleVarName, NULL, NULL, (VOID**)&DevicePathInstances);\r
-  if (EFI_ERROR (Status)) {\r
-    // In case no default console device path has been defined we assume a driver handles the console (eg: SimpleTextInOutSerial)\r
-    if ((DefaultConsolePaths == NULL) || (DefaultConsolePaths[0] == L'\0')) {\r
-      *DevicePaths = NULL;\r
-      return EFI_SUCCESS;\r
-    }\r
-\r
-    Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);\r
-    ASSERT_EFI_ERROR (Status);\r
-\r
-    DevicePathInstances = NULL;\r
-\r
-    // Extract the Device Path instances from the multi-device path string\r
-    while ((DefaultConsolePaths != NULL) && (DefaultConsolePaths[0] != L'\0')) {\r
-      NextDevicePathStr = StrStr (DefaultConsolePaths, L";");\r
-      if (NextDevicePathStr == NULL) {\r
-        DevicePathStr = DefaultConsolePaths;\r
-        DefaultConsolePaths = NULL;\r
-      } else {\r
-        DevicePathStr = (CHAR16*)AllocateCopyPool ((NextDevicePathStr - DefaultConsolePaths + 1) * sizeof (CHAR16), DefaultConsolePaths);\r
-        *(DevicePathStr + (NextDevicePathStr - DefaultConsolePaths)) = L'\0';\r
-        DefaultConsolePaths = NextDevicePathStr;\r
-        if (DefaultConsolePaths[0] == L';') {\r
-          DefaultConsolePaths++;\r
-        }\r
-      }\r
-\r
-      DevicePathInstance = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath (DevicePathStr);\r
-      ASSERT (DevicePathInstance != NULL);\r
-      DevicePathInstances = AppendDevicePathInstance (DevicePathInstances, DevicePathInstance);\r
-\r
-      if (NextDevicePathStr != NULL) {\r
-        FreePool (DevicePathStr);\r
-      }\r
-      FreePool (DevicePathInstance);\r
-    }\r
-\r
-    // Set the environment variable with this device path multi-instances\r
-    Size = GetDevicePathSize (DevicePathInstances);\r
-    if (Size > 0) {\r
-      gRT->SetVariable (\r
-          ConsoleVarName,\r
-          &gEfiGlobalVariableGuid,\r
-          EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
-          Size,\r
-          DevicePathInstances\r
-          );\r
-    } else {\r
-      Status = EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    *DevicePaths = DevicePathInstances;\r
-  }\r
-  return Status;\r
-}\r
-\r
-STATIC\r
-VOID\r
-SetConsoleVariables (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS                Status;\r
-  EFI_DEVICE_PATH*          ConOutDevicePaths;\r
-  EFI_DEVICE_PATH*          ConInDevicePaths;\r
-  EFI_DEVICE_PATH*          ConErrDevicePaths;\r
-\r
-  // By getting the Console Device Paths from the environment variables before initializing the console pipe, we\r
-  // create the 3 environment variables (ConIn, ConOut, ConErr) that allows to initialize all the console interface\r
-  // of newly installed console drivers\r
-  Status = GetConsoleDevicePathFromVariable (L"ConOut", (CHAR16*)PcdGetPtr (PcdDefaultConOutPaths), &ConOutDevicePaths);\r
-  ASSERT_EFI_ERROR (Status);\r
-  Status = GetConsoleDevicePathFromVariable (L"ConIn", (CHAR16*)PcdGetPtr (PcdDefaultConInPaths), &ConInDevicePaths);\r
-  ASSERT_EFI_ERROR (Status);\r
-  Status = GetConsoleDevicePathFromVariable (L"ErrOut", (CHAR16*)PcdGetPtr (PcdDefaultConOutPaths), &ConErrDevicePaths);\r
-  ASSERT_EFI_ERROR (Status);\r
-}\r
-\r
-/**\r
-  Connect with predefined platform connect sequence,\r
-  the OEM/IBV can customize with their own connect sequence.\r
-**/\r
-VOID\r
-PlatformBdsConnectSequence (\r
-  VOID\r
-  )\r
-{\r
-}\r
-\r
-/**\r
-  Load the predefined driver option, OEM/IBV can customize this\r
-  to load their own drivers\r
-\r
-  @param BdsDriverLists  - The header of the driver option link list.\r
-\r
-**/\r
-VOID\r
-PlatformBdsGetDriverOption (\r
-  IN OUT LIST_ENTRY              *BdsDriverLists\r
-  )\r
-{\r
-}\r
-\r
-/**\r
-  Perform the platform diagnostic, such like test memory. OEM/IBV also\r
-  can customize this function to support specific platform diagnostic.\r
-\r
-  @param MemoryTestLevel  The memory test intensive level\r
-  @param QuietBoot        Indicate if need to enable the quiet boot\r
-  @param BaseMemoryTest   A pointer to BdsMemoryTest()\r
-\r
-**/\r
-VOID\r
-PlatformBdsDiagnostics (\r
-  IN EXTENDMEM_COVERAGE_LEVEL    MemoryTestLevel,\r
-  IN BOOLEAN                     QuietBoot,\r
-  IN BASEM_MEMORY_TEST           BaseMemoryTest\r
-  )\r
-{\r
-}\r
-\r
 /**\r
   The function will execute with as the platform policy, current policy\r
   is driven by boot mode. IBV/OEM can customize this code for their specific\r
@@ -194,7 +55,6 @@ PlatformBdsPolicyBehavior (
   IN BASEM_MEMORY_TEST               BaseMemoryTest\r
   )\r
 {\r
-  SetConsoleVariables ();\r
   BdsLibConnectAll ();\r
 \r
   //\r
@@ -265,24 +125,3 @@ PlatformBdsLockNonUpdatableFlash (
 {\r
   return;\r
 }\r
-\r
-\r
-/**\r
-  Lock the ConsoleIn device in system table. All key\r
-  presses will be ignored until the Password is typed in. The only way to\r
-  disable the password is to type it in to a ConIn device.\r
-\r
-  @param  Password        Password used to lock ConIn device.\r
-\r
-  @retval EFI_SUCCESS     lock the Console In Spliter virtual handle successfully.\r
-  @retval EFI_UNSUPPORTED Password not found\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-LockKeyboards (\r
-  IN  CHAR16    *Password\r
-  )\r
-{\r
-    return EFI_UNSUPPORTED;\r
-}\r
index 4d150d93a3a3b166ed483978b11ba304cdac7e75..3d29b0d099ce5df68251b00cfc3aefc5ade0424e 100644 (file)
 #ifndef _INTEL_BDS_PLATFORM_H_\r
 #define _INTEL_BDS_PLATFORM_H_\r
 \r
-#include <Protocol/DevicePathFromText.h>\r
-#include <Protocol/DevicePathToText.h>\r
-\r
 #include <Library/BaseLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
-#include <Library/BdsLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/DevicePathLib.h>\r
-#include <Library/GenericBdsLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/PlatformBdsLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 \r
-#include <Guid/GlobalVariable.h>\r
-\r
 VOID\r
 PlatformBdsEnterFrontPage (\r
   IN UINT16                 TimeoutDefault,\r
index e14b75cd8fe4dc07d19ac92dd3444fbb358ae2b1..c4e5d609ab6b62ab760b2753248633b7c6616169 100644 (file)
@@ -1,6 +1,5 @@
 ## @file\r
 #  Implementation for PlatformBdsLib library class interfaces.\r
-#  using ARM Platform framework.\r
 #\r
 #  Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>\r
 #  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
@@ -35,8 +34,6 @@
   QemuKernel.c\r
 \r
 [Packages]\r
-  ArmPkg/ArmPkg.dec\r
-  ArmPlatformPkg/ArmPlatformPkg.dec\r
   IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
   MdeModulePkg/MdeModulePkg.dec\r
   MdePkg/MdePkg.dec\r
@@ -45,7 +42,6 @@
 [LibraryClasses]\r
   BaseLib\r
   BaseMemoryLib\r
-  BdsLib\r
   DebugLib\r
   DevicePathLib\r
   GenericBdsLib\r
   UefiRuntimeServicesTableLib\r
 \r
 [Guids]\r
-  gArmGlobalVariableGuid\r
   gEfiFileInfoGuid\r
   gEfiFileSystemInfoGuid\r
   gEfiFileSystemVolumeLabelInfoIdGuid\r
 \r
-[Pcd]\r
-  gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths\r
-  gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths\r
-\r
 [Protocols]\r
-  gEfiDevicePathFromTextProtocolGuid\r
   gEfiDevicePathProtocolGuid\r
-  gEfiDevicePathToTextProtocolGuid\r
   gEfiLoadedImageProtocolGuid\r
   gEfiSimpleFileSystemProtocolGuid\r