forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathipc-config.h
More file actions
153 lines (135 loc) · 4.76 KB
/
ipc-config.h
File metadata and controls
153 lines (135 loc) · 4.76 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
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2021 Intel Corporation. All rights reserved.
*/
#ifndef __SOF_AUDIO_IPC_CONFIG_H__
#define __SOF_AUDIO_IPC_CONFIG_H__
#include <stdint.h>
#include <stdbool.h>
/* ACE 2.0 and newer */
#define GTW_DMA_CONFIG_ID 0x1000
#define GTW_DMA_INVALID_CHANNEL_ID 0xffffffff
/* Maximum number of devices */
#define GTW_DMA_DEVICE_MAX_COUNT 16
struct dma_device_stream_channel_map {
uint32_t device_address;
uint32_t channel_map;
};
struct dma_stream_channel_map {
uint32_t device_count;
struct dma_device_stream_channel_map map[GTW_DMA_DEVICE_MAX_COUNT];
};
struct ipc_dma_config {
uint8_t dma_method; /**< DMA method */
uint8_t pre_allocated_by_host; /**< 1 - DMA pre-allocated by host, otherwise to be
* allocated by DSP
*/
uint16_t rsvd;
uint32_t dma_channel_id; /**< channel ID if DMA pre-allocated by host, otherwise
* invalid channel ID
*/
uint32_t stream_id;
/* DmaStreamChannelMap */
struct dma_stream_channel_map channel_map;
uint32_t dma_priv_config_size;
uint8_t dma_priv_config[0];
} __attribute__((packed, aligned(4)));
#define GET_IPC_DMA_CONFIG(buffer, size) \
((struct ipc_dma_config *)((uint8_t *)(buffer) + (size) - sizeof(struct ipc_dma_config)))
#define GET_IPC_DMA_CONFIG_ID(buffer, size) ((uint32_t *)GET_IPC_DMA_CONFIG(buffer, size) - 2)
/*
* Generic IPC information for base components. Fields can be added here with NO impact on
* IPC ABI version.
*/
/* generic host component */
struct ipc_config_host {
uint32_t direction; /**< SOF_IPC_STREAM_ */
uint32_t no_irq; /**< don't send periodic IRQ to host/DSP */
uint32_t dmac_config; /**< DMA engine specific */
uint32_t dma_buffer_size; /**< Requested DMA buffer size */
uint32_t feature_mask; /**< copier feature mask (set directly from
* ipc4_copier_module_cfg on init)
*/
};
/* generic DAI component */
struct ipc_config_dai {
uint32_t direction; /**< SOF_IPC_STREAM_ */
uint32_t dai_index; /**< index of this type dai */
uint32_t type; /**< DAI type - SOF_DAI_ */
uint32_t dma_buffer_size; /**< Requested DMA buffer size */
/* physical protocol and clocking */
uint32_t sampling_frequency; /**< DAI sampling frequency - required only with IPC4 */
uint16_t format; /**< SOF_DAI_FMT_ */
uint16_t group_id; /**< group ID, 0 means no group (ABI 3.17) */
bool is_config_blob; /**< DAI specific configuration is a blob */
uint32_t feature_mask; /**< copier feature mask (set directly from
* ipc4_copier_module_cfg on init)
*/
struct ipc_dma_config *host_dma_config; /**< DMA config - required for ACE 2.0 and newer */
const struct ipc4_audio_format *out_fmt;/**< audio format for output pin 0 - required
* for ACE 2.0 and newer
*/
};
/* generic volume component */
struct ipc_config_volume {
uint32_t channels;
uint32_t min_value;
uint32_t max_value;
uint32_t ramp; /**< SOF_VOLUME_ */
uint32_t initial_ramp; /**< ramp space in ms */
};
/* generic SRC component */
struct ipc_config_src {
/* either source or sink rate must be non zero */
uint32_t source_rate; /**< source rate or 0 for variable */
uint32_t sink_rate; /**< sink rate or 0 for variable */
uint32_t rate_mask; /**< SOF_RATE_ supported rates */
};
/* generic ASRC component */
struct ipc_config_asrc {
/* either source or sink rate must be non zero */
uint32_t source_rate; /**< Define fixed source rate or */
/**< use 0 to indicate need to get */
/**< the rate from stream */
uint32_t sink_rate; /**< Define fixed sink rate or */
/**< use 0 to indicate need to get */
/**< the rate from stream */
uint32_t asynchronous_mode; /**< synchronous 0, asynchronous 1 */
/**< When 1 the ASRC tracks and */
/**< compensates for drift. */
uint32_t operation_mode; /**< push 0, pull 1, In push mode the */
/**< ASRC consumes a defined number */
/**< of frames at input, with varying */
/**< number of frames at output. */
/**< In pull mode the ASRC outputs */
/**< a defined number of frames while */
/**< number of input frames varies. */
};
/* generic tone generator component */
struct ipc_config_tone {
int32_t sample_rate;
int32_t frequency;
int32_t amplitude;
int32_t freq_mult;
int32_t ampl_mult;
int32_t length;
int32_t period;
int32_t repeats;
int32_t ramp_step;
};
/* generic "effect", "codec" or proprietary processing component */
struct ipc_config_process {
uint32_t size; /**< size of bespoke data section in bytes */
uint32_t type; /**< sof_ipc_process_type */
const unsigned char *data;
};
/* file IO ipc comp */
struct ipc_comp_file {
uint32_t rate;
uint32_t channels;
char *fn;
uint32_t mode;
uint32_t frame_fmt;
uint32_t direction; /**< SOF_IPC_STREAM_ */
} __attribute__((packed, aligned(4)));
#endif