-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: virtio: add VIRTIO MMIO transport driver #89460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9c59b55
to
7f6a6ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new VirtIO MMIO transport driver, mirroring the existing VirtIO PCI driver design and integrating it with the entropy (rng) driver.
- Adds VirtIO API definitions and inline functions in include/zephyr/virtio/virtio.h
- Introduces new DTS bindings for virtio, mmio and updates for virtio over PCI and entropy devices
- Implements virtqueue handling in drivers/virtio/virtqueue.c and adds the virtio entropy driver in drivers/entropy/entropy_virtio.c
Reviewed Changes
Copilot reviewed 22 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
include/zephyr/virtio/virtio.h | Introduces the VirtIO API and inline helpers |
dts/bindings/virtio/virtio,pci.yaml | Adds DTS binding for VirtIO over PCI |
dts/bindings/virtio/virtio,mmio.yaml | Adds DTS binding for VirtIO over MMIO |
dts/bindings/rng/virtio,entropy.yaml | Adds DTS binding for VirtIO entropy device |
drivers/virtio/virtqueue.c | Implements virtqueue creation and management |
drivers/entropy/entropy_virtio.c | Implements the VirtIO entropy driver |
MAINTAINERS.yml | Updates maintainers and labels for VirtIO area |
Files not reviewed (13)
- boards/qemu/cortex_a53/board.cmake: Language not supported
- boards/qemu/cortex_a53/qemu_cortex_a53.dts: Language not supported
- boards/qemu/x86/board.cmake: Language not supported
- doc/hardware/index.rst: Language not supported
- doc/hardware/virtualization/index.rst: Language not supported
- doc/hardware/virtualization/virtio.rst: Language not supported
- drivers/CMakeLists.txt: Language not supported
- drivers/Kconfig: Language not supported
- drivers/entropy/CMakeLists.txt: Language not supported
- drivers/entropy/Kconfig: Language not supported
- drivers/entropy/Kconfig.virtio: Language not supported
- drivers/virtio/CMakeLists.txt: Language not supported
- drivers/virtio/Kconfig: Language not supported
f7f453b
to
bd75a24
Compare
Since `VirtIO` is not the official notation, unify the name to `VIRTIO`. In the text, `Virtio` and `virtio` can also be used depending on the context. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add virtio-mmio driver Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add `virtio-mmio` nodes that are retrieved from qemu internal devicetree dump, to dts. Also, enable the virtio-rng device on the command line. Note: Ideally, it would be possible to dynamically generate the command line by looking at the devicetree state, but this PR is a fixed implementation to simplify it. This will be addressed separately. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add the `qemu_cortex_a53` configuration to run the build test for the VIRTIO MMIO driver. To add this test, we have split the virtio-pci and virtio-mmio test cases. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add `qemu_cortex_a53` target which has the `virtio,entropy` device. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
|
@fkokosinski @ceolin @cfriedt @kartben Continuing from #89439, could you please review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VIRTIO MMIO LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds a virtio-mmio driver that is based on the virtio-pci design from #83892.
This is worked with virtio-rng driver
#89439
And it works with the same API as virtio-pci.