3 Copyright (c) 2006 - 2010, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 This file include all platform action which can be customized
23 #include "BdsPlatform.h"
25 #define IS_PCI_ISA_PDECODE(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA_PDECODE, 0)
27 extern BOOLEAN gConnectAllHappened
;
28 extern USB_CLASS_FORMAT_DEVICE_PATH gUsbClassKeyboardDevicePath
;
30 EFI_GUID
*gTableGuidArray
[] = {
31 &gEfiAcpi20TableGuid
, &gEfiAcpiTableGuid
, &gEfiSmbiosTableGuid
, &gEfiMpsTableGuid
35 // BDS Platform Functions
39 GetSystemTablesFromHob (
45 Find GUID'ed HOBs that contain EFI_PHYSICAL_ADDRESS of ACPI, SMBIOS, MPs tables
55 EFI_PEI_HOB_POINTERS GuidHob
;
56 EFI_PEI_HOB_POINTERS HobStart
;
57 EFI_PHYSICAL_ADDRESS
*Table
;
63 HobStart
.Raw
= GetHobList ();
65 // Iteratively add ACPI Table, SMBIOS Table, MPS Table to EFI System Table
67 for (Index
= 0; Index
< sizeof (gTableGuidArray
) / sizeof (*gTableGuidArray
); ++Index
) {
68 GuidHob
.Raw
= GetNextGuidHob (gTableGuidArray
[Index
], HobStart
.Raw
);
69 if (GuidHob
.Raw
!= NULL
) {
70 Table
= GET_GUID_HOB_DATA (GuidHob
.Guid
);
73 // Check if Mps Table/Smbios Table/Acpi Table exists in E/F seg,
74 // According to UEFI Spec, we should make sure Smbios table,
75 // ACPI table and Mps tables kept in memory of specified type
77 ConvertSystemTable(gTableGuidArray
[Index
], (VOID
**)&Table
);
78 gBS
->InstallConfigurationTable (gTableGuidArray
[Index
], (VOID
*)Table
);
86 #define EFI_LDR_MEMORY_DESCRIPTOR_GUID \
87 { 0x7701d7e5, 0x7d1d, 0x4432, {0xa4, 0x68, 0x67, 0x3d, 0xab, 0x8a, 0xde, 0x60 }}
89 EFI_GUID gEfiLdrMemoryDescriptorGuid
= EFI_LDR_MEMORY_DESCRIPTOR_GUID
;
94 EFI_HOB_GUID_TYPE Hob
;
96 EFI_MEMORY_DESCRIPTOR
*MemDesc
;
107 EFI_MEMORY_DESCRIPTOR
*MemMap
;
108 EFI_MEMORY_DESCRIPTOR
*MemMapPtr
;
110 UINTN MapKey
, DescriptorSize
;
112 UINT32 DescriptorVersion
;
118 Status
= gBS
->GetMemoryMap (&MemMapSize
, MemMap
, &MapKey
, &DescriptorSize
, &DescriptorVersion
);
119 ASSERT (Status
== EFI_BUFFER_TOO_SMALL
);
120 MemMapSize
+= EFI_PAGE_SIZE
;
121 Status
= gBS
->AllocatePool (EfiBootServicesData
, MemMapSize
, &MemMap
);
122 ASSERT (Status
== EFI_SUCCESS
);
123 Status
= gBS
->GetMemoryMap (&MemMapSize
, MemMap
, &MapKey
, &DescriptorSize
, &DescriptorVersion
);
124 ASSERT (Status
== EFI_SUCCESS
);
127 ASSERT (DescriptorVersion
== EFI_MEMORY_DESCRIPTOR_VERSION
);
129 for (Index
= 0; Index
< MemMapSize
/ DescriptorSize
; Index
++) {
130 Bytes
= LShiftU64 (MemMap
->NumberOfPages
, 12);
131 DEBUG ((EFI_D_ERROR
, "%lX-%lX %lX %lX %X\n",
132 MemMap
->PhysicalStart
,
133 MemMap
->PhysicalStart
+ Bytes
- 1,
134 MemMap
->NumberOfPages
,
136 (UINTN
)MemMap
->Type
));
137 MemMap
= (EFI_MEMORY_DESCRIPTOR
*)((UINTN
)MemMap
+ DescriptorSize
);
140 gBS
->FreePool (MemMapPtr
);
150 EFI_PEI_HOB_POINTERS GuidHob
;
152 MEMORY_DESC_HOB MemoryDescHob
;
154 EFI_PHYSICAL_ADDRESS Memory
;
155 EFI_GCD_MEMORY_SPACE_DESCRIPTOR Descriptor
;
157 GuidHob
.Raw
= GetFirstGuidHob (&gEfiLdrMemoryDescriptorGuid
);
158 if (GuidHob
.Raw
== NULL
) {
159 DEBUG ((EFI_D_ERROR
, "Fail to get gEfiLdrMemoryDescriptorGuid from GUID HOB LIST!\n"));
162 Table
= GET_GUID_HOB_DATA (GuidHob
.Guid
);
164 DEBUG ((EFI_D_ERROR
, "Fail to get gEfiLdrMemoryDescriptorGuid from GUID HOB LIST!\n"));
167 MemoryDescHob
.MemDescCount
= *(UINTN
*)Table
;
168 MemoryDescHob
.MemDesc
= *(EFI_MEMORY_DESCRIPTOR
**)((UINTN
)Table
+ sizeof(UINTN
));
171 // Add ACPINVS, ACPIReclaim, and Reserved memory to MemoryMap
173 for (Index
= 0; Index
< MemoryDescHob
.MemDescCount
; Index
++) {
174 if (MemoryDescHob
.MemDesc
[Index
].PhysicalStart
< 0x100000) {
177 if (MemoryDescHob
.MemDesc
[Index
].PhysicalStart
>= 0x100000000ULL
) {
180 if ((MemoryDescHob
.MemDesc
[Index
].Type
== EfiReservedMemoryType
) ||
181 (MemoryDescHob
.MemDesc
[Index
].Type
== EfiRuntimeServicesData
) ||
182 (MemoryDescHob
.MemDesc
[Index
].Type
== EfiRuntimeServicesCode
) ||
183 (MemoryDescHob
.MemDesc
[Index
].Type
== EfiACPIReclaimMemory
) ||
184 (MemoryDescHob
.MemDesc
[Index
].Type
== EfiACPIMemoryNVS
)) {
185 DEBUG ((EFI_D_ERROR
, "PhysicalStart - 0x%016lx, ", MemoryDescHob
.MemDesc
[Index
].PhysicalStart
));
186 DEBUG ((EFI_D_ERROR
, "PageNumber - 0x%016lx, ", MemoryDescHob
.MemDesc
[Index
].NumberOfPages
));
187 DEBUG ((EFI_D_ERROR
, "Attribute - 0x%016lx, ", MemoryDescHob
.MemDesc
[Index
].Attribute
));
188 DEBUG ((EFI_D_ERROR
, "Type - 0x%08x\n", MemoryDescHob
.MemDesc
[Index
].Type
));
189 if ((MemoryDescHob
.MemDesc
[Index
].Type
== EfiRuntimeServicesData
) ||
190 (MemoryDescHob
.MemDesc
[Index
].Type
== EfiRuntimeServicesCode
)) {
192 // For RuntimeSevicesData and RuntimeServicesCode, they are BFV or DxeCore.
193 // The memory type is assigned in EfiLdr
195 Status
= gDS
->GetMemorySpaceDescriptor (MemoryDescHob
.MemDesc
[Index
].PhysicalStart
, &Descriptor
);
196 if (EFI_ERROR (Status
)) {
199 if (Descriptor
.GcdMemoryType
!= EfiGcdMemoryTypeReserved
) {
201 // BFV or tested DXE core
206 // Untested DXE Core region, free and remove
208 Status
= gDS
->FreeMemorySpace (
209 MemoryDescHob
.MemDesc
[Index
].PhysicalStart
,
210 LShiftU64 (MemoryDescHob
.MemDesc
[Index
].NumberOfPages
, EFI_PAGE_SHIFT
)
212 if (EFI_ERROR (Status
)) {
213 DEBUG ((EFI_D_ERROR
, "FreeMemorySpace fail - %r!\n", Status
));
216 Status
= gDS
->RemoveMemorySpace (
217 MemoryDescHob
.MemDesc
[Index
].PhysicalStart
,
218 LShiftU64 (MemoryDescHob
.MemDesc
[Index
].NumberOfPages
, EFI_PAGE_SHIFT
)
220 if (EFI_ERROR (Status
)) {
221 DEBUG ((EFI_D_ERROR
, "RemoveMemorySpace fail - %r!\n", Status
));
226 // Convert Runtime type to BootTime type
228 if (MemoryDescHob
.MemDesc
[Index
].Type
== EfiRuntimeServicesData
) {
229 MemoryDescHob
.MemDesc
[Index
].Type
= EfiBootServicesData
;
231 MemoryDescHob
.MemDesc
[Index
].Type
= EfiBootServicesCode
;
235 // PassThrough, let below code add and alloate.
239 // ACPI or reserved memory
241 Status
= gDS
->AddMemorySpace (
242 EfiGcdMemoryTypeSystemMemory
,
243 MemoryDescHob
.MemDesc
[Index
].PhysicalStart
,
244 LShiftU64 (MemoryDescHob
.MemDesc
[Index
].NumberOfPages
, EFI_PAGE_SHIFT
),
245 MemoryDescHob
.MemDesc
[Index
].Attribute
247 if (EFI_ERROR (Status
)) {
248 DEBUG ((EFI_D_ERROR
, "AddMemorySpace fail - %r!\n", Status
));
249 if ((MemoryDescHob
.MemDesc
[Index
].Type
== EfiACPIReclaimMemory
) ||
250 (MemoryDescHob
.MemDesc
[Index
].Type
== EfiACPIMemoryNVS
)) {
252 // For EfiACPIReclaimMemory and EfiACPIMemoryNVS, it must success.
253 // For EfiReservedMemoryType, there maybe overlap. So skip check here.
255 // ASSERT_EFI_ERROR (Status);
260 Memory
= MemoryDescHob
.MemDesc
[Index
].PhysicalStart
;
261 Status
= gBS
->AllocatePages (
263 (EFI_MEMORY_TYPE
)MemoryDescHob
.MemDesc
[Index
].Type
,
264 (UINTN
)MemoryDescHob
.MemDesc
[Index
].NumberOfPages
,
267 if (EFI_ERROR (Status
)) {
268 DEBUG ((EFI_D_ERROR
, "AllocatePages fail - %r!\n", Status
));
270 // For the page added, it must be allocated.
272 // ASSERT_EFI_ERROR (Status);
281 DisableUsbLegacySupport(
287 Disabble the USB legacy Support in all Ehci and Uhci.
288 This function assume all PciIo handles have been created in system.
299 EFI_HANDLE
*HandleArray
;
300 UINTN HandleArrayCount
;
302 EFI_PCI_IO_PROTOCOL
*PciIo
;
311 // Find the usb host controller
313 Status
= gBS
->LocateHandleBuffer (
315 &gEfiPciIoProtocolGuid
,
320 if (!EFI_ERROR (Status
)) {
321 for (Index
= 0; Index
< HandleArrayCount
; Index
++) {
322 Status
= gBS
->HandleProtocol (
324 &gEfiPciIoProtocolGuid
,
327 if (!EFI_ERROR (Status
)) {
329 // Find the USB host controller controller
331 Status
= PciIo
->Pci
.Read (PciIo
, EfiPciIoWidthUint8
, 0x09, 3, &Class
);
332 if (!EFI_ERROR (Status
)) {
333 if ((PCI_CLASS_SERIAL
== Class
[2]) &&
334 (PCI_CLASS_SERIAL_USB
== Class
[1])) {
335 if (PCI_IF_UHCI
== Class
[0]) {
337 // Found the UHCI, then disable the legacy support
340 Status
= PciIo
->Pci
.Write (PciIo
, EfiPciIoWidthUint16
, 0xC0, 1, &Command
);
341 } else if (PCI_IF_EHCI
== Class
[0]) {
343 // Found the EHCI, then disable the legacy support
345 Status
= PciIo
->Mem
.Read (
349 (UINT64
) 0x08, //EHC_HCCPARAMS_OFFSET
354 ExtendCap
= (HcCapParams
>> 8) & 0xFF;
356 // Disable the SMI in USBLEGCTLSTS firstly
358 PciIo
->Pci
.Read (PciIo
, EfiPciIoWidthUint32
, ExtendCap
+ 0x4, 1, &Value
);
360 PciIo
->Pci
.Write (PciIo
, EfiPciIoWidthUint32
, ExtendCap
+ 0x4, 1, &Value
);
363 // Get EHCI Ownership from legacy bios
365 PciIo
->Pci
.Read (PciIo
, EfiPciIoWidthUint32
, ExtendCap
, 1, &Value
);
366 Value
|= (0x1 << 24);
367 PciIo
->Pci
.Write (PciIo
, EfiPciIoWidthUint32
, ExtendCap
, 1, &Value
);
373 PciIo
->Pci
.Read (PciIo
, EfiPciIoWidthUint32
, ExtendCap
, 1, &Value
);
375 if ((Value
& 0x01010000) == 0x01000000) {
387 gBS
->FreePool (HandleArray
);
401 Platform Bds init. Incude the platform firmware vendor, revision
412 GetSystemTablesFromHob ();
417 // Append Usb Keyboard short form DevicePath into "ConInDev"
419 BdsLibUpdateConsoleVariable (
421 (EFI_DEVICE_PATH_PROTOCOL
*) &gUsbClassKeyboardDevicePath
,
427 GetPciExpressBaseAddressForRootBridge (
428 IN UINTN HostBridgeNumber
,
429 IN UINTN RootBridgeNumber
434 This routine is to get PciExpress Base Address for this RootBridge
437 HostBridgeNumber - The number of HostBridge
438 RootBridgeNumber - The number of RootBridge
441 UINT64 - PciExpressBaseAddress for this HostBridge and RootBridge
445 EFI_PCI_EXPRESS_BASE_ADDRESS_INFORMATION
*PciExpressBaseAddressInfo
;
449 EFI_PEI_HOB_POINTERS GuidHob
;
452 // Get PciExpressAddressInfo Hob
454 PciExpressBaseAddressInfo
= NULL
;
456 GuidHob
.Raw
= GetFirstGuidHob (&gEfiPciExpressBaseAddressGuid
);
457 if (GuidHob
.Raw
!= NULL
) {
458 PciExpressBaseAddressInfo
= GET_GUID_HOB_DATA (GuidHob
.Guid
);
459 BufferSize
= GET_GUID_HOB_DATA_SIZE (GuidHob
.Guid
);
465 // Search the PciExpress Base Address in the Hob for current RootBridge
467 Number
= (UINT32
)(BufferSize
/ sizeof(EFI_PCI_EXPRESS_BASE_ADDRESS_INFORMATION
));
468 for (Index
= 0; Index
< Number
; Index
++) {
469 if ((PciExpressBaseAddressInfo
[Index
].HostBridgeNumber
== HostBridgeNumber
) &&
470 (PciExpressBaseAddressInfo
[Index
].RootBridgeNumber
== RootBridgeNumber
)) {
471 return PciExpressBaseAddressInfo
[Index
].PciExpressBaseAddress
;
476 // Do not find the PciExpress Base Address in the Hob
482 PatchPciRootBridgeDevicePath (
483 IN UINTN HostBridgeNumber
,
484 IN UINTN RootBridgeNumber
,
485 IN PLATFORM_ROOT_BRIDGE_DEVICE_PATH
*RootBridge
488 UINT64 PciExpressBase
;
490 PciExpressBase
= GetPciExpressBaseAddressForRootBridge (HostBridgeNumber
, RootBridgeNumber
);
492 DEBUG ((EFI_D_INFO
, "Get PciExpress Address from Hob: 0x%X\n", PciExpressBase
));
494 if (PciExpressBase
!= 0) {
495 RootBridge
->PciRootBridge
.HID
= EISA_PNP_ID(0x0A08);
515 EFI_SUCCESS - Connect RootBridge successfully.
516 EFI_STATUS - Connect RootBridge fail.
521 EFI_HANDLE RootHandle
;
524 // Patch Pci Root Bridge Device Path
526 PatchPciRootBridgeDevicePath (0, 0, &gPlatformRootBridge0
);
529 // Make all the PCI_IO protocols on PCI Seg 0 show up
531 BdsLibConnectDevicePath (gPlatformRootBridges
[0]);
533 Status
= gBS
->LocateDevicePath (
534 &gEfiDevicePathProtocolGuid
,
535 &gPlatformRootBridges
[0],
538 DEBUG ((EFI_D_INFO
, "Pci Root bridge handle is 0x%X\n", RootHandle
));
540 if (EFI_ERROR (Status
)) {
544 Status
= gBS
->ConnectController (RootHandle
, NULL
, NULL
, FALSE
);
545 if (EFI_ERROR (Status
)) {
553 PrepareLpcBridgeDevicePath (
554 IN EFI_HANDLE DeviceHandle
560 Add IsaKeyboard to ConIn,
561 add IsaSerial to ConOut, ConIn, ErrOut.
566 DeviceHandle - Handle of PCIIO protocol.
570 EFI_SUCCESS - LPC bridge is added to ConOut, ConIn, and ErrOut.
571 EFI_STATUS - No LPC bridge is added.
576 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
577 EFI_DEVICE_PATH_PROTOCOL
*TempDevicePath
;
580 Status
= gBS
->HandleProtocol (
582 &gEfiDevicePathProtocolGuid
,
585 if (EFI_ERROR (Status
)) {
588 TempDevicePath
= DevicePath
;
593 DevicePath
= AppendDevicePathNode (DevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*)&gPnpPs2KeyboardDeviceNode
);
595 BdsLibUpdateConsoleVariable (VarConsoleInp
, DevicePath
, NULL
);
600 DevicePath
= TempDevicePath
;
601 gPnp16550ComPortDeviceNode
.UID
= 0;
603 DevicePath
= AppendDevicePathNode (DevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*)&gPnp16550ComPortDeviceNode
);
604 DevicePath
= AppendDevicePathNode (DevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*)&gUartDeviceNode
);
605 DevicePath
= AppendDevicePathNode (DevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*)&gTerminalTypeDeviceNode
);
607 BdsLibUpdateConsoleVariable (VarConsoleOut
, DevicePath
, NULL
);
608 BdsLibUpdateConsoleVariable (VarConsoleInp
, DevicePath
, NULL
);
609 BdsLibUpdateConsoleVariable (VarErrorOut
, DevicePath
, NULL
);
614 DevicePath
= TempDevicePath
;
615 gPnp16550ComPortDeviceNode
.UID
= 1;
617 DevicePath
= AppendDevicePathNode (DevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*)&gPnp16550ComPortDeviceNode
);
618 DevicePath
= AppendDevicePathNode (DevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*)&gUartDeviceNode
);
619 DevicePath
= AppendDevicePathNode (DevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*)&gTerminalTypeDeviceNode
);
621 BdsLibUpdateConsoleVariable (VarConsoleOut
, DevicePath
, NULL
);
622 BdsLibUpdateConsoleVariable (VarConsoleInp
, DevicePath
, NULL
);
623 BdsLibUpdateConsoleVariable (VarErrorOut
, DevicePath
, NULL
);
630 IN EFI_DEVICE_PATH_PROTOCOL
*PciDevicePath
,
631 OUT EFI_DEVICE_PATH_PROTOCOL
**GopDevicePath
636 EFI_HANDLE PciDeviceHandle
;
637 EFI_DEVICE_PATH_PROTOCOL
*TempDevicePath
;
638 EFI_DEVICE_PATH_PROTOCOL
*TempPciDevicePath
;
639 UINTN GopHandleCount
;
640 EFI_HANDLE
*GopHandleBuffer
;
642 if (PciDevicePath
== NULL
|| GopDevicePath
== NULL
) {
643 return EFI_INVALID_PARAMETER
;
647 // Initialize the GopDevicePath to be PciDevicePath
649 *GopDevicePath
= PciDevicePath
;
650 TempPciDevicePath
= PciDevicePath
;
652 Status
= gBS
->LocateDevicePath (
653 &gEfiDevicePathProtocolGuid
,
657 if (EFI_ERROR (Status
)) {
662 // Try to connect this handle, so that GOP dirver could start on this
663 // device and create child handles with GraphicsOutput Protocol installed
664 // on them, then we get device paths of these child handles and select
665 // them as possible console device.
667 gBS
->ConnectController (PciDeviceHandle
, NULL
, NULL
, FALSE
);
669 Status
= gBS
->LocateHandleBuffer (
671 &gEfiGraphicsOutputProtocolGuid
,
676 if (!EFI_ERROR (Status
)) {
678 // Add all the child handles as possible Console Device
680 for (Index
= 0; Index
< GopHandleCount
; Index
++) {
681 Status
= gBS
->HandleProtocol (GopHandleBuffer
[Index
], &gEfiDevicePathProtocolGuid
, (VOID
*)&TempDevicePath
);
682 if (EFI_ERROR (Status
)) {
688 GetDevicePathSize (PciDevicePath
) - END_DEVICE_PATH_LENGTH
691 // In current implementation, we only enable one of the child handles
692 // as console device, i.e. sotre one of the child handle's device
693 // path to variable "ConOut"
694 // In futhure, we could select all child handles to be console device
697 *GopDevicePath
= TempDevicePath
;
700 // Delete the PCI device's path that added by GetPlugInPciVgaDevicePath()
701 // Add the integrity GOP device path.
703 BdsLibUpdateConsoleVariable (VarConsoleOutDev
, NULL
, PciDevicePath
);
704 BdsLibUpdateConsoleVariable (VarConsoleOutDev
, TempDevicePath
, NULL
);
707 gBS
->FreePool (GopHandleBuffer
);
714 PreparePciVgaDevicePath (
715 IN EFI_HANDLE DeviceHandle
721 Add PCI VGA to ConOut.
726 DeviceHandle - Handle of PCIIO protocol.
730 EFI_SUCCESS - PCI VGA is added to ConOut.
731 EFI_STATUS - No PCI VGA device is added.
736 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
737 EFI_DEVICE_PATH_PROTOCOL
*GopDevicePath
;
740 Status
= gBS
->HandleProtocol (
742 &gEfiDevicePathProtocolGuid
,
745 if (EFI_ERROR (Status
)) {
749 GetGopDevicePath (DevicePath
, &GopDevicePath
);
750 DevicePath
= GopDevicePath
;
752 BdsLibUpdateConsoleVariable (VarConsoleOut
, DevicePath
, NULL
);
758 PreparePciSerialDevicePath (
759 IN EFI_HANDLE DeviceHandle
765 Add PCI Serial to ConOut, ConIn, ErrOut.
770 DeviceHandle - Handle of PCIIO protocol.
774 EFI_SUCCESS - PCI Serial is added to ConOut, ConIn, and ErrOut.
775 EFI_STATUS - No PCI Serial device is added.
780 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
783 Status
= gBS
->HandleProtocol (
785 &gEfiDevicePathProtocolGuid
,
788 if (EFI_ERROR (Status
)) {
792 DevicePath
= AppendDevicePathNode (DevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*)&gUartDeviceNode
);
793 DevicePath
= AppendDevicePathNode (DevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*)&gTerminalTypeDeviceNode
);
795 BdsLibUpdateConsoleVariable (VarConsoleOut
, DevicePath
, NULL
);
796 BdsLibUpdateConsoleVariable (VarConsoleInp
, DevicePath
, NULL
);
797 BdsLibUpdateConsoleVariable (VarErrorOut
, DevicePath
, NULL
);
803 DetectAndPreparePlatformPciDevicePath (
804 BOOLEAN DetectVgaOnly
810 Do platform specific PCI Device check and add them to ConOut, ConIn, ErrOut
814 DetectVgaOnly - Only detect VGA device if it's TRUE.
818 EFI_SUCCESS - PCI Device check and Console variable update successfully.
819 EFI_STATUS - PCI Device check or Console variable update fail.
825 EFI_HANDLE
*HandleBuffer
;
827 EFI_PCI_IO_PROTOCOL
*PciIo
;
831 // Start to check all the PciIo to find all possible device
835 Status
= gBS
->LocateHandleBuffer (
837 &gEfiPciIoProtocolGuid
,
842 if (EFI_ERROR (Status
)) {
846 for (Index
= 0; Index
< HandleCount
; Index
++) {
847 Status
= gBS
->HandleProtocol (HandleBuffer
[Index
], &gEfiPciIoProtocolGuid
, (VOID
*)&PciIo
);
848 if (EFI_ERROR (Status
)) {
853 // Check for all PCI device
855 Status
= PciIo
->Pci
.Read (
859 sizeof (Pci
) / sizeof (UINT32
),
862 if (EFI_ERROR (Status
)) {
866 if (!DetectVgaOnly
) {
868 // Here we decide whether it is LPC Bridge
870 if ((IS_PCI_LPC (&Pci
)) ||
871 ((IS_PCI_ISA_PDECODE (&Pci
)) && (Pci
.Hdr
.VendorId
== 0x8086) && (Pci
.Hdr
.DeviceId
== 0x7110))) {
873 // Add IsaKeyboard to ConIn,
874 // add IsaSerial to ConOut, ConIn, ErrOut
876 DEBUG ((EFI_D_INFO
, "Find the LPC Bridge device\n"));
877 PrepareLpcBridgeDevicePath (HandleBuffer
[Index
]);
881 // Here we decide which Serial device to enable in PCI bus
883 if (IS_PCI_16550SERIAL (&Pci
)) {
885 // Add them to ConOut, ConIn, ErrOut.
887 DEBUG ((EFI_D_INFO
, "Find the 16550 SERIAL device\n"));
888 PreparePciSerialDevicePath (HandleBuffer
[Index
]);
894 // Here we decide which VGA device to enable in PCI bus
896 if (IS_PCI_VGA (&Pci
)) {
898 // Add them to ConOut.
900 DEBUG ((EFI_D_INFO
, "Find the VGA device\n"));
901 PreparePciVgaDevicePath (HandleBuffer
[Index
]);
906 gBS
->FreePool (HandleBuffer
);
912 PlatformBdsConnectConsole (
913 IN BDS_CONSOLE_CONNECT_ENTRY
*PlatformConsole
919 Connect the predefined platform default console device. Always try to find
920 and enable the vga device if have.
924 PlatformConsole - Predfined platform default console device array.
928 EFI_SUCCESS - Success connect at least one ConIn and ConOut
929 device, there must have one ConOut device is
932 EFI_STATUS - Return the status of
933 BdsLibConnectAllDefaultConsoles ()
939 EFI_DEVICE_PATH_PROTOCOL
*VarConout
;
940 EFI_DEVICE_PATH_PROTOCOL
*VarConin
;
941 UINTN DevicePathSize
;
944 // Connect RootBridge
946 ConnectRootBridge ();
948 VarConout
= BdsLibGetVariableAndSize (
950 &gEfiGlobalVariableGuid
,
953 VarConin
= BdsLibGetVariableAndSize (
955 &gEfiGlobalVariableGuid
,
959 if (VarConout
== NULL
|| VarConin
== NULL
) {
961 // Do platform specific PCI Device check and add them to ConOut, ConIn, ErrOut
963 DetectAndPreparePlatformPciDevicePath (FALSE
);
966 // Have chance to connect the platform default console,
967 // the platform default console is the minimue device group
968 // the platform should support
970 for (Index
= 0; PlatformConsole
[Index
].DevicePath
!= NULL
; ++Index
) {
972 // Update the console variable with the connect type
974 if ((PlatformConsole
[Index
].ConnectType
& CONSOLE_IN
) == CONSOLE_IN
) {
975 BdsLibUpdateConsoleVariable (VarConsoleInp
, PlatformConsole
[Index
].DevicePath
, NULL
);
977 if ((PlatformConsole
[Index
].ConnectType
& CONSOLE_OUT
) == CONSOLE_OUT
) {
978 BdsLibUpdateConsoleVariable (VarConsoleOut
, PlatformConsole
[Index
].DevicePath
, NULL
);
980 if ((PlatformConsole
[Index
].ConnectType
& STD_ERROR
) == STD_ERROR
) {
981 BdsLibUpdateConsoleVariable (VarErrorOut
, PlatformConsole
[Index
].DevicePath
, NULL
);
986 // Only detect VGA device and add them to ConOut
988 DetectAndPreparePlatformPciDevicePath (TRUE
);
992 // The ConIn devices connection will start the USB bus, should disable all
993 // Usb legacy support firstly.
994 // Caution: Must ensure the PCI bus driver has been started. Since the
995 // ConnectRootBridge() will create all the PciIo protocol, it's safe here now
997 Status
= DisableUsbLegacySupport();
1000 // Connect the all the default console with current cosole variable
1002 Status
= BdsLibConnectAllDefaultConsoles ();
1003 if (EFI_ERROR (Status
)) {
1011 PlatformBdsConnectSequence (
1016 Routine Description:
1018 Connect with predeined platform connect sequence,
1019 the OEM/IBV can customize with their own connect sequence.
1036 // Here we can get the customized platform connect sequence
1037 // Notes: we can connect with new variable which record the
1038 // last time boots connect device path sequence
1040 while (gPlatformConnectSequence
[Index
] != NULL
) {
1042 // Build the platform boot option
1044 BdsLibConnectDevicePath (gPlatformConnectSequence
[Index
]);
1051 PlatformBdsGetDriverOption (
1052 IN OUT LIST_ENTRY
*BdsDriverLists
1056 Routine Description:
1058 Load the predefined driver option, OEM/IBV can customize this
1059 to load their own drivers
1063 BdsDriverLists - The header of the driver option link list.
1076 // Here we can get the customized platform driver option
1078 while (gPlatformDriverOption
[Index
] != NULL
) {
1080 // Build the platform boot option
1082 BdsLibRegisterNewOption (BdsDriverLists
, gPlatformDriverOption
[Index
], NULL
, L
"DriverOrder");
1089 PlatformBdsDiagnostics (
1090 IN EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel
,
1091 IN BOOLEAN QuietBoot
,
1092 IN BASEM_MEMORY_TEST BaseMemoryTest
1096 Routine Description:
1098 Perform the platform diagnostic, such like test memory. OEM/IBV also
1099 can customize this fuction to support specific platform diagnostic.
1103 MemoryTestLevel - The memory test intensive level
1105 QuietBoot - Indicate if need to enable the quiet boot
1107 BaseMemoryTest - A pointer to BdsMemoryTest()
1118 // Here we can decide if we need to show
1119 // the diagnostics screen
1120 // Notes: this quiet boot code should be remove
1121 // from the graphic lib
1124 Status
= EnableQuietBoot (PcdGetPtr(PcdLogoFile
));
1125 if (EFI_ERROR (Status
)) {
1126 DisableQuietBoot ();
1131 // Perform system diagnostic
1133 Status
= BaseMemoryTest (MemoryTestLevel
);
1134 if (EFI_ERROR (Status
)) {
1135 DisableQuietBoot ();
1141 // Perform system diagnostic
1143 Status
= BaseMemoryTest (MemoryTestLevel
);
1148 PlatformBdsPolicyBehavior (
1149 IN OUT LIST_ENTRY
*DriverOptionList
,
1150 IN OUT LIST_ENTRY
*BootOptionList
,
1151 IN PROCESS_CAPSULES ProcessCapsules
,
1152 IN BASEM_MEMORY_TEST BaseMemoryTest
1156 Routine Description:
1158 The function will excute with as the platform policy, current policy
1159 is driven by boot mode. IBV/OEM can customize this code for their specific
1164 DriverOptionList - The header of the driver option link list
1166 BootOptionList - The header of the boot option link list
1176 EFI_EVENT UserInputDurationTime
;
1179 EFI_BOOT_MODE BootMode
;
1182 // Init the time out value
1184 Timeout
= PcdGet16 (PcdPlatformBootTimeOut
);
1187 // Load the driver option as the driver option list
1189 PlatformBdsGetDriverOption (DriverOptionList
);
1192 // Get current Boot Mode
1194 Status
= BdsLibGetBootMode (&BootMode
);
1195 DEBUG ((EFI_D_ERROR
, "Boot Mode:%x\n", BootMode
));
1198 // Go the different platform policy with different boot mode
1199 // Notes: this part code can be change with the table policy
1201 ASSERT (BootMode
== BOOT_WITH_FULL_CONFIGURATION
);
1203 // Connect platform console
1205 Status
= PlatformBdsConnectConsole (gPlatformConsole
);
1206 if (EFI_ERROR (Status
)) {
1208 // Here OEM/IBV can customize with defined action
1210 PlatformBdsNoConsoleAction ();
1213 // Create a 300ms duration event to ensure user has enough input time to enter Setup
1215 Status
= gBS
->CreateEvent (
1220 &UserInputDurationTime
1222 ASSERT (Status
== EFI_SUCCESS
);
1223 Status
= gBS
->SetTimer (UserInputDurationTime
, TimerRelative
, 3000000);
1224 ASSERT (Status
== EFI_SUCCESS
);
1226 // Memory test and Logo show
1228 PlatformBdsDiagnostics (IGNORE
, TRUE
, BaseMemoryTest
);
1231 // Perform some platform specific connect sequence
1233 PlatformBdsConnectSequence ();
1236 // Give one chance to enter the setup if we
1237 // have the time out
1239 // BUGBUG: hard code timeout to 5 second to show logo in graphic mode.
1242 PlatformBdsEnterFrontPage (Timeout
, FALSE
);
1246 //BdsLibConnectAll ();
1247 //BdsLibEnumerateAllBootOption (BootOptionList);
1250 // Please uncomment above ConnectAll and EnumerateAll code and remove following first boot
1251 // checking code in real production tip.
1253 // In BOOT_WITH_FULL_CONFIGURATION boot mode, should always connect every device
1254 // and do enumerate all the default boot options. But in development system board, the boot mode
1255 // cannot be BOOT_ASSUMING_NO_CONFIGURATION_CHANGES because the machine box
1256 // is always open. So the following code only do the ConnectAll and EnumerateAll at first boot.
1258 Status
= BdsLibBuildOptionFromVar (BootOptionList
, L
"BootOrder");
1259 if (EFI_ERROR(Status
)) {
1261 // If cannot find "BootOrder" variable, it may be first boot.
1262 // Try to connect all devices and enumerate all boot options here.
1264 BdsLibConnectAll ();
1265 BdsLibEnumerateAllBootOption (BootOptionList
);
1269 // To give the User a chance to enter Setup here, if user set TimeOut is 0.
1270 // BDS should still give user a chance to enter Setup
1271 // Check whether the user input after the duration time has expired
1273 gBS
->WaitForEvent (1, &UserInputDurationTime
, &Index
);
1274 gBS
->CloseEvent (UserInputDurationTime
);
1275 Status
= gST
->ConIn
->ReadKeyStroke (gST
->ConIn
, &Key
);
1277 if (!EFI_ERROR (Status
)) {
1279 // Enter Setup if user input
1282 PlatformBdsEnterFrontPage (Timeout
, FALSE
);
1291 PlatformBdsBootSuccess (
1292 IN BDS_COMMON_OPTION
*Option
1296 Routine Description:
1298 Hook point after a boot attempt succeeds. We don't expect a boot option to
1299 return, so the EFI 1.0 specification defines that you will default to an
1300 interactive mode and stop processing the BootOrder list in this case. This
1301 is alos a platform implementation and can be customized by IBV/OEM.
1305 Option - Pointer to Boot Option that succeeded to boot.
1316 // If Boot returned with EFI_SUCCESS and there is not in the boot device
1317 // select loop then we need to pop up a UI and wait for user input.
1319 TmpStr
= Option
->StatusString
;
1320 if (TmpStr
!= NULL
) {
1321 BdsLibOutputStrings (gST
->ConOut
, TmpStr
, Option
->Description
, L
"\n\r", NULL
);
1322 gBS
->FreePool (TmpStr
);
1328 PlatformBdsBootFail (
1329 IN BDS_COMMON_OPTION
*Option
,
1330 IN EFI_STATUS Status
,
1331 IN CHAR16
*ExitData
,
1332 IN UINTN ExitDataSize
1336 Routine Description:
1338 Hook point after a boot attempt fails.
1342 Option - Pointer to Boot Option that failed to boot.
1344 Status - Status returned from failed boot.
1346 ExitData - Exit data returned from failed boot.
1348 ExitDataSize - Exit data size returned from failed boot.
1359 // If Boot returned with failed status then we need to pop up a UI and wait
1362 TmpStr
= Option
->StatusString
;
1363 if (TmpStr
!= NULL
) {
1364 BdsLibOutputStrings (gST
->ConOut
, TmpStr
, Option
->Description
, L
"\n\r", NULL
);
1365 gBS
->FreePool (TmpStr
);
1371 PlatformBdsNoConsoleAction (
1376 Routine Description:
1378 This function is remained for IBV/OEM to do some platform action,
1379 if there no console device can be connected.
1387 EFI_SUCCESS - Direct return success now.
1395 ConvertSystemTable (
1396 IN EFI_GUID
*TableGuid
,
1401 Routine Description:
1402 Convert ACPI Table /Smbios Table /MP Table if its location is lower than Address:0x100000
1404 As in legacy Bios, ACPI/Smbios/MP table is required to place in E/F Seg,
1405 So here we just check if the range is E/F seg,
1406 and if Not, assume the Memory type is EfiACPIReclaimMemory/EfiACPIMemoryNVS
1409 TableGuid - Guid of the table
1410 Table - pointer to the table
1413 EFI_SUCEESS - Convert Table successfully
1423 // If match acpi guid (1.0, 2.0, or later), Convert ACPI table according to version.
1425 AcpiHeader
= (VOID
*)(UINTN
)(*(UINT64
*)(*Table
));
1427 if (CompareGuid(TableGuid
, &gEfiAcpiTableGuid
) || CompareGuid(TableGuid
, &gEfiAcpi20TableGuid
)){
1428 if (((EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
*)AcpiHeader
)->Reserved
== 0x00){
1430 // If Acpi 1.0 Table, then RSDP structure doesn't contain Length field, use structure size
1432 AcpiTableLen
= sizeof (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
);
1433 } else if (((EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
*)AcpiHeader
)->Reserved
>= 0x02){
1435 // If Acpi 2.0 or later, use RSDP Length fied.
1437 AcpiTableLen
= ((EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER
*)AcpiHeader
)->Length
;
1440 // Invalid Acpi Version, return
1442 return EFI_UNSUPPORTED
;
1444 Status
= ConvertAcpiTable (AcpiTableLen
, Table
);
1449 // If matches smbios guid, convert Smbios table.
1451 if (CompareGuid(TableGuid
, &gEfiSmbiosTableGuid
)){
1452 Status
= ConvertSmbiosTable (Table
);
1457 // If the table is MP table?
1459 if (CompareGuid(TableGuid
, &gEfiMpsTableGuid
)){
1460 Status
= ConvertMpsTable (Table
);
1464 return EFI_UNSUPPORTED
;
1475 Routine Description:
1476 Convert RSDP of ACPI Table if its location is lower than Address:0x100000
1478 As in legacy Bios, ACPI table is required to place in E/F Seg,
1479 So here we just check if the range is E/F seg,
1480 and if Not, assume the Memory type is EfiACPIReclaimMemory/EfiACPIMemoryNVS
1483 TableLen - Acpi RSDP length
1484 Table - pointer to the table
1487 EFI_SUCEESS - Convert Table successfully
1495 EFI_PHYSICAL_ADDRESS BufferPtr
;
1498 AcpiTableOri
= (VOID
*)(UINTN
)(*(UINT64
*)(*Table
));
1499 if (((UINTN
)AcpiTableOri
< 0x100000) && ((UINTN
)AcpiTableOri
> 0xE0000)) {
1500 BufferPtr
= EFI_SYSTEM_TABLE_MAX_ADDRESS
;
1501 Status
= gBS
->AllocatePages (
1504 EFI_SIZE_TO_PAGES(TableLen
),
1507 ASSERT_EFI_ERROR (Status
);
1508 AcpiTableNew
= (VOID
*)(UINTN
)BufferPtr
;
1509 CopyMem (AcpiTableNew
, AcpiTableOri
, TableLen
);
1511 AcpiTableNew
= AcpiTableOri
;
1514 // Change configuration table Pointer
1516 *Table
= AcpiTableNew
;
1522 ConvertSmbiosTable (
1527 Routine Description:
1529 Convert Smbios Table if the Location of the SMBios Table is lower than Addres 0x100000
1531 As in legacy Bios, Smbios table is required to place in E/F Seg,
1532 So here we just check if the range is F seg,
1533 and if Not, assume the Memory type is EfiACPIMemoryNVS/EfiRuntimeServicesData
1535 Table - pointer to the table
1538 EFI_SUCEESS - Convert Table successfully
1543 SMBIOS_TABLE_ENTRY_POINT
*SmbiosTableNew
;
1544 SMBIOS_TABLE_ENTRY_POINT
*SmbiosTableOri
;
1546 UINT32 SmbiosEntryLen
;
1548 EFI_PHYSICAL_ADDRESS BufferPtr
;
1550 SmbiosTableNew
= NULL
;
1551 SmbiosTableOri
= NULL
;
1554 // Get Smibos configuration Table
1556 SmbiosTableOri
= (SMBIOS_TABLE_ENTRY_POINT
*)(UINTN
)(*(UINT64
*)(*Table
));
1558 if ((SmbiosTableOri
== NULL
) ||
1559 ((UINTN
)SmbiosTableOri
> 0x100000) ||
1560 ((UINTN
)SmbiosTableOri
< 0xF0000)){
1564 // Relocate the Smibos memory
1566 BufferPtr
= EFI_SYSTEM_TABLE_MAX_ADDRESS
;
1567 if (SmbiosTableOri
->SmbiosBcdRevision
!= 0x21) {
1568 SmbiosEntryLen
= SmbiosTableOri
->EntryPointLength
;
1571 // According to Smbios Spec 2.4, we should set entry point length as 0x1F if version is 2.1
1573 SmbiosEntryLen
= 0x1F;
1575 BufferLen
= SmbiosEntryLen
+ SYS_TABLE_PAD(SmbiosEntryLen
) + SmbiosTableOri
->TableLength
;
1576 Status
= gBS
->AllocatePages (
1579 EFI_SIZE_TO_PAGES(BufferLen
),
1582 ASSERT_EFI_ERROR (Status
);
1583 SmbiosTableNew
= (SMBIOS_TABLE_ENTRY_POINT
*)(UINTN
)BufferPtr
;
1590 // Get Smbios Structure table address, and make sure the start address is 32-bit align
1592 BufferPtr
+= SmbiosEntryLen
+ SYS_TABLE_PAD(SmbiosEntryLen
);
1594 (VOID
*)(UINTN
)BufferPtr
,
1595 (VOID
*)(UINTN
)(SmbiosTableOri
->TableAddress
),
1596 SmbiosTableOri
->TableLength
1598 SmbiosTableNew
->TableAddress
= (UINT32
)BufferPtr
;
1599 SmbiosTableNew
->IntermediateChecksum
= 0;
1600 SmbiosTableNew
->IntermediateChecksum
=
1601 CalculateCheckSum8 ((UINT8
*)SmbiosTableNew
+ 0x10, SmbiosEntryLen
-0x10);
1603 // Change the SMBIOS pointer
1605 *Table
= SmbiosTableNew
;
1616 Routine Description:
1618 Convert MP Table if the Location of the SMBios Table is lower than Addres 0x100000
1620 As in legacy Bios, MP table is required to place in E/F Seg,
1621 So here we just check if the range is E/F seg,
1622 and if Not, assume the Memory type is EfiACPIMemoryNVS/EfiRuntimeServicesData
1624 Table - pointer to the table
1627 EFI_SUCEESS - Convert Table successfully
1634 EFI_LEGACY_MP_TABLE_FLOATING_POINTER
*MpsFloatingPointerOri
;
1635 EFI_LEGACY_MP_TABLE_FLOATING_POINTER
*MpsFloatingPointerNew
;
1636 EFI_LEGACY_MP_TABLE_HEADER
*MpsTableOri
;
1637 EFI_LEGACY_MP_TABLE_HEADER
*MpsTableNew
;
1641 EFI_PHYSICAL_ADDRESS BufferPtr
;
1644 // Get MP configuration Table
1646 MpsFloatingPointerOri
= (EFI_LEGACY_MP_TABLE_FLOATING_POINTER
*)(UINTN
)(*(UINT64
*)(*Table
));
1647 if (!(((UINTN
)MpsFloatingPointerOri
<= 0x100000) &&
1648 ((UINTN
)MpsFloatingPointerOri
>= 0xF0000))){
1652 // Get Floating pointer structure length
1654 FPLength
= MpsFloatingPointerOri
->Length
* 16;
1655 Data32
= FPLength
+ SYS_TABLE_PAD (FPLength
);
1656 MpsTableOri
= (EFI_LEGACY_MP_TABLE_HEADER
*)(UINTN
)(MpsFloatingPointerOri
->PhysicalAddress
);
1657 if (MpsTableOri
!= NULL
) {
1658 Data32
+= MpsTableOri
->BaseTableLength
;
1659 Data32
+= MpsTableOri
->ExtendedTableLength
;
1660 if (MpsTableOri
->OemTablePointer
!= 0x00) {
1661 Data32
+= SYS_TABLE_PAD (Data32
);
1662 Data32
+= MpsTableOri
->OemTableSize
;
1670 BufferPtr
= EFI_SYSTEM_TABLE_MAX_ADDRESS
;
1671 Status
= gBS
->AllocatePages (
1674 EFI_SIZE_TO_PAGES(Data32
),
1677 ASSERT_EFI_ERROR (Status
);
1678 MpsFloatingPointerNew
= (EFI_LEGACY_MP_TABLE_FLOATING_POINTER
*)(UINTN
)BufferPtr
;
1679 CopyMem (MpsFloatingPointerNew
, MpsFloatingPointerOri
, FPLength
);
1681 // If Mp Table exists
1683 if (MpsTableOri
!= NULL
) {
1685 // Get Mps table length, including Ext table
1687 BufferPtr
= BufferPtr
+ FPLength
+ SYS_TABLE_PAD (FPLength
);
1688 MpsTableNew
= (EFI_LEGACY_MP_TABLE_HEADER
*)(UINTN
)BufferPtr
;
1689 CopyMem (MpsTableNew
, MpsTableOri
, MpsTableOri
->BaseTableLength
+ MpsTableOri
->ExtendedTableLength
);
1691 if ((MpsTableOri
->OemTableSize
!= 0x0000) && (MpsTableOri
->OemTablePointer
!= 0x0000)){
1692 BufferPtr
+= MpsTableOri
->BaseTableLength
+ MpsTableOri
->ExtendedTableLength
;
1693 BufferPtr
+= SYS_TABLE_PAD (BufferPtr
);
1694 OemTableNew
= (VOID
*)(UINTN
)BufferPtr
;
1695 OemTableOri
= (VOID
*)(UINTN
)MpsTableOri
->OemTablePointer
;
1696 CopyMem (OemTableNew
, OemTableOri
, MpsTableOri
->OemTableSize
);
1697 MpsTableNew
->OemTablePointer
= (UINT32
)(UINTN
)OemTableNew
;
1699 MpsTableNew
->Checksum
= 0;
1700 MpsTableNew
->Checksum
= CalculateCheckSum8 ((UINT8
*)MpsTableNew
, MpsTableOri
->BaseTableLength
);
1701 MpsFloatingPointerNew
->PhysicalAddress
= (UINT32
)(UINTN
)MpsTableNew
;
1702 MpsFloatingPointerNew
->Checksum
= 0;
1703 MpsFloatingPointerNew
->Checksum
= CalculateCheckSum8 ((UINT8
*)MpsFloatingPointerNew
, FPLength
);
1706 // Change the pointer
1708 *Table
= MpsFloatingPointerNew
;
1714 Lock the ConsoleIn device in system table. All key
1715 presses will be ignored until the Password is typed in. The only way to
1716 disable the password is to type it in to a ConIn device.
1718 @param Password Password used to lock ConIn device.
1720 @retval EFI_SUCCESS lock the Console In Spliter virtual handle successfully.
1721 @retval EFI_UNSUPPORTED Password not found
1730 return EFI_UNSUPPORTED
;
1734 This function locks platform flash that is not allowed to be updated during normal boot path.
1735 The flash layout is platform specific.
1740 PlatformBdsLockNonUpdatableFlash (