2 Definitions from the VirtIo 1.0 specification (csprd05).
4 Copyright (C) 2016, Red Hat, Inc.
5 Copyright (C) 2017, AMD, Inc.
7 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef _VIRTIO_1_0_H_
11 #define _VIRTIO_1_0_H_
13 #include <IndustryStandard/Pci23.h>
14 #include <IndustryStandard/Virtio095.h>
17 // Subsystem Device IDs (to be) introduced in VirtIo 1.0
19 #define VIRTIO_SUBSYSTEM_GPU_DEVICE 16
22 // Structures for parsing the VirtIo 1.0 specific PCI capabilities from the
27 EFI_PCI_CAPABILITY_VENDOR_HDR VendorHdr
;
28 UINT8 ConfigType
; // Identifies the specific VirtIo 1.0 config structure
29 UINT8 Bar
; // The BAR that contains the structure
31 UINT32 Offset
; // Offset within Bar until the start of the structure
32 UINT32 Length
; // Length of the structure
37 // Values for the VIRTIO_PCI_CAP.ConfigType field
39 #define VIRTIO_PCI_CAP_COMMON_CFG 1 // Common configuration
40 #define VIRTIO_PCI_CAP_NOTIFY_CFG 2 // Notifications
41 #define VIRTIO_PCI_CAP_DEVICE_CFG 4 // Device specific configuration
44 // Structure pointed-to by Bar and Offset in VIRTIO_PCI_CAP when ConfigType is
45 // VIRTIO_PCI_CAP_COMMON_CFG
49 UINT32 DeviceFeatureSelect
;
51 UINT32 DriverFeatureSelect
;
56 UINT8 ConfigGeneration
;
59 UINT16 QueueMsixVector
;
61 UINT16 QueueNotifyOff
;
65 } VIRTIO_PCI_COMMON_CFG
;
69 // VirtIo 1.0 device status bits
71 #define VSTAT_FEATURES_OK BIT3
74 // VirtIo 1.0 reserved (device-independent) feature bits
76 #define VIRTIO_F_VERSION_1 BIT32
77 #define VIRTIO_F_IOMMU_PLATFORM BIT33
79 #endif // _VIRTIO_1_0_H_