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
\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
{\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
IN BASEM_MEMORY_TEST BaseMemoryTest\r
)\r
{\r
- SetConsoleVariables ();\r
BdsLibConnectAll ();\r
\r
//\r
{\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