2 Platform BDS customizations include file.
4 Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 Head file for BDS Platform specific code
23 #ifndef _PLATFORM_SPECIFIC_BDS_PLATFORM_H_
24 #define _PLATFORM_SPECIFIC_BDS_PLATFORM_H_
29 #include <IndustryStandard/Pci.h>
30 #include <IndustryStandard/Acpi.h>
31 #include <IndustryStandard/SmBios.h>
32 #include <IndustryStandard/PeImage.h>
34 #include <Library/DebugLib.h>
35 #include <Library/BaseMemoryLib.h>
36 #include <Library/UefiBootServicesTableLib.h>
37 #include <Library/UefiRuntimeServicesTableLib.h>
38 #include <Library/MemoryAllocationLib.h>
39 #include <Library/BaseLib.h>
40 #include <Library/PcdLib.h>
41 #include <Library/PciLib.h>
42 #include <Library/UefiBootManagerLib.h>
43 #include <Library/BootLogoLib.h>
44 #include <Library/HobLib.h>
45 #include <Library/UefiLib.h>
46 #include <Library/DxeServicesTableLib.h>
47 #include <Library/DevicePathLib.h>
48 #include <Library/IoLib.h>
49 #include <Library/NvVarsFileLib.h>
50 #include <Library/QemuFwCfgLib.h>
51 #include <Library/QemuBootOrderLib.h>
53 #include <Protocol/Decompress.h>
54 #include <Protocol/PciIo.h>
55 #include <Protocol/FirmwareVolume2.h>
56 #include <Protocol/SimpleFileSystem.h>
57 #include <Protocol/PciRootBridgeIo.h>
58 #include <Protocol/S3SaveState.h>
59 #include <Protocol/DxeSmmReadyToLock.h>
60 #include <Protocol/LoadedImage.h>
62 #include <Guid/Acpi.h>
63 #include <Guid/SmBios.h>
65 #include <Guid/HobList.h>
66 #include <Guid/GlobalVariable.h>
67 #include <Guid/EventGroup.h>
68 #include <Guid/DebugAgentGuid.h>
70 #include <OvmfPlatforms.h>
72 extern EFI_DEVICE_PATH_PROTOCOL
*gPlatformConnectSequence
[];
73 extern ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode
;
74 extern ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode
;
75 extern UART_DEVICE_PATH gUartDeviceNode
;
76 extern VENDOR_DEVICE_PATH gTerminalTypeDeviceNode
;
78 #define PCI_DEVICE_PATH_NODE(Func, Dev) \
81 HARDWARE_DEVICE_PATH, \
84 (UINT8) (sizeof (PCI_DEVICE_PATH)), \
85 (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8) \
92 #define PNPID_DEVICE_PATH_NODE(PnpId) \
98 (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
99 (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
102 EISA_PNP_ID((PnpId)), \
106 #define gPciIsaBridge \
107 PCI_DEVICE_PATH_NODE(0, 0x1f)
110 PCI_DEVICE_PATH_NODE(0, 0x1e)
112 #define gPnpPs2Keyboard \
113 PNPID_DEVICE_PATH_NODE(0x0303)
115 #define gPnp16550ComPort \
116 PNPID_DEVICE_PATH_NODE(0x0501)
121 MESSAGING_DEVICE_PATH, \
124 (UINT8) (sizeof (UART_DEVICE_PATH)), \
125 (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) \
135 #define gPcAnsiTerminal \
138 MESSAGING_DEVICE_PATH, \
141 (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \
142 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \
145 DEVICE_PATH_MESSAGING_PC_ANSI \
150 END_DEVICE_PATH_TYPE, \
151 END_ENTIRE_DEVICE_PATH_SUBTYPE, \
153 END_DEVICE_PATH_LENGTH, \
158 #define PCI_CLASS_SCC 0x07
159 #define PCI_SUBCLASS_SERIAL 0x00
160 #define PCI_IF_16550 0x02
161 #define IS_PCI_16550SERIAL(_p) IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550)
162 #define IS_PCI_ISA_PDECODE(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA_PDECODE, 0)
165 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
167 } PLATFORM_CONSOLE_CONNECT_ENTRY
;
169 #define CONSOLE_OUT BIT0
170 #define CONSOLE_IN BIT1
171 #define STD_ERROR BIT2
172 extern PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole
[];
175 // Platform BDS Functions
179 PlatformInitializeConsole (
180 IN PLATFORM_CONSOLE_CONNECT_ENTRY
*PlatformConsole
184 Loads and boots UEFI Linux via the FwCfg interface.
186 @retval EFI_NOT_FOUND - The Linux kernel was not found
190 TryRunningQemuKernel (
194 #endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_