-
Notifications
You must be signed in to change notification settings - Fork 350
Expand file tree
/
Copy pathheader.h
More file actions
222 lines (189 loc) · 5.68 KB
/
header.h
File metadata and controls
222 lines (189 loc) · 5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2021 Intel Corporation. All rights reserved.
*/
/*
* This file contains structures that are exact copies of an existing ABI used
* by IOT middleware. They are Intel specific and will be used by one middleware.
*
* Some of the structures may contain programming implementations that makes them
* unsuitable for generic use and general usage.
*
* This code is mostly copied "as-is" from existing C++ interface files hence the use of
* different style in places. The intention is to keep the interface as close as possible to
* original so it's easier to track changes with IPC host code.
*/
/**
* \file include/ipc4/header.h
* \brief IPC4 global definitions.
* NOTE: This ABI uses bit fields and is non portable.
*/
#ifndef __SOF_IPC4_HEADER_H__
#define __SOF_IPC4_HEADER_H__
#include <stdint.h>
#define ipc_from_hdr(x) ((struct ipc4_message_request *)x)
/**< Message target, value of msg_tgt field. */
enum ipc4_message_target {
/**< Global FW message */
SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG = 0,
/**< Module message */
SOF_IPC4_MESSAGE_TARGET_MODULE_MSG = 1
};
/**< Message direction, value of rsp field. */
enum ipc4_message_direction {
/**< Request, Notification */
SOF_IPC4_MESSAGE_DIR_MSG_REQUEST = 0,
/**< Reply */
SOF_IPC4_MESSAGE_DIR_MSG_REPLY = 1,
};
/*
* Global IPC4 message types - must fit into 5 bits.
*/
enum ipc4_message_type {
/**< Boot Config. */
SOF_IPC4_GLB_BOOT_CONFIG = 0,
/**< ROM Control (directed to ROM). */
SOF_IPC4_GLB_ROM_CONTROL = 1,
/**< Execute IPC gateway command */
SOF_IPC4_GLB_IPCGATEWAY_CMD = 2,
/* GAP HERE- DO NOT USE - size 10 (3 .. 12) */
/**< Execute performance measurements command. */
SOF_IPC4_GLB_PERF_MEASUREMENTS_CMD = 13,
/**< DMA Chain command. */
SOF_IPC4_GLB_CHAIN_DMA = 14,
/**< Load multiple modules */
SOF_IPC4_GLB_LOAD_MULTIPLE_MODULES = 15,
/**< Unload multiple modules */
SOF_IPC4_GLB_UNLOAD_MULTIPLE_MODULES = 16,
/**< Create pipeline */
SOF_IPC4_GLB_CREATE_PIPELINE = 17,
/**< Delete pipeline */
SOF_IPC4_GLB_DELETE_PIPELINE = 18,
/**< Set pipeline state */
SOF_IPC4_GLB_SET_PIPELINE_STATE = 19,
/**< Get pipeline state */
SOF_IPC4_GLB_GET_PIPELINE_STATE = 20,
/**< Get pipeline context size */
SOF_IPC4_GLB_GET_PIPELINE_CONTEXT_SIZE = 21,
/**< Save pipeline */
SOF_IPC4_GLB_SAVE_PIPELINE = 22,
/**< Restore pipeline */
SOF_IPC4_GLB_RESTORE_PIPELINE = 23,
/**< Loads library */
SOF_IPC4_GLB_LOAD_LIBRARY = 24,
/**< Loads library prepare */
SOF_IPC4_GLB_LOAD_LIBRARY_PREPARE = 25,
/**< Internal FW message */
SOF_IPC4_GLB_INTERNAL_MESSAGE = 26,
/**< Notification (FW to SW driver) */
SOF_IPC4_GLB_NOTIFICATION = 27,
/* GAP HERE- DO NOT USE - size 3 (28 .. 30) */
/**< Maximum message number */
SOF_IPC4_GLB_MAX_IXC_MESSAGE_TYPE = 31
};
/**
* \brief Generic message header. IPC MAJOR 4 version.
* All IPC4 messages use this header as abstraction
* to platform specific calls.
*/
struct ipc_cmd_hdr {
uint32_t pri;
uint32_t ext;
};
/**
* \brief IPC MAJOR 4 message header. All IPC4 messages use this header.
* When msg_tgt is SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG then type is
* enum ipc4_message_type.
*/
struct ipc4_message_request {
union {
uint32_t dat;
struct {
uint32_t rsvd0 : 24;
/**< One of Global::Type */
uint32_t type : 5;
/**< Msg::MSG_REQUEST */
uint32_t rsp : 1;
/**< Msg::FW_GEN_MSG */
uint32_t msg_tgt : 1;
uint32_t _reserved_0 : 1;
} r;
} primary;
union {
uint32_t dat;
struct {
uint32_t ext_data : 30;
uint32_t _reserved_0 : 2;
} r;
} extension;
} __attribute__((packed, aligned(4)));
struct ipc4_message_reply {
union {
uint32_t dat;
struct {
/**< Processing status, one of IxcStatus values */
uint32_t status : 24;
/**< Type, symmetric to Msg */
uint32_t type : 5;
/**< MSG_REPLY */
uint32_t rsp : 1;
/**< same as request, one of FW_GEN_MSG, MODULE_MSG */
uint32_t msg_tgt : 1;
/**< Reserved field (HW ctrl bits) */
uint32_t _reserved_0 : 1;
} r;
} primary;
union {
uint32_t dat;
struct {
/**< Reserved field */
uint32_t rsvd1 : 30;
/**< Reserved field (HW ctrl bits) */
uint32_t _reserved_2 : 2;
} r;
} extension;
} __attribute((packed, aligned(4)));
#define SOF_IPC4_SWITCH_CONTROL_PARAM_ID 200
#define SOF_IPC4_ENUM_CONTROL_PARAM_ID 201
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL ((uint32_t)(0xA15A << 16))
/**
* struct sof_ipc4_ctrl_value_chan: generic channel mapped value data
* @channel: Channel ID
* @value: control value
*/
struct sof_ipc4_ctrl_value_chan {
uint32_t channel;
uint32_t value;
} __attribute((packed, aligned(4)));
/**
* struct sof_ipc4_control_msg_payload - IPC payload for kcontrol parameters
* @id: unique id of the control
* @num_elems: Number of elememnts in the chanv array
* @reserved: reserved for future use, must be set to 0
* @chanv: channel ID and value array
*/
struct sof_ipc4_control_msg_payload {
uint16_t id;
uint16_t num_elems;
uint32_t reserved[4];
struct sof_ipc4_ctrl_value_chan chanv[];
} __attribute((packed, aligned(4)));
/**
* struct sof_ipc4_notify_module_data - payload for module notification
* @instance_id: instance ID of the originator module of the notification
* @module_id: module ID of the originator of the notification
* @event_id: module specific event id
* @event_data_size: Size of the @event_data (if any) in bytes
* @event_data: Optional notification data, module and notification dependent
*/
struct sof_ipc4_notify_module_data {
uint16_t instance_id;
uint16_t module_id;
uint32_t event_id;
uint32_t event_data_size;
uint8_t event_data[];
} __attribute((packed, aligned(4)));
enum sof_ipc4_kcontrol_global_id {
SOF_IPC4_KCONTROL_GLOBAL_CAPTURE_HW_MUTE = 1,
};
#endif