1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
5 * VirtIO PCI bus transport driver
6 * Ported from Linux drivers/virtio/virtio_pci*.c
12 #include <virtio_types.h>
14 #include <virtio_ring.h>
15 #include <dm/device.h>
16 #include <linux/bug.h>
17 #include <linux/compat.h>
18 #include <linux/delay.h>
19 #include <linux/err.h>
21 #include "virtio_pci.h"
23 #define VIRTIO_PCI_DRV_NAME "virtio-pci.m"
25 /* PCI device ID in the range 0x1040 to 0x107f */
26 #define VIRTIO_PCI_VENDOR_ID 0x1af4
27 #define VIRTIO_PCI_DEVICE_ID00 0x1040
28 #define VIRTIO_PCI_DEVICE_ID01 0x1041
29 #define VIRTIO_PCI_DEVICE_ID02 0x1042
30 #define VIRTIO_PCI_DEVICE_ID03 0x1043
31 #define VIRTIO_PCI_DEVICE_ID04 0x1044
32 #define VIRTIO_PCI_DEVICE_ID05 0x1045
33 #define VIRTIO_PCI_DEVICE_ID06 0x1046
34 #define VIRTIO_PCI_DEVICE_ID07 0x1047
35 #define VIRTIO_PCI_DEVICE_ID08 0x1048
36 #define VIRTIO_PCI_DEVICE_ID09 0x1049
37 #define VIRTIO_PCI_DEVICE_ID0A 0x104a
38 #define VIRTIO_PCI_DEVICE_ID0B 0x104b
39 #define VIRTIO_PCI_DEVICE_ID0C 0x104c
40 #define VIRTIO_PCI_DEVICE_ID0D 0x104d
41 #define VIRTIO_PCI_DEVICE_ID0E 0x104e
42 #define VIRTIO_PCI_DEVICE_ID0F 0x104f
43 #define VIRTIO_PCI_DEVICE_ID10 0x1050
44 #define VIRTIO_PCI_DEVICE_ID11 0x1051
45 #define VIRTIO_PCI_DEVICE_ID12 0x1052
46 #define VIRTIO_PCI_DEVICE_ID13 0x1053
47 #define VIRTIO_PCI_DEVICE_ID14 0x1054
48 #define VIRTIO_PCI_DEVICE_ID15 0x1055
49 #define VIRTIO_PCI_DEVICE_ID16 0x1056
50 #define VIRTIO_PCI_DEVICE_ID17 0x1057
51 #define VIRTIO_PCI_DEVICE_ID18 0x1058
52 #define VIRTIO_PCI_DEVICE_ID19 0x1059
53 #define VIRTIO_PCI_DEVICE_ID1A 0x105a
54 #define VIRTIO_PCI_DEVICE_ID1B 0x105b
55 #define VIRTIO_PCI_DEVICE_ID1C 0x105c
56 #define VIRTIO_PCI_DEVICE_ID1D 0x105d
57 #define VIRTIO_PCI_DEVICE_ID1E 0x105e
58 #define VIRTIO_PCI_DEVICE_ID1F 0x105f
59 #define VIRTIO_PCI_DEVICE_ID20 0x1060
60 #define VIRTIO_PCI_DEVICE_ID21 0x1061
61 #define VIRTIO_PCI_DEVICE_ID22 0x1062
62 #define VIRTIO_PCI_DEVICE_ID23 0x1063
63 #define VIRTIO_PCI_DEVICE_ID24 0x1064
64 #define VIRTIO_PCI_DEVICE_ID25 0x1065
65 #define VIRTIO_PCI_DEVICE_ID26 0x1066
66 #define VIRTIO_PCI_DEVICE_ID27 0x1067
67 #define VIRTIO_PCI_DEVICE_ID28 0x1068
68 #define VIRTIO_PCI_DEVICE_ID29 0x1069
69 #define VIRTIO_PCI_DEVICE_ID2A 0x106a
70 #define VIRTIO_PCI_DEVICE_ID2B 0x106b
71 #define VIRTIO_PCI_DEVICE_ID2C 0x106c
72 #define VIRTIO_PCI_DEVICE_ID2D 0x106d
73 #define VIRTIO_PCI_DEVICE_ID2E 0x106e
74 #define VIRTIO_PCI_DEVICE_ID2F 0x106f
75 #define VIRTIO_PCI_DEVICE_ID30 0x1070
76 #define VIRTIO_PCI_DEVICE_ID31 0x1071
77 #define VIRTIO_PCI_DEVICE_ID32 0x1072
78 #define VIRTIO_PCI_DEVICE_ID33 0x1073
79 #define VIRTIO_PCI_DEVICE_ID34 0x1074
80 #define VIRTIO_PCI_DEVICE_ID35 0x1075
81 #define VIRTIO_PCI_DEVICE_ID36 0x1076
82 #define VIRTIO_PCI_DEVICE_ID37 0x1077
83 #define VIRTIO_PCI_DEVICE_ID38 0x1078
84 #define VIRTIO_PCI_DEVICE_ID39 0x1079
85 #define VIRTIO_PCI_DEVICE_ID3A 0x107a
86 #define VIRTIO_PCI_DEVICE_ID3B 0x107b
87 #define VIRTIO_PCI_DEVICE_ID3C 0x107c
88 #define VIRTIO_PCI_DEVICE_ID3D 0x107d
89 #define VIRTIO_PCI_DEVICE_ID3E 0x107e
90 #define VIRTIO_PCI_DEVICE_ID3F 0x107f
93 * virtio pci transport driver private data
95 * @common: pci transport device common register block base
96 * @notify_base: pci transport device notify register block base
97 * @notify_len: pci transport device notify register block length
98 * @device: pci transport device device-specific register block base
99 * @device_len: pci transport device device-specific register block length
100 * @notify_offset_multiplier: multiply queue_notify_off by this value
102 struct virtio_pci_priv {
103 struct virtio_pci_common_cfg __iomem *common;
104 void __iomem *notify_base;
106 void __iomem *device;
108 u32 notify_offset_multiplier;
111 static int virtio_pci_get_config(struct udevice *udev, unsigned int offset,
112 void *buf, unsigned int len)
114 struct virtio_pci_priv *priv = dev_get_priv(udev);
122 if (offset + len > priv->device_len)
127 b = ioread8(priv->device + offset);
128 memcpy(buf, &b, sizeof(b));
131 w = cpu_to_le16(ioread16(priv->device + offset));
132 memcpy(buf, &w, sizeof(w));
135 l = cpu_to_le32(ioread32(priv->device + offset));
136 memcpy(buf, &l, sizeof(l));
139 l = cpu_to_le32(ioread32(priv->device + offset));
140 memcpy(buf, &l, sizeof(l));
141 l = cpu_to_le32(ioread32(priv->device + offset + sizeof(l)));
142 memcpy(buf + sizeof(l), &l, sizeof(l));
151 static int virtio_pci_set_config(struct udevice *udev, unsigned int offset,
152 const void *buf, unsigned int len)
154 struct virtio_pci_priv *priv = dev_get_priv(udev);
162 if (offset + len > priv->device_len)
167 memcpy(&b, buf, sizeof(b));
168 iowrite8(b, priv->device + offset);
171 memcpy(&w, buf, sizeof(w));
172 iowrite16(le16_to_cpu(w), priv->device + offset);
175 memcpy(&l, buf, sizeof(l));
176 iowrite32(le32_to_cpu(l), priv->device + offset);
179 memcpy(&l, buf, sizeof(l));
180 iowrite32(le32_to_cpu(l), priv->device + offset);
181 memcpy(&l, buf + sizeof(l), sizeof(l));
182 iowrite32(le32_to_cpu(l), priv->device + offset + sizeof(l));
191 static int virtio_pci_generation(struct udevice *udev, u32 *counter)
193 struct virtio_pci_priv *priv = dev_get_priv(udev);
195 *counter = ioread8(&priv->common->config_generation);
200 static int virtio_pci_get_status(struct udevice *udev, u8 *status)
202 struct virtio_pci_priv *priv = dev_get_priv(udev);
204 *status = ioread8(&priv->common->device_status);
209 static int virtio_pci_set_status(struct udevice *udev, u8 status)
211 struct virtio_pci_priv *priv = dev_get_priv(udev);
213 /* We should never be setting status to 0 */
214 WARN_ON(status == 0);
216 iowrite8(status, &priv->common->device_status);
221 static int virtio_pci_reset(struct udevice *udev)
223 struct virtio_pci_priv *priv = dev_get_priv(udev);
225 /* 0 status means a reset */
226 iowrite8(0, &priv->common->device_status);
229 * After writing 0 to device_status, the driver MUST wait for a read
230 * of device_status to return 0 before reinitializing the device.
231 * This will flush out the status write, and flush in device writes,
232 * including MSI-X interrupts, if any.
234 while (ioread8(&priv->common->device_status))
240 static int virtio_pci_get_features(struct udevice *udev, u64 *features)
242 struct virtio_pci_priv *priv = dev_get_priv(udev);
244 iowrite32(0, &priv->common->device_feature_select);
245 *features = ioread32(&priv->common->device_feature);
246 iowrite32(1, &priv->common->device_feature_select);
247 *features |= ((u64)ioread32(&priv->common->device_feature) << 32);
252 static int virtio_pci_set_features(struct udevice *udev)
254 struct virtio_pci_priv *priv = dev_get_priv(udev);
255 struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(udev);
257 if (!__virtio_test_bit(udev, VIRTIO_F_VERSION_1)) {
258 debug("virtio: device uses modern interface but does not have VIRTIO_F_VERSION_1\n");
262 iowrite32(0, &priv->common->guest_feature_select);
263 iowrite32((u32)uc_priv->features, &priv->common->guest_feature);
264 iowrite32(1, &priv->common->guest_feature_select);
265 iowrite32(uc_priv->features >> 32, &priv->common->guest_feature);
270 static struct virtqueue *virtio_pci_setup_vq(struct udevice *udev,
273 struct virtio_pci_priv *priv = dev_get_priv(udev);
274 struct virtio_pci_common_cfg __iomem *cfg = priv->common;
275 struct virtqueue *vq;
280 if (index >= ioread16(&cfg->num_queues))
281 return ERR_PTR(-ENOENT);
283 /* Select the queue we're interested in */
284 iowrite16(index, &cfg->queue_select);
286 /* Check if queue is either not available or already active */
287 num = ioread16(&cfg->queue_size);
288 if (!num || ioread16(&cfg->queue_enable))
289 return ERR_PTR(-ENOENT);
291 if (num & (num - 1)) {
292 printf("(%s): bad queue size %u", udev->name, num);
293 return ERR_PTR(-EINVAL);
296 /* Create the vring */
297 vq = vring_create_virtqueue(index, num, VIRTIO_PCI_VRING_ALIGN, udev);
300 goto error_available;
303 /* Activate the queue */
304 iowrite16(virtqueue_get_vring_size(vq), &cfg->queue_size);
306 addr = virtqueue_get_desc_addr(vq);
307 iowrite32((u32)addr, &cfg->queue_desc_lo);
308 iowrite32(addr >> 32, &cfg->queue_desc_hi);
310 addr = virtqueue_get_avail_addr(vq);
311 iowrite32((u32)addr, &cfg->queue_avail_lo);
312 iowrite32(addr >> 32, &cfg->queue_avail_hi);
314 addr = virtqueue_get_used_addr(vq);
315 iowrite32((u32)addr, &cfg->queue_used_lo);
316 iowrite32(addr >> 32, &cfg->queue_used_hi);
318 iowrite16(1, &cfg->queue_enable);
326 static void virtio_pci_del_vq(struct virtqueue *vq)
328 struct virtio_pci_priv *priv = dev_get_priv(vq->vdev);
329 unsigned int index = vq->index;
331 iowrite16(index, &priv->common->queue_select);
333 /* Select and deactivate the queue */
334 iowrite16(0, &priv->common->queue_enable);
336 vring_del_virtqueue(vq);
339 static int virtio_pci_del_vqs(struct udevice *udev)
341 struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(udev);
342 struct virtqueue *vq, *n;
344 list_for_each_entry_safe(vq, n, &uc_priv->vqs, list)
345 virtio_pci_del_vq(vq);
350 static int virtio_pci_find_vqs(struct udevice *udev, unsigned int nvqs,
351 struct virtqueue *vqs[])
355 for (i = 0; i < nvqs; ++i) {
356 vqs[i] = virtio_pci_setup_vq(udev, i);
357 if (IS_ERR(vqs[i])) {
358 virtio_pci_del_vqs(udev);
359 return PTR_ERR(vqs[i]);
366 static int virtio_pci_notify(struct udevice *udev, struct virtqueue *vq)
368 struct virtio_pci_priv *priv = dev_get_priv(udev);
371 /* Select the queue we're interested in */
372 iowrite16(vq->index, &priv->common->queue_select);
374 /* get offset of notification word for this vq */
375 off = ioread16(&priv->common->queue_notify_off);
378 * Check the effective offset is in bounds and leaves space for the
379 * notification, which is just a single 16-bit value since
380 * VIRTIO_F_NOTIFICATION_DATA isn't negotiated by the drivers.
382 off *= priv->notify_offset_multiplier;
383 if (off > priv->notify_len - sizeof(u16))
387 * We write the queue's selector into the notification register
388 * to signal the other end
390 iowrite16(vq->index, priv->notify_base + off);
396 * virtio_pci_find_capability - walk capabilities to find device info
398 * @udev: the transport device
399 * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
400 * @cap_size: expected size of the capability
401 * @cap: capability read from the config space
403 * Return: offset of the configuration structure
405 static int virtio_pci_find_capability(struct udevice *udev, u8 cfg_type,
407 struct virtio_pci_cap *cap)
412 assert(cap_size >= sizeof(struct virtio_pci_cap));
413 assert(cap_size <= PCI_CFG_SPACE_SIZE);
418 for (pos = dm_pci_find_capability(udev, PCI_CAP_ID_VNDR);
420 pos = dm_pci_find_next_capability(udev, pos, PCI_CAP_ID_VNDR)) {
421 /* Ensure the capability is within bounds */
422 if (PCI_CFG_SPACE_SIZE - cap_size < pos)
425 offset = pos + offsetof(struct virtio_pci_cap, cap_vndr);
426 dm_pci_read_config8(udev, offset, &cap->cap_vndr);
427 offset = pos + offsetof(struct virtio_pci_cap, cap_next);
428 dm_pci_read_config8(udev, offset, &cap->cap_next);
429 offset = pos + offsetof(struct virtio_pci_cap, cap_len);
430 dm_pci_read_config8(udev, offset, &cap->cap_len);
431 offset = pos + offsetof(struct virtio_pci_cap, cfg_type);
432 dm_pci_read_config8(udev, offset, &cap->cfg_type);
433 offset = pos + offsetof(struct virtio_pci_cap, bar);
434 dm_pci_read_config8(udev, offset, &cap->bar);
435 offset = pos + offsetof(struct virtio_pci_cap, offset);
436 dm_pci_read_config32(udev, offset, &cap->offset);
437 offset = pos + offsetof(struct virtio_pci_cap, length);
438 dm_pci_read_config32(udev, offset, &cap->length);
440 /* Ignore structures with reserved BAR values */
444 if (cap->cfg_type == cfg_type)
452 * virtio_pci_map_capability - map base address of the capability
454 * @udev: the transport device
455 * @cap: capability to map
457 * Return: base address of the capability
459 static void __iomem *virtio_pci_map_capability(struct udevice *udev,
460 const struct virtio_pci_cap *cap)
463 * Find the corresponding memory region that isn't system memory but is
467 PCI_REGION_TYPE | PCI_REGION_SYS_MEMORY | PCI_REGION_RO;
468 unsigned long flags = PCI_REGION_MEM;
469 u8 *p = dm_pci_map_bar(udev, PCI_BASE_ADDRESS_0 + 4 * cap->bar, cap->offset,
470 cap->length, mask, flags);
472 return (void __iomem *)p;
475 static int virtio_pci_bind(struct udevice *udev)
480 /* Create a unique device name */
481 sprintf(name, "%s#%u", VIRTIO_PCI_DRV_NAME, num_devs++);
482 device_set_name(udev, name);
487 static int virtio_pci_probe(struct udevice *udev)
489 struct pci_child_plat *pplat = dev_get_parent_plat(udev);
490 struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(udev);
491 struct virtio_pci_priv *priv = dev_get_priv(udev);
494 int common, notify, device;
495 struct virtio_pci_cap common_cap, notify_cap, device_cap;
498 /* We only own devices >= 0x1040 and <= 0x107f: leave the rest. */
499 if (pplat->device < 0x1040 || pplat->device > 0x107f)
502 /* Transitional devices must not have a PCI revision ID of 0 */
503 dm_pci_read_config8(udev, PCI_REVISION_ID, &revision);
505 /* Modern devices: simply use PCI device id, but start from 0x1040. */
506 uc_priv->device = pplat->device - 0x1040;
507 dm_pci_read_config16(udev, PCI_SUBSYSTEM_VENDOR_ID, &subvendor);
508 uc_priv->vendor = subvendor;
510 /* Check for a common config: if not, use legacy mode (bar 0) */
511 common = virtio_pci_find_capability(udev, VIRTIO_PCI_CAP_COMMON_CFG,
512 sizeof(struct virtio_pci_cap),
515 printf("(%s): leaving for legacy driver\n", udev->name);
519 if (common_cap.length < sizeof(struct virtio_pci_common_cfg)) {
520 printf("(%s): virtio common config too small\n", udev->name);
524 /* If common is there, notify should be too */
525 notify = virtio_pci_find_capability(udev, VIRTIO_PCI_CAP_NOTIFY_CFG,
526 sizeof(struct virtio_pci_notify_cap),
529 printf("(%s): missing capabilities %i/%i\n", udev->name,
534 /* Map configuration structures */
535 priv->common = virtio_pci_map_capability(udev, &common_cap);
537 printf("(%s): could not map common config\n", udev->name);
541 priv->notify_len = notify_cap.length;
542 priv->notify_base = virtio_pci_map_capability(udev, ¬ify_cap);
543 if (!priv->notify_base) {
544 printf("(%s): could not map notify config\n", udev->name);
549 * Device capability is only mandatory for devices that have
550 * device-specific configuration.
552 device = virtio_pci_find_capability(udev, VIRTIO_PCI_CAP_DEVICE_CFG,
553 sizeof(struct virtio_pci_cap),
556 priv->device_len = device_cap.length;
557 priv->device = virtio_pci_map_capability(udev, &device_cap);
559 printf("(%s): could not map device config\n",
565 debug("(%p): common @ %p, notify base @ %p, device @ %p\n",
566 udev, priv->common, priv->notify_base, priv->device);
568 /* Read notify_off_multiplier from config space */
569 offset = notify + offsetof(struct virtio_pci_notify_cap,
570 notify_off_multiplier);
571 dm_pci_read_config32(udev, offset, &priv->notify_offset_multiplier);
573 debug("(%s): device (%d) vendor (%08x) version (%d)\n", udev->name,
574 uc_priv->device, uc_priv->vendor, revision);
579 static const struct dm_virtio_ops virtio_pci_ops = {
580 .get_config = virtio_pci_get_config,
581 .set_config = virtio_pci_set_config,
582 .generation = virtio_pci_generation,
583 .get_status = virtio_pci_get_status,
584 .set_status = virtio_pci_set_status,
585 .reset = virtio_pci_reset,
586 .get_features = virtio_pci_get_features,
587 .set_features = virtio_pci_set_features,
588 .find_vqs = virtio_pci_find_vqs,
589 .del_vqs = virtio_pci_del_vqs,
590 .notify = virtio_pci_notify,
593 U_BOOT_DRIVER(virtio_pci_modern) = {
594 .name = VIRTIO_PCI_DRV_NAME,
596 .ops = &virtio_pci_ops,
597 .bind = virtio_pci_bind,
598 .probe = virtio_pci_probe,
599 .priv_auto = sizeof(struct virtio_pci_priv),
602 static struct pci_device_id virtio_pci_supported[] = {
603 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID00) },
604 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID01) },
605 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID02) },
606 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID03) },
607 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID04) },
608 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID05) },
609 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID06) },
610 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID07) },
611 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID08) },
612 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID09) },
613 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0A) },
614 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0B) },
615 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0C) },
616 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0D) },
617 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0E) },
618 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID0F) },
619 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID10) },
620 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID11) },
621 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID12) },
622 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID13) },
623 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID14) },
624 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID15) },
625 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID16) },
626 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID17) },
627 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID18) },
628 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID19) },
629 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1A) },
630 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1B) },
631 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1C) },
632 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1D) },
633 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1E) },
634 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID1F) },
635 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID20) },
636 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID21) },
637 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID22) },
638 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID23) },
639 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID24) },
640 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID25) },
641 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID26) },
642 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID27) },
643 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID28) },
644 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID29) },
645 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2A) },
646 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2B) },
647 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2C) },
648 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2D) },
649 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2E) },
650 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID2F) },
651 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID30) },
652 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID31) },
653 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID32) },
654 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID33) },
655 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID34) },
656 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID35) },
657 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID36) },
658 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID37) },
659 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID38) },
660 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID39) },
661 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3A) },
662 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3B) },
663 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3C) },
664 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3D) },
665 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3E) },
666 { PCI_DEVICE(VIRTIO_PCI_VENDOR_ID, VIRTIO_PCI_DEVICE_ID3F) },
670 U_BOOT_PCI_DEVICE(virtio_pci_modern, virtio_pci_supported);