Zephyr Project API 4.4.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
17
18#ifndef ZEPHYR_DRIVERS_VIRTIO_VIRTIO_CONFIG_H_
19#define ZEPHYR_DRIVERS_VIRTIO_VIRTIO_CONFIG_H_
20
31
33#define DEVICE_STATUS_ACKNOWLEDGE 0
35#define DEVICE_STATUS_DRIVER 1
37#define DEVICE_STATUS_DRIVER_OK 2
39#define DEVICE_STATUS_FEATURES_OK 3
41#define DEVICE_STATUS_NEEDS_RESET 6
43#define DEVICE_STATUS_FAILED 7
44
46
59
61#define VIRTIO_RING_F_INDIRECT_DESC 28
63#define VIRTIO_RING_F_EVENT_IDX 29
65#define VIRTIO_F_VERSION_1 32
67#define VIRTIO_F_ACCESS_PLATFORM 33
68
70
88
93#define VIRTQ_AVAIL_F_NO_INTERRUPT 1
94
99#define VIRTQ_USED_F_NO_NOTIFY 1
100
102
114
116#define DEV_TYPE_FEAT_RANGE_0_BEGIN 0
118#define DEV_TYPE_FEAT_RANGE_0_END 23
120#define DEV_TYPE_FEAT_RANGE_1_BEGIN 50
122#define DEV_TYPE_FEAT_RANGE_1_END 127
123
125
143
145#define VIRTIO_QUEUE_INTERRUPT 1
147#define VIRTIO_DEVICE_CONFIGURATION_INTERRUPT 2
148
150
161
163#define VIRTIO_MMIO_MAGIC_VALUE 0x000
165#define VIRTIO_MMIO_VERSION 0x004
167#define VIRTIO_MMIO_DEVICE_ID 0x008
169#define VIRTIO_MMIO_VENDOR_ID 0x00c
171#define VIRTIO_MMIO_DEVICE_FEATURES 0x010
173#define VIRTIO_MMIO_DEVICE_FEATURES_SEL 0x014
175#define VIRTIO_MMIO_DRIVER_FEATURES 0x020
177#define VIRTIO_MMIO_DRIVER_FEATURES_SEL 0x024
179#define VIRTIO_MMIO_QUEUE_SEL 0x030
181#define VIRTIO_MMIO_QUEUE_SIZE_MAX 0x034
183#define VIRTIO_MMIO_QUEUE_SIZE 0x038
185#define VIRTIO_MMIO_QUEUE_READY 0x044
187#define VIRTIO_MMIO_QUEUE_NOTIFY 0x050
189#define VIRTIO_MMIO_INTERRUPT_STATUS 0x060
191#define VIRTIO_MMIO_INTERRUPT_ACK 0x064
193#define VIRTIO_MMIO_STATUS 0x070
195#define VIRTIO_MMIO_QUEUE_DESC_LOW 0x080
197#define VIRTIO_MMIO_QUEUE_DESC_HIGH 0x084
199#define VIRTIO_MMIO_QUEUE_AVAIL_LOW 0x090
201#define VIRTIO_MMIO_QUEUE_AVAIL_HIGH 0x094
203#define VIRTIO_MMIO_QUEUE_USED_LOW 0x0a0
205#define VIRTIO_MMIO_QUEUE_USED_HIGH 0x0a4
207#define VIRTIO_MMIO_SHM_SEL 0x0ac
209#define VIRTIO_MMIO_SHM_LEN_LOW 0x0b0
211#define VIRTIO_MMIO_SHM_LEN_HIGH 0x0b4
213#define VIRTIO_MMIO_SHM_BASE_LOW 0x0b8
215#define VIRTIO_MMIO_SHM_BASE_HIGH 0x0bc
217#define VIRTIO_MMIO_QUEUE_RESET 0x0c0
219#define VIRTIO_MMIO_CONFIG_GENERATION 0x0fc
221#define VIRTIO_MMIO_CONFIG 0x100
222
224
225#endif /* ZEPHYR_DRIVERS_VIRTIO_VIRTIO_CONFIG_H_ */