]>
Commit | Line | Data |
---|---|---|
acb81416 LE |
1 | /** @file\r |
2 | Definitions from the VirtIo 1.0 specification (csprd05).\r | |
3 | \r | |
4 | Copyright (C) 2016, Red Hat, Inc.\r | |
4fb26802 | 5 | Copyright (C) 2017, AMD, Inc.\r |
acb81416 | 6 | \r |
b26f0cf9 | 7 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
acb81416 LE |
8 | **/\r |
9 | \r | |
10 | #ifndef _VIRTIO_1_0_H_\r | |
11 | #define _VIRTIO_1_0_H_\r | |
12 | \r | |
5685a243 | 13 | #include <IndustryStandard/Pci23.h>\r |
acb81416 LE |
14 | #include <IndustryStandard/Virtio095.h>\r |
15 | \r | |
92dc5e9d LE |
16 | //\r |
17 | // Subsystem Device IDs (to be) introduced in VirtIo 1.0\r | |
18 | //\r | |
19 | #define VIRTIO_SUBSYSTEM_GPU_DEVICE 16\r | |
20 | \r | |
acb81416 LE |
21 | //\r |
22 | // Structures for parsing the VirtIo 1.0 specific PCI capabilities from the\r | |
23 | // config space\r | |
24 | //\r | |
25 | #pragma pack (1)\r | |
26 | typedef struct {\r | |
5685a243 | 27 | EFI_PCI_CAPABILITY_VENDOR_HDR VendorHdr;\r |
acb81416 LE |
28 | UINT8 ConfigType; // Identifies the specific VirtIo 1.0 config structure\r |
29 | UINT8 Bar; // The BAR that contains the structure\r | |
30 | UINT8 Padding[3];\r | |
31 | UINT32 Offset; // Offset within Bar until the start of the structure\r | |
32 | UINT32 Length; // Length of the structure\r | |
33 | } VIRTIO_PCI_CAP;\r | |
34 | #pragma pack ()\r | |
35 | \r | |
36 | //\r | |
37 | // Values for the VIRTIO_PCI_CAP.ConfigType field\r | |
38 | //\r | |
39 | #define VIRTIO_PCI_CAP_COMMON_CFG 1 // Common configuration\r | |
40 | #define VIRTIO_PCI_CAP_NOTIFY_CFG 2 // Notifications\r | |
41 | #define VIRTIO_PCI_CAP_DEVICE_CFG 4 // Device specific configuration\r | |
42 | \r | |
43 | //\r | |
44 | // Structure pointed-to by Bar and Offset in VIRTIO_PCI_CAP when ConfigType is\r | |
45 | // VIRTIO_PCI_CAP_COMMON_CFG\r | |
46 | //\r | |
47 | #pragma pack (1)\r | |
48 | typedef struct {\r | |
49 | UINT32 DeviceFeatureSelect;\r | |
50 | UINT32 DeviceFeature;\r | |
51 | UINT32 DriverFeatureSelect;\r | |
52 | UINT32 DriverFeature;\r | |
53 | UINT16 MsixConfig;\r | |
54 | UINT16 NumQueues;\r | |
55 | UINT8 DeviceStatus;\r | |
56 | UINT8 ConfigGeneration;\r | |
57 | UINT16 QueueSelect;\r | |
58 | UINT16 QueueSize;\r | |
59 | UINT16 QueueMsixVector;\r | |
60 | UINT16 QueueEnable;\r | |
61 | UINT16 QueueNotifyOff;\r | |
62 | UINT64 QueueDesc;\r | |
63 | UINT64 QueueAvail;\r | |
64 | UINT64 QueueUsed;\r | |
65 | } VIRTIO_PCI_COMMON_CFG;\r | |
66 | #pragma pack ()\r | |
67 | \r | |
68 | //\r | |
69 | // VirtIo 1.0 device status bits\r | |
70 | //\r | |
71 | #define VSTAT_FEATURES_OK BIT3\r | |
72 | \r | |
73 | //\r | |
74 | // VirtIo 1.0 reserved (device-independent) feature bits\r | |
75 | //\r | |
4fb26802 BS |
76 | #define VIRTIO_F_VERSION_1 BIT32\r |
77 | #define VIRTIO_F_IOMMU_PLATFORM BIT33\r | |
acb81416 LE |
78 | \r |
79 | #endif // _VIRTIO_1_0_H_\r |