2 Platform BDS customizations include file.
4 Copyright (c) 2006 - 2007, 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/GenericBdsLib.h>
43 #include <Library/PlatformBdsLib.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>
51 #include <Protocol/Decompress.h>
52 #include <Protocol/PciIo.h>
53 #include <Protocol/FirmwareVolume2.h>
54 #include <Protocol/SimpleFileSystem.h>
55 #include <Protocol/PciRootBridgeIo.h>
57 #include <Guid/Acpi.h>
58 #include <Guid/SmBios.h>
60 #include <Guid/HobList.h>
61 #include <Guid/GlobalVariable.h>
63 #include <OvmfPlatforms.h>
65 extern BDS_CONSOLE_CONNECT_ENTRY gPlatformConsole
[];
66 extern EFI_DEVICE_PATH_PROTOCOL
*gPlatformConnectSequence
[];
67 extern EFI_DEVICE_PATH_PROTOCOL
*gPlatformDriverOption
[];
68 extern ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode
;
69 extern ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode
;
70 extern UART_DEVICE_PATH gUartDeviceNode
;
71 extern VENDOR_DEVICE_PATH gTerminalTypeDeviceNode
;
75 #define VarConsoleInpDev L"ConInDev"
76 #define VarConsoleInp L"ConIn"
77 #define VarConsoleOutDev L"ConOutDev"
78 #define VarConsoleOut L"ConOut"
79 #define VarErrorOutDev L"ErrOutDev"
80 #define VarErrorOut L"ErrOut"
82 #define PCI_DEVICE_PATH_NODE(Func, Dev) \
85 HARDWARE_DEVICE_PATH, \
88 (UINT8) (sizeof (PCI_DEVICE_PATH)), \
89 (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8) \
96 #define PNPID_DEVICE_PATH_NODE(PnpId) \
102 (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
103 (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
106 EISA_PNP_ID((PnpId)), \
110 #define gPciIsaBridge \
111 PCI_DEVICE_PATH_NODE(0, 0x1f)
114 PCI_DEVICE_PATH_NODE(0, 0x1e)
116 #define gPnpPs2Keyboard \
117 PNPID_DEVICE_PATH_NODE(0x0303)
119 #define gPnp16550ComPort \
120 PNPID_DEVICE_PATH_NODE(0x0501)
125 MESSAGING_DEVICE_PATH, \
128 (UINT8) (sizeof (UART_DEVICE_PATH)), \
129 (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) \
139 #define gPcAnsiTerminal \
142 MESSAGING_DEVICE_PATH, \
145 (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \
146 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \
149 DEVICE_PATH_MESSAGING_PC_ANSI \
152 #define PCI_CLASS_SCC 0x07
153 #define PCI_SUBCLASS_SERIAL 0x00
154 #define PCI_IF_16550 0x02
155 #define IS_PCI_16550SERIAL(_p) IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550)
157 #define EFI_SYSTEM_TABLE_MAX_ADDRESS 0xFFFFFFFF
158 #define SYS_TABLE_PAD(ptr) (((~ptr) +1) & 0x07 )
160 #define IS_PCI_ISA_PDECODE(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA_PDECODE, 0)
163 ACPI_HID_DEVICE_PATH PciRootBridge
;
164 PCI_DEVICE_PATH IsaBridge
;
165 ACPI_HID_DEVICE_PATH Keyboard
;
166 EFI_DEVICE_PATH_PROTOCOL End
;
167 } PLATFORM_DUMMY_ISA_KEYBOARD_DEVICE_PATH
;
170 ACPI_HID_DEVICE_PATH PciRootBridge
;
171 PCI_DEVICE_PATH IsaBridge
;
172 ACPI_HID_DEVICE_PATH IsaSerial
;
173 UART_DEVICE_PATH Uart
;
174 VENDOR_DEVICE_PATH TerminalType
;
175 EFI_DEVICE_PATH_PROTOCOL End
;
176 } PLATFORM_DUMMY_ISA_SERIAL_DEVICE_PATH
;
179 ACPI_HID_DEVICE_PATH PciRootBridge
;
180 PCI_DEVICE_PATH VgaDevice
;
181 EFI_DEVICE_PATH_PROTOCOL End
;
182 } PLATFORM_DUMMY_PCI_VGA_DEVICE_PATH
;
185 ACPI_HID_DEVICE_PATH PciRootBridge
;
186 PCI_DEVICE_PATH PciBridge
;
187 PCI_DEVICE_PATH SerialDevice
;
188 UART_DEVICE_PATH Uart
;
189 VENDOR_DEVICE_PATH TerminalType
;
190 EFI_DEVICE_PATH_PROTOCOL End
;
191 } PLATFORM_DUMMY_PCI_SERIAL_DEVICE_PATH
;
194 // the short form device path for Usb keyboard
197 #define SUBCLASS_BOOT 1
198 #define PROTOCOL_KEYBOARD 1
201 USB_CLASS_DEVICE_PATH UsbClass
;
202 EFI_DEVICE_PATH_PROTOCOL End
;
203 } USB_CLASS_FORMAT_DEVICE_PATH
;
206 // Platform BDS Functions
210 PlatformBdsGetDriverOption (
211 IN LIST_ENTRY
*BdsDriverLists
216 EXTENDMEM_COVERAGE_LEVEL Level
220 PlatformBdsShowProgress (
221 EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground
,
222 EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground
,
224 EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor
,
230 PlatformBdsConnectSequence (
236 EFI_BOOT_MODE BootMode
240 PlatformBdsConnectConsole (
241 IN BDS_CONSOLE_CONNECT_ENTRY
*PlatformConsole
245 PlatformBdsNoConsoleAction (
267 IN EFI_GUID
*TableGuid
,
272 PlatformBdsEnterFrontPage (
273 IN UINT16 TimeoutDefault
,
274 IN BOOLEAN ConnectAllHappened
278 Loads and boots UEFI Linux via the FwCfg interface.
280 @retval EFI_NOT_FOUND - The Linux kernel was not found
284 TryRunningQemuKernel (
288 #endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_