Hi All,
These two patches are a proposal of memory mapped virtio device.
The main goal was to provide an equivalent of the virtio PCI device, happily used by KVM an qemu on x86, which could be used by PCI-less platforms (common in ARM world). The interface exposed by my device is very similar to the original virtio_pci one, maybe just a little bit simplified (no sophisticated IRQ infrastructure here). Of course all the control registers live in memory space, instead of PCI IO space (writel vs iowrite32).
This raises an obvious question whether these two implementation could share some common code. Probably some constant values could be shared (like VIRTIO_*_HOST_FEATURES or VIRTIO_*_VRING_ALIGN), maybe struct virtio_*_vq_info as well. On the other hand the vring interface itself is an abstraction layer already... I really don't know, all comments and ideas appreciated.
The second thing is AMBAness of the driver... I've decided to make it an AMBA device rather than simple platform device to add at least a touch of "dicoverability". The idea was simple - one can add "permanent" virtio AMBA device in the kernel placing it somewhere in reserved area of real hardware, so the kernel running on hardware will not get correct amba_id value and ignore the device. With the eve of Ultimate DeviceTreenes this argument is slightly out of date, as qemu could add the virtio device even in runtime. So maybe I should convert it into platform_device then?
This brings additional problem though. Magnus Damm already proposed a platform virtio device here:
http://thread.gmane.org/gmane.linux.ports.sh.devel/11554
however it's something completely different, as his use case is a heterogeneous system and the virtio is used mainly as a transport between nodes. It also uses lguest-based interface, which is much less applicable to the qemu reality.
Let me just add that Peter Maydell kindly agreed to work on the qemu side of the problem, once there is some consensus about the kernel part. He also suggested to send this to linaro-dev first, before throwing it into LKML fire. So here I am :-)
All comments welcome!
Paweł
Pawel Moll (2): arm: Add VIRTUALIZATION configuration menu and virtio options arm: Add AMBA bus driver for virtio device
arch/arm/Kconfig | 16 ++ drivers/virtio/Kconfig | 11 + drivers/virtio/Makefile | 1 + drivers/virtio/virtio_amba.c | 443 ++++++++++++++++++++++++++++++++++++++++++ include/linux/virtio_amba.h | 62 ++++++ 5 files changed, 533 insertions(+), 0 deletions(-) create mode 100644 drivers/virtio/virtio_amba.c create mode 100644 include/linux/virtio_amba.h