virtio_pci_modern.c 19 KB

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