]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c
OvmfPkg/PlatformBootManagerLib: add USB keyboard to ConIn
[mirror_edk2.git] / OvmfPkg / Library / PlatformBootManagerLib / PlatformData.c
1 /** @file
2 Defined the platform specific device path which will be used by
3 platform Bbd to perform the platform policy connect.
4
5 Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #include "BdsPlatform.h"
17
18 //
19 // Debug Agent UART Device Path structure
20 //
21 #pragma pack(1)
22 typedef struct {
23 VENDOR_DEVICE_PATH VendorHardware;
24 UART_DEVICE_PATH Uart;
25 VENDOR_DEVICE_PATH TerminalType;
26 EFI_DEVICE_PATH_PROTOCOL End;
27 } VENDOR_UART_DEVICE_PATH;
28 #pragma pack()
29
30 //
31 // USB Keyboard Device Path structure
32 //
33 #pragma pack (1)
34 typedef struct {
35 USB_CLASS_DEVICE_PATH Keyboard;
36 EFI_DEVICE_PATH_PROTOCOL End;
37 } USB_KEYBOARD_DEVICE_PATH;
38 #pragma pack ()
39
40 ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = gPnpPs2Keyboard;
41 ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = gPnp16550ComPort;
42 UART_DEVICE_PATH gUartDeviceNode = gUart;
43 VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal;
44
45 //
46 // Platform specific keyboard device path
47 //
48
49
50 //
51 // Debug Agent UART Device Path
52 //
53 VENDOR_UART_DEVICE_PATH gDebugAgentUartDevicePath = {
54 {
55 {
56 HARDWARE_DEVICE_PATH,
57 HW_VENDOR_DP,
58 {
59 (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
60 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
61 }
62 },
63 EFI_DEBUG_AGENT_GUID,
64 },
65 {
66 {
67 MESSAGING_DEVICE_PATH,
68 MSG_UART_DP,
69 {
70 (UINT8) (sizeof (UART_DEVICE_PATH)),
71 (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
72 }
73 },
74 0, // Reserved
75 0, // BaudRate - Default
76 0, // DataBits - Default
77 0, // Parity - Default
78 0, // StopBits - Default
79 },
80 gPcAnsiTerminal,
81 gEndEntire
82 };
83
84 STATIC USB_KEYBOARD_DEVICE_PATH gUsbKeyboardDevicePath = {
85 {
86 {
87 MESSAGING_DEVICE_PATH,
88 MSG_USB_CLASS_DP,
89 {
90 (UINT8)sizeof (USB_CLASS_DEVICE_PATH),
91 (UINT8)(sizeof (USB_CLASS_DEVICE_PATH) >> 8)
92 }
93 },
94 0xFFFF, // VendorId: any
95 0xFFFF, // ProductId: any
96 3, // DeviceClass: HID
97 1, // DeviceSubClass: boot
98 1 // DeviceProtocol: keyboard
99 },
100 gEndEntire
101 };
102
103 //
104 // Predefined platform default console device path
105 //
106 PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] = {
107 {
108 (EFI_DEVICE_PATH_PROTOCOL *) &gDebugAgentUartDevicePath,
109 (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
110 },
111 {
112 (EFI_DEVICE_PATH_PROTOCOL *)&gUsbKeyboardDevicePath,
113 CONSOLE_IN
114 },
115 {
116 NULL,
117 0
118 }
119 };
120
121 //
122 // Predefined platform connect sequence
123 //
124 EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[] = { NULL };
125