blob: 32ce4ea5aea14a8a156c70b5cc5dde543583c9f3 [file] [log] [blame]
Bin Mengc85a5be2018-10-15 02:21:23 -07001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
4 *
5 * VirtIO PCI bus transport driver
6 * Ported from Linux drivers/virtio/virtio_pci*.c
7 */
8
9#include <common.h>
10#include <dm.h>
Simon Glass0f2af882020-05-10 11:40:05 -060011#include <log.h>
Bin Mengc85a5be2018-10-15 02:21:23 -070012#include <virtio_types.h>
13#include <virtio.h>
14#include <virtio_ring.h>
15#include <dm/device.h>
16#include <linux/compat.h>
Simon Glassd66c5f72020-02-03 07:36:15 -070017#include <linux/err.h>
Bin Mengc85a5be2018-10-15 02:21:23 -070018#include <linux/io.h>
19#include "virtio_pci.h"
20
21#define VIRTIO_PCI_DRV_NAME "virtio-pci.m"
22
23/* PCI device ID in the range 0x1040 to 0x107f */
24#define VIRTIO_PCI_VENDOR_ID 0x1af4
25#define VIRTIO_PCI_DEVICE_ID00 0x1040
26#define VIRTIO_PCI_DEVICE_ID01 0x1041
27#define VIRTIO_PCI_DEVICE_ID02 0x1042
28#define VIRTIO_PCI_DEVICE_ID03 0x1043
29#define VIRTIO_PCI_DEVICE_ID04 0x1044
30#define VIRTIO_PCI_DEVICE_ID05 0x1045
31#define VIRTIO_PCI_DEVICE_ID06 0x1046
32#define VIRTIO_PCI_DEVICE_ID07 0x1047
33#define VIRTIO_PCI_DEVICE_ID08 0x1048
34#define VIRTIO_PCI_DEVICE_ID09 0x1049
35#define VIRTIO_PCI_DEVICE_ID0A 0x104a
36#define VIRTIO_PCI_DEVICE_ID0B 0x104b
37#define VIRTIO_PCI_DEVICE_ID0C 0x104c
38#define VIRTIO_PCI_DEVICE_ID0D 0x104d
39#define VIRTIO_PCI_DEVICE_ID0E 0x104e
40#define VIRTIO_PCI_DEVICE_ID0F 0x104f
41#define VIRTIO_PCI_DEVICE_ID10 0x1050
42#define VIRTIO_PCI_DEVICE_ID11 0x1051
43#define VIRTIO_PCI_DEVICE_ID12 0x1052
44#define VIRTIO_PCI_DEVICE_ID13 0x1053
45#define VIRTIO_PCI_DEVICE_ID14 0x1054
46#define VIRTIO_PCI_DEVICE_ID15 0x1055
47#define VIRTIO_PCI_DEVICE_ID16 0x1056
48#define VIRTIO_PCI_DEVICE_ID17 0x1057
49#define VIRTIO_PCI_DEVICE_ID18 0x1058
50#define VIRTIO_PCI_DEVICE_ID19 0x1059
51#define VIRTIO_PCI_DEVICE_ID1A 0x105a
52#define VIRTIO_PCI_DEVICE_ID1B 0x105b
53#define VIRTIO_PCI_DEVICE_ID1C 0x105c
54#define VIRTIO_PCI_DEVICE_ID1D 0x105d
55#define VIRTIO_PCI_DEVICE_ID1E 0x105e
56#define VIRTIO_PCI_DEVICE_ID1F 0x105f
57#define VIRTIO_PCI_DEVICE_ID20 0x1060
58#define VIRTIO_PCI_DEVICE_ID21 0x1061
59#define VIRTIO_PCI_DEVICE_ID22 0x1062
60#define VIRTIO_PCI_DEVICE_ID23 0x1063
61#define VIRTIO_PCI_DEVICE_ID24 0x1064
62#define VIRTIO_PCI_DEVICE_ID25 0x1065
63#define VIRTIO_PCI_DEVICE_ID26 0x1066
64#define VIRTIO_PCI_DEVICE_ID27 0x1067
65#define VIRTIO_PCI_DEVICE_ID28 0x1068
66#define VIRTIO_PCI_DEVICE_ID29 0x1069
67#define VIRTIO_PCI_DEVICE_ID2A 0x106a
68#define VIRTIO_PCI_DEVICE_ID2B 0x106b
69#define VIRTIO_PCI_DEVICE_ID2C 0x106c
70#define VIRTIO_PCI_DEVICE_ID2D 0x106d
71#define VIRTIO_PCI_DEVICE_ID2E 0x106e
72#define VIRTIO_PCI_DEVICE_ID2F 0x106f
73#define VIRTIO_PCI_DEVICE_ID30 0x1070
74#define VIRTIO_PCI_DEVICE_ID31 0x1071
75#define VIRTIO_PCI_DEVICE_ID32 0x1072
76#define VIRTIO_PCI_DEVICE_ID33 0x1073
77#define VIRTIO_PCI_DEVICE_ID34 0x1074
78#define VIRTIO_PCI_DEVICE_ID35 0x1075
79#define VIRTIO_PCI_DEVICE_ID36 0x1076
80#define VIRTIO_PCI_DEVICE_ID37 0x1077
81#define VIRTIO_PCI_DEVICE_ID38 0x1078
82#define VIRTIO_PCI_DEVICE_ID39 0x1079
83#define VIRTIO_PCI_DEVICE_ID3A 0x107a
84#define VIRTIO_PCI_DEVICE_ID3B 0x107b
85#define VIRTIO_PCI_DEVICE_ID3C 0x107c
86#define VIRTIO_PCI_DEVICE_ID3D 0x107d
87#define VIRTIO_PCI_DEVICE_ID3E 0x107e
88#define VIRTIO_PCI_DEVICE_ID3F 0x107f
89
90/**
91 * virtio pci transport driver private data
92 *
93 * @common: pci transport device common register block base
94 * @notify_base: pci transport device notify register block base
95 * @device: pci transport device device-specific register block base
96 * @device_len: pci transport device device-specific register block length
97 * @notify_offset_multiplier: multiply queue_notify_off by this value
98 */
99struct virtio_pci_priv {
100 struct virtio_pci_common_cfg __iomem *common;
101 void __iomem *notify_base;
102 void __iomem *device;
103 u32 device_len;
104 u32 notify_offset_multiplier;
105};
106
107static int virtio_pci_get_config(struct udevice *udev, unsigned int offset,
108 void *buf, unsigned int len)
109{
110 struct virtio_pci_priv *priv = dev_get_priv(udev);
111 u8 b;
112 __le16 w;
113 __le32 l;
114
115 WARN_ON(offset + len > priv->device_len);
116
117 switch (len) {
118 case 1:
119 b = ioread8(priv->device + offset);
120 memcpy(buf, &b, sizeof(b));
121 break;
122 case 2:
123 w = cpu_to_le16(ioread16(priv->device + offset));
124 memcpy(buf, &w, sizeof(w));
125 break;
126 case 4:
127 l = cpu_to_le32(ioread32(priv->device + offset));
128 memcpy(buf, &l, sizeof(l));
129 break;
130 case 8:
131 l = cpu_to_le32(ioread32(priv->device + offset));
132 memcpy(buf, &l, sizeof(l));
133 l = cpu_to_le32(ioread32(priv->device + offset + sizeof(l)));
134 memcpy(buf + sizeof(l), &l, sizeof(l));
135 break;
136 default:
137 WARN_ON(true);
138 }
139
140 return 0;
141}
142
143static int virtio_pci_set_config(struct udevice *udev, unsigned int offset,
144 const void *buf, unsigned int len)
145{
146 struct virtio_pci_priv *priv = dev_get_priv(udev);
147 u8 b;
148 __le16 w;
149 __le32 l;
150
151 WARN_ON(offset + len > priv->device_len);
152
153 switch (len) {
154 case 1:
155 memcpy(&b, buf, sizeof(b));
156 iowrite8(b, priv->device + offset);
157 break;
158 case 2:
159 memcpy(&w, buf, sizeof(w));
160 iowrite16(le16_to_cpu(w), priv->device + offset);
161 break;
162 case 4:
163 memcpy(&l, buf, sizeof(l));
164 iowrite32(le32_to_cpu(l), priv->device + offset);
165 break;
166 case 8:
167 memcpy(&l, buf, sizeof(l));
168 iowrite32(le32_to_cpu(l), priv->device + offset);
169 memcpy(&l, buf + sizeof(l), sizeof(l));
170 iowrite32(le32_to_cpu(l), priv->device + offset + sizeof(l));
171 break;
172 default:
173 WARN_ON(true);
174 }
175
176 return 0;
177}
178
179static int virtio_pci_generation(struct udevice *udev, u32 *counter)
180{
181 struct virtio_pci_priv *priv = dev_get_priv(udev);
182
183 *counter = ioread8(&priv->common->config_generation);
184
185 return 0;
186}
187
188static int virtio_pci_get_status(struct udevice *udev, u8 *status)
189{
190 struct virtio_pci_priv *priv = dev_get_priv(udev);
191
192 *status = ioread8(&priv->common->device_status);
193
194 return 0;
195}
196
197static int virtio_pci_set_status(struct udevice *udev, u8 status)
198{
199 struct virtio_pci_priv *priv = dev_get_priv(udev);
200
201 /* We should never be setting status to 0 */
202 WARN_ON(status == 0);
203
204 iowrite8(status, &priv->common->device_status);
205
206 return 0;
207}
208
209static int virtio_pci_reset(struct udevice *udev)
210{
211 struct virtio_pci_priv *priv = dev_get_priv(udev);
212
213 /* 0 status means a reset */
214 iowrite8(0, &priv->common->device_status);
215
216 /*
217 * After writing 0 to device_status, the driver MUST wait for a read
218 * of device_status to return 0 before reinitializing the device.
219 * This will flush out the status write, and flush in device writes,
220 * including MSI-X interrupts, if any.
221 */
222 while (ioread8(&priv->common->device_status))
223 udelay(1000);
224
225 return 0;
226}
227
228static int virtio_pci_get_features(struct udevice *udev, u64 *features)
229{
230 struct virtio_pci_priv *priv = dev_get_priv(udev);
231
232 iowrite32(0, &priv->common->device_feature_select);
233 *features = ioread32(&priv->common->device_feature);
234 iowrite32(1, &priv->common->device_feature_select);
235 *features |= ((u64)ioread32(&priv->common->device_feature) << 32);
236
237 return 0;
238}
239
240static int virtio_pci_set_features(struct udevice *udev)
241{
242 struct virtio_pci_priv *priv = dev_get_priv(udev);
243 struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(udev);
244
245 if (!__virtio_test_bit(udev, VIRTIO_F_VERSION_1)) {
246 debug("virtio: device uses modern interface but does not have VIRTIO_F_VERSION_1\n");
247 return -EINVAL;
248 }
249
250 iowrite32(0, &priv->common->guest_feature_select);
251 iowrite32((u32)uc_priv->features, &priv->common->guest_feature);
252 iowrite32(1, &priv->common->guest_feature_select);
253 iowrite32(uc_priv->features >> 32, &priv->common->guest_feature);
254
255 return 0;
256}
257
258static struct virtqueue *virtio_pci_setup_vq(struct udevice *udev,
259 unsigned int index)
260{
261 struct virtio_pci_priv *priv = dev_get_priv(udev);
262 struct virtio_pci_common_cfg __iomem *cfg = priv->common;
263 struct virtqueue *vq;
264 u16 num;
265 u64 addr;
266 int err;
267
268 if (index >= ioread16(&cfg->num_queues))
269 return ERR_PTR(-ENOENT);
270
271 /* Select the queue we're interested in */
272 iowrite16(index, &cfg->queue_select);
273
274 /* Check if queue is either not available or already active */
275 num = ioread16(&cfg->queue_size);
276 if (!num || ioread16(&cfg->queue_enable))
277 return ERR_PTR(-ENOENT);
278
279 if (num & (num - 1)) {
280 printf("(%s): bad queue size %u", udev->name, num);
281 return ERR_PTR(-EINVAL);
282 }
283
284 /* Create the vring */
285 vq = vring_create_virtqueue(index, num, VIRTIO_PCI_VRING_ALIGN, udev);
286 if (!vq) {
287 err = -ENOMEM;
288 goto error_available;
289 }
290
291 /* Activate the queue */
292 iowrite16(virtqueue_get_vring_size(vq), &cfg->queue_size);
293
294 addr = virtqueue_get_desc_addr(vq);
295 iowrite32((u32)addr, &cfg->queue_desc_lo);
296 iowrite32(addr >> 32, &cfg->queue_desc_hi);
297
298 addr = virtqueue_get_avail_addr(vq);
299 iowrite32((u32)addr, &cfg->queue_avail_lo);
300 iowrite32(addr >> 32, &cfg->queue_avail_hi);
301
302 addr = virtqueue_get_used_addr(vq);
303 iowrite32((u32)addr, &cfg->queue_used_lo);
304 iowrite32(addr >> 32, &cfg->queue_used_hi);
305
306 iowrite16(1, &cfg->queue_enable);
307
308 return vq;
309
310error_available:
311 return ERR_PTR(err);
312}
313
314static void virtio_pci_del_vq(struct virtqueue *vq)
315{
316 struct virtio_pci_priv *priv = dev_get_priv(vq->vdev);
317 unsigned int index = vq->index;
318
319 iowrite16(index, &priv->common->queue_select);
320
321 /* Select and deactivate the queue */
322 iowrite16(0, &priv->common->queue_enable);
323
324 vring_del_virtqueue(vq);
325}
326
327static int virtio_pci_del_vqs(struct udevice *udev)
328{
329 struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(udev);
330 struct virtqueue *vq, *n;
331
332 list_for_each_entry_safe(vq, n, &uc_priv->vqs, list)
333 virtio_pci_del_vq(vq);
334
335 return 0;
336}
337
338static int virtio_pci_find_vqs(struct udevice *udev, unsigned int nvqs,
339 struct virtqueue *vqs[])
340{
341 int i;
342
343 for (i = 0; i < nvqs; ++i) {
344 vqs[i] = virtio_pci_setup_vq(udev, i);
345 if (IS_ERR(vqs[i])) {
346 virtio_pci_del_vqs(udev);
347 return PTR_ERR(vqs[i]);
348 }
349 }
350
351 return 0;
352}
353
354static int virtio_pci_notify(struct udevice *udev, struct virtqueue *vq)
355{
356 struct virtio_pci_priv *priv = dev_get_priv(udev);
357 u16 off;
358
359 /* Select the queue we're interested in */
360 iowrite16(vq->index, &priv->common->queue_select);
361
362 /* get offset of notification word for this vq */
363 off = ioread16(&priv->common->queue_notify_off);
364
365 /*
366 * We write the queue's selector into the notification register
367 * to signal the other end
368 */
369 iowrite16(vq->index,
370 priv->notify_base + off * priv->notify_offset_multiplier);
371
372 return 0;
373}
374
375/**
376 * virtio_pci_find_capability - walk capabilities to find device info
377 *
378 * @udev: the transport device
379 * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
380 *
381 * @return offset of the configuration structure
382 */
383static int virtio_pci_find_capability(struct udevice *udev, u8 cfg_type)
384{
385 int pos;
386 int offset;
387 u8 type, bar;
388
389 for (pos = dm_pci_find_capability(udev, PCI_CAP_ID_VNDR);
390 pos > 0;
391 pos = dm_pci_find_next_capability(udev, pos, PCI_CAP_ID_VNDR)) {
392 offset = pos + offsetof(struct virtio_pci_cap, cfg_type);
393 dm_pci_read_config8(udev, offset, &type);
394 offset = pos + offsetof(struct virtio_pci_cap, bar);
395 dm_pci_read_config8(udev, offset, &bar);
396
397 /* Ignore structures with reserved BAR values */
398 if (bar > 0x5)
399 continue;
400
401 if (type == cfg_type)
402 return pos;
403 }
404
405 return 0;
406}
407
408/**
409 * virtio_pci_map_capability - map base address of the capability
410 *
411 * @udev: the transport device
412 * @off: offset of the configuration structure
413 *
414 * @return base address of the capability
415 */
416static void __iomem *virtio_pci_map_capability(struct udevice *udev, int off)
417{
418 u8 bar;
419 u32 offset;
420 ulong base;
421 void __iomem *p;
422
423 if (!off)
424 return NULL;
425
426 offset = off + offsetof(struct virtio_pci_cap, bar);
427 dm_pci_read_config8(udev, offset, &bar);
428 offset = off + offsetof(struct virtio_pci_cap, offset);
429 dm_pci_read_config32(udev, offset, &offset);
430
431 /*
432 * TODO: adding 64-bit BAR support
433 *
434 * Per spec, the BAR is permitted to be either 32-bit or 64-bit.
435 * For simplicity, only read the BAR address as 32-bit.
436 */
437 base = dm_pci_read_bar32(udev, bar);
438 p = (void __iomem *)base + offset;
439
440 return p;
441}
442
443static int virtio_pci_bind(struct udevice *udev)
444{
445 static int num_devs;
446 char name[20];
447
448 /* Create a unique device name */
449 sprintf(name, "%s#%u", VIRTIO_PCI_DRV_NAME, num_devs++);
450 device_set_name(udev, name);
451
452 return 0;
453}
454
455static int virtio_pci_probe(struct udevice *udev)
456{
457 struct pci_child_platdata *pplat = dev_get_parent_platdata(udev);
458 struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(udev);
459 struct virtio_pci_priv *priv = dev_get_priv(udev);
460 u16 subvendor;
461 u8 revision;
462 int common, notify, device;
463 int offset;
464
465 /* We only own devices >= 0x1040 and <= 0x107f: leave the rest. */
466 if (pplat->device < 0x1040 || pplat->device > 0x107f)
467 return -ENODEV;
468
469 /* Transitional devices must not have a PCI revision ID of 0 */
470 dm_pci_read_config8(udev, PCI_REVISION_ID, &revision);
471
472 /* Modern devices: simply use PCI device id, but start from 0x1040. */
473 uc_priv->device = pplat->device - 0x1040;
474 dm_pci_read_config16(udev, PCI_SUBSYSTEM_VENDOR_ID, &subvendor);
475 uc_priv->vendor = subvendor;
476
477 /* Check for a common config: if not, use legacy mode (bar 0) */
478 common = virtio_pci_find_capability(udev, VIRTIO_PCI_CAP_COMMON_CFG);
479 if (!common) {
480 printf("(%s): leaving for legacy driver\n", udev->name);
481 return -ENODEV;
482 }
483
484 /* If common is there, notify should be too */
485 notify = virtio_pci_find_capability(udev, VIRTIO_PCI_CAP_NOTIFY_CFG);
486 if (!notify) {
487 printf("(%s): missing capabilities %i/%i\n", udev->name,
488 common, notify);
489 return -EINVAL;
490 }
491
492 /*
493 * Device capability is only mandatory for devices that have
494 * device-specific configuration.
495 */
496 device = virtio_pci_find_capability(udev, VIRTIO_PCI_CAP_DEVICE_CFG);
497 if (device) {
498 offset = notify + offsetof(struct virtio_pci_cap, length);
499 dm_pci_read_config32(udev, offset, &priv->device_len);
500 }
501
502 /* Map configuration structures */
503 priv->common = virtio_pci_map_capability(udev, common);
504 priv->notify_base = virtio_pci_map_capability(udev, notify);
505 priv->device = virtio_pci_map_capability(udev, device);
506 debug("(%p): common @ %p, notify base @ %p, device @ %p\n",
507 udev, priv->common, priv->notify_base, priv->device);
508
509 /* Read notify_off_multiplier from config space */
510 offset = notify + offsetof(struct virtio_pci_notify_cap,
511 notify_off_multiplier);
512 dm_pci_read_config32(udev, offset, &priv->notify_offset_multiplier);
513
514 debug("(%s): device (%d) vendor (%08x) version (%d)\n", udev->name,
515 uc_priv->device, uc_priv->vendor, revision);
516
517 return 0;
518}
519
520static const struct dm_virtio_ops virtio_pci_ops = {
521 .get_config = virtio_pci_get_config,
522 .set_config = virtio_pci_set_config,
523 .generation = virtio_pci_generation,
524 .get_status = virtio_pci_get_status,
525 .set_status = virtio_pci_set_status,
526 .reset = virtio_pci_reset,
527 .get_features = virtio_pci_get_features,
528 .set_features = virtio_pci_set_features,
529 .find_vqs = virtio_pci_find_vqs,
530 .del_vqs = virtio_pci_del_vqs,
531 .notify = virtio_pci_notify,
532};
533
534U_BOOT_DRIVER(virtio_pci_modern) = {
535 .name = VIRTIO_PCI_DRV_NAME,
536 .id = UCLASS_VIRTIO,
537 .ops = &virtio_pci_ops,
538 .bind = virtio_pci_bind,
539 .probe = virtio_pci_probe,
540 .priv_auto_alloc_size = sizeof(struct virtio_pci_priv),
541};
542
543static struct pci_device_id virtio_pci_supported[] = {
544 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID00) },
545 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID01) },
546 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID02) },
547 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID03) },
548 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID04) },
549 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID05) },
550 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID06) },
551 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID07) },
552 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID08) },
553 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID09) },
554 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0A) },
555 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0B) },
556 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0C) },
557 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0D) },
558 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0E) },
559 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0F) },
560 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID10) },
561 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID11) },
562 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID12) },
563 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID13) },
564 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID14) },
565 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID15) },
566 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID16) },
567 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID17) },
568 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID18) },
569 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID19) },
570 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1A) },
571 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1B) },
572 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1C) },
573 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1D) },
574 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1E) },
575 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1F) },
576 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID20) },
577 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID21) },
578 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID22) },
579 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID23) },
580 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID24) },
581 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID25) },
582 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID26) },
583 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID27) },
584 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID28) },
585 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID29) },
586 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2A) },
587 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2B) },
588 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2C) },
589 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2D) },
590 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2E) },
591 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2F) },
592 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID30) },
593 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID31) },
594 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID32) },
595 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID33) },
596 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID34) },
597 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID35) },
598 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID36) },
599 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID37) },
600 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID38) },
601 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID39) },
602 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3A) },
603 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3B) },
604 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3C) },
605 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3D) },
606 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3E) },
607 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3F) },
608 {},
609};
610
611U_BOOT_PCI_DEVICE(virtio_pci_modern, virtio_pci_supported);