comparison L1/dyn_dwl_cfile/l1_dyn_dwl_init.c @ 21:dfc7b0bc468a

L1/dyn_dwl_cfile/*.c: initial import from tcs211-l1-reconst
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 10 Jun 2016 08:59:53 +0000
parents 75a11d740a02
children fc33e796507a
comparison
equal deleted inserted replaced
20:5fd4e7669c93 21:dfc7b0bc468a
4 * 4 *
5 * Filename l1_dyn_dwl_init.c 5 * Filename l1_dyn_dwl_init.c
6 * Copyright 2004 (C) Texas Instruments 6 * Copyright 2004 (C) Texas Instruments
7 * 7 *
8 ************* Revision Controle System Header *************/ 8 ************* Revision Controle System Header *************/
9 #include "config.h" 9 #include "nucleus.h"
10 #include "l1_confg.h" 10 #include "l1_confg.h"
11 #include "sys_types.h" 11 #include "sys_types.h"
12 #include "../../riviera/rv/rv_general.h"
13 #include "../../nucleus/nucleus.h"
14 #include "l1_types.h" 12 #include "l1_types.h"
15 #include "l1audio_const.h" 13 #include "l1audio_const.h"
16 #include "l1audio_cust.h" 14 #include "l1audio_cust.h"
17 #include "l1audio_defty.h" 15 #include "l1audio_defty.h"
18 #include "l1_const.h" 16 #include "l1_const.h"
37 #if (L1_AAC == 1) 35 #if (L1_AAC == 1)
38 #include "l1aac_defty.h" 36 #include "l1aac_defty.h"
39 #endif //L1_AAC 37 #endif //L1_AAC
40 38
41 #include "l1_defty.h" 39 #include "l1_defty.h"
42 #include "../../gpf/inc/cust_os.h" 40 #include "cust_os.h"
43 /* #include "nu_main.h" */ 41 /* #include "nu_main.h" */
44 #include "l1audio_signa.h" 42 #include "l1audio_signa.h"
45 #include "l1_varex.h" 43 #include "l1_varex.h"
46 #include "l1_macro.h" 44 #include "l1_macro.h"
47 #include "l1_trace.h" 45 #include "l1_trace.h"
109 /*-------------------------------------------------------*/ 107 /*-------------------------------------------------------*/
110 108
111 void l1_dyn_dwnld_initialize_var() 109 void l1_dyn_dwnld_initialize_var()
112 { 110 {
113 UWORD16 i; 111 UWORD16 i;
114
115 112
116 /* Init Dynamic Download NDB */ 113 /* Init Dynamic Download NDB */
117 dyn_dwl_ndb=(T_DYN_DWNLD_MCU_DSP *)API_address_dsp2mcu(C_DYN_DWNLD_API_BASE_ADDRESS); 114 dyn_dwl_ndb=(T_DYN_DWNLD_MCU_DSP *)API_address_dsp2mcu(C_DYN_DWNLD_API_BASE_ADDRESS);
118 #if (CODE_VERSION == SIMULATION) 115 #if (CODE_VERSION == SIMULATION)
119 { 116 {
128 125
129 if(l1s_dsp_com.dsp_ndb_ptr->d_max_background<(C_BGD_DSP_DYN_DWNLD+1)) 126 if(l1s_dsp_com.dsp_ndb_ptr->d_max_background<(C_BGD_DSP_DYN_DWNLD+1))
130 l1s_dsp_com.dsp_ndb_ptr->d_max_background=(API)(C_BGD_DSP_DYN_DWNLD+1); 127 l1s_dsp_com.dsp_ndb_ptr->d_max_background=(API)(C_BGD_DSP_DYN_DWNLD+1);
131 128
132 dyn_dwnld_copy_MCU_vect[0] = gprs_patch_array; 129 dyn_dwnld_copy_MCU_vect[0] = gprs_patch_array;
130 l1_set_dyn_dwnld_install_vect(size_vect,dyn_dwnld_address_vect,dyn_dwnld_crc_vect, gprs_patch_array, 0);
131
133 dyn_dwnld_copy_MCU_vect[1] = amr_sch_patch_array; 132 dyn_dwnld_copy_MCU_vect[1] = amr_sch_patch_array;
133 l1_set_dyn_dwnld_install_vect(size_vect,dyn_dwnld_address_vect,dyn_dwnld_crc_vect, amr_sch_patch_array, 1);
134
134 #if (L1_GTT == 1) 135 #if (L1_GTT == 1)
135 dyn_dwnld_copy_MCU_vect[2] = tty_patch_array; 136 dyn_dwnld_copy_MCU_vect[2] = tty_patch_array;
137 l1_set_dyn_dwnld_install_vect(size_vect,dyn_dwnld_address_vect,dyn_dwnld_crc_vect, tty_patch_array, 2);
136 #endif 138 #endif
139
137 #if (MELODY_E2 == 1) 140 #if (MELODY_E2 == 1)
138 dyn_dwnld_copy_MCU_vect[3] = amr_mms_patch_array; 141 dyn_dwnld_copy_MCU_vect[3] = amr_mms_patch_array;
142 l1_set_dyn_dwnld_install_vect(size_vect,dyn_dwnld_address_vect,dyn_dwnld_crc_vect, amr_mms_patch_array, 3);
139 dyn_dwnld_copy_MCU_vect[4] = e2_patch_array; 143 dyn_dwnld_copy_MCU_vect[4] = e2_patch_array;
144 l1_set_dyn_dwnld_install_vect(size_vect,dyn_dwnld_address_vect,dyn_dwnld_crc_vect, e2_patch_array, 4);
140 #endif 145 #endif
141
142 for(i=0;i<MAX_NUM_OF_PATCH_IDS;i++)
143 {
144 if (dyn_dwnld_copy_MCU_vect[i] != 0)
145 {
146 l1_set_dyn_dwnld_install_vect(size_vect,dyn_dwnld_address_vect,dyn_dwnld_crc_vect,dyn_dwnld_copy_MCU_vect[i],i);
147 }
148 }
149 146
150 /*---------- Set L1A globals at phone init ----------------------------*/ 147 /*---------- Set L1A globals at phone init ----------------------------*/
151 l1a.dyn_dwnld.melody0_E2_flag_activated = FALSE; 148 l1a.dyn_dwnld.melody0_E2_flag_activated = FALSE;
152 l1a.dyn_dwnld.melody1_E2_flag_activated = FALSE; 149 l1a.dyn_dwnld.melody1_E2_flag_activated = FALSE;
150 l1a.dyn_dwnld.dedicated_stop_flag = FALSE;
151
152 l1a.dyn_dwnld.num_patches_installed = 2;
153 l1a.dyn_dwnld.state = 0; 153 l1a.dyn_dwnld.state = 0;
154 154 l1a.dyn_dwnld.dsp_trace_level_copy = 0;
155 155
156 l1a.dyn_dwnld.num_patches_installed = 0; 156 l1a.dyn_dwnld.patch_id[0] = GPRS_PATCH;
157 157 l1a.dyn_dwnld.patch_id[1] = AMR_MMS_PATCH;
158 l1a.dyn_dwnld.patch_id[0] = 0xFFFF; //omaps00090550 158
159 for (i=l1a.dyn_dwnld.num_patches_installed;i<MAX_NUM_OF_PATCH_IDS;i++)
160 {
161 l1a.dyn_dwnld.patch_id[i] = 0xFFFF; //omaps00090550 ;
162 l1a.dyn_dwnld.next_patch_id[i] = 0xFFFF; //omaps00090550 ;
163 }
164 for (i=0;i<MAX_NUM_OF_SEMAPHORES;i++)
165 l1a.dyn_dwnld.semaphore_vect[i] = GREEN;
166
167 l1a.dyn_dwnld.trace_flag_blocked = FALSE;
168
169 l1a.dyn_dwnld.waiting_patch_fifo.num_of_elem = 0;
170 for (i=0;i<MAX_NUM_OF_PATCH_IDS;i++)
171 l1a.dyn_dwnld.waiting_patch_fifo.signal_code_vect[i] = 0;
159 172
160 /**************************************************/ 173 /**************************************************/
161 174
162 // Compute number of current primitives defined via compilation switch 175 // Compute number of current primitives defined via compilation switch
163 l1a.dyn_dwnld.num_of_primitives = 2; 176 l1a.dyn_dwnld.num_of_primitives = 2;
168 // Two primitives for MELODY E2 181 // Two primitives for MELODY E2
169 // FreeCalypso: apparently there are 3 in TCS211 182 // FreeCalypso: apparently there are 3 in TCS211
170 l1a.dyn_dwnld.num_of_primitives += 3; 183 l1a.dyn_dwnld.num_of_primitives += 3;
171 #endif // MELODY_E2 184 #endif // MELODY_E2
172 185
173 for (i=l1a.dyn_dwnld.num_patches_installed;i<MAX_NUM_OF_PATCH_IDS;i++) 186
174 {
175 l1a.dyn_dwnld.patch_id[i] = 0xFFFF; //omaps00090550 ;
176 l1a.dyn_dwnld.next_patch_id[i] = 0xFFFF; //omaps00090550 ;
177 }
178 for (i=0;i<MAX_NUM_OF_SEMAPHORES;i++)
179 l1a.dyn_dwnld.semaphore_vect[i] = GREEN;
180
181
182 l1a.dyn_dwnld.waiting_patch_fifo.num_of_elem = 0;
183 for (i=0;i<MAX_NUM_OF_PATCH_IDS;i++)
184 l1a.dyn_dwnld.waiting_patch_fifo.signal_code_vect[i] = 0;
185
186 /*---------------------------------------------------------------------*/ 187 /*---------------------------------------------------------------------*/
187 188
188 /*---------- Set L1S globals at phone init ----------------------------*/ 189 /*---------- Set L1S globals at phone init ----------------------------*/
189 190
190 l1s.dyn_dwnld_state=0; 191 l1s.dyn_dwnld_state=0;