hw/loongarch: Modify flash block size to 256K
[qemu/ar7.git] / qapi / pci.json
blobec28f1d9b4620d25d51570e0e7e889f3a4e67772
1 # -*- Mode: Python -*-
2 # vim: filetype=python
4 # This work is licensed under the terms of the GNU GPL, version 2 or later.
5 # See the COPYING file in the top-level directory.
6 # SPDX-License-Identifier: GPL-2.0-or-later
8 ##
9 # = PCI
13 # @PciMemoryRange:
15 # A PCI device memory region
17 # @base: the starting address (guest physical)
19 # @limit: the ending address (guest physical)
21 # Since: 0.14
23 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
26 # @PciMemoryRegion:
28 # Information about a PCI device I/O region.
30 # @bar: the index of the Base Address Register for this region
32 # @type:
33 #     - 'io' if the region is a PIO region
34 #     - 'memory' if the region is a MMIO region
36 # @size: memory size
38 # @prefetch: if @type is 'memory', true if the memory is prefetchable
40 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
42 # Since: 0.14
44 { 'struct': 'PciMemoryRegion',
45   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
46            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
49 # @PciBusInfo:
51 # Information about a bus of a PCI Bridge device
53 # @number: primary bus interface number.  This should be the number of
54 #     the bus the device resides on.
56 # @secondary: secondary bus interface number.  This is the number of
57 #     the main bus for the bridge
59 # @subordinate: This is the highest number bus that resides below the
60 #     bridge.
62 # @io_range: The PIO range for all devices on this bridge
64 # @memory_range: The MMIO range for all devices on this bridge
66 # @prefetchable_range: The range of prefetchable MMIO for all devices
67 #     on this bridge
69 # Since: 2.4
71 { 'struct': 'PciBusInfo',
72   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
73            'io_range': 'PciMemoryRange',
74            'memory_range': 'PciMemoryRange',
75            'prefetchable_range': 'PciMemoryRange' } }
78 # @PciBridgeInfo:
80 # Information about a PCI Bridge device
82 # @bus: information about the bus the device resides on
84 # @devices: a list of @PciDeviceInfo for each device on this bridge
86 # Since: 0.14
88 { 'struct': 'PciBridgeInfo',
89   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
92 # @PciDeviceClass:
94 # Information about the Class of a PCI device
96 # @desc: a string description of the device's class (not stable, and
97 #     should only be treated as informational)
99 # @class: the class code of the device
101 # Since: 2.4
103 { 'struct': 'PciDeviceClass',
104   'data': {'*desc': 'str', 'class': 'int'} }
107 # @PciDeviceId:
109 # Information about the Id of a PCI device
111 # @device: the PCI device id
113 # @vendor: the PCI vendor id
115 # @subsystem: the PCI subsystem id (since 3.1)
117 # @subsystem-vendor: the PCI subsystem vendor id (since 3.1)
119 # Since: 2.4
121 { 'struct': 'PciDeviceId',
122   'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int',
123             '*subsystem-vendor': 'int'} }
126 # @PciDeviceInfo:
128 # Information about a PCI device
130 # @bus: the bus number of the device
132 # @slot: the slot the device is located in
134 # @function: the function of the slot used by the device
136 # @class_info: the class of the device
138 # @id: the PCI device id
140 # @irq: if an IRQ is assigned to the device, the IRQ number
142 # @irq_pin: the IRQ pin, zero means no IRQ (since 5.1)
144 # @qdev_id: the device name of the PCI device
146 # @pci_bridge: if the device is a PCI bridge, the bridge information
148 # @regions: a list of the PCI I/O regions associated with the device
150 # Since: 0.14
152 { 'struct': 'PciDeviceInfo',
153   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
154            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
155            '*irq': 'int', 'irq_pin': 'int', 'qdev_id': 'str',
156            '*pci_bridge': 'PciBridgeInfo', 'regions': ['PciMemoryRegion'] }}
159 # @PciInfo:
161 # Information about a PCI bus
163 # @bus: the bus index
165 # @devices: a list of devices on this bus
167 # Since: 0.14
169 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
172 # @query-pci:
174 # Return information about the PCI bus topology of the guest.
176 # Returns: a list of @PciInfo for each PCI bus.  Each bus is
177 #     represented by a json-object, which has a key with a json-array
178 #     of all PCI devices attached to it.  Each device is represented
179 #     by a json-object.
181 # Since: 0.14
183 # .. qmp-example::
185 #     -> { "execute": "query-pci" }
186 #     <- { "return": [
187 #              {
188 #                 "bus": 0,
189 #                 "devices": [
190 #                    {
191 #                       "bus": 0,
192 #                       "qdev_id": "",
193 #                       "slot": 0,
194 #                       "class_info": {
195 #                          "class": 1536,
196 #                          "desc": "Host bridge"
197 #                       },
198 #                       "id": {
199 #                          "device": 32902,
200 #                          "vendor": 4663
201 #                       },
202 #                       "function": 0,
203 #                       "regions": [
204 #                       ]
205 #                    },
206 #                    {
207 #                       "bus": 0,
208 #                       "qdev_id": "",
209 #                       "slot": 1,
210 #                       "class_info": {
211 #                          "class": 1537,
212 #                          "desc": "ISA bridge"
213 #                       },
214 #                       "id": {
215 #                          "device": 32902,
216 #                          "vendor": 28672
217 #                       },
218 #                       "function": 0,
219 #                       "regions": [
220 #                       ]
221 #                    },
222 #                    {
223 #                       "bus": 0,
224 #                       "qdev_id": "",
225 #                       "slot": 1,
226 #                       "class_info": {
227 #                          "class": 257,
228 #                          "desc": "IDE controller"
229 #                       },
230 #                       "id": {
231 #                          "device": 32902,
232 #                          "vendor": 28688
233 #                       },
234 #                       "function": 1,
235 #                       "regions": [
236 #                          {
237 #                             "bar": 4,
238 #                             "size": 16,
239 #                             "address": 49152,
240 #                             "type": "io"
241 #                          }
242 #                       ]
243 #                    },
244 #                    {
245 #                       "bus": 0,
246 #                       "qdev_id": "",
247 #                       "slot": 2,
248 #                       "class_info": {
249 #                          "class": 768,
250 #                          "desc": "VGA controller"
251 #                       },
252 #                       "id": {
253 #                          "device": 4115,
254 #                          "vendor": 184
255 #                       },
256 #                       "function": 0,
257 #                       "regions": [
258 #                          {
259 #                             "prefetch": true,
260 #                             "mem_type_64": false,
261 #                             "bar": 0,
262 #                             "size": 33554432,
263 #                             "address": 4026531840,
264 #                             "type": "memory"
265 #                          },
266 #                          {
267 #                             "prefetch": false,
268 #                             "mem_type_64": false,
269 #                             "bar": 1,
270 #                             "size": 4096,
271 #                             "address": 4060086272,
272 #                             "type": "memory"
273 #                          },
274 #                          {
275 #                             "prefetch": false,
276 #                             "mem_type_64": false,
277 #                             "bar": 6,
278 #                             "size": 65536,
279 #                             "address": -1,
280 #                             "type": "memory"
281 #                          }
282 #                       ]
283 #                    },
284 #                    {
285 #                       "bus": 0,
286 #                       "qdev_id": "",
287 #                       "irq": 11,
288 #                       "slot": 4,
289 #                       "class_info": {
290 #                          "class": 1280,
291 #                          "desc": "RAM controller"
292 #                       },
293 #                       "id": {
294 #                          "device": 6900,
295 #                          "vendor": 4098
296 #                       },
297 #                       "function": 0,
298 #                       "regions": [
299 #                          {
300 #                             "bar": 0,
301 #                             "size": 32,
302 #                             "address": 49280,
303 #                             "type": "io"
304 #                          }
305 #                       ]
306 #                    }
307 #                 ]
308 #              }
309 #           ]
310 #        }
312 # This example has been shortened as the real response is too long.
315 { 'command': 'query-pci', 'returns': ['PciInfo'] }