2 * include/linux/tegra_nvavp.h
4 * Copyright (c) 2012-2014, NVIDIA CORPORATION. All rights reserved.
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
11 #ifndef __LINUX_TEGRA_NVAVP_H
12 #define __LINUX_TEGRA_NVAVP_H
14 #include <linux/ioctl.h>
15 #include <linux/types.h>
17 #define NVAVP_MAX_RELOCATION_COUNT 64
19 /* avp submit flags */
20 #define NVAVP_FLAG_NONE 0x00000000
21 #define NVAVP_UCODE_EXT 0x00000001 /*use external ucode provided */
24 NVAVP_MODULE_ID_CPU = 1,
25 NVAVP_MODULE_ID_AVP = 2,
26 NVAVP_MODULE_ID_VCP = 3,
27 NVAVP_MODULE_ID_BSEA = 27,
28 NVAVP_MODULE_ID_VDE = 28,
29 NVAVP_MODULE_ID_MPE = 29,
30 NVAVP_MODULE_ID_EMC = 75,
52 struct nvavp_pushbuffer_submit_hdr_v32 {
53 struct nvavp_cmdbuf cmdbuf;
61 struct nvavp_pushbuffer_submit_hdr {
62 struct nvavp_cmdbuf cmdbuf;
63 struct nvavp_reloc *relocs;
65 struct nvavp_syncpt *syncpt;
69 struct nvavp_set_nvmap_fd_args {
73 struct nvavp_clock_args {
78 enum nvavp_clock_stay_on_state {
79 NVAVP_CLOCK_STAY_ON_DISABLED = 0,
80 NVAVP_CLOCK_STAY_ON_ENABLED
83 struct nvavp_clock_stay_on_state_args {
84 enum nvavp_clock_stay_on_state state;
87 struct nvavp_num_cpus_args {
88 __u32 min_online_cpus;
91 struct nvavp_map_args {
96 struct nvavp_channel_open_args {
100 #define NVAVP_IOCTL_MAGIC 'n'
102 #define NVAVP_IOCTL_SET_NVMAP_FD _IOW(NVAVP_IOCTL_MAGIC, 0x60, \
103 struct nvavp_set_nvmap_fd_args)
104 #define NVAVP_IOCTL_GET_SYNCPOINT_ID _IOR(NVAVP_IOCTL_MAGIC, 0x61, \
106 #define NVAVP_IOCTL_PUSH_BUFFER_SUBMIT _IOWR(NVAVP_IOCTL_MAGIC, 0x63, \
107 struct nvavp_pushbuffer_submit_hdr)
109 #define NVAVP_IOCTL_PUSH_BUFFER_SUBMIT32 _IOWR(NVAVP_IOCTL_MAGIC, 0x63, \
110 struct nvavp_pushbuffer_submit_hdr_v32)
112 #define NVAVP_IOCTL_SET_CLOCK _IOWR(NVAVP_IOCTL_MAGIC, 0x64, \
113 struct nvavp_clock_args)
114 #define NVAVP_IOCTL_GET_CLOCK _IOR(NVAVP_IOCTL_MAGIC, 0x65, \
115 struct nvavp_clock_args)
116 #define NVAVP_IOCTL_WAKE_AVP _IOR(NVAVP_IOCTL_MAGIC, 0x66, \
118 #define NVAVP_IOCTL_FORCE_CLOCK_STAY_ON _IOW(NVAVP_IOCTL_MAGIC, 0x67, \
119 struct nvavp_clock_stay_on_state_args)
120 #define NVAVP_IOCTL_ENABLE_AUDIO_CLOCKS _IOWR(NVAVP_IOCTL_MAGIC, 0x68, \
121 struct nvavp_clock_args)
122 #define NVAVP_IOCTL_DISABLE_AUDIO_CLOCKS _IOWR(NVAVP_IOCTL_MAGIC, 0x69, \
123 struct nvavp_clock_args)
124 #define NVAVP_IOCTL_SET_MIN_ONLINE_CPUS _IOWR(NVAVP_IOCTL_MAGIC, 0x70, \
125 struct nvavp_num_cpus_args)
126 #define NVAVP_IOCTL_MAP_IOVA _IOWR(NVAVP_IOCTL_MAGIC, 0x71, \
127 struct nvavp_map_args)
128 #define NVAVP_IOCTL_UNMAP_IOVA _IOW(NVAVP_IOCTL_MAGIC, 0x72, \
129 struct nvavp_map_args)
130 #define NVAVP_IOCTL_CHANNEL_OPEN _IOR(NVAVP_IOCTL_MAGIC, 0x73, \
131 struct nvavp_channel_open_args)
133 #define NVAVP_IOCTL_MIN_NR _IOC_NR(NVAVP_IOCTL_SET_NVMAP_FD)
134 #define NVAVP_IOCTL_MAX_NR _IOC_NR(NVAVP_IOCTL_CHANNEL_OPEN)
136 #define NVAVP_IOCTL_CHANNEL_MAX_ARG_SIZE \
137 sizeof(struct nvavp_pushbuffer_submit_hdr)
138 #endif /* __LINUX_TEGRA_NVAVP_H */