virtio_pci_modern.c 19 KB

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