Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
virtio_config.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Antmicro <www.antmicro.com>
3 * Copyright (c) 2025 TOKITA Hiroshi
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
16
17#ifndef ZEPHYR_DRIVERS_VIRTIO_VIRTIO_CONFIG_H_
18#define ZEPHYR_DRIVERS_VIRTIO_VIRTIO_CONFIG_H_
19
30
32#define DEVICE_STATUS_ACKNOWLEDGE 0
34#define DEVICE_STATUS_DRIVER 1
36#define DEVICE_STATUS_DRIVER_OK 2
38#define DEVICE_STATUS_FEATURES_OK 3
40#define DEVICE_STATUS_NEEDS_RESET 6
42#define DEVICE_STATUS_FAILED 7
43
45
58
60#define VIRTIO_RING_F_INDIRECT_DESC 28
62#define VIRTIO_RING_F_EVENT_IDX 29
64#define VIRTIO_F_VERSION_1 32
66#define VIRTIO_F_ACCESS_PLATFORM 33
67
69
87
92#define VIRTQ_AVAIL_F_NO_INTERRUPT 1
93
98#define VIRTQ_USED_F_NO_NOTIFY 1
99
101
113
115#define DEV_TYPE_FEAT_RANGE_0_BEGIN 0
117#define DEV_TYPE_FEAT_RANGE_0_END 23
119#define DEV_TYPE_FEAT_RANGE_1_BEGIN 50
121#define DEV_TYPE_FEAT_RANGE_1_END 127
122
124
142
144#define VIRTIO_QUEUE_INTERRUPT 1
146#define VIRTIO_DEVICE_CONFIGURATION_INTERRUPT 2
147
149
160
162#define VIRTIO_MMIO_MAGIC_VALUE 0x000
164#define VIRTIO_MMIO_VERSION 0x004
166#define VIRTIO_MMIO_DEVICE_ID 0x008
168#define VIRTIO_MMIO_VENDOR_ID 0x00c
170#define VIRTIO_MMIO_DEVICE_FEATURES 0x010
172#define VIRTIO_MMIO_DEVICE_FEATURES_SEL 0x014
174#define VIRTIO_MMIO_DRIVER_FEATURES 0x020
176#define VIRTIO_MMIO_DRIVER_FEATURES_SEL 0x024
178#define VIRTIO_MMIO_QUEUE_SEL 0x030
180#define VIRTIO_MMIO_QUEUE_SIZE_MAX 0x034
182#define VIRTIO_MMIO_QUEUE_SIZE 0x038
184#define VIRTIO_MMIO_QUEUE_READY 0x044
186#define VIRTIO_MMIO_QUEUE_NOTIFY 0x050
188#define VIRTIO_MMIO_INTERRUPT_STATUS 0x060
190#define VIRTIO_MMIO_INTERRUPT_ACK 0x064
192#define VIRTIO_MMIO_STATUS 0x070
194#define VIRTIO_MMIO_QUEUE_DESC_LOW 0x080
196#define VIRTIO_MMIO_QUEUE_DESC_HIGH 0x084
198#define VIRTIO_MMIO_QUEUE_AVAIL_LOW 0x090
200#define VIRTIO_MMIO_QUEUE_AVAIL_HIGH 0x094
202#define VIRTIO_MMIO_QUEUE_USED_LOW 0x0a0
204#define VIRTIO_MMIO_QUEUE_USED_HIGH 0x0a4
206#define VIRTIO_MMIO_SHM_SEL 0x0ac
208#define VIRTIO_MMIO_SHM_LEN_LOW 0x0b0
210#define VIRTIO_MMIO_SHM_LEN_HIGH 0x0b4
212#define VIRTIO_MMIO_SHM_BASE_LOW 0x0b8
214#define VIRTIO_MMIO_SHM_BASE_HIGH 0x0bc
216#define VIRTIO_MMIO_QUEUE_RESET 0x0c0
218#define VIRTIO_MMIO_CONFIG_GENERATION 0x0fc
220#define VIRTIO_MMIO_CONFIG 0x100
221
223
224#endif /* ZEPHYR_DRIVERS_VIRTIO_VIRTIO_CONFIG_H_ */