virtio_pci_modern.c 19 KB

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