Skip to content

Commit 6d9e4e4

Browse files
jmichalski-antfkokosinski
authored andcommitted
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 90cd350 commit 6d9e4e4

File tree

10 files changed

+1210
-0
lines changed

10 files changed

+1210
-0
lines changed

MAINTAINERS.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,20 @@ Release Notes:
21602160
tests:
21612161
- drivers.video
21622162

2163+
"Drivers: VIRTIO":
2164+
status: maintained
2165+
maintainers:
2166+
- fkokosinski
2167+
- tgorochowik
2168+
collaborators:
2169+
- kgugala
2170+
files:
2171+
- drivers/virtio/
2172+
- dts/bindings/virtio/
2173+
- include/zephyr/virtio/
2174+
labels:
2175+
- "area: VIRTIO"
2176+
21632177
"Drivers: W1":
21642178
status: maintained
21652179
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_PCI 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)