]>
Commit | Line | Data |
---|---|---|
caff4cae IM |
1 | /* arch/arm/mach-msm/qdsp5/adsp_6225.h |
2 | * | |
3 | * Copyright (c) 2008 QUALCOMM Incorporated. | |
4 | * | |
5 | * This software is licensed under the terms of the GNU General Public | |
6 | * License version 2, as published by the Free Software Foundation, and | |
7 | * may be copied, distributed, and modified under those terms. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | */ | |
15 | ||
16 | #include "adsp.h" | |
17 | ||
18 | /* Firmware modules */ | |
19 | typedef enum { | |
20 | QDSP_MODULE_KERNEL, | |
21 | QDSP_MODULE_AFETASK, | |
22 | QDSP_MODULE_AUDPLAY0TASK, | |
23 | QDSP_MODULE_AUDPLAY1TASK, | |
24 | QDSP_MODULE_AUDPPTASK, | |
25 | QDSP_MODULE_VIDEOTASK, | |
26 | QDSP_MODULE_VIDEO_AAC_VOC, | |
27 | QDSP_MODULE_PCM_DEC, | |
28 | QDSP_MODULE_AUDIO_DEC_MP3, | |
29 | QDSP_MODULE_AUDIO_DEC_AAC, | |
30 | QDSP_MODULE_AUDIO_DEC_WMA, | |
31 | QDSP_MODULE_HOSTPCM, | |
32 | QDSP_MODULE_DTMF, | |
33 | QDSP_MODULE_AUDRECTASK, | |
34 | QDSP_MODULE_AUDPREPROCTASK, | |
35 | QDSP_MODULE_SBC_ENC, | |
36 | QDSP_MODULE_VOC_UMTS, | |
37 | QDSP_MODULE_VOC_CDMA, | |
38 | QDSP_MODULE_VOC_PCM, | |
39 | QDSP_MODULE_VOCENCTASK, | |
40 | QDSP_MODULE_VOCDECTASK, | |
41 | QDSP_MODULE_VOICEPROCTASK, | |
42 | QDSP_MODULE_VIDEOENCTASK, | |
43 | QDSP_MODULE_VFETASK, | |
44 | QDSP_MODULE_WAV_ENC, | |
45 | QDSP_MODULE_AACLC_ENC, | |
46 | QDSP_MODULE_VIDEO_AMR, | |
47 | QDSP_MODULE_VOC_AMR, | |
48 | QDSP_MODULE_VOC_EVRC, | |
49 | QDSP_MODULE_VOC_13K, | |
50 | QDSP_MODULE_VOC_FGV, | |
51 | QDSP_MODULE_DIAGTASK, | |
52 | QDSP_MODULE_JPEGTASK, | |
53 | QDSP_MODULE_LPMTASK, | |
54 | QDSP_MODULE_QCAMTASK, | |
55 | QDSP_MODULE_MODMATHTASK, | |
56 | QDSP_MODULE_AUDPLAY2TASK, | |
57 | QDSP_MODULE_AUDPLAY3TASK, | |
58 | QDSP_MODULE_AUDPLAY4TASK, | |
59 | QDSP_MODULE_GRAPHICSTASK, | |
60 | QDSP_MODULE_MIDI, | |
61 | QDSP_MODULE_GAUDIO, | |
62 | QDSP_MODULE_VDEC_LP_MODE, | |
63 | QDSP_MODULE_MAX, | |
64 | } qdsp_module_type; | |
65 | ||
66 | #define QDSP_RTOS_MAX_TASK_ID 30U | |
67 | ||
68 | /* Table of modules indexed by task ID for the GAUDIO image */ | |
69 | static qdsp_module_type qdsp_gaudio_task_to_module_table[] = { | |
70 | QDSP_MODULE_KERNEL, | |
71 | QDSP_MODULE_AFETASK, | |
72 | QDSP_MODULE_MAX, | |
73 | QDSP_MODULE_MAX, | |
74 | QDSP_MODULE_MAX, | |
75 | QDSP_MODULE_MAX, | |
76 | QDSP_MODULE_MAX, | |
77 | QDSP_MODULE_MAX, | |
78 | QDSP_MODULE_MAX, | |
79 | QDSP_MODULE_AUDPPTASK, | |
80 | QDSP_MODULE_AUDPLAY0TASK, | |
81 | QDSP_MODULE_AUDPLAY1TASK, | |
82 | QDSP_MODULE_AUDPLAY2TASK, | |
83 | QDSP_MODULE_AUDPLAY3TASK, | |
84 | QDSP_MODULE_AUDPLAY4TASK, | |
85 | QDSP_MODULE_MAX, | |
86 | QDSP_MODULE_AUDRECTASK, | |
87 | QDSP_MODULE_AUDPREPROCTASK, | |
88 | QDSP_MODULE_MAX, | |
89 | QDSP_MODULE_GRAPHICSTASK, | |
90 | QDSP_MODULE_MAX, | |
91 | QDSP_MODULE_MAX, | |
92 | QDSP_MODULE_MAX, | |
93 | QDSP_MODULE_MAX, | |
94 | QDSP_MODULE_MAX, | |
95 | QDSP_MODULE_MAX, | |
96 | QDSP_MODULE_MAX, | |
97 | QDSP_MODULE_MAX, | |
98 | QDSP_MODULE_MAX, | |
99 | QDSP_MODULE_MAX, | |
100 | QDSP_MODULE_MAX, | |
101 | QDSP_MODULE_MAX, | |
102 | }; | |
103 | ||
104 | /* Queue offset table indexed by queue ID for the GAUDIO image */ | |
105 | static uint32_t qdsp_gaudio_queue_offset_table[] = { | |
106 | QDSP_RTOS_NO_QUEUE, /* QDSP_lpmCommandQueue */ | |
107 | 0x3f0, /* QDSP_mpuAfeQueue */ | |
108 | 0x420, /* QDSP_mpuGraphicsCmdQueue */ | |
109 | QDSP_RTOS_NO_QUEUE, /* QDSP_mpuModmathCmdQueue */ | |
110 | QDSP_RTOS_NO_QUEUE, /* QDSP_mpuVDecCmdQueue */ | |
111 | QDSP_RTOS_NO_QUEUE, /* QDSP_mpuVDecPktQueue */ | |
112 | QDSP_RTOS_NO_QUEUE, /* QDSP_mpuVEncCmdQueue */ | |
113 | QDSP_RTOS_NO_QUEUE, /* QDSP_rxMpuDecCmdQueue */ | |
114 | QDSP_RTOS_NO_QUEUE, /* QDSP_rxMpuDecPktQueue */ | |
115 | QDSP_RTOS_NO_QUEUE, /* QDSP_txMpuEncQueue */ | |
116 | 0x3f4, /* QDSP_uPAudPPCmd1Queue */ | |
117 | 0x3f8, /* QDSP_uPAudPPCmd2Queue */ | |
118 | 0x3fc, /* QDSP_uPAudPPCmd3Queue */ | |
119 | 0x40c, /* QDSP_uPAudPlay0BitStreamCtrlQueue */ | |
120 | 0x410, /* QDSP_uPAudPlay1BitStreamCtrlQueue */ | |
121 | 0x414, /* QDSP_uPAudPlay2BitStreamCtrlQueue */ | |
122 | 0x418, /* QDSP_uPAudPlay3BitStreamCtrlQueue */ | |
123 | 0x41c, /* QDSP_uPAudPlay4BitStreamCtrlQueue */ | |
124 | 0x400, /* QDSP_uPAudPreProcCmdQueue */ | |
125 | 0x408, /* QDSP_uPAudRecBitStreamQueue */ | |
126 | 0x404, /* QDSP_uPAudRecCmdQueue */ | |
127 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPJpegActionCmdQueue */ | |
128 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPJpegCfgCmdQueue */ | |
129 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPVocProcQueue */ | |
130 | QDSP_RTOS_NO_QUEUE, /* QDSP_vfeCommandQueue */ | |
131 | QDSP_RTOS_NO_QUEUE, /* QDSP_vfeCommandScaleQueue */ | |
132 | QDSP_RTOS_NO_QUEUE, /* QDSP_vfeCommandTableQueue */ | |
133 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPDiagQueue */ | |
134 | }; | |
135 | ||
136 | /* Table of modules indexed by task ID for the COMBO image */ | |
137 | static qdsp_module_type qdsp_combo_task_to_module_table[] = { | |
138 | QDSP_MODULE_KERNEL, | |
139 | QDSP_MODULE_AFETASK, | |
140 | QDSP_MODULE_VOCDECTASK, | |
141 | QDSP_MODULE_VOCENCTASK, | |
142 | QDSP_MODULE_VIDEOTASK, | |
143 | QDSP_MODULE_VIDEOENCTASK, | |
144 | QDSP_MODULE_VOICEPROCTASK, | |
145 | QDSP_MODULE_VFETASK, | |
146 | QDSP_MODULE_JPEGTASK, | |
147 | QDSP_MODULE_AUDPPTASK, | |
148 | QDSP_MODULE_AUDPLAY0TASK, | |
149 | QDSP_MODULE_AUDPLAY1TASK, | |
150 | QDSP_MODULE_MAX, | |
151 | QDSP_MODULE_MAX, | |
152 | QDSP_MODULE_MAX, | |
153 | QDSP_MODULE_LPMTASK, | |
154 | QDSP_MODULE_AUDRECTASK, | |
155 | QDSP_MODULE_AUDPREPROCTASK, | |
156 | QDSP_MODULE_MODMATHTASK, | |
157 | QDSP_MODULE_MAX, | |
158 | QDSP_MODULE_MAX, | |
159 | QDSP_MODULE_MAX, | |
160 | QDSP_MODULE_MAX, | |
161 | QDSP_MODULE_MAX, | |
162 | QDSP_MODULE_MAX, | |
163 | QDSP_MODULE_MAX, | |
164 | QDSP_MODULE_MAX, | |
165 | QDSP_MODULE_MAX, | |
166 | QDSP_MODULE_MAX, | |
167 | QDSP_MODULE_MAX, | |
168 | QDSP_MODULE_DIAGTASK, | |
169 | QDSP_MODULE_MAX, | |
170 | }; | |
171 | ||
172 | /* Queue offset table indexed by queue ID for the COMBO image */ | |
173 | static uint32_t qdsp_combo_queue_offset_table[] = { | |
174 | 0x714, /* QDSP_lpmCommandQueue */ | |
175 | 0x6bc, /* QDSP_mpuAfeQueue */ | |
176 | QDSP_RTOS_NO_QUEUE, /* QDSP_mpuGraphicsCmdQueue */ | |
177 | 0x6d0, /* QDSP_mpuModmathCmdQueue */ | |
178 | 0x6e8, /* QDSP_mpuVDecCmdQueue */ | |
179 | 0x6ec, /* QDSP_mpuVDecPktQueue */ | |
180 | 0x6e4, /* QDSP_mpuVEncCmdQueue */ | |
181 | 0x6c4, /* QDSP_rxMpuDecCmdQueue */ | |
182 | 0x6c8, /* QDSP_rxMpuDecPktQueue */ | |
183 | 0x6cc, /* QDSP_txMpuEncQueue */ | |
184 | 0x6f0, /* QDSP_uPAudPPCmd1Queue */ | |
185 | 0x6f4, /* QDSP_uPAudPPCmd2Queue */ | |
186 | 0x6f8, /* QDSP_uPAudPPCmd3Queue */ | |
187 | 0x708, /* QDSP_uPAudPlay0BitStreamCtrlQueue */ | |
188 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPAudPlay1BitStreamCtrlQueue */ | |
189 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPAudPlay2BitStreamCtrlQueue */ | |
190 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPAudPlay3BitStreamCtrlQueue */ | |
191 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPAudPlay4BitStreamCtrlQueue */ | |
192 | 0x6fc, /* QDSP_uPAudPreProcCmdQueue */ | |
193 | 0x704, /* QDSP_uPAudRecBitStreamQueue */ | |
194 | 0x700, /* QDSP_uPAudRecCmdQueue */ | |
195 | 0x710, /* QDSP_uPJpegActionCmdQueue */ | |
196 | 0x70c, /* QDSP_uPJpegCfgCmdQueue */ | |
197 | 0x6c0, /* QDSP_uPVocProcQueue */ | |
198 | 0x6d8, /* QDSP_vfeCommandQueue */ | |
199 | 0x6e0, /* QDSP_vfeCommandScaleQueue */ | |
200 | 0x6dc, /* QDSP_vfeCommandTableQueue */ | |
201 | 0x6d4, /* QDSP_uPDiagQueue */ | |
202 | }; | |
203 | ||
204 | /* Table of modules indexed by task ID for the QTV_LP image */ | |
205 | static qdsp_module_type qdsp_qtv_lp_task_to_module_table[] = { | |
206 | QDSP_MODULE_KERNEL, | |
207 | QDSP_MODULE_AFETASK, | |
208 | QDSP_MODULE_MAX, | |
209 | QDSP_MODULE_MAX, | |
210 | QDSP_MODULE_VIDEOTASK, | |
211 | QDSP_MODULE_MAX, | |
212 | QDSP_MODULE_MAX, | |
213 | QDSP_MODULE_MAX, | |
214 | QDSP_MODULE_MAX, | |
215 | QDSP_MODULE_AUDPPTASK, | |
216 | QDSP_MODULE_AUDPLAY0TASK, | |
217 | QDSP_MODULE_MAX, | |
218 | QDSP_MODULE_MAX, | |
219 | QDSP_MODULE_MAX, | |
220 | QDSP_MODULE_MAX, | |
221 | QDSP_MODULE_MAX, | |
222 | QDSP_MODULE_AUDRECTASK, | |
223 | QDSP_MODULE_AUDPREPROCTASK, | |
224 | QDSP_MODULE_MAX, | |
225 | QDSP_MODULE_MAX, | |
226 | QDSP_MODULE_MAX, | |
227 | QDSP_MODULE_MAX, | |
228 | QDSP_MODULE_MAX, | |
229 | QDSP_MODULE_MAX, | |
230 | QDSP_MODULE_MAX, | |
231 | QDSP_MODULE_MAX, | |
232 | QDSP_MODULE_MAX, | |
233 | QDSP_MODULE_MAX, | |
234 | QDSP_MODULE_MAX, | |
235 | QDSP_MODULE_MAX, | |
236 | QDSP_MODULE_MAX, | |
237 | QDSP_MODULE_MAX, | |
238 | }; | |
239 | ||
240 | /* Queue offset table indexed by queue ID for the QTV_LP image */ | |
241 | static uint32_t qdsp_qtv_lp_queue_offset_table[] = { | |
242 | QDSP_RTOS_NO_QUEUE, /* QDSP_lpmCommandQueue */ | |
243 | 0x3fe, /* QDSP_mpuAfeQueue */ | |
244 | QDSP_RTOS_NO_QUEUE, /* QDSP_mpuGraphicsCmdQueue */ | |
245 | QDSP_RTOS_NO_QUEUE, /* QDSP_mpuModmathCmdQueue */ | |
246 | 0x402, /* QDSP_mpuVDecCmdQueue */ | |
247 | 0x406, /* QDSP_mpuVDecPktQueue */ | |
248 | QDSP_RTOS_NO_QUEUE, /* QDSP_mpuVEncCmdQueue */ | |
249 | QDSP_RTOS_NO_QUEUE, /* QDSP_rxMpuDecCmdQueue */ | |
250 | QDSP_RTOS_NO_QUEUE, /* QDSP_rxMpuDecPktQueue */ | |
251 | QDSP_RTOS_NO_QUEUE, /* QDSP_txMpuEncQueue */ | |
252 | 0x40e, /* QDSP_uPAudPPCmd1Queue */ | |
253 | 0x412, /* QDSP_uPAudPPCmd2Queue */ | |
254 | 0x416, /* QDSP_uPAudPPCmd3Queue */ | |
255 | 0x422, /* QDSP_uPAudPlay0BitStreamCtrlQueue */ | |
256 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPAudPlay1BitStreamCtrlQueue */ | |
257 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPAudPlay2BitStreamCtrlQueue */ | |
258 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPAudPlay3BitStreamCtrlQueue */ | |
259 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPAudPlay4BitStreamCtrlQueue */ | |
260 | 0x40a, /* QDSP_uPAudPreProcCmdQueue */ | |
261 | 0x41e, /* QDSP_uPAudRecBitStreamQueue */ | |
262 | 0x41a, /* QDSP_uPAudRecCmdQueue */ | |
263 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPJpegActionCmdQueue */ | |
264 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPJpegCfgCmdQueue */ | |
265 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPVocProcQueue */ | |
266 | QDSP_RTOS_NO_QUEUE, /* QDSP_vfeCommandQueue */ | |
267 | QDSP_RTOS_NO_QUEUE, /* QDSP_vfeCommandScaleQueue */ | |
268 | QDSP_RTOS_NO_QUEUE, /* QDSP_vfeCommandTableQueue */ | |
269 | QDSP_RTOS_NO_QUEUE, /* QDSP_uPDiagQueue */ | |
270 | }; | |
271 | ||
272 | /* Tables to convert tasks to modules */ | |
273 | static qdsp_module_type *qdsp_task_to_module[] = { | |
274 | qdsp_combo_task_to_module_table, | |
275 | qdsp_gaudio_task_to_module_table, | |
276 | qdsp_qtv_lp_task_to_module_table, | |
277 | }; | |
278 | ||
279 | /* Tables to retrieve queue offsets */ | |
280 | static uint32_t *qdsp_queue_offset_table[] = { | |
281 | qdsp_combo_queue_offset_table, | |
282 | qdsp_gaudio_queue_offset_table, | |
283 | qdsp_qtv_lp_queue_offset_table, | |
284 | }; | |
285 | ||
286 | #define QDSP_MODULE(n, clkname, clkrate, verify_cmd_func, patch_event_func) \ | |
287 | { .name = #n, .pdev_name = "adsp_" #n, .id = QDSP_MODULE_##n, \ | |
288 | .clk_name = clkname, .clk_rate = clkrate, \ | |
289 | .verify_cmd = verify_cmd_func, .patch_event = patch_event_func } | |
290 | ||
291 | static struct adsp_module_info module_info[] = { | |
292 | QDSP_MODULE(AUDPLAY0TASK, NULL, 0, NULL, NULL), | |
293 | QDSP_MODULE(AUDPPTASK, NULL, 0, NULL, NULL), | |
294 | QDSP_MODULE(AUDRECTASK, NULL, 0, NULL, NULL), | |
295 | QDSP_MODULE(AUDPREPROCTASK, NULL, 0, NULL, NULL), | |
296 | QDSP_MODULE(VFETASK, "vfe_clk", 0, adsp_vfe_verify_cmd, | |
297 | adsp_vfe_patch_event), | |
298 | QDSP_MODULE(QCAMTASK, NULL, 0, NULL, NULL), | |
299 | QDSP_MODULE(LPMTASK, NULL, 0, adsp_lpm_verify_cmd, NULL), | |
300 | QDSP_MODULE(JPEGTASK, "vdc_clk", 0, adsp_jpeg_verify_cmd, | |
301 | adsp_jpeg_patch_event), | |
302 | QDSP_MODULE(VIDEOTASK, "vdc_clk", 96000000, | |
303 | adsp_video_verify_cmd, NULL), | |
304 | QDSP_MODULE(VDEC_LP_MODE, NULL, 0, NULL, NULL), | |
305 | QDSP_MODULE(VIDEOENCTASK, "vdc_clk", 96000000, | |
306 | adsp_videoenc_verify_cmd, NULL), | |
307 | }; | |
308 | ||
309 | int adsp_init_info(struct adsp_info *info) | |
310 | { | |
311 | info->send_irq = 0x00c00200; | |
312 | info->read_ctrl = 0x00400038; | |
313 | info->write_ctrl = 0x00400034; | |
314 | ||
315 | info->max_msg16_size = 193; | |
316 | info->max_msg32_size = 8; | |
317 | ||
318 | info->max_task_id = 16; | |
319 | info->max_module_id = QDSP_MODULE_MAX - 1; | |
320 | info->max_queue_id = QDSP_QUEUE_MAX; | |
321 | info->max_image_id = 2; | |
322 | info->queue_offset = qdsp_queue_offset_table; | |
323 | info->task_to_module = qdsp_task_to_module; | |
324 | ||
325 | info->module_count = ARRAY_SIZE(module_info); | |
326 | info->module = module_info; | |
327 | return 0; | |
328 | } |