0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef __INCLUDE_SOUND_SOF_IPC4_TOPOLOGY_H__
0010 #define __INCLUDE_SOUND_SOF_IPC4_TOPOLOGY_H__
0011
0012 #include <sound/sof/ipc4/header.h>
0013
0014 #define SOF_IPC4_FW_PAGE_SIZE BIT(12)
0015 #define SOF_IPC4_FW_PAGE(x) ((((x) + BIT(12) - 1) & ~(BIT(12) - 1)) >> 12)
0016 #define SOF_IPC4_FW_ROUNDUP(x) (((x) + BIT(6) - 1) & (~(BIT(6) - 1)))
0017
0018 #define SOF_IPC4_MODULE_LOAD_TYPE GENMASK(3, 0)
0019 #define SOF_IPC4_MODULE_AUTO_START BIT(4)
0020
0021
0022
0023
0024
0025
0026 #define SOF_IPC4_MODULE_LL BIT(5)
0027 #define SOF_IPC4_MODULE_DP BIT(6)
0028 #define SOF_IPC4_MODULE_LIB_CODE BIT(7)
0029
0030 #define SOF_IPC4_MODULE_INSTANCE_LIST_ITEM_SIZE 12
0031 #define SOF_IPC4_PIPELINE_OBJECT_SIZE 448
0032 #define SOF_IPC4_DATA_QUEUE_OBJECT_SIZE 128
0033 #define SOF_IPC4_LL_TASK_OBJECT_SIZE 72
0034 #define SOF_IPC4_DP_TASK_OBJECT_SIZE 104
0035 #define SOF_IPC4_DP_TASK_LIST_SIZE (12 + 8)
0036 #define SOF_IPC4_LL_TASK_LIST_ITEM_SIZE 12
0037 #define SOF_IPC4_FW_MAX_PAGE_COUNT 20
0038 #define SOF_IPC4_FW_MAX_QUEUE_COUNT 8
0039
0040
0041 #define SOF_IPC4_NODE_INDEX_MASK 0xFF
0042 #define SOF_IPC4_NODE_INDEX(x) ((x) & SOF_IPC4_NODE_INDEX_MASK)
0043 #define SOF_IPC4_NODE_TYPE(x) ((x) << 8)
0044
0045
0046 #define SOF_IPC4_NODE_INDEX_INTEL_SSP(x) (((x) & 0xf) << 4)
0047
0048
0049 #define SOF_IPC4_NODE_INDEX_INTEL_DMIC(x) (((x) & 0x7) << 5)
0050
0051 #define SOF_IPC4_GAIN_ALL_CHANNELS_MASK 0xffffffff
0052 #define SOF_IPC4_VOL_ZERO_DB 0x7fffffff
0053
0054 #define ALH_MAX_NUMBER_OF_GTW 16
0055
0056
0057
0058
0059
0060
0061
0062
0063 #define ALH_MULTI_GTW_BASE 0x50
0064
0065 #define ALH_MULTI_GTW_COUNT 8
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075 struct sof_ipc4_pipeline {
0076 uint32_t priority;
0077 uint32_t lp_mode;
0078 uint32_t mem_usage;
0079 int state;
0080 struct sof_ipc4_msg msg;
0081 };
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091 struct sof_ipc4_available_audio_format {
0092 struct sof_ipc4_base_module_cfg *base_config;
0093 struct sof_ipc4_audio_format *out_audio_fmt;
0094 struct sof_ipc4_audio_format *ref_audio_fmt;
0095 u32 *dma_buffer_size;
0096 int audio_fmt_num;
0097 };
0098
0099
0100
0101
0102
0103
0104
0105
0106 struct sof_copier_gateway_cfg {
0107 uint32_t node_id;
0108 uint32_t dma_buffer_size;
0109 uint32_t config_length;
0110 uint32_t config_data[];
0111 };
0112
0113
0114
0115
0116
0117
0118
0119
0120 struct sof_ipc4_copier_data {
0121 struct sof_ipc4_base_module_cfg base_config;
0122 struct sof_ipc4_audio_format out_format;
0123 uint32_t copier_feature_mask;
0124 struct sof_copier_gateway_cfg gtw_cfg;
0125 };
0126
0127
0128
0129
0130
0131
0132
0133 struct sof_ipc4_gtw_attributes {
0134 uint32_t lp_buffer_alloc : 1;
0135 uint32_t alloc_from_reg_file : 1;
0136 uint32_t rsvd : 30;
0137 };
0138
0139
0140
0141
0142
0143
0144
0145 struct sof_ipc4_alh_multi_gtw_cfg {
0146 uint32_t count;
0147 struct {
0148 uint32_t alh_id;
0149 uint32_t channel_mask;
0150 } mapping[ALH_MAX_NUMBER_OF_GTW];
0151 } __packed;
0152
0153
0154
0155
0156
0157 struct sof_ipc4_alh_configuration_blob {
0158 struct sof_ipc4_gtw_attributes gw_attr;
0159 struct sof_ipc4_alh_multi_gtw_cfg alh_cfg;
0160 };
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174 struct sof_ipc4_copier {
0175 struct sof_ipc4_copier_data data;
0176 u32 *copier_config;
0177 uint32_t ipc_config_size;
0178 void *ipc_config_data;
0179 struct sof_ipc4_available_audio_format available_fmt;
0180 u32 frame_fmt;
0181 struct sof_ipc4_msg msg;
0182 struct sof_ipc4_gtw_attributes *gtw_attr;
0183 u32 dai_type;
0184 int dai_index;
0185 };
0186
0187
0188
0189
0190
0191
0192 struct sof_ipc4_ctrl_value_chan {
0193 u32 channel;
0194 u32 value;
0195 };
0196
0197
0198
0199
0200
0201
0202
0203
0204 struct sof_ipc4_control_data {
0205 struct sof_ipc4_msg msg;
0206 int index;
0207
0208 union {
0209 struct sof_ipc4_ctrl_value_chan chanv[0];
0210 struct sof_abi_hdr data[0];
0211 };
0212 };
0213
0214
0215
0216
0217
0218
0219
0220
0221
0222 struct sof_ipc4_gain_data {
0223 uint32_t channels;
0224 uint32_t init_val;
0225 uint32_t curve_type;
0226 uint32_t reserved;
0227 uint32_t curve_duration;
0228 } __aligned(8);
0229
0230
0231
0232
0233
0234
0235
0236
0237 struct sof_ipc4_gain {
0238 struct sof_ipc4_base_module_cfg base_config;
0239 struct sof_ipc4_gain_data data;
0240 struct sof_ipc4_available_audio_format available_fmt;
0241 struct sof_ipc4_msg msg;
0242 };
0243
0244
0245
0246
0247
0248
0249
0250 struct sof_ipc4_mixer {
0251 struct sof_ipc4_base_module_cfg base_config;
0252 struct sof_ipc4_available_audio_format available_fmt;
0253 struct sof_ipc4_msg msg;
0254 };
0255
0256
0257
0258
0259
0260
0261
0262
0263 struct sof_ipc4_src {
0264 struct sof_ipc4_base_module_cfg base_config;
0265 uint32_t sink_rate;
0266 struct sof_ipc4_available_audio_format available_fmt;
0267 struct sof_ipc4_msg msg;
0268 };
0269
0270 #endif