Skip to content

Commit 9082049

Browse files
virtio: add API for VIRTIO devices and add VIRTIO PCI driver
This commit adds the API for accessing VIRTIO devices, and adds a driver for a VIRTIO PCIE device based on the newly added API. This commit is based on the Virtual I/O Device (VIRTIO) Version 1.3 specification: https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.pdf Signed-off-by: Jakub Michalski <jmichalski@antmicro.com> Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
1 parent 5d74f78 commit 9082049

File tree

10 files changed

+1326
-0
lines changed

10 files changed

+1326
-0
lines changed

MAINTAINERS.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,20 @@ Release Notes:
21762176
tests:
21772177
- drivers.video
21782178

2179+
"Drivers: VIRTIO":
2180+
status: maintained
2181+
maintainers:
2182+
- fkokosinski
2183+
- tgorochowik
2184+
collaborators:
2185+
- kgugala
2186+
files:
2187+
- drivers/virtio/
2188+
- dts/bindings/virtio/
2189+
- include/zephyr/virtio/
2190+
labels:
2191+
- "area: VIRTIO"
2192+
21792193
"Drivers: W1":
21802194
status: maintained
21812195
maintainers:

drivers/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ add_subdirectory_ifdef(CONFIG_SYSCON syscon)
8989
add_subdirectory_ifdef(CONFIG_SYS_CLOCK_EXISTS timer)
9090
add_subdirectory_ifdef(CONFIG_TEE tee)
9191
add_subdirectory_ifdef(CONFIG_VIDEO video)
92+
add_subdirectory_ifdef(CONFIG_VIRTIO virtio)
9293
add_subdirectory_ifdef(CONFIG_VIRTUALIZATION virtualization)
9394
add_subdirectory_ifdef(CONFIG_W1 w1)
9495
add_subdirectory_ifdef(CONFIG_WATCHDOG watchdog)

drivers/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ source "drivers/timer/Kconfig"
8888
source "drivers/usb/Kconfig"
8989
source "drivers/usb_c/Kconfig"
9090
source "drivers/video/Kconfig"
91+
source "drivers/virtio/Kconfig"
9192
source "drivers/virtualization/Kconfig"
9293
source "drivers/w1/Kconfig"
9394
source "drivers/watchdog/Kconfig"

drivers/virtio/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2024 Antmicro <www.antmicro.com>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_library()
5+
6+
zephyr_library_sources_ifdef(CONFIG_VIRTIO virtqueue.c)
7+
zephyr_library_sources_ifdef(CONFIG_VIRTIO_PCI virtio_pci.c)

drivers/virtio/Kconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2024 Antmicro <www.antmicro.com>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config VIRTIO
5+
bool "support for VIRTIO"
6+
help
7+
Enable options for VIRTIO
8+
9+
if VIRTIO
10+
11+
config VIRTIO_PCI
12+
bool "support for VIRTIO over PCI"
13+
default y
14+
depends on DT_HAS_VIRTIO_PCI_ENABLED
15+
help
16+
Enable options for VIRTIO over PCI
17+
18+
endif # VIRTIO
19+
20+
module = VIRTIO
21+
module-str = VIRTIO
22+
source "subsys/logging/Kconfig.template.log_config"

0 commit comments

Comments
 (0)