]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Bhyve/Library/PlatformBootManagerLib/PlatformData.c
UefiCpuPkg/PiSmmCpuDxeSmm: pause in WaitForSemaphore() before re-fetch
[mirror_edk2.git] / OvmfPkg / Bhyve / 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) 2020, Rebecca Cran <rebecca@bsdio.com>
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 //
58 // Debug Agent UART Device Path
59 //
60 VENDOR_UART_DEVICE_PATH gDebugAgentUartDevicePath = {
61 {
62 {
63 HARDWARE_DEVICE_PATH,
64 HW_VENDOR_DP,
65 {
66 (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
67 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
68 }
69 },
70 EFI_DEBUG_AGENT_GUID,
71 },
72 {
73 {
74 MESSAGING_DEVICE_PATH,
75 MSG_UART_DP,
76 {
77 (UINT8) (sizeof (UART_DEVICE_PATH)),
78 (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
79 }
80 },
81 0, // Reserved
82 0, // BaudRate - Default
83 0, // DataBits - Default
84 0, // Parity - Default
85 0, // StopBits - Default
86 },
87 gPcAnsiTerminal,
88 gEndEntire
89 };
90
91 STATIC USB_KEYBOARD_DEVICE_PATH gUsbKeyboardDevicePath = {
92 {
93 {
94 MESSAGING_DEVICE_PATH,
95 MSG_USB_CLASS_DP,
96 {
97 (UINT8)sizeof (USB_CLASS_DEVICE_PATH),
98 (UINT8)(sizeof (USB_CLASS_DEVICE_PATH) >> 8)
99 }
100 },
101 0xFFFF, // VendorId: any
102 0xFFFF, // ProductId: any
103 3, // DeviceClass: HID
104 1, // DeviceSubClass: boot
105 1 // DeviceProtocol: keyboard
106 },
107 gEndEntire
108 };
109
110 STATIC VENDOR_RAMFB_DEVICE_PATH gQemuRamfbDevicePath = {
111 {
112 {
113 HARDWARE_DEVICE_PATH,
114 HW_VENDOR_DP,
115 {
116 (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
117 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
118 }
119 },
120 QEMU_RAMFB_GUID,
121 },
122 {
123 {
124 ACPI_DEVICE_PATH,
125 ACPI_ADR_DP,
126 {
127 (UINT8) (sizeof (ACPI_ADR_DEVICE_PATH)),
128 (UINT8) ((sizeof (ACPI_ADR_DEVICE_PATH)) >> 8)
129 }
130 },
131 ACPI_DISPLAY_ADR (
132 1, // DeviceIdScheme
133 0, // HeadId
134 0, // NonVgaOutput
135 1, // BiosCanDetect
136 0, // VendorInfo
137 ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL, // Type
138 0, // Port
139 0 // Index
140 ),
141 },
142 gEndEntire
143 };
144
145 //
146 // Predefined platform default console device path
147 //
148 PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] = {
149 {
150 (EFI_DEVICE_PATH_PROTOCOL *) &gDebugAgentUartDevicePath,
151 (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
152 },
153 {
154 (EFI_DEVICE_PATH_PROTOCOL *)&gUsbKeyboardDevicePath,
155 CONSOLE_IN
156 },
157 {
158 (EFI_DEVICE_PATH_PROTOCOL *)&gQemuRamfbDevicePath,
159 CONSOLE_OUT
160 },
161 {
162 NULL,
163 0
164 }
165 };
166
167 //
168 // Predefined platform connect sequence
169 //
170 EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[] = { NULL };
171