From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: rcz@pengutronix.de
Subject: [PATCH 0/8] drivers: add VirtIO console, block device support
Date: Mon, 22 Feb 2021 08:05:56 +0100 [thread overview]
Message-ID: <20210222070605.589180-1-ahmad@a3f.at> (raw)
To make it easier to exchange data with paravirtualized barebox during
testing, import parts of the VirtIO support in Linux and U-Boot.
API basically looks like U-Boot's, but driver boilerplate (like having
a virtio bus) is taken from Linux. Headers are the Linux ones with some
necessary modifications on top.
Quite nifty thing is that Qemu will fix up the device tree appropriately,
so just compile in the drivers and it works. The vexpress_defconfig
already does this, so this just works:
$ qemu-system-arm -m 256M -M virt -nographic \
-kernel ./images/barebox-dt-2nd.img \
-device virtio-rng-device \
-drive if=none,file=/tmp/first.hdimg,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
Ahmad Fatoum (8):
kbuild: add include/uapi to path
driver: Don't throw an error on probes that didn't find the device
drivers: add support for memory-mapped VirtIO paravirtualization
hw_random: add VirtIO RNG driver
serial: add basic VirtIO console driver
block: add VirtIO block device driver
ARM: vexpress: config: update for VirtIO support
Documentation: add Documentation on VirtIO for barebox
Documentation/user/user-manual.rst | 1 +
Documentation/user/virtio.rst | 80 +++++
Makefile | 10 +-
arch/arm/configs/vexpress_defconfig | 15 +-
drivers/Kconfig | 1 +
drivers/Makefile | 1 +
drivers/ata/Kconfig | 2 +
drivers/base/driver.c | 5 +-
drivers/block/Kconfig | 6 +
drivers/block/Makefile | 1 +
drivers/block/virtio_blk.c | 133 ++++++++
drivers/hw_random/Kconfig | 7 +
drivers/hw_random/Makefile | 1 +
drivers/hw_random/virtio-rng.c | 120 +++++++
drivers/serial/Kconfig | 8 +
drivers/serial/Makefile | 1 +
drivers/serial/virtio_console.c | 166 ++++++++++
drivers/virtio/Kconfig | 28 ++
drivers/virtio/Makefile | 3 +
drivers/virtio/virtio.c | 347 ++++++++++++++++++++
drivers/virtio/virtio_mmio.c | 465 +++++++++++++++++++++++++++
drivers/virtio/virtio_ring.c | 365 +++++++++++++++++++++
include/linux/typecheck.h | 25 ++
include/linux/virtio.h | 128 ++++++++
include/linux/virtio_byteorder.h | 64 ++++
include/linux/virtio_config.h | 480 ++++++++++++++++++++++++++++
include/linux/virtio_ring.h | 330 +++++++++++++++++++
include/uapi/linux/virtio_blk.h | 203 ++++++++++++
include/uapi/linux/virtio_config.h | 95 ++++++
include/uapi/linux/virtio_console.h | 78 +++++
include/uapi/linux/virtio_ids.h | 58 ++++
include/uapi/linux/virtio_mmio.h | 152 +++++++++
include/uapi/linux/virtio_ring.h | 244 ++++++++++++++
include/uapi/linux/virtio_rng.h | 8 +
include/uapi/linux/virtio_types.h | 46 +++
35 files changed, 3673 insertions(+), 4 deletions(-)
create mode 100644 Documentation/user/virtio.rst
create mode 100644 drivers/block/Kconfig
create mode 100644 drivers/block/virtio_blk.c
create mode 100644 drivers/hw_random/virtio-rng.c
create mode 100644 drivers/serial/virtio_console.c
create mode 100644 drivers/virtio/Kconfig
create mode 100644 drivers/virtio/Makefile
create mode 100644 drivers/virtio/virtio.c
create mode 100644 drivers/virtio/virtio_mmio.c
create mode 100644 drivers/virtio/virtio_ring.c
create mode 100644 include/linux/typecheck.h
create mode 100644 include/linux/virtio.h
create mode 100644 include/linux/virtio_byteorder.h
create mode 100644 include/linux/virtio_config.h
create mode 100644 include/linux/virtio_ring.h
create mode 100644 include/uapi/linux/virtio_blk.h
create mode 100644 include/uapi/linux/virtio_config.h
create mode 100644 include/uapi/linux/virtio_console.h
create mode 100644 include/uapi/linux/virtio_ids.h
create mode 100644 include/uapi/linux/virtio_mmio.h
create mode 100644 include/uapi/linux/virtio_ring.h
create mode 100644 include/uapi/linux/virtio_rng.h
create mode 100644 include/uapi/linux/virtio_types.h
--
2.30.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2021-02-22 7:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-22 7:05 Ahmad Fatoum [this message]
2021-02-22 7:05 ` [PATCH 1/8] kbuild: add include/uapi to path Ahmad Fatoum
2021-02-22 7:05 ` [PATCH 2/8] driver: Don't throw an error on probes that didn't find the device Ahmad Fatoum
2021-02-22 7:05 ` [PATCH 3/8] drivers: add support for memory-mapped VirtIO paravirtualization Ahmad Fatoum
2021-02-22 7:06 ` [PATCH 4/8] hw_random: add VirtIO RNG driver Ahmad Fatoum
2021-02-22 7:06 ` [PATCH 5/8] serial: add basic VirtIO console driver Ahmad Fatoum
2021-02-22 7:06 ` [PATCH 6/8] block: add VirtIO block device driver Ahmad Fatoum
2021-02-22 7:06 ` [PATCH 7/8] ARM: vexpress: config: update for VirtIO support Ahmad Fatoum
2021-02-22 7:06 ` [PATCH 8/8] Documentation: add Documentation on VirtIO for barebox Ahmad Fatoum
2021-02-22 7:15 ` [PATCH] fixup! " Ahmad Fatoum
2021-02-22 8:39 ` [PATCH] fixup! " Ahmad Fatoum
2021-02-22 9:53 ` [PATCH 0/8] drivers: add VirtIO console, block device support Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210222070605.589180-1-ahmad@a3f.at \
--to=ahmad@a3f.at \
--cc=barebox@lists.infradead.org \
--cc=rcz@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox