]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
MdeModulePkg/ResetUtilityLib: Add a new API ResetSystemWithSubtype
[mirror_edk2.git] / OvmfPkg / Library / PlatformBootManagerLib / BdsPlatform.h
CommitLineData
30541881
RN
1/** @file\r
2 Platform BDS customizations include file.\r
3\r
f4d575b5 4 Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
b26f0cf9 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
30541881
RN
6\r
7Module Name:\r
8\r
9 BdsPlatform.h\r
10\r
11Abstract:\r
12\r
13 Head file for BDS Platform specific code\r
14\r
15**/\r
16\r
17#ifndef _PLATFORM_SPECIFIC_BDS_PLATFORM_H_\r
18#define _PLATFORM_SPECIFIC_BDS_PLATFORM_H_\r
19\r
20\r
21#include <PiDxe.h>\r
22\r
23#include <IndustryStandard/Pci.h>\r
24#include <IndustryStandard/Acpi.h>\r
25#include <IndustryStandard/SmBios.h>\r
26#include <IndustryStandard/PeImage.h>\r
7ebad830 27#include <IndustryStandard/Virtio095.h>\r
30541881
RN
28\r
29#include <Library/DebugLib.h>\r
30#include <Library/BaseMemoryLib.h>\r
31#include <Library/UefiBootServicesTableLib.h>\r
32#include <Library/UefiRuntimeServicesTableLib.h>\r
33#include <Library/MemoryAllocationLib.h>\r
34#include <Library/BaseLib.h>\r
35#include <Library/PcdLib.h>\r
36#include <Library/PciLib.h>\r
2b23b8d4 37#include <Library/UefiBootManagerLib.h>\r
a3cd5cd5 38#include <Library/BootLogoLib.h>\r
30541881
RN
39#include <Library/HobLib.h>\r
40#include <Library/UefiLib.h>\r
41#include <Library/DxeServicesTableLib.h>\r
42#include <Library/DevicePathLib.h>\r
43#include <Library/IoLib.h>\r
44#include <Library/NvVarsFileLib.h>\r
45#include <Library/QemuFwCfgLib.h>\r
687f7521 46#include <Library/QemuFwCfgS3Lib.h>\r
04fe914b 47#include <Library/QemuBootOrderLib.h>\r
30541881
RN
48\r
49#include <Protocol/Decompress.h>\r
50#include <Protocol/PciIo.h>\r
51#include <Protocol/FirmwareVolume2.h>\r
52#include <Protocol/SimpleFileSystem.h>\r
53#include <Protocol/PciRootBridgeIo.h>\r
54#include <Protocol/S3SaveState.h>\r
55#include <Protocol/DxeSmmReadyToLock.h>\r
07dd96e8 56#include <Protocol/LoadedImage.h>\r
30541881
RN
57\r
58#include <Guid/Acpi.h>\r
59#include <Guid/SmBios.h>\r
60#include <Guid/Mps.h>\r
61#include <Guid/HobList.h>\r
62#include <Guid/GlobalVariable.h>\r
63#include <Guid/EventGroup.h>\r
f4d575b5 64#include <Guid/DebugAgentGuid.h>\r
30541881
RN
65\r
66#include <OvmfPlatforms.h>\r
67\r
30541881 68extern EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[];\r
30541881
RN
69extern ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode;\r
70extern ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode;\r
71extern UART_DEVICE_PATH gUartDeviceNode;\r
72extern VENDOR_DEVICE_PATH gTerminalTypeDeviceNode;\r
30541881
RN
73\r
74#define PCI_DEVICE_PATH_NODE(Func, Dev) \\r
75 { \\r
76 { \\r
77 HARDWARE_DEVICE_PATH, \\r
78 HW_PCI_DP, \\r
79 { \\r
80 (UINT8) (sizeof (PCI_DEVICE_PATH)), \\r
81 (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8) \\r
82 } \\r
83 }, \\r
84 (Func), \\r
85 (Dev) \\r
86 }\r
87\r
88#define PNPID_DEVICE_PATH_NODE(PnpId) \\r
89 { \\r
90 { \\r
91 ACPI_DEVICE_PATH, \\r
92 ACPI_DP, \\r
93 { \\r
94 (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \\r
95 (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \\r
96 }, \\r
97 }, \\r
98 EISA_PNP_ID((PnpId)), \\r
99 0 \\r
100 }\r
101\r
102#define gPciIsaBridge \\r
103 PCI_DEVICE_PATH_NODE(0, 0x1f)\r
104\r
105#define gP2PBridge \\r
106 PCI_DEVICE_PATH_NODE(0, 0x1e)\r
107\r
108#define gPnpPs2Keyboard \\r
109 PNPID_DEVICE_PATH_NODE(0x0303)\r
110\r
111#define gPnp16550ComPort \\r
112 PNPID_DEVICE_PATH_NODE(0x0501)\r
113\r
114#define gUart \\r
115 { \\r
116 { \\r
117 MESSAGING_DEVICE_PATH, \\r
118 MSG_UART_DP, \\r
119 { \\r
120 (UINT8) (sizeof (UART_DEVICE_PATH)), \\r
121 (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) \\r
122 } \\r
123 }, \\r
124 0, \\r
125 115200, \\r
126 8, \\r
127 1, \\r
128 1 \\r
129 }\r
130\r
131#define gPcAnsiTerminal \\r
132 { \\r
133 { \\r
134 MESSAGING_DEVICE_PATH, \\r
135 MSG_VENDOR_DP, \\r
136 { \\r
137 (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \\r
138 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \\r
139 } \\r
140 }, \\r
141 DEVICE_PATH_MESSAGING_PC_ANSI \\r
142 }\r
143\r
f4d575b5
MK
144#define gEndEntire \\r
145 { \\r
146 END_DEVICE_PATH_TYPE, \\r
147 END_ENTIRE_DEVICE_PATH_SUBTYPE, \\r
148 { \\r
149 END_DEVICE_PATH_LENGTH, \\r
150 0 \\r
151 } \\r
152 }\r
153\r
30541881
RN
154#define PCI_CLASS_SCC 0x07\r
155#define PCI_SUBCLASS_SERIAL 0x00\r
156#define PCI_IF_16550 0x02\r
157#define IS_PCI_16550SERIAL(_p) IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550)\r
30541881
RN
158#define IS_PCI_ISA_PDECODE(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA_PDECODE, 0)\r
159\r
e9e9ad64
RN
160typedef struct {\r
161 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
162 UINTN ConnectType;\r
163} PLATFORM_CONSOLE_CONNECT_ENTRY;\r
164\r
165#define CONSOLE_OUT BIT0\r
166#define CONSOLE_IN BIT1\r
167#define STD_ERROR BIT2\r
168extern PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[];\r
169\r
30541881
RN
170//\r
171// Platform BDS Functions\r
172//\r
30541881 173\r
e9e9ad64
RN
174VOID\r
175PlatformInitializeConsole (\r
176 IN PLATFORM_CONSOLE_CONNECT_ENTRY *PlatformConsole\r
30541881
RN
177 );\r
178\r
30541881
RN
179/**\r
180 Loads and boots UEFI Linux via the FwCfg interface.\r
181\r
182 @retval EFI_NOT_FOUND - The Linux kernel was not found\r
183\r
184**/\r
185EFI_STATUS\r
186TryRunningQemuKernel (\r
187 VOID\r
188 );\r
189\r
190#endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_\r