blob: 40263673eb2b10381bd8a017345c0c696aec9a7b [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/*
2 * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#include "adsp.h"
16
17/* Firmware modules */
18#define QDSP_MODULE_KERNEL 0x0106dd4e
19#define QDSP_MODULE_AFETASK 0x0106dd6f
20#define QDSP_MODULE_AUDPLAY0TASK 0x0106dd70
21#define QDSP_MODULE_AUDPLAY1TASK 0x0106dd71
22#define QDSP_MODULE_AUDPPTASK 0x0106dd72
23#define QDSP_MODULE_VIDEOTASK 0x0106dd73
24#define QDSP_MODULE_VIDEO_AAC_VOC 0x0106dd74
25#define QDSP_MODULE_PCM_DEC 0x0106dd75
26#define QDSP_MODULE_AUDIO_DEC_MP3 0x0106dd76
27#define QDSP_MODULE_AUDIO_DEC_AAC 0x0106dd77
28#define QDSP_MODULE_AUDIO_DEC_WMA 0x0106dd78
29#define QDSP_MODULE_HOSTPCM 0x0106dd79
30#define QDSP_MODULE_DTMF 0x0106dd7a
31#define QDSP_MODULE_AUDRECTASK 0x0106dd7b
32#define QDSP_MODULE_AUDPREPROCTASK 0x0106dd7c
33#define QDSP_MODULE_SBC_ENC 0x0106dd7d
34#define QDSP_MODULE_VOC_UMTS 0x0106dd9a
35#define QDSP_MODULE_VOC_CDMA 0x0106dd98
36#define QDSP_MODULE_VOC_PCM 0x0106dd7f
37#define QDSP_MODULE_VOCENCTASK 0x0106dd80
38#define QDSP_MODULE_VOCDECTASK 0x0106dd81
39#define QDSP_MODULE_VOICEPROCTASK 0x0106dd82
40#define QDSP_MODULE_VIDEOENCTASK 0x0106dd83
41#define QDSP_MODULE_VFETASK 0x0106dd84
42#define QDSP_MODULE_WAV_ENC 0x0106dd85
43#define QDSP_MODULE_AACLC_ENC 0x0106dd86
44#define QDSP_MODULE_VIDEO_AMR 0x0106dd87
45#define QDSP_MODULE_VOC_AMR 0x0106dd88
46#define QDSP_MODULE_VOC_EVRC 0x0106dd89
47#define QDSP_MODULE_VOC_13K 0x0106dd8a
48#define QDSP_MODULE_VOC_FGV 0x0106dd8b
49#define QDSP_MODULE_DIAGTASK 0x0106dd8c
50#define QDSP_MODULE_JPEGTASK 0x0106dd8d
51#define QDSP_MODULE_LPMTASK 0x0106dd8e
52#define QDSP_MODULE_QCAMTASK 0x0106dd8f
53#define QDSP_MODULE_MODMATHTASK 0x0106dd90
54#define QDSP_MODULE_AUDPLAY2TASK 0x0106dd91
55#define QDSP_MODULE_AUDPLAY3TASK 0x0106dd92
56#define QDSP_MODULE_AUDPLAY4TASK 0x0106dd93
57#define QDSP_MODULE_GRAPHICSTASK 0x0106dd94
58#define QDSP_MODULE_MIDI 0x0106dd95
59#define QDSP_MODULE_GAUDIO 0x0106dd96
60#define QDSP_MODULE_VDEC_LP_MODE 0x0106dd97
61#define QDSP_MODULE_VIDEO_AAC_VOC_TURBO 0x01089f77
62#define QDSP_MODULE_VIDEO_AMR_TURBO 0x01089f78
63#define QDSP_MODULE_WM_TURBO_MODE 0x01089f79
64#define QDSP_MODULE_VDEC_LP_MODE_TURBO 0x01089f7a
65#define QDSP_MODULE_AUDREC0TASK 0x0109696f
66#define QDSP_MODULE_AUDREC1TASK 0x01096970
67#define QDSP_MODULE_AUDREC2TASK 0x010a2f59
68#define QDSP_MODULE_MAX 0x7fffffff
69
70 /* DO NOT USE: Force this enum to be a 32bit type to improve speed */
71#define QDSP_MODULE_32BIT_DUMMY 0x10000
72
73static uint32_t *qdsp_task_to_module[IMG_MAX];
74static uint32_t *qdsp_queue_offset_table[IMG_MAX];
75
76#define QDSP_MODULE(n, clkname, clkrate, verify_cmd_func, patch_event_func) \
77 { .name = #n, .pdev_name = "adsp_" #n, .id = QDSP_MODULE_##n, \
78 .clk_name = clkname, .clk_rate = clkrate, \
79 .verify_cmd = verify_cmd_func, .patch_event = patch_event_func }
80
81static struct adsp_module_info module_info[] = {
82 QDSP_MODULE(AUDPLAY0TASK, NULL, 0, NULL, NULL),
83 QDSP_MODULE(AUDPLAY1TASK, NULL, 0, NULL, NULL),
84 QDSP_MODULE(AUDPLAY2TASK, NULL, 0, NULL, NULL),
85 QDSP_MODULE(AUDPLAY3TASK, NULL, 0, NULL, NULL),
86 QDSP_MODULE(AUDPPTASK, NULL, 0, NULL, NULL),
87 QDSP_MODULE(AUDPREPROCTASK, NULL, 0, NULL, NULL),
88 QDSP_MODULE(AFETASK , NULL, 0, NULL, NULL),
89 QDSP_MODULE(AUDREC0TASK, NULL, 0, NULL, NULL),
90 QDSP_MODULE(AUDREC1TASK, NULL, 0, NULL, NULL),
91 QDSP_MODULE(AUDREC2TASK, NULL, 0, NULL, NULL),
92};
93
94int adsp_init_info(struct adsp_info *info)
95{
96 uint32_t img_num;
97
98 info->send_irq = 0x00c00200;
99 info->read_ctrl = 0x00400038;
100 info->write_ctrl = 0x00400034;
101
102 info->max_msg16_size = 193;
103 info->max_msg32_size = 8;
104 for (img_num = 0; img_num < IMG_MAX; img_num++)
105 qdsp_queue_offset_table[img_num] =
106 &info->init_info_ptr->queue_offsets[img_num][0];
107
108 for (img_num = 0; img_num < IMG_MAX; img_num++)
109 qdsp_task_to_module[img_num] =
110 &info->init_info_ptr->task_to_module_tbl[img_num][0];
111 info->max_task_id = ENTRIES_MAX;
112 info->max_module_id = QDSP_MODULE_MAX - 1;
113 info->max_queue_id = QDSP_MAX_NUM_QUEUES;
114 info->max_image_id = 0;
115 info->queue_offset = qdsp_queue_offset_table;
116 info->task_to_module = qdsp_task_to_module;
117
118 info->module_count = ARRAY_SIZE(module_info);
119 info->module = module_info;
120 return 0;
121}