1/*
2 * Copyright (c) 2012, ETH Zurich. All rights reserved.
3 *
4 * This file is distributed under the terms in the attached LICENSE file.
5 * If you do not find this file, copies can be found by writing to:
6 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
7 */
8
9/*
10 * virtio_pci.dev
11 *
12 * 4.1 Virtio Over PCI Bus
13 */
14 
15device virtio_pci lsbfirst ( addr base, addr common ) "Virtio PCI Device Specification" {
16 
17    constants vendor_id width(4) "VirtIO PCI vendor" {
18        virtio_vendor = 0x1AF4;
19    };
20 
21    /*
22     * cap_vndr 0x09;
23     */
24    register vendor addr(base, 0x0) "Identifies a vendor-specific capability." {
25        vndr     8 "Vendor ID";
26    };
27    
28    register next  addr(base, 0x1) "Next Pointer" {
29        next     8 "Link to next capability in the capability list." ;  
30    };
31    
32    register length addr(base, 0x2) "Length of this capability structure" {
33        len      8 "Length";
34    };
35    
36    constants config_type width(8) "Configuration types" {
37        common  = 1 "Common configuration";
38        notify  = 2 "Notifications";
39        isr     = 3 "ISR Status";
40        devspec  = 4 "Device specific configuration";
41        pci_cfg = 5 "PCI configuration access";
42        
43    };
44    
45    register config addr(base, 0x3) "identifies the structure" {
46        cfg_type 8 "configuration type";
47    };
48    
49    register bar addr(base, 0x4) "Base Address register (BAR) belonging to the function located beginning" {
50        bar 8 "Base Address register (BAR)";
51    };
52    
53    register offset addr(base, 0x8) "beginning of the structure relative to the base address" {
54        off 32 "Offset";
55    };
56    
57    register length2 addr(base, 0xC) "indicates the length of the structure." {
58        len 32 "Length";
59    };
60    
61    
62    register device_feature_select addr(common, 0x0) "" {
63       reg 32 "todo";
64    };
65    
66    register device_feature addr(common, 0x4) "" {
67    reg 32 "todo";
68    };
69    
70    register driver_feature_select addr(common, 0x8) "" {
71    reg 32 "todo";
72    };
73    
74    register driver addr(common, 0xC) "" {
75    reg 32 "todo";
76    };
77    
78    register msix_config addr(common, 0x10) {
79    reg 16 "todo";
80    };
81    
82    register num_queues addr(common, 0x12) {
83    reg 16 "todo";
84    };
85          
86    register device_status addr(common, 0x14) {
87    reg 8 "todo";
88    };
89    
90    register config_generation addr(common, 0x15) {
91    reg 8 "todo";
92    };
93
94          register queue_select addr(common, 0x16) {
95             val 16 "";
96          };
97          
98          register queue_size addr(common, 0x18){
99             val 16 "";
100          };
101          
102          register queue_msix_vector addr(common, 0x1A){
103             val 16 "";
104          };
105          
106          register queue_enable addr(common, 0x1C){
107             val 16 "";
108          };
109          
110          register queue_notify_off addr(common, 0x1E){
111             val 16 "";
112          };
113          
114          register queue_desc addr(common, 0x20){
115             val 64 "";
116          };
117          
118          register queue_avail addr(common, 0x28){
119             val 64 "";
120          };
121          
122          register queue_used addr(common, 0x30){
123             val 64 "";
124          };
125    
126  
127 };
128