diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2018-10-15 12:21:00 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-11-14 20:16:27 +0300 |
commit | 8fb49b4c7a820461db7c11dce767f36fd6395cac (patch) | |
tree | 3289c27071a293689680da11b1d9614531d7cce9 /include/virtio_types.h | |
parent | b1893a9e0def4052e56513bfcee0a0eb95841f7f (diff) | |
download | u-boot-8fb49b4c7a820461db7c11dce767f36fd6395cac.tar.xz |
dm: Add a new uclass driver for VirtIO transport devices
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@iki.fi>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/virtio_types.h')
-rw-r--r-- | include/virtio_types.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/virtio_types.h b/include/virtio_types.h new file mode 100644 index 0000000000..d700d1936d --- /dev/null +++ b/include/virtio_types.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* + * Copyright (C) 2018, Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> + * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com> + * + * From Linux kernel include/uapi/linux/virtio_types.h + */ + +#ifndef _LINUX_VIRTIO_TYPES_H +#define _LINUX_VIRTIO_TYPES_H + +#include <linux/types.h> + +/* + * __virtio{16,32,64} have the following meaning: + * - __u{16,32,64} for virtio devices in legacy mode, accessed in native endian + * - __le{16,32,64} for standard-compliant virtio devices + */ + +typedef __u16 __bitwise __virtio16; +typedef __u32 __bitwise __virtio32; +typedef __u64 __bitwise __virtio64; + +#endif /* _LINUX_VIRTIO_TYPES_H */ |