1 /* arch/arm/mach-msm/qdsp5/adsp_6225.h
3 * Copyright (c) 2008 QUALCOMM Incorporated.
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.
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.
18 /* Firmware modules */
22 QDSP_MODULE_AUDPLAY0TASK
,
23 QDSP_MODULE_AUDPLAY1TASK
,
24 QDSP_MODULE_AUDPPTASK
,
25 QDSP_MODULE_VIDEOTASK
,
26 QDSP_MODULE_VIDEO_AAC_VOC
,
28 QDSP_MODULE_AUDIO_DEC_MP3
,
29 QDSP_MODULE_AUDIO_DEC_AAC
,
30 QDSP_MODULE_AUDIO_DEC_WMA
,
33 QDSP_MODULE_AUDRECTASK
,
34 QDSP_MODULE_AUDPREPROCTASK
,
39 QDSP_MODULE_VOCENCTASK
,
40 QDSP_MODULE_VOCDECTASK
,
41 QDSP_MODULE_VOICEPROCTASK
,
42 QDSP_MODULE_VIDEOENCTASK
,
45 QDSP_MODULE_AACLC_ENC
,
46 QDSP_MODULE_VIDEO_AMR
,
55 QDSP_MODULE_MODMATHTASK
,
56 QDSP_MODULE_AUDPLAY2TASK
,
57 QDSP_MODULE_AUDPLAY3TASK
,
58 QDSP_MODULE_AUDPLAY4TASK
,
59 QDSP_MODULE_GRAPHICSTASK
,
62 QDSP_MODULE_VDEC_LP_MODE
,
66 #define QDSP_RTOS_MAX_TASK_ID 30U
68 /* Table of modules indexed by task ID for the GAUDIO image */
69 static qdsp_module_type qdsp_gaudio_task_to_module_table
[] = {
79 QDSP_MODULE_AUDPPTASK
,
80 QDSP_MODULE_AUDPLAY0TASK
,
81 QDSP_MODULE_AUDPLAY1TASK
,
82 QDSP_MODULE_AUDPLAY2TASK
,
83 QDSP_MODULE_AUDPLAY3TASK
,
84 QDSP_MODULE_AUDPLAY4TASK
,
86 QDSP_MODULE_AUDRECTASK
,
87 QDSP_MODULE_AUDPREPROCTASK
,
89 QDSP_MODULE_GRAPHICSTASK
,
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 */
136 /* Table of modules indexed by task ID for the COMBO image */
137 static qdsp_module_type qdsp_combo_task_to_module_table
[] = {
140 QDSP_MODULE_VOCDECTASK
,
141 QDSP_MODULE_VOCENCTASK
,
142 QDSP_MODULE_VIDEOTASK
,
143 QDSP_MODULE_VIDEOENCTASK
,
144 QDSP_MODULE_VOICEPROCTASK
,
146 QDSP_MODULE_JPEGTASK
,
147 QDSP_MODULE_AUDPPTASK
,
148 QDSP_MODULE_AUDPLAY0TASK
,
149 QDSP_MODULE_AUDPLAY1TASK
,
154 QDSP_MODULE_AUDRECTASK
,
155 QDSP_MODULE_AUDPREPROCTASK
,
156 QDSP_MODULE_MODMATHTASK
,
168 QDSP_MODULE_DIAGTASK
,
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 */
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
[] = {
210 QDSP_MODULE_VIDEOTASK
,
215 QDSP_MODULE_AUDPPTASK
,
216 QDSP_MODULE_AUDPLAY0TASK
,
222 QDSP_MODULE_AUDRECTASK
,
223 QDSP_MODULE_AUDPREPROCTASK
,
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 */
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
,
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
,
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 }
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
),
309 int adsp_init_info(struct adsp_info
*info
)
311 info
->send_irq
= 0x00c00200;
312 info
->read_ctrl
= 0x00400038;
313 info
->write_ctrl
= 0x00400034;
315 info
->max_msg16_size
= 193;
316 info
->max_msg32_size
= 8;
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
;
325 info
->module_count
= ARRAY_SIZE(module_info
);
326 info
->module
= module_info
;