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) 2020, Rebecca Cran <[email protected]>
|
---|
6 | Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
|
---|
7 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
8 |
|
---|
9 | **/
|
---|
10 |
|
---|
11 | #include "BdsPlatform.h"
|
---|
12 | #include <Guid/QemuRamfb.h>
|
---|
13 |
|
---|
14 | //
|
---|
15 | // Debug Agent UART Device Path structure
|
---|
16 | //
|
---|
17 | #pragma pack(1)
|
---|
18 | typedef struct {
|
---|
19 | VENDOR_DEVICE_PATH VendorHardware;
|
---|
20 | UART_DEVICE_PATH Uart;
|
---|
21 | VENDOR_DEVICE_PATH TerminalType;
|
---|
22 | EFI_DEVICE_PATH_PROTOCOL End;
|
---|
23 | } VENDOR_UART_DEVICE_PATH;
|
---|
24 | #pragma pack()
|
---|
25 |
|
---|
26 | //
|
---|
27 | // USB Keyboard Device Path structure
|
---|
28 | //
|
---|
29 | #pragma pack (1)
|
---|
30 | typedef struct {
|
---|
31 | USB_CLASS_DEVICE_PATH Keyboard;
|
---|
32 | EFI_DEVICE_PATH_PROTOCOL End;
|
---|
33 | } USB_KEYBOARD_DEVICE_PATH;
|
---|
34 | #pragma pack ()
|
---|
35 |
|
---|
36 | //
|
---|
37 | // QemuRamfb Device Path structure
|
---|
38 | //
|
---|
39 | #pragma pack (1)
|
---|
40 | typedef struct {
|
---|
41 | VENDOR_DEVICE_PATH Vendor;
|
---|
42 | ACPI_ADR_DEVICE_PATH AcpiAdr;
|
---|
43 | EFI_DEVICE_PATH_PROTOCOL End;
|
---|
44 | } VENDOR_RAMFB_DEVICE_PATH;
|
---|
45 | #pragma pack ()
|
---|
46 |
|
---|
47 | ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = gPnpPs2Keyboard;
|
---|
48 | ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = gPnp16550ComPort;
|
---|
49 | UART_DEVICE_PATH gUartDeviceNode = gUart;
|
---|
50 | VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal;
|
---|
51 |
|
---|
52 | //
|
---|
53 | // Platform specific keyboard device path
|
---|
54 | //
|
---|
55 |
|
---|
56 | //
|
---|
57 | // Debug Agent UART Device Path
|
---|
58 | //
|
---|
59 | VENDOR_UART_DEVICE_PATH gDebugAgentUartDevicePath = {
|
---|
60 | {
|
---|
61 | {
|
---|
62 | HARDWARE_DEVICE_PATH,
|
---|
63 | HW_VENDOR_DP,
|
---|
64 | {
|
---|
65 | (UINT8)(sizeof (VENDOR_DEVICE_PATH)),
|
---|
66 | (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
---|
67 | }
|
---|
68 | },
|
---|
69 | EFI_DEBUG_AGENT_GUID,
|
---|
70 | },
|
---|
71 | {
|
---|
72 | {
|
---|
73 | MESSAGING_DEVICE_PATH,
|
---|
74 | MSG_UART_DP,
|
---|
75 | {
|
---|
76 | (UINT8)(sizeof (UART_DEVICE_PATH)),
|
---|
77 | (UINT8)((sizeof (UART_DEVICE_PATH)) >> 8)
|
---|
78 | }
|
---|
79 | },
|
---|
80 | 0, // Reserved
|
---|
81 | 0, // BaudRate - Default
|
---|
82 | 0, // DataBits - Default
|
---|
83 | 0, // Parity - Default
|
---|
84 | 0, // StopBits - Default
|
---|
85 | },
|
---|
86 | gPcAnsiTerminal,
|
---|
87 | gEndEntire
|
---|
88 | };
|
---|
89 |
|
---|
90 | STATIC USB_KEYBOARD_DEVICE_PATH gUsbKeyboardDevicePath = {
|
---|
91 | {
|
---|
92 | {
|
---|
93 | MESSAGING_DEVICE_PATH,
|
---|
94 | MSG_USB_CLASS_DP,
|
---|
95 | {
|
---|
96 | (UINT8)sizeof (USB_CLASS_DEVICE_PATH),
|
---|
97 | (UINT8)(sizeof (USB_CLASS_DEVICE_PATH) >> 8)
|
---|
98 | }
|
---|
99 | },
|
---|
100 | 0xFFFF, // VendorId: any
|
---|
101 | 0xFFFF, // ProductId: any
|
---|
102 | 3, // DeviceClass: HID
|
---|
103 | 1, // DeviceSubClass: boot
|
---|
104 | 1 // DeviceProtocol: keyboard
|
---|
105 | },
|
---|
106 | gEndEntire
|
---|
107 | };
|
---|
108 |
|
---|
109 | STATIC VENDOR_RAMFB_DEVICE_PATH gQemuRamfbDevicePath = {
|
---|
110 | {
|
---|
111 | {
|
---|
112 | HARDWARE_DEVICE_PATH,
|
---|
113 | HW_VENDOR_DP,
|
---|
114 | {
|
---|
115 | (UINT8)(sizeof (VENDOR_DEVICE_PATH)),
|
---|
116 | (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
---|
117 | }
|
---|
118 | },
|
---|
119 | QEMU_RAMFB_GUID,
|
---|
120 | },
|
---|
121 | {
|
---|
122 | {
|
---|
123 | ACPI_DEVICE_PATH,
|
---|
124 | ACPI_ADR_DP,
|
---|
125 | {
|
---|
126 | (UINT8)(sizeof (ACPI_ADR_DEVICE_PATH)),
|
---|
127 | (UINT8)((sizeof (ACPI_ADR_DEVICE_PATH)) >> 8)
|
---|
128 | }
|
---|
129 | },
|
---|
130 | ACPI_DISPLAY_ADR (
|
---|
131 | 1, // DeviceIdScheme
|
---|
132 | 0, // HeadId
|
---|
133 | 0, // NonVgaOutput
|
---|
134 | 1, // BiosCanDetect
|
---|
135 | 0, // VendorInfo
|
---|
136 | ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL, // Type
|
---|
137 | 0, // Port
|
---|
138 | 0 // Index
|
---|
139 | ),
|
---|
140 | },
|
---|
141 | gEndEntire
|
---|
142 | };
|
---|
143 |
|
---|
144 | //
|
---|
145 | // Predefined platform default console device path
|
---|
146 | //
|
---|
147 | PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] = {
|
---|
148 | {
|
---|
149 | (EFI_DEVICE_PATH_PROTOCOL *)&gDebugAgentUartDevicePath,
|
---|
150 | (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
|
---|
151 | },
|
---|
152 | {
|
---|
153 | (EFI_DEVICE_PATH_PROTOCOL *)&gUsbKeyboardDevicePath,
|
---|
154 | CONSOLE_IN
|
---|
155 | },
|
---|
156 | {
|
---|
157 | (EFI_DEVICE_PATH_PROTOCOL *)&gQemuRamfbDevicePath,
|
---|
158 | CONSOLE_OUT
|
---|
159 | },
|
---|
160 | {
|
---|
161 | NULL,
|
---|
162 | 0
|
---|
163 | }
|
---|
164 | };
|
---|
165 |
|
---|
166 | //
|
---|
167 | // Predefined platform connect sequence
|
---|
168 | //
|
---|
169 | EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[] = { NULL };
|
---|