Skip to content

Commit f955903

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 ef6f804 commit f955903

File tree

10 files changed

+1200
-0
lines changed

10 files changed

+1200
-0
lines changed

MAINTAINERS.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,6 +2138,20 @@ Release Notes:
21382138
tests:
21392139
- drivers.video
21402140

2141+
"Drivers: VIRTIO":
2142+
status: maintained
2143+
maintainers:
2144+
- fkokosinski
2145+
- tgorochowik
2146+
collaborators:
2147+
- kgugala
2148+
files:
2149+
- drivers/virtio/
2150+
- dts/bindings/virtio/
2151+
- include/zephyr/virtio/
2152+
labels:
2153+
- "area: VIRTIO"
2154+
21412155
"Drivers: W1":
21422156
status: maintained
21432157
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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_PCI virtio_pci.c virtqueue.c)

drivers/virtio/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
config VIRTIO_PCI
10+
bool "support for VIRTIO over PCI"
11+
depends on VIRTIO
12+
depends on PCIE
13+
depends on MMU
14+
help
15+
Enable options for VIRTIO over PCI
16+
17+
module = VIRTIO
18+
module-str = VIRTIO
19+
source "subsys/logging/Kconfig.template.log_config"

0 commit comments

Comments
 (0)