[U-Boot] [PATCH 02/27] dm: Add a new uclass driver for VirtIO transport devices

Tuomas Tynkkynen tuomas.tynkkynen at iki.fi
Thu Sep 27 22:10:22 UTC 2018


Hi Bin,

Thanks for the patches, they look great. Some minor comments:

On 09/23/2018 04:42 PM, Bin Meng wrote:
> This adds a new virtio uclass driver for “virtio” [1] family of
> devices that are are found in virtual environments like QEMU,
> yet by design they look like physical devices to the guest.
> 
> The uclass driver provides child_pre_probe() and child_post_probe()
> methods to do some common operations for virtio device drivers like
> device and driver supported feature negotiation, etc.
> 
> [1] http://docs.oasis-open.org/virtio/virtio/v1.0/virtio-v1.0.pdf
> 
> Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen at iki.fi>
> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> ---...
>+
>+config VIRTIO
>+	bool
>+	help
>+	  This option is selected by any driver which implements the virtio
>+	  bus, such as CONFIG_VIRTIO_MMIO or CONFIG_VIRTIO_PCI.

I think most other places use the term 'transport' over 'bus'.

> +
> +int virtio_get_config(struct udevice *vdev, unsigned int offset,
> +		      void *buf, unsigned int len)
> +{
> +	struct dm_virtio_ops *ops;
> +
> +	ops = virtio_get_ops(vdev->parent);
> +	if (!ops->get_config)
> +		return -ENOSYS;

I'm not sure how useful the -ENOSYS fallbacks for most of these ops
are. E.g. a transport lacking .find_vqs() cannot ever be useful
for implementing real-world devices.



More information about the U-Boot mailing list