annotate gsm-fw/L1/dyn_dwl_cfile/l1_dyn_dwl_apihisr.c @ 925:c56ba3363aa3

gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Thu, 22 Oct 2015 18:19:42 +0000
parents
children 48969469d961
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_APIHISR.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_apihisr.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>
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12 #include "nucleus.h"
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 "sys_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_types.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16 #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
17 #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
18 #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
19 #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
20 #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
21
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 #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
23 #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
24 #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
25 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 #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
28 #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
29 #include "l1_dyn_dwl_signa.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30 #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
31 #include "l1_dyn_dwl_msgty.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 #include "l1_dyn_dwl_error.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 #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
34 #include "l1_api_hisr.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 "cust_os.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 /* #include "nu_main.h" */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46 #include "l1audio_signa.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
47 #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
48 #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
49 #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
50 #include "l1_api_hisr.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
51 #include "l1_trace.h"
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53 #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
54
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
55 /* Dynamic Download NDB API */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56 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
57
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58 #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
59 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
60 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
61 #endif
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 enum states
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 RESET = 0,
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
66 WAIT_UNINSTALL = 1,
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67 WAIT_DSP_END_BUFFER = 2,
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 WAIT_CRC = 3,
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69 WAIT_INSTALL = 4
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 /* l1_dyn_dwnld_copy_patch_process() */
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 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
75 /* Parameters : BOOL new_patch: TRUE if the patch is copied from scratch, FALSE if it has been started so far */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
76 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
77 /* Return : state in which must be stepped into */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
78 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
79 /* Description : Performs the copy of the patch and computes next state of corresponding APIHISR state machine */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
80 /* */
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 UWORD8 l1_dyn_dwnld_copy_patch_process (BOOL new_patch)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
84 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
85 BOOL still_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
86 UWORD16 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
87 UWORD8 return_state;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
88 UWORD16 *p_src_mcu = NULL;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
89 UWORD16 *p_dest_mcu = NULL;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
90 UWORD16 *tmp_pointer = NULL;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
91
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
92 UWORD16 tmp_patch_size = l1_apihisr.dyn_dwnld.tmp_patch_size;
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 /* Copy first N block of data */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
95 still_words_to_be_copied = l1_init_pointers_and_copy_first_block_of_data(&(tmp_dwnld_area_size), &(tmp_patch_size), &(p_dest_mcu), &(p_src_mcu),new_patch);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
96
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
97 /* Set download command */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
98 dyn_dwl_ndb->d_api_dwl_download_ctrl = (API) C_DWL_DOWNLOAD_CTRL_DOWNLOAD;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
99
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
100 #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
101 l1_trigger_api_interrupt();
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
102 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
103
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
104 /* Check if there are still words to be copied after first API interrupt generation: if not */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
105 /* the patch has been completely downloaded and MCU waits for CRC*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
106 if(still_words_to_be_copied == FALSE)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
107 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
108 return_state = WAIT_CRC;
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
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
111 /* If not copy the patch: if download area is bigger than patch size 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
112 /* Else copy till the end of buffer download area and wait for DSP interrupt */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
113 else
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
115 if (tmp_dwnld_area_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
116 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 l1_copy_till_the_end_of_the_patch_and_update_write_pointer(tmp_patch_size,p_dest_mcu,p_src_mcu);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118 return_state = WAIT_CRC;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120 else
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122 l1_copy_till_end_of_dwnld_area_and_update_write_pointer(tmp_dwnld_area_size,p_dest_mcu,&tmp_patch_size,&p_src_mcu);
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 /* Save source patch file pointerand temporary patch size*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
125 l1_apihisr.dyn_dwnld.running_source_pointer = (UWORD32) p_src_mcu;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
126 l1_apihisr.dyn_dwnld.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
127
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
128 /* Change state*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
129 return_state = WAIT_DSP_END_BUFFER;
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 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
132 return return_state;
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_dyn_dwnld_apihisr() */
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 : none */
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 : n/a */
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 : implements Dynamic Download API HISR */
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 void l1_dyn_dwnld_apihisr()
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
147 {
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 UWORD8 *state = &l1_apihisr.dyn_dwnld.state;
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
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
152 /* Variables for copy process */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
153
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
154 xSignalHeaderRec *conf_msg;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
155 BOOL flag_error;
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 /* Dynamic Download error handler : check if critical error occured */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
158 if( l1_dyn_dwnld_apihisr_error_handler() == TRUE )
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
159 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
160 /* Send notification to L1A */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
161 conf_msg = os_alloc_sig(sizeof(T_API_L1_DYN_DWNLD_STOP));
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
162 DEBUGMSG(status,NU_ALLOC_ERR)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
163 conf_msg->SignalCode = API_L1_DYN_DWNLD_STOP;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
164 ((T_API_L1_DYN_DWNLD_STOP *) (conf_msg->SigP))->error = dyn_dwl_ndb->d_api_dwl_error_code;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
165 dyn_dwl_ndb->d_api_dwl_error_code = C_DWL_ERR_RESET;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
166 os_send_sig(conf_msg,L1C1_QUEUE);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
167 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
168
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
169 /* Branch state */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
170 *state = RESET;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
171 flag_error = TRUE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
172 return;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
173 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
174 else
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 flag_error = FALSE;
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
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 /*STATE MACHINE */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
181 /****************/
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 (1){
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
184 switch(*state)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
185 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
186 /*********/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
187 /* RESET */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
188 /*********/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
189 case RESET:
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
190 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
191 /* Check reset init command (if reset by DSP) / Restart in case dynamic download delayed */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
192 if ( dyn_dwl_ndb->d_api_dwl_download_ctrl == (API) C_DWL_DOWNLOAD_CTRL_DSP_ACK ||
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
193 l1a_apihisr_com.dyn_dwnld.command.restart == TRUE)
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 if (flag_error == FALSE)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
196 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
197
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
198 /* Send confirmation to L1A */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
199 conf_msg = os_alloc_sig(0);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
200 DEBUGMSG(status,NU_ALLOC_ERR)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
201 conf_msg->SignalCode = API_L1_DYN_DWNLD_START_CON;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
202 os_send_sig(conf_msg,L1C1_QUEUE);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
203 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
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 /* Store patch IDs to install counter in global API */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
206 l1_apihisr.dyn_dwnld.patch_ids_counter = l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem;
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 /* Reset command */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
209 l1a_apihisr_com.dyn_dwnld.command.restart = FALSE;
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 /* Test if number of uninstall elements is greater than zero */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
212 if ( l1a_apihisr_com.dyn_dwnld.uninstall_parameters.num_of_elem > 0 )
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 /* Copy num of elem L1A-API variable counter into global uninstall counter */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
215 l1_apihisr.dyn_dwnld.uninstall_counter = l1a_apihisr_com.dyn_dwnld.uninstall_parameters.num_of_elem;
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 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
218
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
219 #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
220 l1_trigger_api_interrupt();
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
221 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
222
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
223 /* Change state */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
224 *state = WAIT_UNINSTALL;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
225 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
226 else /* No elements to uninstall*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
227 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
228 /* Reset patch size */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
229 l1_apihisr.dyn_dwnld.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
230
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
231 /* Copy the patch and update current state*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
232 *state = l1_dyn_dwnld_copy_patch_process(TRUE);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
233
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 }
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 return;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
238 } /* end case RESET */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
239 //omaps00090550 break;
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 /******************/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
242 /* WAIT_UNINSTALL */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
243 /******************/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
244 case WAIT_UNINSTALL:
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 /* Check uninstall command (if reset by DSP) */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
247 if ( dyn_dwl_ndb->d_api_dwl_download_ctrl == (API) C_DWL_DOWNLOAD_CTRL_DSP_ACK )
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 /* Decrement uninstall counter */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
250 l1_apihisr.dyn_dwnld.uninstall_counter--;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
251
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
252 /* Check uninstall counter: if it is 0 no more uninstall to perform*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
253 if ( l1_apihisr.dyn_dwnld.uninstall_counter == 0 )
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
254 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
255 /* Send confirmation to L1A */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
256 conf_msg = os_alloc_sig(0);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
257 DEBUGMSG(status,NU_ALLOC_ERR)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
258 conf_msg->SignalCode = API_L1_DYN_DWNLD_UNINST_OK;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
259 os_send_sig(conf_msg,L1C1_QUEUE);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
260 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
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 /* Reset patch size */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
263 l1_apihisr.dyn_dwnld.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
264
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
265 /* Copy the patch and update current state*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
266 *state = l1_dyn_dwnld_copy_patch_process(TRUE);
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 else /* there are some uninstall to perform */
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 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
271
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
272 #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
273 l1_trigger_api_interrupt();
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
274 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
275 }
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 return;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
278 } /* end case WAIT_UNINSTALL */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
279 //omaps00090550 break;
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 /***********************/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
282 /* WAIT_DSP_END_BUFFER */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
283 /***********************/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
284 case WAIT_DSP_END_BUFFER:
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
285 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
286 if ( dyn_dwl_ndb->d_api_dwl_download_ctrl == (API) C_DWL_DOWNLOAD_CTRL_DSP_ACK )
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
287 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
288 /* Copy the patch and update current state*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
289 *state = l1_dyn_dwnld_copy_patch_process(FALSE);
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 return;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
292 } /* end case WAIT_DSP_END_BUFFER */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
293 //omaps00090550 break;
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 /************/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
296 /* WAIT_CRC */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
297 /************/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
298 case WAIT_CRC:
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
299 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
300 /* Check if DSP install command is reset */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
301 if (dyn_dwl_ndb->d_api_dwl_download_ctrl == (API) C_DWL_DOWNLOAD_CTRL_DSP_ACK )
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
302 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
303 /* Test if CRC is OK */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
304 if ( dyn_dwl_ndb->d_api_dwl_crc != l1a_apihisr_com.dyn_dwnld.copy_parameters.crc[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter]) /* CRC not OK */
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 /* Send notification to L1A */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
307 conf_msg = os_alloc_sig(sizeof(T_API_L1_CRC_NOT_OK));
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
308 DEBUGMSG(status,NU_ALLOC_ERR)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
309 conf_msg->SignalCode = API_L1_CRC_NOT_OK;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
310 ((T_API_L1_CRC_NOT_OK *) (conf_msg->SigP))->patch_id = dyn_dwl_ndb->d_api_dwl_crc;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
311 os_send_sig(conf_msg,L1C1_QUEUE);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
312 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
313
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
314 /* Change state */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
315 *state = RESET;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
316 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
317 else /* CRC OK */
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 conf_msg = os_alloc_sig(sizeof(T_API_L1_CRC_NOT_OK));
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
320 DEBUGMSG(status,NU_ALLOC_ERR)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
321 conf_msg->SignalCode = API_L1_CRC_OK;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
322 ((T_API_L1_CRC_NOT_OK *) (conf_msg->SigP))->patch_id = l1a_apihisr_com.dyn_dwnld.copy_parameters.crc[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
323 os_send_sig(conf_msg,L1C1_QUEUE);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
324 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
325 *state = WAIT_INSTALL;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
326
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
327 /* Set install parameters */
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 dyn_dwl_ndb->d_api_dwl_function_address[0] =
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
330 (API) (l1a_apihisr_com.dyn_dwnld.copy_parameters.address_to_install[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter] & 0x0000FFFF);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
331 dyn_dwl_ndb->d_api_dwl_function_address[1] =
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
332 (API) ((l1a_apihisr_com.dyn_dwnld.copy_parameters.address_to_install[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter] >> 16) & 0x0000FFFF);
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 dyn_dwl_ndb->d_api_dwl_download_ctrl = (API) C_DWL_DOWNLOAD_CTRL_INSTALL;
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 #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
337 l1_trigger_api_interrupt();
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
338 #endif
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
339 }
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 return;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
342 } /* end case WAIT_CRC */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
343 //omaps00090550 break;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
344
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
345 /****************/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
346 /* WAIT_INSTALL */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
347 /****************/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
348 case WAIT_INSTALL:
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 /* Check if DSP install command is reset */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
351 if (dyn_dwl_ndb->d_api_dwl_download_ctrl == (API) C_DWL_DOWNLOAD_CTRL_DSP_ACK )
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 /* Decrement patch counter */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
354 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
355
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
356 /* Test if patch counter is null */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
357 if ( l1_apihisr.dyn_dwnld.patch_ids_counter == 0 )
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 /* Send notification to L1A */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
360 conf_msg = os_alloc_sig(0);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
361 DEBUGMSG(status,NU_ALLOC_ERR)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
362 conf_msg->SignalCode = API_L1_DYN_DWNLD_FINISHED;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
363 os_send_sig(conf_msg,L1C1_QUEUE);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
364 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
365 *state = RESET;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
366 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
367 else
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
368 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
369 /* Reset patch size */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
370 l1_apihisr.dyn_dwnld.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
371
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
372 /* Copy the patch and update current state*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
373 *state = l1_dyn_dwnld_copy_patch_process(TRUE);
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
374 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
375 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
376 return;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
377 } /* end case WAIT_INSTALL */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
378 //omaps00090550 break;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
379 } /* end switch */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
380 } /* end while */
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
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
383 /*-------------------------------------------------------------*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
384 /* l1_dyn_dwnld_apihisr_error_handler() */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
385 /*-------------------------------------------------------------*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
386 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
387 /* Parameters : error_code (OUT) error_code received from DSP */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
388 /* */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
389 /* Return : TRUE if errors signaled by DSP */
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 /*-------------------------------------------------------------*/
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
392 BOOL l1_dyn_dwnld_apihisr_error_handler()
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
393 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
394 BOOL critical;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
395
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
396 /* Initialisation */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
397 critical = FALSE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
398
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
399 if(dyn_dwl_ndb->d_api_dwl_error_code != 0)
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
400 {
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
401 critical = TRUE;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
402 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
403
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
404 return critical;
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
405 }
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
406
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
407
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
408 #endif /* L1_DYN_DSP_DWNLD */
c56ba3363aa3 gsm-fw: l1_dyn_dwl code imported from tcs211-l1-reconst
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
409