1divert(-1)
2
3# list of generic scheduling time domains
4define(`SCHEDULE_TIME_DOMAIN_DMA', 0)
5define(`SCHEDULE_TIME_DOMAIN_TIMER', 1)
6
7# default number of DAI periods
8define(`DAI_DEFAULT_PERIODS', 2)
9
10# default stereo channel map
11ifdef(`VOLUME_CHANNEL_MAP', , `define(`VOLUME_CHANNEL_MAP', LIST(`	',
12								KCONTROL_CHANNEL(FL, 1, 0),
13								KCONTROL_CHANNEL(FR, 1, 1)))')
14
15ifdef(`SWITCH_CHANNEL_MAP', , `define(`SWITCH_CHANNEL_MAP', LIST(`	',
16								KCONTROL_CHANNEL(FL, 2, 0),
17								KCONTROL_CHANNEL(FR, 2, 1)))')
18
19dnl Define macro for pipeline widget
20
21dnl Pipeline name)
22define(`N_PIPELINE', `PIPELINE.'PIPELINE_ID`.'$1)
23
24dnl W_PIPELINE(stream, period, priority, core, initiator, platform)
25define(`W_PIPELINE',
26`SectionVendorTuples."'N_PIPELINE($1)`_tuples" {'
27`	tokens "sof_sched_tokens"'
28`	tuples."word" {'
29`		SOF_TKN_SCHED_PERIOD'		STR($2)
30`		SOF_TKN_SCHED_PRIORITY'		STR($3)
31`		SOF_TKN_SCHED_CORE'		STR($4)
32`		SOF_TKN_SCHED_FRAMES'		"0"
33`		SOF_TKN_SCHED_TIME_DOMAIN'	STR($5)
34`		SOF_TKN_SCHED_DYNAMIC_PIPELINE'	ifdef(`DYNAMIC', "1", ifelse(DYNAMIC_PIPE, `1', "1", "0"))
35`	}'
36`}'
37`SectionData."'N_PIPELINE($1)`_data" {'
38`	tuples "'N_PIPELINE($1)`_tuples"'
39`}'
40`SectionWidget."'N_PIPELINE($1)`" {'
41`	index "'PIPELINE_ID`"'
42`	type "scheduler"'
43`	no_pm "true"'
44`	stream_name "'$1`"'
45`	data ['
46`		"'N_PIPELINE($1)`_data"'
47`		"'$6`"'
48`	]'
49`}')
50
51dnl PIPELINE_PCM_ADD(pipeline,
52dnl     pipe id, pcm, max channels, format,
53dnl     period, priority, core,
54dnl     pcm_min_rate, pcm_max_rate, pipeline_rate,
55dnl     time_domain, sched_comp, dynamic)
56define(`PIPELINE_PCM_ADD',
57`ifelse(eval(`$# > 10'), `1',
58`undefine(`PCM_ID')'
59`undefine(`PIPELINE_ID')'
60`undefine(`PIPELINE_CHANNELS')'
61`undefine(`PIPELINE_FORMAT')'
62`undefine(`SCHEDULE_PERIOD')'
63`undefine(`SCHEDULE_PRIORITY')'
64`undefine(`SCHEDULE_CORE')'
65`undefine(`PCM_MIN_RATE')'
66`undefine(`PCM_MAX_RATE')'
67`undefine(`PIPELINE_RATE')'
68`undefine(`SCHEDULE_TIME_DOMAIN')'
69`undefine(`DAI_FORMAT')'
70`undefine(`SCHED_COMP')'
71`undefine(`DYNAMIC_PIPE')'
72`define(`PIPELINE_ID', $2)'
73`define(`PCM_ID', $3)'
74`define(`PIPELINE_CHANNELS', $4)'
75`define(`PIPELINE_FORMAT', $5)'
76`define(`SCHEDULE_PERIOD', $6)'
77`define(`SCHEDULE_PRIORITY', $7)'
78`define(`SCHEDULE_CORE', $8)'
79`define(`PCM_MIN_RATE', $9)'
80`define(`PCM_MAX_RATE', $10)'
81`define(`PIPELINE_RATE', $11)'
82`define(`SCHEDULE_TIME_DOMAIN', $12)'
83`define(`DAI_FORMAT', $5)'
84`define(`SCHED_COMP', $13)'
85`define(`DYNAMIC_PIPE', $14)'
86`ifdef(`DAI_PERIODS', `', `define(`DAI_PERIODS', DAI_DEFAULT_PERIODS)')'
87`include($1)'
88`DEBUG_PCM_ADD($1, $3)'
89`undefine(`PCM_ID')'
90`undefine(`PIPELINE_ID')'
91`undefine(`PIPELINE_CHANNELS')'
92`undefine(`PIPELINE_FORMAT')'
93`undefine(`SCHEDULE_PERIOD')'
94`undefine(`SCHEDULE_PRIORITY')'
95`undefine(`SCHEDULE_CORE')'
96`undefine(`PCM_MIN_RATE')'
97`undefine(`PCM_MAX_RATE')'
98`undefine(`PIPELINE_RATE')'
99`undefine(`SCHEDULE_TIME_DOMAIN')'
100`undefine(`DAI_FORMAT')'
101`undefine(`SCHED_COMP')'
102`undefine(`DYNAMIC_PIPE')'
103,`fatal_error(`Invalid parameters ($#) to PIPELINE_PCM_ADD')')'
104)
105
106dnl PIPELINE_PCM_DAI_ADD(pipeline,
107dnl     pipe id, pcm, max channels, format,
108dnl     period, priority, core,
109dnl     dai type, dai_index, dai format,
110dnl     periods, time_domain)
111define(`PIPELINE_PCM_DAI_ADD',
112`ifelse(`$#', `15',
113`undefine(`PCM_ID')'
114`undefine(`PIPELINE_ID')'
115`undefine(`PIPELINE_CHANNELS')'
116`undefine(`PIPELINE_FORMAT')'
117`undefine(`SCHEDULE_PERIOD')'
118`undefine(`SCHEDULE_PRIORITY')'
119`undefine(`SCHEDULE_CORE')'
120`undefine(`SCHEDULE_TIME_DOMAIN')'
121`undefine(`DAI_TYPE')'
122`undefine(`DAI_INDEX')'
123`undefine(`DAI_FORMAT')'
124`undefine(`DAI_PERIODS')'
125`undefine(`PCM_MIN_RATE')'
126`undefine(`PCM_MAX_RATE')'
127`undefine(`PIPELINE_RATE')'
128`define(`PIPELINE_ID', $2)'
129`define(`PCM_ID', $3)'
130`define(`PIPELINE_CHANNELS', $4)'
131`define(`PIPELINE_FORMAT', $5)'
132`define(`SCHEDULE_PERIOD', $6)'
133`define(`SCHEDULE_PRIORITY', $7)'
134`define(`SCHEDULE_CORE', $8)'
135`define(`SCHEDULE_TIME_DOMAIN', $16)'
136`define(`DAI_TYPE', STR($9))'
137`define(`DAI_INDEX', STR($10))'
138`define(`DAI_FORMAT', $11)'
139`define(`DAI_PERIODS', $12)'
140`define(`DAI_NAME', $9$10)'
141`define(`PCM_MIN_RATE', $13)'
142`define(`PCM_MAX_RATE', $14)'
143`define(`PIPELINE_RATE', $15)'
144`include($1)'
145`undefine(`PCM_ID')'
146`undefine(`PIPELINE_ID')'
147`undefine(`PIPELINE_CHANNELS')'
148`undefine(`PIPELINE_FORMAT')'
149`undefine(`SCHEDULE_PERIOD')'
150`undefine(`SCHEDULE_PRIORITY')'
151`undefine(`SCHEDULE_CORE')'
152`undefine(`SCHEDULE_TIME_DOMAIN')'
153`undefine(`DAI_TYPE')'
154`undefine(`DAI_INDEX')'
155`undefine(`DAI_FORMAT')'
156`undefine(`DAI_PERIODS')'
157`undefine(`PCM_MIN_RATE')'
158`undefine(`PCM_MAX_RATE')'
159`undefine(`PIPELINE_RATE')'
160,`fatal_error(`Invalid parameters ($#) to PIPELINE_PCM_DAI_ADD')')'
161)
162
163dnl PIPELINE_ADD(pipeline,
164dnl     pipe id, max channels, format,
165dnl     period, priority, core,
166dnl     sched_comp, time_domain,
167dnl     pcm_min_rate, pcm_max_rate, pipeline_rate, dynamic)
168define(`PIPELINE_ADD',
169`ifelse(`$#', `12',
170`undefine(`PIPELINE_ID')'
171`undefine(`PIPELINE_CHANNELS')'
172`undefine(`PIPELINE_FORMAT')'
173`undefine(`SCHEDULE_PERIOD')'
174`undefine(`SCHEDULE_PRIORITY')'
175`undefine(`SCHEDULE_CORE')'
176`undefine(`SCHEDULE_TIME_DOMAIN')'
177`undefine(`PCM_MIN_RATE')'
178`undefine(`PCM_MAX_RATE')'
179`undefine(`PIPELINE_RATE')'
180`undefine(`DYNAMIC_PIPE')'
181`define(`PIPELINE_ID', $2)'
182`define(`PIPELINE_CHANNELS', $3)'
183`define(`PIPELINE_FORMAT', $4)'
184`define(`SCHEDULE_PERIOD', $5)'
185`define(`SCHEDULE_PRIORITY', $6)'
186`define(`SCHEDULE_CORE', $7)'
187`define(`SCHEDULE_TIME_DOMAIN', $9)'
188`define(`SCHED_COMP', $8)'
189`define(`PCM_MIN_RATE', $10)'
190`define(`PCM_MAX_RATE', $11)'
191`define(`PIPELINE_RATE', $12)'
192`define(`DYNAMIC_PIPE', $13)'
193`include($1)'
194`undefine(`PIPELINE_ID')'
195`undefine(`PIPELINE_CHANNELS')'
196`undefine(`PIPELINE_FORMAT')'
197`undefine(`SCHEDULE_PERIOD')'
198`undefine(`SCHEDULE_PRIORITY')'
199`undefine(`SCHEDULE_CORE')'
200`undefine(`SCHEDULE_TIME_DOMAIN')'
201`undefine(`PCM_MIN_RATE')'
202`undefine(`PCM_MAX_RATE')'
203`undefine(`PIPELINE_RATE')'
204`undefine(`DYNAMIC_PIPE')'
205,`fatal_error(`Invalid parameters ($#) to PIPELINE_ADD')')'
206)
207
208divert(0)dnl
209