2 Platform BDS customizations include file.
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. 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>
56 #include <Guid/Acpi.h>
57 #include <Guid/SmBios.h>
59 #include <Guid/HobList.h>
60 #include <Guid/GlobalVariable.h>
62 extern BDS_CONSOLE_CONNECT_ENTRY gPlatformConsole
[];
63 extern EFI_DEVICE_PATH_PROTOCOL
*gPlatformConnectSequence
[];
64 extern EFI_DEVICE_PATH_PROTOCOL
*gPlatformDriverOption
[];
65 extern EFI_DEVICE_PATH_PROTOCOL
*gPlatformRootBridges
[];
66 extern ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode
;
67 extern ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode
;
68 extern UART_DEVICE_PATH gUartDeviceNode
;
69 extern VENDOR_DEVICE_PATH gTerminalTypeDeviceNode
;
73 #define VarConsoleInpDev L"ConInDev"
74 #define VarConsoleInp L"ConIn"
75 #define VarConsoleOutDev L"ConOutDev"
76 #define VarConsoleOut L"ConOut"
77 #define VarErrorOutDev L"ErrOutDev"
78 #define VarErrorOut L"ErrOut"
80 #define PCI_DEVICE_PATH_NODE(Func, Dev) \
82 HARDWARE_DEVICE_PATH, \
84 (UINT8) (sizeof (PCI_DEVICE_PATH)), \
85 (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8), \
90 #define PNPID_DEVICE_PATH_NODE(PnpId) \
94 (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
95 (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8), \
96 EISA_PNP_ID((PnpId)), \
100 #define gPciRootBridge \
101 PNPID_DEVICE_PATH_NODE(0x0A03)
103 #define gPciIsaBridge \
104 PCI_DEVICE_PATH_NODE(0, 0x1f)
107 PCI_DEVICE_PATH_NODE(0, 0x1e)
109 #define gPnpPs2Keyboard \
110 PNPID_DEVICE_PATH_NODE(0x0303)
112 #define gPnp16550ComPort \
113 PNPID_DEVICE_PATH_NODE(0x0501)
117 MESSAGING_DEVICE_PATH, \
119 (UINT8) (sizeof (UART_DEVICE_PATH)), \
120 (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8), \
128 #define gPcAnsiTerminal \
130 MESSAGING_DEVICE_PATH, \
132 (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \
133 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8), \
134 DEVICE_PATH_MESSAGING_PC_ANSI \
139 END_DEVICE_PATH_TYPE, \
140 END_ENTIRE_DEVICE_PATH_SUBTYPE, \
141 END_DEVICE_PATH_LENGTH, \
145 #define PCI_CLASS_SCC 0x07
146 #define PCI_SUBCLASS_SERIAL 0x00
147 #define PCI_IF_16550 0x02
148 #define IS_PCI_16550SERIAL(_p) IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550)
150 #define EFI_SYSTEM_TABLE_MAX_ADDRESS 0xFFFFFFFF
151 #define SYS_TABLE_PAD(ptr) (((~ptr) +1) & 0x07 )
153 #define IS_PCI_ISA_PDECODE(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA_PDECODE, 0)
156 // Platform Root Bridge
159 ACPI_HID_DEVICE_PATH PciRootBridge
;
160 EFI_DEVICE_PATH_PROTOCOL End
;
161 } PLATFORM_ROOT_BRIDGE_DEVICE_PATH
;
164 ACPI_HID_DEVICE_PATH PciRootBridge
;
165 PCI_DEVICE_PATH IsaBridge
;
166 ACPI_HID_DEVICE_PATH Keyboard
;
167 EFI_DEVICE_PATH_PROTOCOL End
;
168 } PLATFORM_DUMMY_ISA_KEYBOARD_DEVICE_PATH
;
171 ACPI_HID_DEVICE_PATH PciRootBridge
;
172 PCI_DEVICE_PATH IsaBridge
;
173 ACPI_HID_DEVICE_PATH IsaSerial
;
174 UART_DEVICE_PATH Uart
;
175 VENDOR_DEVICE_PATH TerminalType
;
176 EFI_DEVICE_PATH_PROTOCOL End
;
177 } PLATFORM_DUMMY_ISA_SERIAL_DEVICE_PATH
;
180 ACPI_HID_DEVICE_PATH PciRootBridge
;
181 PCI_DEVICE_PATH VgaDevice
;
182 EFI_DEVICE_PATH_PROTOCOL End
;
183 } PLATFORM_DUMMY_PCI_VGA_DEVICE_PATH
;
186 ACPI_HID_DEVICE_PATH PciRootBridge
;
187 PCI_DEVICE_PATH PciBridge
;
188 PCI_DEVICE_PATH SerialDevice
;
189 UART_DEVICE_PATH Uart
;
190 VENDOR_DEVICE_PATH TerminalType
;
191 EFI_DEVICE_PATH_PROTOCOL End
;
192 } PLATFORM_DUMMY_PCI_SERIAL_DEVICE_PATH
;
195 // the short form device path for Usb keyboard
198 #define SUBCLASS_BOOT 1
199 #define PROTOCOL_KEYBOARD 1
202 USB_CLASS_DEVICE_PATH UsbClass
;
203 EFI_DEVICE_PATH_PROTOCOL End
;
204 } USB_CLASS_FORMAT_DEVICE_PATH
;
206 extern PLATFORM_ROOT_BRIDGE_DEVICE_PATH gPlatformRootBridge0
;
209 // Platform BDS Functions
213 PlatformBdsGetDriverOption (
214 IN LIST_ENTRY
*BdsDriverLists
219 EXTENDMEM_COVERAGE_LEVEL Level
223 PlatformBdsShowProgress (
224 EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground
,
225 EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground
,
227 EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor
,
233 PlatformBdsConnectSequence (
239 EFI_BOOT_MODE BootMode
243 PlatformBdsConnectConsole (
244 IN BDS_CONSOLE_CONNECT_ENTRY
*PlatformConsole
248 PlatformBdsNoConsoleAction (
270 IN EFI_GUID
*TableGuid
,
275 PlatformBdsEnterFrontPage (
276 IN UINT16 TimeoutDefault
,
277 IN BOOLEAN ConnectAllHappened
280 #endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_