]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
MdeModulePkg/BootLogoLib: pull GraphicsOutput protocol into class header
[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
817fb3ac 29#include <IndustryStandard/Bmp.h>\r
30541881
RN
30#include <IndustryStandard/Pci.h>\r
31#include <IndustryStandard/Acpi.h>\r
32#include <IndustryStandard/SmBios.h>\r
33#include <IndustryStandard/PeImage.h>\r
34\r
35#include <Library/DebugLib.h>\r
36#include <Library/BaseMemoryLib.h>\r
37#include <Library/UefiBootServicesTableLib.h>\r
38#include <Library/UefiRuntimeServicesTableLib.h>\r
39#include <Library/MemoryAllocationLib.h>\r
40#include <Library/BaseLib.h>\r
41#include <Library/PcdLib.h>\r
42#include <Library/PciLib.h>\r
2b23b8d4 43#include <Library/UefiBootManagerLib.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
817fb3ac 52#include <Library/DxeServicesLib.h>\r
30541881 53\r
817fb3ac
RN
54#include <Protocol/OEMBadging.h>\r
55#include <Protocol/UgaDraw.h>\r
56#include <Protocol/BootLogo.h>\r
30541881
RN
57#include <Protocol/Decompress.h>\r
58#include <Protocol/PciIo.h>\r
59#include <Protocol/FirmwareVolume2.h>\r
60#include <Protocol/SimpleFileSystem.h>\r
61#include <Protocol/PciRootBridgeIo.h>\r
62#include <Protocol/S3SaveState.h>\r
63#include <Protocol/DxeSmmReadyToLock.h>\r
07dd96e8 64#include <Protocol/LoadedImage.h>\r
30541881
RN
65\r
66#include <Guid/Acpi.h>\r
67#include <Guid/SmBios.h>\r
68#include <Guid/Mps.h>\r
69#include <Guid/HobList.h>\r
70#include <Guid/GlobalVariable.h>\r
71#include <Guid/EventGroup.h>\r
72\r
73#include <OvmfPlatforms.h>\r
74\r
30541881 75extern EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[];\r
30541881
RN
76extern ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode;\r
77extern ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode;\r
78extern UART_DEVICE_PATH gUartDeviceNode;\r
79extern VENDOR_DEVICE_PATH gTerminalTypeDeviceNode;\r
30541881
RN
80\r
81#define PCI_DEVICE_PATH_NODE(Func, Dev) \\r
82 { \\r
83 { \\r
84 HARDWARE_DEVICE_PATH, \\r
85 HW_PCI_DP, \\r
86 { \\r
87 (UINT8) (sizeof (PCI_DEVICE_PATH)), \\r
88 (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8) \\r
89 } \\r
90 }, \\r
91 (Func), \\r
92 (Dev) \\r
93 }\r
94\r
95#define PNPID_DEVICE_PATH_NODE(PnpId) \\r
96 { \\r
97 { \\r
98 ACPI_DEVICE_PATH, \\r
99 ACPI_DP, \\r
100 { \\r
101 (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \\r
102 (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \\r
103 }, \\r
104 }, \\r
105 EISA_PNP_ID((PnpId)), \\r
106 0 \\r
107 }\r
108\r
109#define gPciIsaBridge \\r
110 PCI_DEVICE_PATH_NODE(0, 0x1f)\r
111\r
112#define gP2PBridge \\r
113 PCI_DEVICE_PATH_NODE(0, 0x1e)\r
114\r
115#define gPnpPs2Keyboard \\r
116 PNPID_DEVICE_PATH_NODE(0x0303)\r
117\r
118#define gPnp16550ComPort \\r
119 PNPID_DEVICE_PATH_NODE(0x0501)\r
120\r
121#define gUart \\r
122 { \\r
123 { \\r
124 MESSAGING_DEVICE_PATH, \\r
125 MSG_UART_DP, \\r
126 { \\r
127 (UINT8) (sizeof (UART_DEVICE_PATH)), \\r
128 (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) \\r
129 } \\r
130 }, \\r
131 0, \\r
132 115200, \\r
133 8, \\r
134 1, \\r
135 1 \\r
136 }\r
137\r
138#define gPcAnsiTerminal \\r
139 { \\r
140 { \\r
141 MESSAGING_DEVICE_PATH, \\r
142 MSG_VENDOR_DP, \\r
143 { \\r
144 (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \\r
145 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \\r
146 } \\r
147 }, \\r
148 DEVICE_PATH_MESSAGING_PC_ANSI \\r
149 }\r
150\r
151#define PCI_CLASS_SCC 0x07\r
152#define PCI_SUBCLASS_SERIAL 0x00\r
153#define PCI_IF_16550 0x02\r
154#define IS_PCI_16550SERIAL(_p) IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550)\r
30541881
RN
155#define IS_PCI_ISA_PDECODE(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA_PDECODE, 0)\r
156\r
e9e9ad64
RN
157typedef struct {\r
158 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
159 UINTN ConnectType;\r
160} PLATFORM_CONSOLE_CONNECT_ENTRY;\r
161\r
162#define CONSOLE_OUT BIT0\r
163#define CONSOLE_IN BIT1\r
164#define STD_ERROR BIT2\r
165extern PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[];\r
166\r
30541881
RN
167//\r
168// Platform BDS Functions\r
169//\r
30541881 170\r
e9e9ad64
RN
171VOID\r
172PlatformInitializeConsole (\r
173 IN PLATFORM_CONSOLE_CONNECT_ENTRY *PlatformConsole\r
30541881
RN
174 );\r
175\r
30541881
RN
176/**\r
177 Loads and boots UEFI Linux via the FwCfg interface.\r
178\r
179 @retval EFI_NOT_FOUND - The Linux kernel was not found\r
180\r
181**/\r
182EFI_STATUS\r
183TryRunningQemuKernel (\r
184 VOID\r
185 );\r
186\r
817fb3ac
RN
187/**\r
188 Use SystemTable Conout to stop video based Simple Text Out consoles from going\r
189 to the video device. Put up LogoFile on every video device that is a console.\r
190\r
191 @param[in] LogoFile File name of logo to display on the center of the screen.\r
192\r
193 @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed.\r
194 @retval EFI_UNSUPPORTED Logo not found\r
195\r
196**/\r
197EFI_STATUS\r
198EnableQuietBoot (\r
199 IN EFI_GUID *LogoFile\r
200 );\r
201\r
202/**\r
203 Use SystemTable Conout to turn on video based Simple Text Out consoles. The\r
204 Simple Text Out screens will now be synced up with all non video output devices\r
205\r
206 @retval EFI_SUCCESS UGA devices are back in text mode and synced up.\r
207\r
208**/\r
209EFI_STATUS\r
210DisableQuietBoot (\r
211 VOID\r
212 );\r
213\r
30541881 214#endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_\r