virtio_mmio.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. /*
  2. * Virtio memory mapped device driver
  3. *
  4. * Copyright 2011, ARM Ltd.
  5. *
  6. * This module allows virtio devices to be used over a virtual, memory mapped
  7. * platform device.
  8. *
  9. * The guest device(s) may be instantiated in one of three equivalent ways:
  10. *
  11. * 1. Static platform device in board's code, eg.:
  12. *
  13. * static struct platform_device v2m_virtio_device = {
  14. * .name = "virtio-mmio",
  15. * .id = -1,
  16. * .num_resources = 2,
  17. * .resource = (struct resource []) {
  18. * {
  19. * .start = 0x1001e000,
  20. * .end = 0x1001e0ff,
  21. * .flags = IORESOURCE_MEM,
  22. * }, {
  23. * .start = 42 + 32,
  24. * .end = 42 + 32,
  25. * .flags = IORESOURCE_IRQ,
  26. * },
  27. * }
  28. * };
  29. *
  30. * 2. Device Tree node, eg.:
  31. *
  32. * virtio_block@1e000 {
  33. * compatible = "virtio,mmio";
  34. * reg = <0x1e000 0x100>;
  35. * interrupts = <42>;
  36. * }
  37. *
  38. * 3. Kernel module (or command line) parameter. Can be used more than once -
  39. * one device will be created for each one. Syntax:
  40. *
  41. * [virtio_mmio.]device=<size>@<baseaddr>:<irq>[:<id>]
  42. * where:
  43. * <size> := size (can use standard suffixes like K, M or G)
  44. * <baseaddr> := physical base address
  45. * <irq> := interrupt number (as passed to request_irq())
  46. * <id> := (optional) platform device id
  47. * eg.:
  48. * virtio_mmio.device=0x100@0x100b0000:48 \
  49. * virtio_mmio.device=1K@0x1001e000:74
  50. *
  51. *
  52. *
  53. * Registers layout (all 32-bit wide):
  54. *
  55. * offset d. name description
  56. * ------ -- ---------------- -----------------
  57. *
  58. * 0x000 R MagicValue Magic value "virt"
  59. * 0x004 R Version Device version (current max. 1)
  60. * 0x008 R DeviceID Virtio device ID
  61. * 0x00c R VendorID Virtio vendor ID
  62. *
  63. * 0x010 R HostFeatures Features supported by the host
  64. * 0x014 W HostFeaturesSel Set of host features to access via HostFeatures
  65. *
  66. * 0x020 W GuestFeatures Features activated by the guest
  67. * 0x024 W GuestFeaturesSel Set of activated features to set via GuestFeatures
  68. * 0x028 W GuestPageSize Size of guest's memory page in bytes
  69. *
  70. * 0x030 W QueueSel Queue selector
  71. * 0x034 R QueueNumMax Maximum size of the currently selected queue
  72. * 0x038 W QueueNum Queue size for the currently selected queue
  73. * 0x03c W QueueAlign Used Ring alignment for the current queue
  74. * 0x040 RW QueuePFN PFN for the currently selected queue
  75. *
  76. * 0x050 W QueueNotify Queue notifier
  77. * 0x060 R InterruptStatus Interrupt status register
  78. * 0x060 W InterruptACK Interrupt acknowledge register
  79. * 0x070 RW Status Device status register
  80. *
  81. * 0x100+ RW Device-specific configuration space
  82. *
  83. * Based on Virtio PCI driver by Anthony Liguori, copyright IBM Corp. 2007
  84. *
  85. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  86. * See the COPYING file in the top-level directory.
  87. */
  88. #define pr_fmt(fmt) "virtio-mmio: " fmt
  89. #include <linux/highmem.h>
  90. #include <linux/interrupt.h>
  91. #include <linux/io.h>
  92. #include <linux/list.h>
  93. #include <linux/module.h>
  94. #include <linux/platform_device.h>
  95. #include <linux/slab.h>
  96. #include <linux/spinlock.h>
  97. #include <linux/virtio.h>
  98. #include <linux/virtio_config.h>
  99. #include <linux/virtio_mmio.h>
  100. #include <linux/virtio_ring.h>
  101. /* The alignment to use between consumer and producer parts of vring.
  102. * Currently hardcoded to the page size. */
  103. #define VIRTIO_MMIO_VRING_ALIGN PAGE_SIZE
  104. #define to_virtio_mmio_device(_plat_dev) \
  105. container_of(_plat_dev, struct virtio_mmio_device, vdev)
  106. struct virtio_mmio_device {
  107. struct virtio_device vdev;
  108. struct platform_device *pdev;
  109. void __iomem *base;
  110. unsigned long version;
  111. /* a list of queues so we can dispatch IRQs */
  112. spinlock_t lock;
  113. struct list_head virtqueues;
  114. };
  115. struct virtio_mmio_vq_info {
  116. /* the actual virtqueue */
  117. struct virtqueue *vq;
  118. /* the number of entries in the queue */
  119. unsigned int num;
  120. /* the index of the queue */
  121. int queue_index;
  122. /* the virtual address of the ring queue */
  123. void *queue;
  124. /* the list node for the virtqueues list */
  125. struct list_head node;
  126. };
  127. /* Configuration interface */
  128. static u32 vm_get_features(struct virtio_device *vdev)
  129. {
  130. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  131. /* TODO: Features > 32 bits */
  132. writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL);
  133. return readl(vm_dev->base + VIRTIO_MMIO_HOST_FEATURES);
  134. }
  135. static void vm_finalize_features(struct virtio_device *vdev)
  136. {
  137. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  138. int i;
  139. /* Give virtio_ring a chance to accept features. */
  140. vring_transport_features(vdev);
  141. for (i = 0; i < ARRAY_SIZE(vdev->features); i++) {
  142. writel(i, vm_dev->base + VIRTIO_MMIO_GUEST_FEATURES_SEL);
  143. writel(vdev->features[i],
  144. vm_dev->base + VIRTIO_MMIO_GUEST_FEATURES);
  145. }
  146. }
  147. static void vm_get(struct virtio_device *vdev, unsigned offset,
  148. void *buf, unsigned len)
  149. {
  150. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  151. u8 *ptr = buf;
  152. int i;
  153. for (i = 0; i < len; i++)
  154. ptr[i] = readb(vm_dev->base + VIRTIO_MMIO_CONFIG + offset + i);
  155. }
  156. static void vm_set(struct virtio_device *vdev, unsigned offset,
  157. const void *buf, unsigned len)
  158. {
  159. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  160. const u8 *ptr = buf;
  161. int i;
  162. for (i = 0; i < len; i++)
  163. writeb(ptr[i], vm_dev->base + VIRTIO_MMIO_CONFIG + offset + i);
  164. }
  165. static u8 vm_get_status(struct virtio_device *vdev)
  166. {
  167. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  168. return readl(vm_dev->base + VIRTIO_MMIO_STATUS) & 0xff;
  169. }
  170. static void vm_set_status(struct virtio_device *vdev, u8 status)
  171. {
  172. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  173. /* We should never be setting status to 0. */
  174. BUG_ON(status == 0);
  175. writel(status, vm_dev->base + VIRTIO_MMIO_STATUS);
  176. }
  177. static void vm_reset(struct virtio_device *vdev)
  178. {
  179. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  180. /* 0 status means a reset. */
  181. writel(0, vm_dev->base + VIRTIO_MMIO_STATUS);
  182. }
  183. /* Transport interface */
  184. /* the notify function used when creating a virt queue */
  185. static void vm_notify(struct virtqueue *vq)
  186. {
  187. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev);
  188. struct virtio_mmio_vq_info *info = vq->priv;
  189. /* We write the queue's selector into the notification register to
  190. * signal the other end */
  191. writel(info->queue_index, vm_dev->base + VIRTIO_MMIO_QUEUE_NOTIFY);
  192. }
  193. /* Notify all virtqueues on an interrupt. */
  194. static irqreturn_t vm_interrupt(int irq, void *opaque)
  195. {
  196. struct virtio_mmio_device *vm_dev = opaque;
  197. struct virtio_mmio_vq_info *info;
  198. struct virtio_driver *vdrv = container_of(vm_dev->vdev.dev.driver,
  199. struct virtio_driver, driver);
  200. unsigned long status;
  201. unsigned long flags;
  202. irqreturn_t ret = IRQ_NONE;
  203. /* Read and acknowledge interrupts */
  204. status = readl(vm_dev->base + VIRTIO_MMIO_INTERRUPT_STATUS);
  205. writel(status, vm_dev->base + VIRTIO_MMIO_INTERRUPT_ACK);
  206. if (unlikely(status & VIRTIO_MMIO_INT_CONFIG)
  207. && vdrv && vdrv->config_changed) {
  208. vdrv->config_changed(&vm_dev->vdev);
  209. ret = IRQ_HANDLED;
  210. }
  211. if (likely(status & VIRTIO_MMIO_INT_VRING)) {
  212. spin_lock_irqsave(&vm_dev->lock, flags);
  213. list_for_each_entry(info, &vm_dev->virtqueues, node)
  214. ret |= vring_interrupt(irq, info->vq);
  215. spin_unlock_irqrestore(&vm_dev->lock, flags);
  216. }
  217. return ret;
  218. }
  219. static void vm_del_vq(struct virtqueue *vq)
  220. {
  221. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev);
  222. struct virtio_mmio_vq_info *info = vq->priv;
  223. unsigned long flags, size;
  224. spin_lock_irqsave(&vm_dev->lock, flags);
  225. list_del(&info->node);
  226. spin_unlock_irqrestore(&vm_dev->lock, flags);
  227. vring_del_virtqueue(vq);
  228. /* Select and deactivate the queue */
  229. writel(info->queue_index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
  230. writel(0, vm_dev->base + VIRTIO_MMIO_QUEUE_PFN);
  231. size = PAGE_ALIGN(vring_size(info->num, VIRTIO_MMIO_VRING_ALIGN));
  232. free_pages_exact(info->queue, size);
  233. kfree(info);
  234. }
  235. static void vm_del_vqs(struct virtio_device *vdev)
  236. {
  237. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  238. struct virtqueue *vq, *n;
  239. list_for_each_entry_safe(vq, n, &vdev->vqs, list)
  240. vm_del_vq(vq);
  241. free_irq(platform_get_irq(vm_dev->pdev, 0), vm_dev);
  242. }
  243. static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
  244. void (*callback)(struct virtqueue *vq),
  245. const char *name)
  246. {
  247. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  248. struct virtio_mmio_vq_info *info;
  249. struct virtqueue *vq;
  250. unsigned long flags, size;
  251. int err;
  252. /* Select the queue we're interested in */
  253. writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
  254. /* Queue shouldn't already be set up. */
  255. if (readl(vm_dev->base + VIRTIO_MMIO_QUEUE_PFN)) {
  256. err = -ENOENT;
  257. goto error_available;
  258. }
  259. /* Allocate and fill out our active queue description */
  260. info = kmalloc(sizeof(*info), GFP_KERNEL);
  261. if (!info) {
  262. err = -ENOMEM;
  263. goto error_kmalloc;
  264. }
  265. info->queue_index = index;
  266. /* Allocate pages for the queue - start with a queue as big as
  267. * possible (limited by maximum size allowed by device), drop down
  268. * to a minimal size, just big enough to fit descriptor table
  269. * and two rings (which makes it "alignment_size * 2")
  270. */
  271. info->num = readl(vm_dev->base + VIRTIO_MMIO_QUEUE_NUM_MAX);
  272. while (1) {
  273. size = PAGE_ALIGN(vring_size(info->num,
  274. VIRTIO_MMIO_VRING_ALIGN));
  275. /* Already smallest possible allocation? */
  276. if (size <= VIRTIO_MMIO_VRING_ALIGN * 2) {
  277. err = -ENOMEM;
  278. goto error_alloc_pages;
  279. }
  280. info->queue = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
  281. if (info->queue)
  282. break;
  283. info->num /= 2;
  284. }
  285. /* Activate the queue */
  286. writel(info->num, vm_dev->base + VIRTIO_MMIO_QUEUE_NUM);
  287. writel(VIRTIO_MMIO_VRING_ALIGN,
  288. vm_dev->base + VIRTIO_MMIO_QUEUE_ALIGN);
  289. writel(virt_to_phys(info->queue) >> PAGE_SHIFT,
  290. vm_dev->base + VIRTIO_MMIO_QUEUE_PFN);
  291. /* Create the vring */
  292. vq = vring_new_virtqueue(info->num, VIRTIO_MMIO_VRING_ALIGN, vdev,
  293. true, info->queue, vm_notify, callback, name);
  294. if (!vq) {
  295. err = -ENOMEM;
  296. goto error_new_virtqueue;
  297. }
  298. vq->priv = info;
  299. info->vq = vq;
  300. spin_lock_irqsave(&vm_dev->lock, flags);
  301. list_add(&info->node, &vm_dev->virtqueues);
  302. spin_unlock_irqrestore(&vm_dev->lock, flags);
  303. return vq;
  304. error_new_virtqueue:
  305. writel(0, vm_dev->base + VIRTIO_MMIO_QUEUE_PFN);
  306. free_pages_exact(info->queue, size);
  307. error_alloc_pages:
  308. kfree(info);
  309. error_kmalloc:
  310. error_available:
  311. return ERR_PTR(err);
  312. }
  313. static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs,
  314. struct virtqueue *vqs[],
  315. vq_callback_t *callbacks[],
  316. const char *names[])
  317. {
  318. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  319. unsigned int irq = platform_get_irq(vm_dev->pdev, 0);
  320. int i, err;
  321. err = request_irq(irq, vm_interrupt, IRQF_SHARED,
  322. dev_name(&vdev->dev), vm_dev);
  323. if (err)
  324. return err;
  325. for (i = 0; i < nvqs; ++i) {
  326. vqs[i] = vm_setup_vq(vdev, i, callbacks[i], names[i]);
  327. if (IS_ERR(vqs[i])) {
  328. vm_del_vqs(vdev);
  329. return PTR_ERR(vqs[i]);
  330. }
  331. }
  332. return 0;
  333. }
  334. static const char *vm_bus_name(struct virtio_device *vdev)
  335. {
  336. struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
  337. return vm_dev->pdev->name;
  338. }
  339. static struct virtio_config_ops virtio_mmio_config_ops = {
  340. .get = vm_get,
  341. .set = vm_set,
  342. .get_status = vm_get_status,
  343. .set_status = vm_set_status,
  344. .reset = vm_reset,
  345. .find_vqs = vm_find_vqs,
  346. .del_vqs = vm_del_vqs,
  347. .get_features = vm_get_features,
  348. .finalize_features = vm_finalize_features,
  349. .bus_name = vm_bus_name,
  350. };
  351. /* Platform device */
  352. static int __devinit virtio_mmio_probe(struct platform_device *pdev)
  353. {
  354. struct virtio_mmio_device *vm_dev;
  355. struct resource *mem;
  356. unsigned long magic;
  357. mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  358. if (!mem)
  359. return -EINVAL;
  360. if (!devm_request_mem_region(&pdev->dev, mem->start,
  361. resource_size(mem), pdev->name))
  362. return -EBUSY;
  363. vm_dev = devm_kzalloc(&pdev->dev, sizeof(*vm_dev), GFP_KERNEL);
  364. if (!vm_dev)
  365. return -ENOMEM;
  366. vm_dev->vdev.dev.parent = &pdev->dev;
  367. vm_dev->vdev.config = &virtio_mmio_config_ops;
  368. vm_dev->pdev = pdev;
  369. INIT_LIST_HEAD(&vm_dev->virtqueues);
  370. spin_lock_init(&vm_dev->lock);
  371. vm_dev->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
  372. if (vm_dev->base == NULL)
  373. return -EFAULT;
  374. /* Check magic value */
  375. magic = readl(vm_dev->base + VIRTIO_MMIO_MAGIC_VALUE);
  376. if (memcmp(&magic, "virt", 4) != 0) {
  377. dev_warn(&pdev->dev, "Wrong magic value 0x%08lx!\n", magic);
  378. return -ENODEV;
  379. }
  380. /* Check device version */
  381. vm_dev->version = readl(vm_dev->base + VIRTIO_MMIO_VERSION);
  382. if (vm_dev->version != 1) {
  383. dev_err(&pdev->dev, "Version %ld not supported!\n",
  384. vm_dev->version);
  385. return -ENXIO;
  386. }
  387. vm_dev->vdev.id.device = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_ID);
  388. vm_dev->vdev.id.vendor = readl(vm_dev->base + VIRTIO_MMIO_VENDOR_ID);
  389. writel(PAGE_SIZE, vm_dev->base + VIRTIO_MMIO_GUEST_PAGE_SIZE);
  390. platform_set_drvdata(pdev, vm_dev);
  391. return register_virtio_device(&vm_dev->vdev);
  392. }
  393. static int __devexit virtio_mmio_remove(struct platform_device *pdev)
  394. {
  395. struct virtio_mmio_device *vm_dev = platform_get_drvdata(pdev);
  396. unregister_virtio_device(&vm_dev->vdev);
  397. return 0;
  398. }
  399. /* Devices list parameter */
  400. #if defined(CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES)
  401. static struct device vm_cmdline_parent = {
  402. .init_name = "virtio-mmio-cmdline",
  403. };
  404. static int vm_cmdline_parent_registered;
  405. static int vm_cmdline_id;
  406. static int vm_cmdline_set(const char *device,
  407. const struct kernel_param *kp)
  408. {
  409. int err;
  410. struct resource resources[2] = {};
  411. char *str;
  412. long long int base;
  413. int processed, consumed = 0;
  414. struct platform_device *pdev;
  415. resources[0].flags = IORESOURCE_MEM;
  416. resources[1].flags = IORESOURCE_IRQ;
  417. resources[0].end = memparse(device, &str) - 1;
  418. processed = sscanf(str, "@%lli:%u%n:%d%n",
  419. &base, &resources[1].start, &consumed,
  420. &vm_cmdline_id, &consumed);
  421. if (processed < 2 || processed > 3 || str[consumed])
  422. return -EINVAL;
  423. resources[0].start = base;
  424. resources[0].end += base;
  425. resources[1].end = resources[1].start;
  426. if (!vm_cmdline_parent_registered) {
  427. err = device_register(&vm_cmdline_parent);
  428. if (err) {
  429. pr_err("Failed to register parent device!\n");
  430. return err;
  431. }
  432. vm_cmdline_parent_registered = 1;
  433. }
  434. pr_info("Registering device virtio-mmio.%d at 0x%llx-0x%llx, IRQ %d.\n",
  435. vm_cmdline_id,
  436. (unsigned long long)resources[0].start,
  437. (unsigned long long)resources[0].end,
  438. (int)resources[1].start);
  439. pdev = platform_device_register_resndata(&vm_cmdline_parent,
  440. "virtio-mmio", vm_cmdline_id++,
  441. resources, ARRAY_SIZE(resources), NULL, 0);
  442. if (IS_ERR(pdev))
  443. return PTR_ERR(pdev);
  444. return 0;
  445. }
  446. static int vm_cmdline_get_device(struct device *dev, void *data)
  447. {
  448. char *buffer = data;
  449. unsigned int len = strlen(buffer);
  450. struct platform_device *pdev = to_platform_device(dev);
  451. snprintf(buffer + len, PAGE_SIZE - len, "0x%llx@0x%llx:%llu:%d\n",
  452. pdev->resource[0].end - pdev->resource[0].start + 1ULL,
  453. (unsigned long long)pdev->resource[0].start,
  454. (unsigned long long)pdev->resource[1].start,
  455. pdev->id);
  456. return 0;
  457. }
  458. static int vm_cmdline_get(char *buffer, const struct kernel_param *kp)
  459. {
  460. buffer[0] = '\0';
  461. device_for_each_child(&vm_cmdline_parent, buffer,
  462. vm_cmdline_get_device);
  463. return strlen(buffer) + 1;
  464. }
  465. static struct kernel_param_ops vm_cmdline_param_ops = {
  466. .set = vm_cmdline_set,
  467. .get = vm_cmdline_get,
  468. };
  469. device_param_cb(device, &vm_cmdline_param_ops, NULL, S_IRUSR);
  470. static int vm_unregister_cmdline_device(struct device *dev,
  471. void *data)
  472. {
  473. platform_device_unregister(to_platform_device(dev));
  474. return 0;
  475. }
  476. static void vm_unregister_cmdline_devices(void)
  477. {
  478. if (vm_cmdline_parent_registered) {
  479. device_for_each_child(&vm_cmdline_parent, NULL,
  480. vm_unregister_cmdline_device);
  481. device_unregister(&vm_cmdline_parent);
  482. vm_cmdline_parent_registered = 0;
  483. }
  484. }
  485. #else
  486. static void vm_unregister_cmdline_devices(void)
  487. {
  488. }
  489. #endif
  490. /* Platform driver */
  491. static struct of_device_id virtio_mmio_match[] = {
  492. { .compatible = "virtio,mmio", },
  493. {},
  494. };
  495. MODULE_DEVICE_TABLE(of, virtio_mmio_match);
  496. static struct platform_driver virtio_mmio_driver = {
  497. .probe = virtio_mmio_probe,
  498. .remove = __devexit_p(virtio_mmio_remove),
  499. .driver = {
  500. .name = "virtio-mmio",
  501. .owner = THIS_MODULE,
  502. .of_match_table = virtio_mmio_match,
  503. },
  504. };
  505. static int __init virtio_mmio_init(void)
  506. {
  507. return platform_driver_register(&virtio_mmio_driver);
  508. }
  509. static void __exit virtio_mmio_exit(void)
  510. {
  511. platform_driver_unregister(&virtio_mmio_driver);
  512. vm_unregister_cmdline_devices();
  513. }
  514. module_init(virtio_mmio_init);
  515. module_exit(virtio_mmio_exit);
  516. MODULE_AUTHOR("Pawel Moll <pawel.moll@arm.com>");
  517. MODULE_DESCRIPTION("Platform bus driver for memory mapped virtio devices");
  518. MODULE_LICENSE("GPL");