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