annotate gsm-fw/L1/dyn_dwl_cfile/l1_dyn_dwl_func.c @ 1030:194967e11b2b

fc-shell: tch record and tch play reworked for libgsm-compatible file format
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 31 May 2016 18:39:06 +0000
parents 48969469d961
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
925
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 /************* Revision Controle System Header *************
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 * GSM Layer 1 software
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 * L1_DYN_DWL_FUNC.C
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 *
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5 * Filename l1_dyn_dwl_func.c
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 * Copyright 2004 (C) Texas Instruments
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 *
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 ************* Revision Controle System Header *************/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10 #include <stdio.h>
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 #include <string.h>
927
48969469d961 gsm-fw: l1_dyn_dwl code compiles and links
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 925
diff changeset
12 #include "config.h"
925
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 #include "l1_confg.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14 #include "l1_types.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15 #include "l1_const.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16 #include "l1_signa.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17 #include "sys_types.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 #if(L1_DYN_DSP_DWNLD == 1)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20 #include "l1_dyn_dwl_const.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 #include "l1_dyn_dwl_proto.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 #include "l1_dyn_dwl_defty.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 #if TESTMODE
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 #include "l1tm_defty.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 #if (AUDIO_TASK == 1)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28 #include "l1audio_const.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29 #include "l1audio_cust.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30 #include "l1audio_defty.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
31 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 #if (L1_GTT == 1)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 #include "l1gtt_const.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 #include "l1gtt_defty.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 #if (L1_MP3 == 1)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37 #include "l1mp3_defty.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 #endif //L1_MP3
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39 #if (L1_MIDI == 1)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 #include "l1midi_defty.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 #include "l1_defty.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 #include "l1_varex.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 #include "l1_macro.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
47 #if (L1_DYN_DSP_DWNLD == 1)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
48 #ifndef NULL
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
49 #define NULL 0
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
50 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
51
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52 extern T_DYN_DWNLD_MCU_DSP *dyn_dwl_ndb;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53 #if (CODE_VERSION == SIMULATION)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
54 extern T_DYN_DWNLD_MCU_DSP dyn_dwl_ndb_sim;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
55 extern UWORD16 dwnld_area_array[SIZE_DWNLD_AREA_SIMU];
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56 #endif // CODE_VERSION == SIMULATION
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
57
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
60 /* l1_initialize_patch_parameters */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61 /*------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
63 /* Parameters : */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 /* Return : size of the patch */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
66 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67 /* Description : Initialize patch parameters and returns the size of the patch*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
70 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
71
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
72 UWORD16 l1_initialize_patch_parameters(void)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
73 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
74 UWORD16 patch_size = 0;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
75
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
76 /* Initialize download patch parameters */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
77 l1_apihisr.dyn_dwnld.running_source_pointer = l1a_apihisr_com.dyn_dwnld.copy_parameters.start_MCU_copy_address[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter];
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
78 patch_size = l1a_apihisr_com.dyn_dwnld.copy_parameters.size_array[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter];
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
79 dyn_dwl_ndb->d_api_dwl_crc = 0x0;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
80 return patch_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
81 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
82
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
83 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
84 /* l1_set_uninstall_parameters */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
85 /*------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
86 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
87 /* Parameters : void */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
88 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
89 /* Return : void */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
90 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
91 /* Description : Set uninstall parameters */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
92 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
93 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
94 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
95
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
96 void l1_set_uninstall_parameters(void)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
97 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
98 /* Set next uninstall adress (pointer incremented) */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
99 dyn_dwl_ndb->d_api_dwl_function_address[0] = (API) (l1a_apihisr_com.dyn_dwnld.uninstall_parameters.address[l1a_apihisr_com.dyn_dwnld.uninstall_parameters.num_of_elem - l1_apihisr.dyn_dwnld.uninstall_counter] & 0x0000FFFF);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
100 dyn_dwl_ndb->d_api_dwl_function_address[1] = (API) ((l1a_apihisr_com.dyn_dwnld.uninstall_parameters.address[l1a_apihisr_com.dyn_dwnld.uninstall_parameters.num_of_elem - l1_apihisr.dyn_dwnld.uninstall_counter] >> 16) & 0x0000FFFF);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
101
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
102 /* Set uninstall command */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
103 dyn_dwl_ndb->d_api_dwl_download_ctrl = (API) C_DWL_DOWNLOAD_CTRL_UNINSTALL;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
104 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
105
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
106 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
107 /* l1_initialize_pointers_for_copy */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
108 /*------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
109 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
110 /* Parameters : address of source and destination pointer */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
111 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
112 /* Return : source and destination address modified by reference */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
113 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 /* Description : Initialize the pointers for the copy */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
115 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
116 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 void l1_initialize_pointers_for_copy(UWORD16 **pp_dest_mcu, UWORD16 **pp_src_mcu)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121 /* BEGIN: Initialize download area parameters at start download area */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122 dyn_dwl_ndb->d_api_dwl_write_pointer = l1a_apihisr_com.dyn_dwnld.copy_parameters.start_of_dwnld_area - 1; // correction
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
123
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 /* Initialize pointers */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
125 #if (CODE_VERSION == SIMULATION)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
126 *pp_dest_mcu = (UWORD16 *) dwnld_area_array;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
127 #else
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
128 *pp_dest_mcu = (UWORD16 *) API_address_dsp2mcu(l1a_apihisr_com.dyn_dwnld.copy_parameters.start_of_dwnld_area);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
129 #endif // CODE_VERSION == SIMULATION
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
130
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
131 *pp_src_mcu = (UWORD16 *) l1_apihisr.dyn_dwnld.running_source_pointer;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
132 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
133
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
134 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
135 /* l1_copy_till_the_end_of_the_patch_and_update_write_pointer */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
136 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
137 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
138 /* Parameters : size of the patch, source and destination pointer */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
139 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
140 /* Return : none */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
141 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
142 /* Description : Copy until the end of the patch is reached */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
143 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
144 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
145 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
146
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
147 void l1_copy_till_the_end_of_the_patch_and_update_write_pointer(UWORD16 tmp_patch_size, UWORD16* p_dest_mcu, UWORD16* p_src_mcu)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
148 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
149 while (tmp_patch_size > NUM_WORDS_COPY_API)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
150 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
151 l1_memcpy_16bit(p_dest_mcu,p_src_mcu, NUM_WORDS_COPY_API*sizeof(UWORD16));
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
152 p_dest_mcu += NUM_WORDS_COPY_API;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
153 p_src_mcu += NUM_WORDS_COPY_API;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
154 tmp_patch_size -= NUM_WORDS_COPY_API;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
155 dyn_dwl_ndb->d_api_dwl_write_pointer += NUM_WORDS_COPY_API;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
156 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
157 if (tmp_patch_size != 0)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
158 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
159 l1_memcpy_16bit(p_dest_mcu,p_src_mcu, tmp_patch_size*sizeof(UWORD16));
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
160 dyn_dwl_ndb->d_api_dwl_write_pointer += tmp_patch_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
161 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
162 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
163
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
164 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
165 /* l1_copy_till_end_of_dwnld_area_and_update_write_pointer */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
166 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
167 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
168 /* Parameters : address of size of the patch, size of download area, */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
169 /* addresses of source pointer, destination pointer */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
170 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
171 /* Return : source pointer and size modified by reference */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
172 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
173 /* Description : Copy until the end of download area is reached */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
174 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
175 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
176 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
177
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
178 void l1_copy_till_end_of_dwnld_area_and_update_write_pointer(UWORD16 tmp_dwnld_area_size,UWORD16 *p_dest_mcu, UWORD16 *p_tmp_patch_size, UWORD16 **pp_src_mcu)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
179 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
180 UWORD16 tmp_patch_size = *p_tmp_patch_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
181 UWORD16 *p_src_mcu = (UWORD16 *)*pp_src_mcu;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
182
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
183 while (tmp_dwnld_area_size > NUM_WORDS_COPY_API)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
184 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
185 l1_memcpy_16bit(p_dest_mcu,p_src_mcu, NUM_WORDS_COPY_API*sizeof(UWORD16));
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
186 p_dest_mcu += NUM_WORDS_COPY_API;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
187 p_src_mcu += NUM_WORDS_COPY_API;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
188 tmp_patch_size -= NUM_WORDS_COPY_API;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
189 tmp_dwnld_area_size -= NUM_WORDS_COPY_API;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
190 dyn_dwl_ndb->d_api_dwl_write_pointer += NUM_WORDS_COPY_API;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
191 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
192
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
193 if (tmp_dwnld_area_size > 0)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
194 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
195 l1_memcpy_16bit(p_dest_mcu,p_src_mcu, tmp_dwnld_area_size*sizeof(UWORD16));
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
196 p_src_mcu += tmp_dwnld_area_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
197 tmp_patch_size -= tmp_dwnld_area_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
198 dyn_dwl_ndb->d_api_dwl_write_pointer += tmp_dwnld_area_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
199 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
200 *pp_src_mcu = (UWORD16 *) p_src_mcu;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
201 *p_tmp_patch_size = tmp_patch_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
202 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
203
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
204 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
205 /* l1_copy_first_N_words */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
206 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
207 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
208 /* Parameters : address of size of the patch, address of size of download area,*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
209 /* addresses of source pointer, address of destination pointer */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
210 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
211 /* Return : source and destination pointer modified by reference */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
212 /* size of download area and patch area modified by reference */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
213 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
214 /* Description : Copy the min(N, remaining size of the patch) at the beginning */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
215 /* download area */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
216 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
217 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
218 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
219
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
220 BOOL l1_copy_first_N_words (UWORD16 *dwnld_area_size_p, UWORD16 *patch_area_size_p, UWORD16 **pp_dest_mcu, UWORD16 **pp_src_mcu)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
221 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
222 BOOL return_flag;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
223 UWORD16 num_words_interrupt;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
224 UWORD16 tmp_patch_size = *patch_area_size_p;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
225 UWORD16 tmp_dwnld_area_size = *dwnld_area_size_p;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
226 UWORD16 *p_dest_mcu =(UWORD16 *)*pp_dest_mcu;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
227 UWORD16 *p_src_mcu = (UWORD16 *)*pp_src_mcu;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
228
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
229 /* Copy first N words and generate API interrupt*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
230 if (tmp_patch_size > NUM_WORDS_COPY_API)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
231 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
232 num_words_interrupt = NUM_WORDS_COPY_API;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
233 return_flag = TRUE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
234 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
235 else
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
236 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
237 num_words_interrupt = tmp_patch_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
238 return_flag = FALSE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
239 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
240
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
241 l1_memcpy_16bit(p_dest_mcu,p_src_mcu, num_words_interrupt*sizeof(UWORD16));
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
242
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
243 p_dest_mcu += num_words_interrupt;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
244 p_src_mcu += num_words_interrupt;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
245
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
246 tmp_patch_size -= num_words_interrupt;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
247 tmp_dwnld_area_size -= num_words_interrupt;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
248
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
249 dyn_dwl_ndb->d_api_dwl_write_pointer+=num_words_interrupt;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
250
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
251 *patch_area_size_p = tmp_patch_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
252 *dwnld_area_size_p = tmp_dwnld_area_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
253 *pp_dest_mcu = (UWORD16 *)p_dest_mcu;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
254 *pp_src_mcu = (UWORD16 *)p_src_mcu ;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
255
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
256 return return_flag;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
257 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
258
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
259 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
260 /* l1_initialize_download_area_parameters */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
261 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
262 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
263 /* Parameters : none */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
264 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
265 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
266 /* Return : download area size */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
267 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
268 /* Description : Initialize download area: all the parameters */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
269 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
270 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
271 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
272
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
273 UWORD16 l1_initialize_download_area_parameters(void)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
274 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
275 UWORD16 dwnld_area_size = 0;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
276
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
277 /* Set download address and size in API-DSP com */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
278 dyn_dwl_ndb->d_api_dwl_function_address[0] = l1a_apihisr_com.dyn_dwnld.copy_parameters.start_of_dwnld_area;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
279 dyn_dwl_ndb->d_api_dwl_function_address[1] = 0x0;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
280
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
281 #if (CODE_VERSION == SIMULATION)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
282 dyn_dwl_ndb->d_api_dwl_size = SIZE_DWNLD_AREA_SIMU;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
283 #else
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
284 dyn_dwl_ndb->d_api_dwl_size = l1a_apihisr_com.dyn_dwnld.copy_parameters.size_of_dwnld_area;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
285 #endif // CODE_VERSION == SIMULATION
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
286
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
287 dwnld_area_size = l1a_apihisr_com.dyn_dwnld.copy_parameters.size_of_dwnld_area;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
288 return dwnld_area_size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
289 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
290
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
291 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
292 /* l1_init_pointers_and_copy_first_block_of_data */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
293 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
294 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
295 /* Parameters : address of size of the patch, address of size of download area,*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
296 /* addresses of source pointer, address of destination pointer */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
297 /* new patch flag */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
298 /* Return : TRUE if N< size of patch, FALSE otherwise */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
299 /* source and destination pointer modified by reference */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
300 /* size of download area and patch area modified by reference, */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
301 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
302 /* Description : Initialize pointers and starts the copy. */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
303 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
304 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
305 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
306 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
307
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
308 BOOL l1_init_pointers_and_copy_first_block_of_data(UWORD16 *dwnld_area_size_p, UWORD16 *patch_size_p, UWORD16 **pp_dest_mcu, UWORD16 **pp_src_mcu, BOOL new_patch)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
309 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
310 BOOL return_flag;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
311
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
312 /* Initialize download area*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
313 *dwnld_area_size_p = l1_initialize_download_area_parameters();
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
314
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
315 /* In case this is a new patch, initialize patch parameters*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
316 if (new_patch == TRUE)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
317 *patch_size_p = l1_initialize_patch_parameters();
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
318
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
319 /* Initialize pointers for the copy*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
320 l1_initialize_pointers_for_copy(pp_dest_mcu, pp_src_mcu);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
321
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
322 /* If this is a new patch, the header of the patch must be taken off from the copy*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
323 if (new_patch == TRUE)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
324 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
325 /* Take the initial header off */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
326 *pp_src_mcu= (*pp_src_mcu)+HEADER_PATCH_SIZE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
327 *patch_size_p= (*patch_size_p)-HEADER_PATCH_SIZE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
328 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
329
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
330 /* Copy first N words; if remaining size of the patch is smaller than N copy until the end of the patch */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
331 /* In this case, return FALSE as there are no more words to be copied*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
332 return_flag = l1_copy_first_N_words (dwnld_area_size_p, patch_size_p, pp_dest_mcu, pp_src_mcu);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
333
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
334 return return_flag;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
335 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
336
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
337
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
338 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
339 /* l1_set_dyn_dwnld_install_vect */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
340 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
341 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
342 /* Parameters : size vector, destination address vector, crc vector */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
343 /* patch code vector, identifier i of the patch */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
344 /* new patch flag */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
345 /* Return : TRUE operation is successful, FALSE otherwise */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
346 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
347 /* Description : Compute address, size and crc of i-th patch */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
348 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
349 /*---------------------------------------------------------------------------- */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
350
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
351 BOOL l1_set_dyn_dwnld_install_vect(UWORD16* size_p, UWORD32* dest_addr, UWORD16* crc_vect, const UWORD8 *patch_array_code, UWORD16 i)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
352 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
353 UWORD16 full_size_32_bit, size, size_ext, dsp_addr, dsp_addr_ext, crc_value;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
354 UWORD16 *codePtr;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
355 UWORD16 size_total = 0;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
356 BOOL status_flag = FALSE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
357 codePtr = (UWORD16 *) patch_array_code;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
358
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
359 if ( (0 == *codePtr++) && (0 == *codePtr++))
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
360 { // NULL TAG detection
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
361 if ( (3 == *codePtr++) && (0 == *codePtr++))
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
362 { // coff2c version number detection
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
363 size = *codePtr++;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
364 size_ext = *codePtr++;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
365
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
366 // first header:4
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
367 size_total+=HEADER_PATCH_SIZE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
368 while(size != 0 || size_ext != 0)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
369 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
370 full_size_32_bit = (size_ext << 16) + size;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
371 // reconstruction of the total 32-bit size of the section
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
372 size_total+=HEADER_PATCH_SIZE+full_size_32_bit+1;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
373 // Header + size_block + cntrl_word(0xDEAD):1
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
374 codePtr+=full_size_32_bit+2+1;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
375 // Two words for address and one for the cntrl word 0xDEAD
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
376 size = *codePtr++;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
377 size_ext = *codePtr++;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
378 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
379 size_total+=HEADER_PATCH_SIZE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
380 // Last header to consider
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
381
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
382 dsp_addr = *codePtr++;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
383 dsp_addr_ext = *codePtr++;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
384 crc_value = *codePtr++;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
385 dest_addr[i] = (dsp_addr_ext << 16)+dsp_addr;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
386 crc_vect[i] = crc_value;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
387 size_p[i] = size_total;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
388 status_flag = TRUE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
389 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
390 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
391 return status_flag;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
392 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
393 #endif //L1_DYN_DSP_DWNLD == 1