1
2
3
4
5
6
7
8
9 #ifndef __INCLUDE_SOUND_SOF_HEADER_H__
10 #define __INCLUDE_SOUND_SOF_HEADER_H__
11
12 #include <uapi/sound/sof/abi.h>
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 #define SOF_GLB_TYPE_SHIFT 28
33 #define SOF_GLB_TYPE_MASK (0xf << SOF_GLB_TYPE_SHIFT)
34 #define SOF_GLB_TYPE(x) ((x) << SOF_GLB_TYPE_SHIFT)
35
36
37 #define SOF_CMD_TYPE_SHIFT 16
38 #define SOF_CMD_TYPE_MASK (0xfff << SOF_CMD_TYPE_SHIFT)
39 #define SOF_CMD_TYPE(x) ((x) << SOF_CMD_TYPE_SHIFT)
40
41
42 #define SOF_IPC_GLB_REPLY SOF_GLB_TYPE(0x1U)
43 #define SOF_IPC_GLB_COMPOUND SOF_GLB_TYPE(0x2U)
44 #define SOF_IPC_GLB_TPLG_MSG SOF_GLB_TYPE(0x3U)
45 #define SOF_IPC_GLB_PM_MSG SOF_GLB_TYPE(0x4U)
46 #define SOF_IPC_GLB_COMP_MSG SOF_GLB_TYPE(0x5U)
47 #define SOF_IPC_GLB_STREAM_MSG SOF_GLB_TYPE(0x6U)
48 #define SOF_IPC_FW_READY SOF_GLB_TYPE(0x7U)
49 #define SOF_IPC_GLB_DAI_MSG SOF_GLB_TYPE(0x8U)
50 #define SOF_IPC_GLB_TRACE_MSG SOF_GLB_TYPE(0x9U)
51 #define SOF_IPC_GLB_GDB_DEBUG SOF_GLB_TYPE(0xAU)
52 #define SOF_IPC_GLB_TEST_MSG SOF_GLB_TYPE(0xBU)
53
54
55
56
57
58
59 #define SOF_IPC_TPLG_COMP_NEW SOF_CMD_TYPE(0x001)
60 #define SOF_IPC_TPLG_COMP_FREE SOF_CMD_TYPE(0x002)
61 #define SOF_IPC_TPLG_COMP_CONNECT SOF_CMD_TYPE(0x003)
62 #define SOF_IPC_TPLG_PIPE_NEW SOF_CMD_TYPE(0x010)
63 #define SOF_IPC_TPLG_PIPE_FREE SOF_CMD_TYPE(0x011)
64 #define SOF_IPC_TPLG_PIPE_CONNECT SOF_CMD_TYPE(0x012)
65 #define SOF_IPC_TPLG_PIPE_COMPLETE SOF_CMD_TYPE(0x013)
66 #define SOF_IPC_TPLG_BUFFER_NEW SOF_CMD_TYPE(0x020)
67 #define SOF_IPC_TPLG_BUFFER_FREE SOF_CMD_TYPE(0x021)
68
69
70 #define SOF_IPC_PM_CTX_SAVE SOF_CMD_TYPE(0x001)
71 #define SOF_IPC_PM_CTX_RESTORE SOF_CMD_TYPE(0x002)
72 #define SOF_IPC_PM_CTX_SIZE SOF_CMD_TYPE(0x003)
73 #define SOF_IPC_PM_CLK_SET SOF_CMD_TYPE(0x004)
74 #define SOF_IPC_PM_CLK_GET SOF_CMD_TYPE(0x005)
75 #define SOF_IPC_PM_CLK_REQ SOF_CMD_TYPE(0x006)
76 #define SOF_IPC_PM_CORE_ENABLE SOF_CMD_TYPE(0x007)
77
78
79 #define SOF_IPC_COMP_SET_VALUE SOF_CMD_TYPE(0x001)
80 #define SOF_IPC_COMP_GET_VALUE SOF_CMD_TYPE(0x002)
81 #define SOF_IPC_COMP_SET_DATA SOF_CMD_TYPE(0x003)
82 #define SOF_IPC_COMP_GET_DATA SOF_CMD_TYPE(0x004)
83 #define SOF_IPC_COMP_NOTIFICATION SOF_CMD_TYPE(0x005)
84
85
86 #define SOF_IPC_DAI_CONFIG SOF_CMD_TYPE(0x001)
87 #define SOF_IPC_DAI_LOOPBACK SOF_CMD_TYPE(0x002)
88
89
90 #define SOF_IPC_STREAM_PCM_PARAMS SOF_CMD_TYPE(0x001)
91 #define SOF_IPC_STREAM_PCM_PARAMS_REPLY SOF_CMD_TYPE(0x002)
92 #define SOF_IPC_STREAM_PCM_FREE SOF_CMD_TYPE(0x003)
93 #define SOF_IPC_STREAM_TRIG_START SOF_CMD_TYPE(0x004)
94 #define SOF_IPC_STREAM_TRIG_STOP SOF_CMD_TYPE(0x005)
95 #define SOF_IPC_STREAM_TRIG_PAUSE SOF_CMD_TYPE(0x006)
96 #define SOF_IPC_STREAM_TRIG_RELEASE SOF_CMD_TYPE(0x007)
97 #define SOF_IPC_STREAM_TRIG_DRAIN SOF_CMD_TYPE(0x008)
98 #define SOF_IPC_STREAM_TRIG_XRUN SOF_CMD_TYPE(0x009)
99 #define SOF_IPC_STREAM_POSITION SOF_CMD_TYPE(0x00a)
100 #define SOF_IPC_STREAM_VORBIS_PARAMS SOF_CMD_TYPE(0x010)
101 #define SOF_IPC_STREAM_VORBIS_FREE SOF_CMD_TYPE(0x011)
102
103
104 #define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x001)
105 #define SOF_IPC_TRACE_DMA_POSITION SOF_CMD_TYPE(0x002)
106 #define SOF_IPC_TRACE_DMA_PARAMS_EXT SOF_CMD_TYPE(0x003)
107
108
109 #define SOF_IPC_TEST_IPC_FLOOD SOF_CMD_TYPE(0x001)
110
111
112 #define SOF_IPC_MESSAGE_ID(x) ((x) & 0xffff)
113
114
115 #define SOF_IPC_MSG_MAX_SIZE 384
116
117
118
119
120
121
122
123
124 struct sof_ipc_hdr {
125 uint32_t size;
126 } __packed;
127
128
129
130
131
132
133
134
135 struct sof_ipc_cmd_hdr {
136 uint32_t size;
137 uint32_t cmd;
138 } __packed;
139
140
141
142
143
144 struct sof_ipc_reply {
145 struct sof_ipc_cmd_hdr hdr;
146 int32_t error;
147 } __packed;
148
149
150
151
152
153
154
155
156
157
158 struct sof_ipc_compound_hdr {
159 struct sof_ipc_cmd_hdr hdr;
160 uint32_t count;
161 } __packed;
162
163
164
165
166 struct sof_ipc_dsp_oops_arch_hdr {
167 uint32_t arch;
168 uint32_t totalsize;
169 } __packed;
170
171
172
173
174 struct sof_ipc_dsp_oops_plat_hdr {
175 uint32_t configidhi;
176 uint32_t configidlo;
177 uint32_t numaregs;
178 uint32_t stackoffset;
179
180
181 uint32_t stackptr;
182 } __packed;
183
184
185
186 #endif