annotate src/cs/system/Main/init.c @ 265:0aa748b6413a

src/cs/system/Main/init.c: initial import from LoCosto source
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 05 Aug 2017 02:02:16 +0000
parents
children f62b71017afd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
265
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * INIT.C
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * This module allows to initialize the board:
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * - wait states,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * - unmask selected interrupts,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 * - initialize clock,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 * - disable watchdog.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 * Dummy functions used by the EVA3 library are defined.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 /* Config Files */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 #pragma DUPLICATE_FOR_INTERNAL_RAM_START
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 #ifndef PSP_FAILSAFE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 #define PSP_FAILSAFE 0
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 #warn "PSP Failsafe Flag Not Defined in your Build, taking default"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #ifndef _WINDOWS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #include "l1sw.cfg"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #include "rf.cfg"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 #include "chipset.cfg"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 #include "board.cfg"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 #include "swconfig.cfg"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #include "rv.cfg"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #include "sys.cfg"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #include "debug.cfg"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #ifdef BLUETOOTH_INCLUDED
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 #include "btemobile.cfg"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #ifdef BLUETOOTH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #include "bluetooth.cfg"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #include "rv/rv_defined_swe.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 /* Include Files */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 #include <assert.h>
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 #include <ctype.h>
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 #include <stdarg.h>
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 #include <stdlib.h>
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 #include <string.h>
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 #include "nucleus.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #include "sys_types.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 #include "l1_types.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 #include "l1_confg.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #include "l1_const.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 #include "pin_config.h" // added for Init tuned to Power Management
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 #if TESTMODE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 #include "l1tm_defty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 #endif // TESTMODE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 #if (AUDIO_TASK == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 #include "l1audio_const.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 #include "l1audio_cust.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 #include "l1audio_defty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 #endif // AUDIO_TASK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 #if (L1_GTT == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 #include "l1gtt_const.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 #include "l1gtt_defty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 #if (L1_MP3 == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 #include "l1mp3_defty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 #if (L1_MIDI == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 #include "l1midi_defty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 #if (L1_AAC == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 #include "l1aac_defty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 #if (L1_DYN_DSP_DWNLD == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 #include "l1_dyn_dwl_defty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 #if (TRACE_TYPE == 4)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 #include "l1_defty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 #if ((OP_L1_STANDALONE == 1) && (CODE_VERSION != SIMULATION) && (PSP_STANDALONE == 0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 #if (AUDIO_TASK == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 #include "l1audio_signa.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 #include "l1audio_msgty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 #endif // AUDIO_TASK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 #if (L1_GTT == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 #include "l1gtt_signa.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 #include "l1gtt_msgty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 #include "l1_defty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 #include "cust_os.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 #include "l1_msgty.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 #include "nu_main.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 #include "l1_varex.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 #include "l1_proto.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 #include "hw_debug.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 #include "l1_trace.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 #endif /* ((OP_L1_STANDALONE == 1) && (CODE_VERSION != SIMULATION) && (PSP_STANDALONE==0)) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 #include "armio/armio.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 #include "timer/timer.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 #if (CHIPSET==15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 #include "types.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 #include "bspI2c.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 #include "bspTwl3029.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 #include "bspTwl3029_I2c.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 #include "bspTwl3029_Power.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 #include "uicc/board/bspUicc.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 #include "rvf/rvf_api.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 #include "rvm/rvm_api.h" /* A-M-E-N-D-E-D! */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 #include "sim/sim.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 #include "dynamic_clock.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 #if (ANLG_FAM !=11)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 #include "abb/abb.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 #if (BOARD==35 || BOARD==46)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 #include "csmi/csmi.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 #include "csmi/csmi_gsmctrl.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 #include "csmi/csmi_uart.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 #include "uart/uartfax.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 #include "csmi/csmi_uartfax.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 #include "ffs/ffs.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 #include "ffs/ffspcm.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 #include "csmi/sleep.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 #endif /* (OP_L1_STANDALONE == 0) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 /* WCP Profiler */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 #if (BOARD==35 || BOARD==43 || BOARD==46) && (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 #if WCP_PROF == 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 #include "prf/prf_api.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 #include "inth/iq.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 #include "tpudrv.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 #include "memif/mem.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 #include "clkm/clkm.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 #include "inth/inth.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 void bspUicc_Phy_intCHandler(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 #include "uart/serialswitch_core.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 #include "uart/serialswitch.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 #include "uart/traceswitch.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 #include "dma/dma.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 #include "rhea/rhea_arm.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 #include "ulpd/ulpd.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 #if (GSM_IDLE_RAM != 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 #include "csmi_simul.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 #include "csmi/csmi.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 #if (CHIPSET == 12) || (CHIPSET == 15) || ((CHIPSET == 10) && (OP_WCP == 1))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 #include "memif/sys_memif.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 #if ((CHIPSET == 12) || (CHIPSET == 15))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 #include "timer/timer_sec.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 #include "dma/sys_dma.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 #include "conf/sys_conf.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 #include "inth/sys_inth.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 #ifdef RVM_NAN_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 #include "nan/nan_i.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 #ifdef RVM_DMA_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 #include "dma/board/dma_inth.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 #ifdef RVM_I2C_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 #include "i2c/i2c_hw_functions.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 #ifdef RVM_MC_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 #include "mc/board/mc_inth.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 #ifdef RVM_USB_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 #include "usb/usb_inth.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 #define TIMER_RESET_VALUE (0xFFFF)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 * These constants define the number of ticks per TDMA when timer 0
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 * is set to pre-scale=0 and the upper limit in percent of TICKS_PER_TDMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 * for the execution of synchronous layer 1.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 #define TICKS_PER_TDMA (1875)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 #define LIMIT_FOR_L1_SYNC (80)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 UWORD16 flash_device_id;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 extern void ffs_main_init(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239 extern void create_tasks(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 #if TI_NUC_MONITOR == 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 extern void ti_nuc_monitor_tdma_action( void );
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 #if WCP_PROF == 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 #if PRF_CALIBRATION == 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 extern NU_HISR prf_CalibrationHISR;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 void l1ctl_pgm_clk32(UWORD32 nb_hf, UWORD32 nb_32khz);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 extern void L1_trace_string(char *s);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 #endif /* (OP_L1_STANDALONE) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 extern const T_INTH_CONFIG a_inth_config[C_INTH_NB_INTERRUPT];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 #ifdef RVM_CAMD_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259 extern void f_camera_interrupt_manager(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 #if (GSM_IDLE_RAM != 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 // Interrupt handler called in case the interrupt requires the traffic controler active
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267 // These routines need to be declared here in order to put them into the a_inth_config_idle_ram structure
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 extern void ext_ram_irq_inth_handler(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 extern void ext_ram_fiq_inth_handler(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 // declared for the _intram file generated by ICL470
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 extern const T_INTH_CONFIG a_inth_config_idle_ram[C_INTH_NB_INTERRUPT];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 // Debug mode: irq ext shall be connected to the chipselect signals
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277 #if GSM_IDLE_RAM_DEBUG
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 extern void flash_access_handler(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 extern void ext_ram_access_handler(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 #endif // CHIPSET 12 || CHIPSET 15
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 extern void hisr(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 extern void layer_1_sync_HISR_entry(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 extern NU_HISR layer_1_sync_HISR;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 #if (CODE_VERSION != SIMULATION)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 #if (BOARD == 71)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 extern void INT_DisableIRQ(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 extern void INT_EnableIRQ(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 #endif /* (BOARD == 71) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295 #endif /* CODE_VERSION != SIMULATION */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 #if (LOCOSTO_LITE==1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 #ifndef HISR_STACK_SHARING
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 #define HISR_STACK_SHARING
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 #ifdef HISR_STACK_SHARING
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 unsigned char HISR_STACK_PRIO2[1500]={0xFE};
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 #pragma DATA_SECTION(layer_1_sync_stack,".stackandheap");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 #define LAYER_1_SYNC_STACK_SIZE (3000 /*4000*/)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 extern unsigned char layer_1_sync_stack[LAYER_1_SYNC_STACK_SIZE];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 #if (LONG_JUMP == 3)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 #pragma DATA_SECTION(layer_1_sync_stack,".HISR_stack");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 #if TESTMODE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 extern char FAR layer_1_sync_stack[2600 /*3600*/]; // Frame interrupt task stack for EVA3
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319 extern char FAR layer_1_sync_stack[1600 /*2600*/]; // Frame interrupt task stack for EVA3
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 #endif /* OP_L1_STANDALONE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 #if (FF_L1_IT_DSP_USF == 1) || (FF_L1_IT_DSP_DTX == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 extern void api_modem_hisr();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 #if (LONG_JUMP == 3)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 #pragma DATA_SECTION(API_MODEM_HISR_stack,".l1s_global");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 extern char FAR API_MODEM_HISR_stack[0x400]; // stack size to be tuned
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 extern NU_HISR api_modemHISR;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 #pragma DUPLICATE_FOR_INTERNAL_RAM_END
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 #if !((MOVE_IN_INTERNAL_RAM == 1) && (GSM_IDLE_RAM !=0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 #pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_START
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 * Timing monitor
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 #if (TRACE_TYPE == 4)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 extern T_L1A_L1S_COM l1a_l1s_com;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344 extern T_L1S_GLOBAL l1s;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 UNSIGNED max_cpu, fn_max_cpu;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 unsigned short layer_1_sync_end_time;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 unsigned short max_cpu_flag;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 #pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_END
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 #endif // !((MOVE_IN_INTERNAL_RAM == 1) && (GSM_IDLE_RAM !=0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 #if (L1_EXT_AUDIO_MGT == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 NU_HISR EXT_AUDIO_MGT_hisr;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 #ifndef HISR_STACK_SHARING
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 char FAR ext_audio_mgt_hisr_stack[500];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358 #define ext_audio_mgt_hisr_stack HISR_STACK_PRIO2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 extern void Cust_ext_audio_mgt_hisr(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 #if ( (L1_MP3 == 1) || (L1_MIDI == 1) || (L1_AAC == 1) || (L1_DYN_DSP_DWNLD == 1) ) // equivalent to an API_HISR flag
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 extern void api_hisr(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365 #ifndef HISR_STACK_SHARING
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 #if (LONG_JUMP == 3)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 #pragma DATA_SECTION (API_HISR_stack,".l1s_global");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 char FAR API_HISR_stack[0x400];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372 #define API_HISR_stack HISR_STACK_PRIO2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 NU_HISR apiHISR;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375 #endif // (L1_MP3 == 1) || (L1_MIDI == 1) || (L1_DYN_DSP_DWNLD == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377 #if (FF_L1_IT_DSP_USF == 1) || (FF_L1_IT_DSP_DTX == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378 #if !((MOVE_IN_INTERNAL_RAM == 1) && (GSM_IDLE_RAM != 0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 #pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_START
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 char FAR API_MODEM_HISR_stack[0x400]; // stack size to be tuned
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 NU_HISR api_modemHISR;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382 #pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_END
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384 #endif // FF_L1_IT_DSP_USF
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 #endif /* PSP_STANDALONE == 0 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388 #if ((TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE==7) || TESTMODE)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389 #include "uart/uart.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 * Serial Configuration set up.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 extern char ser_cfg_info[NUMBER_OF_TR_UART];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 #include "rvt_gen.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396 extern T_RVT_USER_ID trace_id;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 #endif /* (OP_L1_STANDALONE == 1) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401 * Serial Configuration set up.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 ** One config is:
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406 ** {XXX_BT_HCI, // Bluetooth HCI
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407 ** XXX_FAX_DATA, // Fax/Data AT-Cmd
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 ** XXX_TRACE, // L1/Riviera Trace Mux
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 ** XXX_TRACE}, // Trace PS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410 **
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411 ** with XXX being DUMMY, UART_IRDA or UART_MODEM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 #if ((((TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE==7) ||\
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415 (TESTMODE)) && (OP_L1_STANDALONE == 1)) || (OP_L1_STANDALONE == 0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 static T_AppliSerialInfo appli_ser_cfg_info =
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 T_AppliSerialInfo appli_ser_cfg_info =
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 #endif /* OP_L1_STANDALONE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 #if (CHIPSET!=15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 #ifdef BTEMOBILE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 #ifdef BT_UART_USED_MODEM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425 {UART_MODEM_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 UART_IRDA_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428 DUMMY_TRACE}, // default config (Bluetooth on Modem) - 0x014A
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 {UART_IRDA_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 UART_MODEM_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 DUMMY_TRACE}, // default config (Bluetooth on IrDa) - 0x0249
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434 #endif // BT_UART_USED_MODEM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 #else // BTEMOBILE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 UART_MODEM_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 UART_IRDA_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 DUMMY_TRACE}, // default config = 0x0168
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441 #ifdef BTEMOBILE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 12, // 12 serial config allowed
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 #else // BTEMOBILE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 9, // 9 serial config allowed
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447 // Configs with Condat Panel only
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 DUMMY_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 UART_IRDA_TRACE}, // 0x1048
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454 DUMMY_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 UART_MODEM_TRACE}, // 0x2048
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 // Configs with L1/Riviera Trace only
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 UART_IRDA_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460 DUMMY_TRACE}, // 0x0148
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 UART_MODEM_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464 DUMMY_TRACE}, // 0x0248
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 // Configs with AT-Cmd only
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467 UART_MODEM_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468 DUMMY_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 DUMMY_TRACE}, // 0x0068
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470 // Configs with Condat Panel and L1/Riviera Trace
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473 UART_MODEM_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474 UART_IRDA_TRACE}, // 0x1248
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477 UART_IRDA_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478 UART_MODEM_TRACE}, // 0x2148
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479 // Configs with Condat Panel and AT-Cmd
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 UART_MODEM_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482 DUMMY_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483 UART_IRDA_TRACE}, // 0x1068
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484 #ifdef BTEMOBILE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485 // Configs with L1/Riviera Trace and Bluetooth HCI
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 {UART_IRDA_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488 UART_MODEM_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
489 DUMMY_TRACE}, // 0x0249
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
490 {UART_MODEM_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492 UART_IRDA_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493 DUMMY_TRACE}, // 0x014A
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494 // Configs with AT-Cmd and Bluetooth HCI
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495 {UART_IRDA_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496 UART_MODEM_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497 DUMMY_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 DUMMY_TRACE}, // 0x0069
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499 #endif // BTEMOBILE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500 // Configs with L1/Riviera Trace and AT-Cmd
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502 UART_MODEM_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503 UART_IRDA_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504 DUMMY_TRACE} // 0x0168
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506 };
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507 #else /* CHIPSET==15 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
509 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
510 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
511 UART_IRDA_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
512 DUMMY_TRACE}, // 0x0148
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
513 3,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
515 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
516 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517 UART_IRDA_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518 DUMMY_TRACE},// 0x0148
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519 {DUMMY_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 DUMMY_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522 UART_IRDA_TRACE}, // 0x1048
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523 {UART_IRDA_BT_HCI,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
524 DUMMY_FAX_DATA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
525 DUMMY_TRACE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526 DUMMY_TRACE}, // 0x0049
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528 };
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 #endif /* CHIPSET !=15*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530 #endif /* (TRACE_TYPE ...) || (OP_L1_STANDALONE == 0) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
532
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
533 #if !((MOVE_IN_INTERNAL_RAM == 1) && (GSM_IDLE_RAM !=0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
534 #pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_START
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
535
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
537 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
538 * HISR stack and semaphore needed by L1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542 unsigned char layer_1_sync_stack[LAYER_1_SYNC_STACK_SIZE];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544 #if TESTMODE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 char FAR layer_1_sync_stack[2600 /*3600*/]; // Frame interrupt task stack for EVA3
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547 char FAR layer_1_sync_stack[1600 /* 2600 */]; // Frame interrupt task stack for EVA3
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
548 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
549 #endif /* OP_L1_STANDALONE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 NU_HISR layer_1_sync_HISR; // Frame interrupt task stack for EVA3
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
553
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
554 #if (CHIPSET == 12)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
556 const T_INTH_CONFIG a_inth_config[C_INTH_NB_INTERRUPT] =
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
557 { // IRQ/FIQ LEVEL/EDGE PRIORITY HANDLER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558 { C_INTH_IRQ, C_INTH_EDGE, 0x01, IQ_TimerHandler }, // 0 : WATCHDOG TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 { C_INTH_IRQ, C_INTH_EDGE, 0x02, IQ_TimerHandler1 }, // 1 : TIMER 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560 { C_INTH_IRQ, C_INTH_EDGE, 0x02, IQ_TimerHandler2 }, // 2 : TIMER 2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561 { C_INTH_FIQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 3 : TSP RECEIVE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562 { C_INTH_IRQ, C_INTH_EDGE, 0x00, IQ_FrameHandler }, // 4 : TPU FRAME
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563 { C_INTH_IRQ, C_INTH_EDGE, 0x04, f_inth_dummy }, // 5 : TPU PAGE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
564 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
565 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 6 : SIM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
566 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
567 { C_INTH_IRQ, C_INTH_EDGE, 0x07, SIM_IntHandler }, // 6 : SIM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
569 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, SER_uart_modem_handler }, // 7 : UART_MODEM1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
570 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, f_inth_dummy }, // 8 : KEYBOARD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
573 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, IQ_KeypadHandler }, // 8 : KEYBOARD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
574 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
575 { C_INTH_IRQ, C_INTH_EDGE, 0x03, IQ_Rtc_Handler }, // 9 : RTC_TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
576 { C_INTH_IRQ, C_INTH_LEVEL, 0x03, IQ_RtcA_Handler }, // 10 : RTC_ALARM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577 { C_INTH_IRQ, C_INTH_EDGE, 0x00, IQ_Gauging_Handler }, // 11 : ULPD_GAUGING
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578 { C_INTH_IRQ, C_INTH_EDGE, 0x08, IQ_External }, // 12 : ABB_IRQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
579 { C_INTH_IRQ, C_INTH_EDGE, 0x05, f_inth_dummy }, // 13 : SPI
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
580 { C_INTH_IRQ, C_INTH_LEVEL, 0x06, f_dma_interrupt_manager }, // 14 : DMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
581 { C_INTH_IRQ, C_INTH_EDGE, 0x03, IQ_ApiHandler }, // 15 : API
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
582 { C_INTH_IRQ, C_INTH_EDGE, 0x07, f_inth_dummy }, // 16 : GPIO
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583 { C_INTH_FIQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 17 : ABB_FIQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, SER_uart_irda_handler }, // 18 : UART_IRDA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585 { C_INTH_IRQ, C_INTH_LEVEL, 0x03, IQ_GsmTim_Handler }, // 19 : ULPD GSM TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 20 : GEA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587 #if GSM_IDLE_RAM_DEBUG
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, flash_access_handler }, // 21 : EXTERNAL IRQ 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, ext_ram_access_handler }, // 22 : EXTERNAL IRQ 2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
591 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 21 : EXTERNAL IRQ 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
592 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 22 : EXTERNAL IRQ 2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595 { C_INTH_FIQ, C_INTH_LEVEL, 0x02, bspUicc_Phy_intCHandler }, // 23 : USIM Card Detect
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596 { C_INTH_IRQ, C_INTH_EDGE, 0x02, bspUicc_Phy_intCHandler }, // 24 : USIM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
598 { C_INTH_FIQ, C_INTH_LEVEL, 0x02, f_inth_dummy }, // 23 : USIM Card Detect
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
599 { C_INTH_IRQ, C_INTH_EDGE, 0x02, f_inth_dummy }, // 24 : USIM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
600 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
601 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 25 : LCD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
602 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
603 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 26 : USB
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
604 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
605 #ifdef RVM_USB_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
606 { C_INTH_IRQ, C_INTH_LEVEL, 0x00, usb_int_handler }, // 26 : USB
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
607 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
608 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy },
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
609 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
610 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
611 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
612 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 27 : MMC/SD/MS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
613 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
614 #ifdef RVM_MC_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
615 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, mc_int_handler }, // 27 : MMC/SD/MS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
616 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
617 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy },
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
618 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
619 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
620 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, SER_uart_modem2_handler }, // 28 : UART_MODEM2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
621 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
622 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_2nd_level_handler }, // 29 : 2nd Interrupt Handler
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
623 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
624 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, f_inth_2nd_level_handler }, // 29 : 2nd Interrupt Handler
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
625 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
626 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
627 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 30 : I2C
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
628 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
629 #ifdef RVM_I2C_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
630 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, i2c_hw_int_manager }, // 30 : I2C
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
631 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
632 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy },
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
633 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
634 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
635 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
636 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 31 : NAND FLASH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
637 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
638 #ifdef RVM_NAN_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
639 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, nan_IT_handler }, // 31 : NAND FLASH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
640 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
641 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy },
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
642 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
643 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
644
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
645 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 0 : RNG
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
646 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 1 : SHA1/MD5
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
647 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 2 : EMPU
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
648 { C_INTH_IRQ, C_INTH_LEVEL, 0x06, f_dma_interrupt_manager }, // 14 : DMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
649 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy } // 4 : Secure TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
650 };
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
651
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
652 #if (GSM_IDLE_RAM != 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
653 const T_INTH_CONFIG a_inth_config_idle_ram[C_INTH_NB_INTERRUPT] =
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
654 { // IRQ/FIQ LEVEL/EDGE PRIORITY HANDLER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
655 { C_INTH_IRQ, C_INTH_EDGE, 0x01, ext_ram_irq_inth_handler }, // 0 : WATCHDOG TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
656 { C_INTH_IRQ, C_INTH_EDGE, 0x02, ext_ram_irq_inth_handler }, // 1 : TIMER 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
657 { C_INTH_IRQ, C_INTH_EDGE, 0x02, ext_ram_irq_inth_handler }, // 2 : TIMER 2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
658 { C_INTH_FIQ, C_INTH_EDGE, 0xFF, ext_ram_fiq_inth_handler }, // 3 : TSP RECEIVE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
659 { C_INTH_IRQ, C_INTH_EDGE, 0x00, IQ_FrameHandler }, // 4 : TPU FRAME
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
660 { C_INTH_IRQ, C_INTH_EDGE, 0x04, ext_ram_irq_inth_handler }, // 5 : TPU PAGE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
661 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
662 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, ext_ram_irq_inth_handler }, // 6 : SIM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
663 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
664 { C_INTH_IRQ, C_INTH_EDGE, 0x07, ext_ram_irq_inth_handler }, // 6 : SIM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
665 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
666 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, ext_ram_irq_inth_handler }, // 7 : UART_MODEM1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
667 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
668 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, ext_ram_irq_inth_handler }, // 8 : KEYBOARD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
669 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
670 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, ext_ram_irq_inth_handler }, // 8 : KEYBOARD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
671 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
672 { C_INTH_IRQ, C_INTH_EDGE, 0x03, ext_ram_irq_inth_handler }, // 9 : RTC_TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
673 { C_INTH_IRQ, C_INTH_LEVEL, 0x03, ext_ram_irq_inth_handler }, // 10 : RTC_ALARM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
674 { C_INTH_IRQ, C_INTH_EDGE, 0x00, IQ_Gauging_Handler }, // 11 : ULPD_GAUGING
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
675 { C_INTH_IRQ, C_INTH_EDGE, 0x08, ext_ram_irq_inth_handler }, // 12 : ABB_IRQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
676 { C_INTH_IRQ, C_INTH_EDGE, 0x05, ext_ram_irq_inth_handler }, // 13 : SPI
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
677 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
678 { C_INTH_IRQ, C_INTH_LEVEL, 0x06, ext_ram_irq_inth_handler }, // 14 : DMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
679 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
680 { C_INTH_IRQ, C_INTH_EDGE, 0x02, ext_ram_irq_inth_handler }, // 14 : DMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
681 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
682 { C_INTH_IRQ, C_INTH_EDGE, 0x03, ext_ram_irq_inth_handler }, // 15 : API
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
683 { C_INTH_IRQ, C_INTH_EDGE, 0x07, ext_ram_irq_inth_handler }, // 16 : GPIO
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
684 { C_INTH_FIQ, C_INTH_EDGE, 0xFF, ext_ram_fiq_inth_handler }, // 17 : ABB_FIQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
685 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, ext_ram_irq_inth_handler }, // 18 : UART_IRDA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
686 { C_INTH_IRQ, C_INTH_LEVEL, 0x03, IQ_GsmTim_Handler }, // 19 : ULPD GSM TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
687 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 20 : GEA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
688 #if GSM_IDLE_RAM_DEBUG
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
689 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, flash_access_handler }, // 21 : EXTERNAL IRQ 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
690 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, ext_ram_access_handler }, // 22 : EXTERNAL IRQ 2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
691 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
692 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 21 : EXTERNAL IRQ 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
693 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 22 : EXTERNAL IRQ 2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
694 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
695 { C_INTH_FIQ, C_INTH_LEVEL, 0xFF, ext_ram_fiq_inth_handler }, // 23 : USIM Card Detect
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
696 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, ext_ram_irq_inth_handler }, // 24 : USIM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
697 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 25 : LCD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
698 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
699 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 26 : USB
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
700 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
701 { C_INTH_IRQ, C_INTH_LEVEL, 0x00, ext_ram_irq_inth_handler }, // 26 : USB
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
702 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
703 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
704 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 27 : MMC/SD/MS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
705 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
706 #ifdef RVM_MC_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
707 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, ext_ram_irq_inth_handler }, // 27 : MMC/SD/MS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
708 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
709 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, ext_ram_irq_inth_handler },
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
710 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
711 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
712 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, ext_ram_irq_inth_handler }, // 28 : UART_MODEM2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
713 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
714 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 29 : 2nd Interrupt Handler
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
715 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
716 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, ext_ram_irq_inth_handler }, // 29 : 2nd Interrupt Handler
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
717 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
718 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
719 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 30 : I2C
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
720 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
721 { C_INTH_IRQ, C_INTH_EDGE, 0x01, ext_ram_irq_inth_handler }, // 30 : I2C
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
722 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
723 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
724 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 31 : NAND FLASH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
725 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
726 { C_INTH_IRQ, C_INTH_EDGE, 0x02, ext_ram_irq_inth_handler }, // 31 : NAND FLASH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
727 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
728
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
729 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 0 : RNG
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
730 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 1 : SHA1/MD5
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
731 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 2 : EMPU
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
732 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
733 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler }, // 3 : Secure DMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
734 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
735 { C_INTH_IRQ, C_INTH_LEVEL,  0x03,   ext_ram_irq_inth_handler  }, // 3  : Secure DMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
736 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
737 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, ext_ram_irq_inth_handler } // 4 : Secure TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
738 };
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
739 #endif //(GSM_IDLE_RAM != 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
740
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
741 #endif /* (CHIPSET ==12) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
742
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
743 #if (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
744 const T_INTH_CONFIG a_inth_config[C_INTH_NB_INTERRUPT] =
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
745 { // IRQ/FIQ LEVEL/EDGE PRIORITY HANDLER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
746 { C_INTH_IRQ, C_INTH_EDGE, 0x01, IQ_TimerHandler }, // 0 : WATCHDOG TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
747 { C_INTH_IRQ, C_INTH_EDGE, 0x02, IQ_TimerHandler1 }, // 1 : TIMER 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
748 { C_INTH_IRQ, C_INTH_EDGE, 0x02, IQ_TimerHandler2 }, // 2 : TIMER 2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
749 { C_INTH_FIQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 3 : MCSI
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
750 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
751 { C_INTH_IRQ, C_INTH_EDGE, 0x00, IQ_FrameHandler }, // 4 : TPU FRAME
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
752 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
753 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 4 : TPU FRAME
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
754 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
755 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 5 : TPU PAGE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
756 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
757 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 6 : DRP DBB
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
758 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
759 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 6 : DRP DBB
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
760 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
761 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, SER_uart_irda_handler }, // 7 : UART_IRDA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
762 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
763 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 8 : KEYBOARD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
764 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
765 { C_INTH_IRQ, C_INTH_LEVEL, 0x01, IQ_KeypadHandler }, // 8 : KEYBOARD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
766 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
767 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 9 : DRP DBB RX
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
768
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
769 #ifdef RVM_CAMD_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
770
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
771 { C_INTH_IRQ, C_INTH_LEVEL, 0x03, f_camera_interrupt_manager }, // 10 : CAMERA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
772
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
773 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
774 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 10 : CAMERA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
775
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
776 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
777
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
778 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
779 { C_INTH_IRQ, C_INTH_EDGE, 0x00, IQ_Gauging_Handler }, // 11 : ULPD_GAUGING
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
780 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
781 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 11 : ULPD_GAUGING
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
782 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
783 { C_INTH_IRQ, C_INTH_EDGE, 0x08, IQ_External }, // 12 : ABB_IRQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
784 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 13 : MSSPI
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
785 { C_INTH_IRQ, C_INTH_LEVEL, 0x06, f_dma_interrupt_manager }, // 14 : DMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
786 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
787 { C_INTH_IRQ, C_INTH_EDGE, 0x03, IQ_ApiHandler }, // 15 : API
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
788 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
789 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 15 : API
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
790 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
791 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 16 : GPIO
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
792 { C_INTH_FIQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 17 : ABB_FIQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
793 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 18 : DRP DBB RX
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
794 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
795 { C_INTH_IRQ, C_INTH_LEVEL, 0x03, IQ_GsmTim_Handler }, // 19 : ULPD GSM TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
796 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
797 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 19 : ULPD GSM TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
798 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
799 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 20 : GEA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
800 #if GSM_IDLE_RAM_DEBUG
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
801 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 21 : GPIO1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
802 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 22 : GPIO2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
803 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
804 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 21 : GPIO1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
805 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 22 : GPIO2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
806 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
807 { C_INTH_FIQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 23 : CPORT
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
808 #if(OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
809 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy }, // 24 : USIM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
810 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
811 { C_INTH_IRQ, C_INTH_EDGE, 0x04, bspUicc_Phy_intCHandler }, // 24 : USIM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
812 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
813 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 25 : LCD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
814 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
815 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 26 : USB
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
816 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
817 #ifdef RVM_USB_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
818 { C_INTH_IRQ, C_INTH_LEVEL, 0x03, usb_int_handler }, // 26 : USB
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
819 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
820 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy },
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
821 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
822 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
823 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 27 : not used
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
824 { C_INTH_IRQ, C_INTH_LEVEL, 0x03, bspI2c_Handeler2 }, // 28 : I2C TRITON
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
825 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, f_inth_2nd_level_handler }, // 29 : 2nd Interrupt Handler
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
826 { C_INTH_IRQ, C_INTH_LEVEL, 0x03, bspI2c_Handeler1 }, // 30 : I2C
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
827 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
828 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 31 : NAND FLASH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
829 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
830 #ifdef RVM_NAN_SWE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
831 { C_INTH_IRQ, C_INTH_LEVEL, 0x02, nan_IT_handler }, // 31 : NAND FLASH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
832 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
833 { C_INTH_IRQ, C_INTH_EDGE, 0xFF, f_inth_dummy },
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
834 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
835 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
836
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
837 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 0 : RNG
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
838 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 1 : SHA1/MD5
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
839 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy }, // 2 : EMPU
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
840 { C_INTH_IRQ, C_INTH_LEVEL, 0x06, f_dma_interrupt_manager }, // 14 : DMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
841 { C_INTH_IRQ, C_INTH_LEVEL, 0xFF, f_inth_dummy } // 4 : Secure TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
842 };
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
843 #endif /* CHIPSET == 15 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
844
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
845 #pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_END
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
846 #endif // !((MOVE_IN_INTERNAL_RAM == 1) && (GSM_IDLE_RAM !=0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
847
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
848 #if (CHIPSET == 12)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
849 const T_DMA_TYPE_GLOBAL_PARAMETER d_dma_global_parameter=
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
850 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
851 #if (CHIPSET_PG == CP_PG_F751685A)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
852 C_DMA_AUTO_GATE_ON,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
853 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
854 C_DMA_AUTO_GATE_OFF,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
855 #endif /* endif (CHIPSET_PG == F751685A) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
856 C_DMA_API_PRIO_ARM,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
857 C_DMA_RHEA_PRIO_ARM,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
858 C_DMA_IMIF_PRIO_CPU_4
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
859 };
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
860
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
861 #endif /* (CHIPSET ==12) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
862
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
863 #if (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
864 const T_DMA_TYPE_GLOBAL_PARAMETER d_dma_global_parameter=
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
865 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
866 C_DMA_AUTO_GATE_ON,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
867 C_DMA_API_PRIO_ARM,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
868 C_DMA_RHEA_PRIO_ARM,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
869 C_DMA_IMIF_PRIO_CPU_4,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
870 C_DMA_IPERIF_PRIO_CPU_4, // set same as the IMIF priority. Actual value need to decided
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
871 C_DMA_EMIF_DMA_PRIO_7, // Actual value need to be decided
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
872 C_DMA_EMIF_MCU_PRIO_5 // Actual value need to be decided
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
873 };
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
874
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
875 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
876
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
877
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
878 #if (GSM_IDLE_RAM != 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
879
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
880 #define IRQ_STACK_SIZE 128
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
881 #pragma DATA_SECTION(irq_stack,".irqstk");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
882 UWORD32 irq_stack[IRQ_STACK_SIZE/4];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
883 const UWORD32 irq_stack_size = IRQ_STACK_SIZE;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
884
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
885 #define FIQ_STACK_SIZE 512
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
886 #pragma DATA_SECTION(fiq_stack,".fiqstk");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
887 UWORD32 fiq_stack[FIQ_STACK_SIZE/4];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
888 const UWORD32 fiq_stack_size = FIQ_STACK_SIZE;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
889
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
890 #define SVC_STACK_SIZE 1024
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
891 #pragma DATA_SECTION(svc_stack,".svcstk");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
892 UWORD32 svc_stack[SVC_STACK_SIZE/4];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
893 const UWORD32 svc_stack_size = SVC_STACK_SIZE;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
894
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
895 #define TIMER_HISR_STACK_SIZE 1024
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
896 #pragma DATA_SECTION(timer_hisr_stack,".timstk");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
897 UWORD32 timer_hisr_stack[TIMER_HISR_STACK_SIZE/4];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
898 const UWORD32 timer_hisr_stack_size = TIMER_HISR_STACK_SIZE;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
899 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
900
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
901 /* HISR_STACK_SHARING: Create global stacks to be used by all HISRs
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
902 * having the same priority */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
903
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
904
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
905
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
906 #if (CODE_VERSION != SIMULATION)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
907 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
908 * Init_Target
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
909 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
910 * Performs low-level HW Initialization.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
911 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
912 void Init_Target(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
913 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
914
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
915
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
916 #if (BOARD==70)|| (BOARD==71)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
917 /* Variable for reading the BCR for MCP RAM */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
918 unsigned short bcrTmpVal;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
919 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
920 (*(volatile Uint16 *) 0xFFFF702A) = 0x0002;//reset the UART module.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
921 #if (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
922 char detect_code[80];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
923 typedef void (*pf_t)(UWORD32, UWORD16 *, UWORD16 *);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
924 extern void ffsdrv_device_id_read(UWORD32 base_addr, UWORD16 *manufact, UWORD16 *device);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
925 pf_t myfp;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
926 UWORD16 manufact;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
927 UWORD16 device_id[3];
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
928
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
929 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
930 #if (BOARD == 5)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
931 #define WS_ROM (1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
932 #define WS_RAM (1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
933 #define WS_APIF (1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
934 #define WS_CS2 (7) /* LCD on EVA3. */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
935 #define WS_CS0 (7) /* DUART on EVA3. UART16750 and latch on A-Sample. */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
936 #define WS_CS1 (7) /* LCD on A-Sample. */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
937
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
938 IQ_InitWaitState (WS_ROM, WS_RAM, WS_APIF, WS_CS2, WS_CS0, WS_CS1);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
939 IQ_InitClock (2); /* Internal clock division factor. */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
940
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
941 IQ_MaskAll (); /* Mask all interrupts. */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
942 IQ_SetupInterrupts (); /* IRQ priorities. */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
943
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
944 TM_DisableWatchdog ();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
945
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
946 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
947 * Reset all TSP and DBG fdefault values
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
948 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
949
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
950 AI_ResetTspIO ();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
951 AI_ResetDbgReg ();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
952 AI_ResetIoConfig ();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
953
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
954 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
955 * Warning! The external reset signal is connected to the Omega and the
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
956 * external device. If the layer 1 is used its initialization removes
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
957 * the external reset. If the application does not use the layer 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
958 * you must remove the external reset (bit 2 of the reset control
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
959 * register 0x505808).
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
960 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
961
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
962 AI_ResetTspIO();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
963 AI_ResetDbgReg();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
964 AI_ResetIoConfig();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
965
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
966 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
967 * Configure all IOs (see RD300 specification).
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
968 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
969
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
970 AI_ConfigBitAsInput (1);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
971 AI_EnableBit (1);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
972
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
973 AI_ConfigBitAsOutput (2);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
974 AI_EnableBit (2);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
975
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
976 AI_ConfigBitAsInput (11);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
977 AI_EnableBit (11);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
978
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
979 AI_ConfigBitAsOutput (13);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
980 AI_EnableBit (13);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
981
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
982 AI_Power (1); /* Maintain power supply. */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
983
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
984 #elif (BOARD == 6) || (BOARD == 7) || (BOARD == 8) || (BOARD == 9) || \
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
985 (BOARD == 40) || (BOARD == 41) || (BOARD == 42) || (BOARD == 43) || (BOARD == 45) || \
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
986 (BOARD == 35) || (BOARD == 46) || (BOARD == 70) || (BOARD == 71)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
987
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
988 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
989 // RIF/SPI rising edge clock for ULYSSE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
990 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
991 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3)|| (ANLG_FAM == 11))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
992 #if ((CHIPSET >= 3))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
993 #if (CHIPSET == 12)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
994 F_CONF_RIF_RX_RISING_EDGE;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
995 F_CONF_SPI_RX_RISING_EDGE;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
996 #elif (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
997 //do the DRP init here for Locosto
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
998 #if (L1_DRP == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
999 // drp_power_on(); This should be done after the script is downloaded.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1000 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1001 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1002 #if (BOARD==35)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1003 *((volatile SYS_UWORD16 *) ASIC_CONF) = 0x2000;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1004 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1005 *((volatile SYS_UWORD16 *) ASIC_CONF) = 0x6000;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1006 #endif /* (BOARD == 35) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1007 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1008 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1009 #endif /* ANLG(ANALOG)) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1010
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1011 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1012 #if (BOARD == 40) || (BOARD == 41) || \
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1013 (BOARD == 42) || (BOARD == 43) || (BOARD == 45)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1014 // enable 8 Ohm amplifier for audio on D-sample
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1015 AI_ConfigBitAsOutput (1);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1016 AI_SetBit(1);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1017 #elif (BOARD == 70) || (BOARD == 71)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1018 //Locosto I-sample or UPP costo board.BOARD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1019 // Initialize the ARMIO bits as per the I-sample spec
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1020 // FIXME
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1021 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1022 #endif /* (OP_L1_STANDALONE == 1) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1023 #endif /* PSP_STANDALONE ==0 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1024
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1025 // Watchdog
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1026 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1027 TM_DisableWatchdog(); /* Disable Watchdog */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1028 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1029 TM_SEC_DisableWatchdog();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1030 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1031
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1032 #if ((CHIPSET == 4) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12) || (CHIPSET == 15))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1033
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1034 #if (CHIPSET == 12)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1035
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1036 #if 0 /* example of configuration for DMA debug */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1037 #if (BOARD == 6) /* debug on EVA 4 , GPO2 must not be changed */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1038
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1039 /* TPU_FRAME, NMIIT, IACKn */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1040 F_DBG_IRQ_CONFIG(C_DBG_IRQ_IRQ4|C_DBG_IRQ_NMIIT|C_DBG_IRQ_IACKN);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1041
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1042 /* NDMA_REQ_VIEW1, NDMA_REQ_VIEW0, DMA_V(1), DMA_S(1), DMAREQ_P1(3:0)*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1043 F_DBG_DMA_P1_NDFLASH_CONFIG(C_DBG_DMA_P1_NDFLASH_NDMA_REQ_VIEW_1 |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1044 C_DBG_DMA_P1_NDFLASH_NDMA_REQ_VIEW_0 |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1045 C_DBG_DMA_P1_NDFLASH_DMA_REQ_P1_3 |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1046 C_DBG_DMA_P1_NDFLASH_DMA_REQ_P1_2 |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1047 C_DBG_DMA_P1_NDFLASH_DMA_REQ_P1_1 |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1048 C_DBG_DMA_P1_NDFLASH_DMA_REQ_P1_0 |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1049 C_DBG_DMA_P1_NDFLASH_DMA_REQ_S_1 |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1050 C_DBG_DMA_P1_NDFLASH_DMA_REQ_V1 );
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1051 /* DMA_REQ_S(2)*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1052 F_DBG_DMA_P2_CONFIG(C_DBG_DMA_P2_DMA_REQ_S2);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1053
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1054 /* DMA_CLK_REQ, BRIDGE_CLK */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1055 F_DBG_CLK1_CONFIG(C_DBG_CLK1_DMA_CLK_REQ |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1056 C_DBG_CLK1_BRIDGE_CLK );
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1057
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1058 /* XIO_nREADY */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1059 F_DBG_IMIF_CONFIG(C_DBG_IMIF_XIO_NREADY_MEM);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1060
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1061 /* DSP_nIRQ_VIEW1, DSP_nIRQ_VIEW0, BRIDGE_EN */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1062 F_DBG_KB_USIM_SHD_CONFIG(C_DBG_KB_USIM_SHD_DSP_NIRQ_VIEW_1 |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1063 C_DBG_KB_USIM_SHD_DSP_NIRQ_VIEW_0 |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1064 C_DBG_KB_USIM_SHD_BRIDGE_EN );
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1065
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1066 /* RHEA_nREADY , RHEA_nSTROBE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1067 F_DBG_USIM_CONFIG(C_DBG_USIM_RHEA_NSTROBE |
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1068 C_DBG_USIM_RHEA_NREADY );
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1069
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1070 /* XIO_STROBE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1071 F_DBG_MISC2_CONFIG(C_DBG_MISC2_X_IOSTRBN);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1072
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1073 /* DMA_CLK_REQ */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1074 F_DBG_CLK2_CONFIG(C_DBG_CLK2_DMA_CLK_REQ2);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1075
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1076 /* DSP_IRQ_SEL0=DMA, DSP_IRQ_SEL1=DMA, DMA_REQ_SEL0=RIF_RX, DMA_REQ_SEL1=RIF_RX */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1077 F_DBG_VIEW_CONFIG(0,0,C_DBG_DSP_INT_DMA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1078 C_DBG_DSP_INT_DMA,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1079 C_DMA_CHANNEL_RIF_RX,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1080 C_DMA_CHANNEL_RIF_RX);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1081
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1082 #endif /* (BOARD == 6) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1083 #endif /* DMA debug example */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1084 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1085 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1086 * Configure ASIC in order to output the DPLL and ARM clock
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1087 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1088 // (*( volatile UWORD16* )(0xFFFEF008)) = 0x8000; // DPLL
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1089 // (*( volatile UWORD16* )(0xFFFEF00E)) = 0x0004; // ARM clock
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1090 // (*( volatile UWORD16* )(0xfffef004)) = 0x0600; // DSP clock + nIACK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1091 #endif /* (CHIPSET == 12) || CHIPSET == 15*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1092
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1093
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1094 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1095 * Enable/Disable of clock switch off for INTH, TIMER, BRIDGE and DPLL modules
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1096 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1097 // IRQ, Timer and bridge may SLEEP
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1098 // In first step, same configuration as SAMSON
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1099 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1100 #if (CHIPSET == 12)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1101 CLKM_INITCNTL(CLKM_IRQ_DIS | CLKM_TIMER_DIS | CLKM_BRIDGE_DIS | CLKM_DPLL_DIS);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1102 #elif (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1103 CLKM_INITCNTL(CLKM_IRQ_DIS | CLKM_TIMER_DIS | CLKM_CPORT_EN | CLKM_BRIDGE_DIS | 0x8000 ); /* CLKM_DPLL_DIS is remove by Ranga*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1104
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1105 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1106 CLKM_INITCNTL(CLKM_IRQ_DIS | CLKM_TIMER_DIS);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1107
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1108 // Select VTCXO input frequency
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1109 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1110 CLKM_UNUSED_VTCXO_26MHZ;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1111
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1112 // Rita RF uses 26MHz VCXO
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1113 #if (RF_FAM == 12)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1114 CLKM_USE_VTCXO_26MHZ;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1115 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1116 // Renesas RF uses 26MHz on F-sample but 13MHz on TEB
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1117 #if (RF_FAM == 43) && (BOARD == 46)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1118 CLKM_USE_VTCXO_26MHZ;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1119 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1120 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1121
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1122 #if (CHIPSET ==15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1123 //Enable APLL
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1124 *((volatile unsigned short *) (C_MAP_CLKM_BASE+0x10)) = 0x01|0x6;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1125 // UART Clock from APLL
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1126 *((volatile unsigned short *) CLKM_CNTL_CLK_PROG_FREE_RUNN) = 0x0001;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1127 (*(volatile Uint16 *) 0xFFFF702A) = 0x0002;//reset the UART module.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1128
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1129 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1130
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1131
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1132
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1133
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1134 //
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1135 // Control HOM/SAM automatic switching
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1136 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1137 *((volatile unsigned short *) CLKM_CNTL_CLK) &= ~CLKM_EN_IDLE3_FLG;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1138
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1139 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1140 * Disable and Clear all pending interrupts
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1141 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1142 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1143 F_INTH_DISABLE_ALL_IT; // MASK all it
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1144 F_INTH2_VALID_NEXT(C_INTH_IRQ); // reset current IT in INTH2 IRQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1145 F_INTH_VALID_NEXT(C_INTH_IRQ); // reset current IT in INTH IRQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1146 F_INTH_VALID_NEXT(C_INTH_FIQ); // reset current IT in INTH FIQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1147 F_INTH_RESET_ALL_IT; // reset all IRQ/FIQ source
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1148 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1149 INTH_DISABLEALLIT;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1150 INTH_RESETALLIT;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1151 INTH_CLEAR; /* reset IRQ/FIQ source */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1152 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1153
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1154 #if (CHIPSET == 12)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1155 /* API-RHEA control register configuration */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1156 f_memif_init_api_rhea_ctrl(C_MEMIF_API_RHEA_ADAPT,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1157 C_MEMIF_API_RHEA_ADAPT,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1158 C_MEMIF_API_RHEA_ADAPT,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1159 C_MEMIF_API_RHEA_NO_DEBUG);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1160
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1161 #if ((BOARD == 43) || (BOARD == 45))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1162 // if Esample,Evaconso active extended page mode
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1163 // With Calypso+ chipset, extended page mode can be enabled
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1164 // only if W_A_CALYPSO_PLUS_SPR_19599 is set to one in l1_confg.h.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1165 // see L1_MCU-SPR-17515 and L1_MCU-SPR-19599 for more information
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1166 f_memif_extended_page_mode_enable();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1167 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1168 #endif /* (CHIPSET == 12) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1169
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1170 #if (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1171 /* API-RHEA control register configuration */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1172 f_emif_api_rhea_conf(C_RHEA_STROBE0_ACCESS_SIZE_ADAPT_ENABLE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1173 C_RHEA_STROBE1_ACCESS_SIZE_ADAPT_ENABLE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1174 C_API_ACCESS_SIZE_ADAPT_ENABLE,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1175 C_ARM_DEBUG_DISABLE);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1176 #if (BOARD == 70) || (BOARD == 71)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1177 // set the EMIF settings here for locosto
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1178 // We could have the default settings here and
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1179 // then change it after dynamic clock config
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1180 /* MCP RAM Setting Is being done here */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1181 #if 0 /* This is commented out by Ranga */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1182 #if (PSP_FAILSAFE!=1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1183 bcrTmpVal = *((volatile unsigned char *)0x007FFFFFE);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1184 bcrTmpVal +=1;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1185 bcrTmpVal = *((volatile unsigned char *)0x007FFFFFE);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1186 *((volatile unsigned char *)0x007FFFFFE)=0x0001;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1187 *((volatile unsigned char *)0x007FFFFFE)=0x1542;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1188
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1189 /* Setting NOR Flash to these 3 Wait State */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1190 *((volatile char *)0x06000AAA)=0xAA;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1191 *((volatile char *)0x06000555)=0x55;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1192 *((volatile char *)0x06016AAA)=0xC0;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1193 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1194 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1195 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1196 #endif /* (CHIPSET == 15) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1197
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1198
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1199 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1200 * Initialize current DSP clock to 0 in order to pass through
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1201 * the right DSP latency configuration (increase DSP clock)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1202 * in f_dynamic_clock_cfg().
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1203 * Obviously, the real DSP clock is not 0kHz.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1204 * d_dsp_cur_clk will be updated after clock configuration in f_dynamic_clock_cfg().
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1205 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1206 d_dsp_cur_clk = 0; // Used to keep track of current DSP clock.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1207
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1208 /* Dynamic clock configuration */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1209 f_dynamic_clock_cfg(C_CLOCK_CFG_DEFAULT);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1210
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1211 // Write_en_0 = 0 , Write_en_1 = 0
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1212 RHEA_INITARM(0,0);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1213
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1214 #if (CHIPSET ==15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1215 // Mark USB on 52 MHZ Clock
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1216 *((volatile unsigned short *) (CLKM_CNTL_CLK_USB)) = 0x02;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1217 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1218
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1219 #if (CHIPSET == 12) || ((CHIPSET == 10) && (OP_WCP == 1))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1220 /* Allocate the 0.5 Mbits Shared RAM to the DSP */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1221 f_memif_shared_sram_allocation(C_MEMIF_DSPMS_0_5MBITS_TO_DSP);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1222 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1223
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1224 // INTH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1225 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1226 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1227 #if (GSM_IDLE_RAM != 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1228 f_inth_setup((T_INTH_CONFIG *)a_inth_config_idle_ram); // setup configuration IT handlers
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1229 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1230 f_inth_setup((T_INTH_CONFIG *)a_inth_config); // setup configuration IT handlers
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1231 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1232 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1233 IQ_SetupInterrupts();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1234 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1235
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1236
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1237 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1238 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1239
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1240 f_dma_global_parameter_set((T_DMA_TYPE_GLOBAL_PARAMETER *)&d_dma_global_parameter);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1241 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1242 f_dma_channel_allocation_set(C_DMA_CHANNEL_0, C_DMA_CHANNEL_DSP);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1243 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1244 f_dma_global_parameter_set((T_DMA_TYPE_GLOBAL_PARAMETER *)&d_dma_global_parameter);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1245 f_dma_channel_allocation_set(C_DMA_CHANNEL_0, C_DMA_CHANNEL_DSP);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1246 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1247
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1248 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1249 // DMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1250 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1251 // channel0 = Arm, channel1 = Lead, channel2 = forced to Arm, channel3=forced to Arm, dma_burst = 0001, priority = same
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1252 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1253 DMA_ALLOCDMA(1,0,1,1); // Channel 1 used by DSP with RIF RX
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1254 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1255 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1256
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1257 /* CHIPSET = 4 or 7 or 8 or 10 or 11 or 12 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1258
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1259 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1260
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1261 // RHEA Bridge
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1262 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1263 // ACCES_FAC_0 = 0, ACCES_FAC_1 = 0 ,TIMEOUT = 0x7F
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1264 RHEA_INITRHEA(0,0,0x7F);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1265
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1266 #if (CHIPSET == 6)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1267 // WS_H = 1 , WS_L = 15
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1268 RHEA_INITAPI(1,15); // should be 0x01E1 for 65 Mhz
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1269 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1270 // WS_H = 0 , WS_L = 7
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1271 RHEA_INITAPI(0,7); // should be 0x0101 for 65 Mhz
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1272 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1273
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1274 // Write_en_0 = 0 , Write_en_1 = 0
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1275 RHEA_INITARM(0,0);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1276
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1277 // INTH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1278 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1279 INTH_DISABLEALLIT; // MASK all it
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1280 INTH_CLEAR; // reset IRQ/FIQ source
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1281 IQ_SetupInterrupts();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1282
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1283 // DMA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1284 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1285 // channel0 = Arm, channel1 = Lead, dma_burst = 0001, priority = same
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1286 DMA_ALLOCDMA(1,0,1,1); // should be 0x25 (channel 1 = lead)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1287
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1288 #if (CHIPSET == 6)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1289 // Memory WS configuration for ULYSS/G1 (26 Mhz) board
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1290 //-----------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1291 MEM_INIT_CS2(2,MEM_DVS_16,MEM_WRITE_EN,0);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1292 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1293
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1294 // CLKM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1295 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1296 CLKM_InitARMClock(0x00, 2); /* no low freq, no ext clock, div by 1 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1297
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1298 #if (CHIPSET == 6)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1299 CLKM_INITCNTL(CLKM_IRQ_DIS | CLKM_BRIDGE_DIS | CLKM_TIMER_DIS | CLKM_VTCXO_26);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1300 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1301 CLKM_INITCNTL(CLKM_IRQ_DIS | CLKM_BRIDGE_DIS | CLKM_TIMER_DIS);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1302 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1303
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1304 #endif /* CHIPSET = 4 or 7 or 8 or 10 or 11 or 12 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1305
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1306 // Freeze ULPD timer ....
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1307 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1308 *((volatile SYS_UWORD16 *) ULDP_GSM_TIMER_INIT_REG ) = 0;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1309 *((volatile SYS_UWORD16 *) ULDP_GSM_TIMER_CTRL_REG ) = TPU_FREEZE;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1310
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1311 // reset INC_SIXTEEN and INC_FRAC
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1312 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1313 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1314 l1ctl_pgm_clk32(DEFAULT_HFMHZ_VALUE,DEFAULT_32KHZ_VALUE);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1315 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1316 ULDP_INCSIXTEEN_UPDATE(132); //32768.29038 =>132, 32500 => 133
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1317 // 26000 --> 166
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1318 ULDP_INCFRAC_UPDATE(15840); //32768.29038 =>15840, 32500 => 21845
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1319 // 26000 --> 43691
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1320 #endif /* OP_L1_STANDALONE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1321
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1322 // program ULPD WAKE-UP ....
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1323 //=================================================
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1324 #if (CHIPSET == 2)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1325 *((volatile SYS_UWORD16 *)ULDP_SETUP_FRAME_REG) = SETUP_FRAME; // 2 frame
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1326 *((volatile SYS_UWORD16 *)ULDP_SETUP_VTCXO_REG) = SETUP_VTCXO; // 31 periods
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1327 *((volatile SYS_UWORD16 *)ULDP_SETUP_SLICER_REG) = SETUP_SLICER; // 31 periods
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1328 *((volatile SYS_UWORD16 *)ULDP_SETUP_CLK13_REG) = SETUP_CLK13; // 31 periods
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1329 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1330 *((volatile SYS_UWORD16 *)ULDP_SETUP_FRAME_REG) = SETUP_FRAME; // 3 frames
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1331 *((volatile SYS_UWORD16 *)ULDP_SETUP_VTCXO_REG) = SETUP_VTCXO; // 0 periods
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1332 *((volatile SYS_UWORD16 *)ULDP_SETUP_SLICER_REG) = SETUP_SLICER; // 31 periods
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1333 *((volatile SYS_UWORD16 *)ULDP_SETUP_CLK13_REG) = SETUP_CLK13; // 31 periods
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1334 *((volatile SYS_UWORD16 *)ULPD_SETUP_RF_REG) = SETUP_RF; // 31 periods
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1335 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1336
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1337 #if (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1338 *((volatile SYS_UWORD16 *)ULPD_DCXO_SETUP_SLEEPN) = SETUP_SLEEPZ; // 0
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1339 *((volatile SYS_UWORD16 *)ULPD_DCXO_SETUP_SYSCLKEN) = SETUP_SYSCLKEN; // 255 clocks of 32 KHz for 7.8 ms DCXO delay for Locosto
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1340 *((volatile SYS_UWORD16 *)0xFFFEF192) = 0x1; //CLRZ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1341 *((volatile SYS_UWORD16 *)0xFFFEF190) = 0x2; //SLPZ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1342 *((volatile SYS_UWORD16 *)0xFFFEF18E)= 0x2; //SYSCLKEN
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1343 *((volatile SYS_UWORD16 *)0xFFFEF186) = 0x2; //CLK13_EN
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1344 *((volatile SYS_UWORD16 *)0xFFFEF18A) = 0x2; //DRP_DBB_SYSCLK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1345
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1346
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1347
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1348
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1349 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1350
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1351 // Set Gauging versus HF (PLL)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1352 //=================================================
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1353 ULDP_GAUGING_SET_HF; // Enable gauging versus HF
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1354 ULDP_GAUGING_HF_PLL; // Gauging versus PLL
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1355
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1356 // current supply for quartz oscillation
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1357 //=================================================
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1358 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1359 #if ((CHIPSET != 9) && (CHIPSET != 12) && (CHIPSET !=15)) // programming model changed for Ulysse C035, stay with default value
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1360 *(volatile SYS_UWORD16 *)QUARTZ_REG = 0x27;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1361 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1362 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1363 #if ((BOARD == 6) || (BOARD == 8) || (BOARD == 9) || (BOARD == 35) || (BOARD == 40) || (BOARD == 41))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1364 *((volatile SYS_UWORD16 *)QUARTZ_REG) = 0x27;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1365 #elif (BOARD == 7)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1366 *((volatile SYS_UWORD16 *)QUARTZ_REG) = 0x24;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1367 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1368 #endif /* OP_L1_STANDALONE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1369
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1370 // stop Gauging if any (debug purpose ...)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1371 //--------------------------------------------------
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1372 if ( *((volatile SYS_UWORD16 *) ULDP_GAUGING_CTRL_REG) & ULDP_GAUGING_EN)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1373 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1374 volatile UWORD32 j;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1375 ULDP_GAUGING_STOP; /* Stop the gauging */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1376 /* wait for gauging it*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1377 // one 32khz period = 401 periods of 13Mhz
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1378 for (j=1; j<50; j++);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1379 while (! (* (volatile SYS_UWORD16 *) ULDP_GAUGING_STATUS_REG) & ULDP_IT_GAUGING);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1380 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1381
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1382 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1383 AI_ClockEnable ();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1384
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1385 #if (BOARD == 7)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1386 // IOs configuration of the B-Sample in order to optimize the power consumption
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1387 AI_InitIOConfig();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1388
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1389 // Set LPG instead of DSR_MODEM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1390 *((volatile SYS_UWORD16 *) ASIC_CONF) |= 0x40;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1391 // Reset the PERM_ON bit of LCR_REG
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1392 *((volatile SYS_UWORD16 *) MEM_LPG) &= ~(0x80);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1393 #elif ((BOARD == 8) || (BOARD == 9))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1394 // IOs configuration of the C-Sample in order to optimize the power consumption
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1395 AI_InitIOConfig();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1396
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1397 // set the debug latch to 0x00.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1398 *((volatile SYS_UWORD8 *) 0x2800000) = 0x00;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1399 #elif ((BOARD == 35) || (BOARD == 46))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1400 AI_InitIOConfig();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1401 // CSMI INTERFACE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1402 // Initialize CSMI clients for GSM control
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1403 // and Fax/Data services
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1404 CSMI_Init();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1405 GC_Initialize(); // GSM control initialization
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1406 CU_Initialize(); // Trace initialization
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1407 CF_Initialize(); // Fax/Data pre-initialization
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1408 #elif ((BOARD == 40) || (BOARD == 41))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1409 // IOs configuration of the D-Sample in order to optimize the power consumption
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1410 AI_InitIOConfig();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1411
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1412 #ifdef BTEMOBILE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1413 // Reset BT chip by toggling the Island's nRESET_OUT signal
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1414 *((volatile SYS_UWORD16 *) 0xFFFFFD04) |= 0x04;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1415 *((volatile SYS_UWORD16 *) 0xFFFFFD04) &= ~(0x4);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1416 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1417
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1418 // set the debug latch to 0x0000.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1419 *((volatile SYS_UWORD16 *) 0x2700000) = 0x0000;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1420 #elif ((BOARD == 70) || (BOARD == 71))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1421 AI_InitIOConfig();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1422 /* Mark The System configuration According to I-Sample */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1423 /* Adding GPIO Mux Setting Here */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1424 pin_configuration_all(); // Init Tuned for Power Management
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1425 /* A22 is Enabled in int.s hence not Here */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1426 /* FIXME: PULL_UP Enable and PULL UP Values Need to revisited */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1427
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1428 /* Add code to find out the manufacture id of NOR flash*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1429
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1430 // Copy ffsdrv_device_id_read() function code to RAM. The only known
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1431 // way to determine the size of the code is to look either in the
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1432 // linker-generated map file or in the assember output file.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1433 ffsdrv_copy_code_to_ram((UWORD16 *) detect_code,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1434 (UWORD16 *) &ffsdrv_device_id_read,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1435 sizeof(detect_code));
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1436
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1437 // Combine bit 0 of the thumb mode function pointer with the address
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1438 // of the code in RAM. Then call the detect function in RAM.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1439 myfp = (pf_t) (((int) &ffsdrv_device_id_read & 1) | (int) detect_code);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1440 (*myfp)(0x06000000, &manufact, device_id);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1441
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1442 enable_ps_ram_burst();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1443
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1444 if( 0x7e == device_id[0] )
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1445 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1446 enable_flash_burst();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1447 flash_device_id = 0x7E;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1448 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1449 else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1450 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1451 enable_flash_burst_mirror();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1452 flash_device_id = 0;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1453 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1454
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1455
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1456 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1457 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1458 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1459 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1460 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1461 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1462 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1463 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1464
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1465 #if 0 // Init Changed for tuning to Power Management -Old Init Commented
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1466 /* Ball N9 Mapped to TSPACT_8 (TPU) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1467 F_IO_CONFIG(C_CONF_GPIO_5,C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1468 /* Ball A6 ND_WE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1469 F_IO_CONFIG(C_CONF_GPIO_18,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1470 /* Ball C2 ND_RDY */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1471 F_IO_CONFIG(C_CONF_GPIO_34,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1472 /* Ball C3 ND_RE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1473 F_IO_CONFIG(C_CONF_GPIO_31,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1474 /* BALL E5 CAM_D_4 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1475 F_IO_CONFIG(C_CONF_ND_NWP,0x02);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1476 /* BALL F6 ND_CLE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1477 F_IO_CONFIG(C_CONF_GPIO_32,C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1478 /* BALL H8 ND_ALE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1479 F_IO_CONFIG(C_CONF_GPIO_33,C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1480 /* BALL E10 LCD_NCS0 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1481 F_IO_CONFIG(C_CONF_GPIO_13,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1482 /* BALL C11 GPIO_10 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1483 F_IO_CONFIG(C_CONF_GPIO_10,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1484 /* BALL D10 GPIO_11 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1485 F_IO_CONFIG(C_CONF_GPIO_11,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1486 /* BALL M6 CAM_D_1 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1487 F_IO_CONFIG(C_CONF_GPIO_0,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x02);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1488 /* BALL N5 CAM_D_0 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1489 F_IO_CONFIG(C_CONF_GPIO_47,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x02);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1490 /* BALL A5 CAM_LCLK */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1491 F_IO_CONFIG(C_CONF_GPIO_21,0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1492 /* BALL C6 CAM_XCLK */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1493 F_IO_CONFIG(C_CONF_GPIO_22,0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1494 /* BALL E7 CAM_VS */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1495 F_IO_CONFIG(C_CONF_GPIO_20,0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1496 /* BALL F8 CAM_HS */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1497 F_IO_CONFIG(C_CONF_GPIO_19,0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1498 /* BALL K7 MCSI_TX */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1499 F_IO_CONFIG(C_CONF_GPIO_45,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1500 /* BALL M5 MCSI_FS */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1501 F_IO_CONFIG(C_CONF_GPIO_44,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1502 /* BALL N3 MCSI_CK */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1503 F_IO_CONFIG(C_CONF_GPIO_43,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1504 /* BALL P2 MCSI_RX */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1505 F_IO_CONFIG(C_CONF_GPIO_46,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1506 /* BALL B11 TSPACT_10 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1507 F_IO_CONFIG(C_CONF_GPIO_12,C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1508 /* BALL B3 CAM_D_5 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1509 F_IO_CONFIG(C_CONF_GPIO_30,C_CONF_PUPD_EN|0x03);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1510 /* BALL C4 CAM_D_7 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1511 F_IO_CONFIG(C_CONF_GPIO_28,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x03);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1512 /* BALL C5 SPI_DATA_MOSI */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1513 F_IO_CONFIG(C_CONF_GPIO_25,C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1514 /* BALL E6 SPI_NCS0 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1515 F_IO_CONFIG(C_CONF_GPIO_26,C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1516 /* BALL F7 SPI_DATA_MIS0 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1517 F_IO_CONFIG(C_CONF_GPIO_24,C_CONF_PUPD_EN|0x03);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1518 /* BALL G6 CAM_D_2 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1519 F_IO_CONFIG(C_CONF_GPIO_7,C_CONF_PUPD_EN|0x05);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1520 /* BALL G7 CAM_D_6 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1521 F_IO_CONFIG(C_CONF_GPIO_29,C_CONF_PUPD_EN|0x03);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1522 /* BALL G8 SPI_NCS1 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1523 F_IO_CONFIG(C_CONF_GPIO_27,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1524 /* BALL G9 SPI_CLK */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1525 F_IO_CONFIG(C_CONF_GPIO_23,C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1526 /* BALL L6 CKM */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1527 F_IO_CONFIG(C_CONF_GPIO_42,C_CONF_PUPD_VAL|C_CONF_PUPD_EN|0x01);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1528
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1529 /*By default the muxed bus is given to LCD*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1530 C_CONF_LCD_CAM_NAN_REG=0x03;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1531
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1532 #endif // for #if 0 Init Changed for Power Management
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1533 #endif // BOARD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1534
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1535 // Enable HW Timers 1 & 2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1536 TM_EnableTimer (1);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1537 TM_EnableTimer (2);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1538
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1539 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1540 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1541 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1542 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1543 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1544 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1545 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1546 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1547 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1548 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1549 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1550 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1551 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1552 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1553 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1554 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1555 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1556 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1557 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1558 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1559 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1560 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1561 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1562 asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1563 #endif /* (OP_L1_STANDALONE == 0) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1564
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1565 #endif /* #if (BOARD == 5) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1566 #if(OP_L1_STANDALONE == 1 && MIRROR_BIT == 1 ) //temp FIX for L1 standalone-this fix will work only for I-sample mirror bit
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1567 //#if(OP_L1_STANDALONE == 1 )
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1568 //AI_InitIOConfig();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1569 //pin_configuration_all(); // Init Tuned for Power Management
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1570 //enable_ps_ram_burst();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1571 //enable_flash_burst_mirror();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1572 flash_device_id = 0;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1573 //asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1574 //asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1575 //asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1576 //asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1577 //asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1578 //asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1579 //asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1580 //asm(" NOP");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1581 #elif(OP_L1_STANDALONE == 1 && MIRROR_BIT == 0 )
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1582 flash_device_id = 0x7E;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1583 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1584
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1585
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1586 #if GSM_IDLE_RAM_DEBUG
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1587 #if (CHIPSET!=15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1588 *((volatile SYS_UWORD16 *) 0xFFFE4806) = (0x0020);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1589 AI_ConfigBitAsOutput(3);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1590 AI_ConfigBitAsOutput(2);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1591 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1592 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1593 #if (CHIPSET==15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1594 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1595 volatile unsigned int * configReg=(volatile unsigned int *)0xFFFEF01C;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1596 *configReg &= 0xF7FF;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1597 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1598 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1599
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1600 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1601
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1602 //--> Init Added for Power Management
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1603 /*******************************************************
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1604 Configure ALL I/O pins
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1605 *******************************************************/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1606 void pin_configuration_all(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1607 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1608 pin_configuration_bluetooth();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1609 pin_configuration_emifs();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1610 pin_configuration_system();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1611 pin_configuration_lcd_nand(0);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1612 pin_configuration_keypad();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1613 pin_configuration_sim();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1614 pin_configuration_radio();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1615 pin_configuration_usb();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1616 pin_configuration_camera_irda(1);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1617 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1618
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1619 /*******************************************************
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1620 Configure Bluetooth I/O pins
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1621 *******************************************************/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1622 void pin_configuration_bluetooth(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1623 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1624 GPIO_DIRECTION_OUT(37); GPIO_CLEAR_OUTPUT(37); // BT_nSHUTDOWN
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1625 CONF_GPIO_43 = MUX_CFG(1, PULLOFF); // MCSI_CK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1626 CONF_GPIO_44 = MUX_CFG(1, PULLOFF); // MCSI_FS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1627 CONF_GPIO_45 = MUX_CFG(1, PULLOFF); // MCSI_TX
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1628 CONF_GPIO_46 = MUX_CFG(1, PULLOFF); // MCSI_RX
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1629 CONF_UART_CTS = MUX_CFG(0, PULLOFF); // CTS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1630 CONF_UART_RX = MUX_CFG(0, PULLOFF); // RX
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1631 CONF_UART_TX = MUX_CFG(0, PULLOFF); // TX
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1632 CONF_GPIO_37 = MUX_CFG(0, PULLOFF); // BT_SHUTDOWN
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1633 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1634
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1635 /*******************************************************
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1636 Configure EMIFS I/O pins
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1637 *******************************************************/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1638 void pin_configuration_emifs(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1639 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1640 CONF_ADD_21 = MUX_CFG(0, PULLOFF); // ADD21
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1641 CONF_GPIO_39 = MUX_CFG(1, PULLOFF); // ADD22
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1642 CONF_GPIO_38 = MUX_CFG(0, PULLOFF); // nCS0
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1643 CONF_NCS3 = MUX_CFG(0, PULLOFF); // nCS3
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1644 CONF_ADV = MUX_CFG(0, PULLOFF); // ADV
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1645 CONF_NMOE = MUX_CFG(0, PULLOFF); // nMOE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1646 CONF_RNW = MUX_CFG(0, PULLOFF); // RnW
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1647 CONF_GPIO_42 = MUX_CFG(1, PULLOFF); // CKM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1648 CONF_NRDY = MUX_CFG(0, PULLUP); // nRDYMEM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1649 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1650
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1651 /*******************************************************
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1652 Configure system I/O pins
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1653 *******************************************************/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1654 void pin_configuration_system(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1655 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1656 GPIO_DIRECTION_IN(1); // GPIO_1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1657 GPIO_DIRECTION_OUT(2); GPIO_CLEAR_OUTPUT(2); // SYS_RESET
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1658 GPIO_DIRECTION_IN(10); // Not used (nEMU0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1659 CONF_CK13MHZ_EN = MUX_CFG(0, PULLOFF); // CK13MHZ_EN
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1660 CONF_ABB_IRQ = MUX_CFG(0, PULLUP); // ABB_IRQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1661 CONF_GPIO_5 = MUX_CFG(1, PULLOFF); // STARTADC
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1662 CONF_CDO = MUX_CFG(0, PULLOFF); // CDO (I2S)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1663 CONF_CSCLK = MUX_CFG(0, PULLOFF); // CSCLK (I2S)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1664 CONF_CSYNC = MUX_CFG(0, PULLOFF); // CSYNC (I2S)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1665 CONF_NBSCAN = MUX_CFG(0, PULLUP); // nBSCAN
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1666 CONF_SPARE_3 = MUX_CFG(0, PULLUP); // Spare3
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1667 CONF_TDO = MUX_CFG(0, PULLOFF); // TDO
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1668
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1669 // JTAG pulls are disabled on I-Sample due to external buffers.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1670 // CONF_TCK = MUX_CFG(0, PULLDOWN); // TCK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1671 // CONF_TDI = MUX_CFG(0, PULLUP); // TDI
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1672 // CONF_TMS = MUX_CFG(0, PULLUP); // TMS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1673 // CONF_TRST = MUX_CFG(0, PULLUP); // TRST
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1674 CONF_TCK = MUX_CFG(0, PULLOFF); // TCK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1675 CONF_TDI = MUX_CFG(0, PULLOFF); // TDI
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1676 CONF_TMS = MUX_CFG(0, PULLOFF); // TMS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1677 CONF_TRST = MUX_CFG(0, PULLOFF); // TRST
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1678
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1679 CONF_VDR = MUX_CFG(0, PULLOFF); // VDR
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1680 CONF_VFSRX = MUX_CFG(0, PULLDOWN); // VFSRX
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1681 CONF_GPIO_1 = MUX_CFG(0, PULLUP); // Not used GPIO
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1682 CONF_GPIO_2 = MUX_CFG(0, PULLOFF); // SYS_RESET
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1683 CONF_GPIO_10 = MUX_CFG(1, PULLUP); // Not used (NEMU0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1684 CONF_GPIO_12 = MUX_CFG(2, PULLOFF); // TSPACT10
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1685 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1686
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1687 /*******************************************************
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1688 Configure LCD and NAND Flash I/O pins
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1689 Mode = 0 : LCD functional. NAND not functional
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1690 Mode = 1 : NAND functional. LCD not functional
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1691 *******************************************************/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1692 void pin_configuration_lcd_nand(int mode)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1693 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1694 CONF_ND_CE1 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1695 CONF_GPIO_18 = MUX_CFG(1, PULLOFF); // ND_WE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1696 CONF_GPIO_31 = MUX_CFG(1, PULLOFF); // ND_RE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1697 CONF_GPIO_32 = MUX_CFG(1, PULLOFF); // ND_CLE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1698 CONF_GPIO_33 = MUX_CFG(1, PULLOFF); // ND_ALE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1699 CONF_GPIO_34 = MUX_CFG(1, PULLUP); // ND_RDY
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1700 CONF_LCD_NRST = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1701 CONF_LCD_RNW = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1702 CONF_LCD_RS = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1703 CONF_LCD_STB = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1704 CONF_GPIO_13 = MUX_CFG(1, PULLOFF); // LCD_NCS0
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1705 switch(mode)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1706 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1707 case 0: // LCD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1708 CONF_LCD_DATA_0 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1709 CONF_LCD_DATA_1 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1710 CONF_LCD_DATA_2 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1711 CONF_LCD_DATA_3 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1712 CONF_LCD_DATA_4 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1713 CONF_LCD_DATA_5 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1714 CONF_LCD_DATA_6 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1715 CONF_LCD_DATA_7 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1716 break;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1717 case 1: // NAND
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1718 CONF_LCD_DATA_0 = MUX_CFG(3, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1719 CONF_LCD_DATA_1 = MUX_CFG(3, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1720 CONF_LCD_DATA_2 = MUX_CFG(3, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1721 CONF_LCD_DATA_3 = MUX_CFG(3, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1722 CONF_LCD_DATA_4 = MUX_CFG(3, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1723 CONF_LCD_DATA_5 = MUX_CFG(3, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1724 CONF_LCD_DATA_6 = MUX_CFG(3, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1725 CONF_LCD_DATA_7 = MUX_CFG(3, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1726 break;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1727 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1728 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1729
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1730 /*******************************************************
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1731 Configure keypad pins
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1732 *******************************************************/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1733 void pin_configuration_keypad(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1734 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1735 CONF_GPIO_8 = MUX_CFG(0, PULLUP); // KBR4
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1736 CONF_GPIO_9 = MUX_CFG(0, PULLOFF); // KBC4
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1737 CONF_KBC_0 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1738 CONF_KBC_1 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1739 CONF_KBC_2 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1740 CONF_KBC_3 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1741 CONF_KBR_0 = MUX_CFG(0, PULLUP);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1742 CONF_KBR_1 = MUX_CFG(0, PULLUP);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1743 CONF_KBR_2 = MUX_CFG(0, PULLUP);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1744 CONF_KBR_3 = MUX_CFG(0, PULLUP);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1745 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1746
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1747 /*******************************************************
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1748 Configure SIM I/O pins
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1749 *******************************************************/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1750 void pin_configuration_sim(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1751 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1752 CONF_SIM_CLK = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1753 CONF_SIM_IO = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1754 CONF_SIM_PWCTRL = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1755 CONF_SIM_RST = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1756 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1757
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1758 /*******************************************************
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1759 Configure radio I/O pins
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1760 *******************************************************/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1761 void pin_configuration_radio(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1762 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1763 CONF_TSPACT_11 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1764 CONF_TSPACT_12 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1765 CONF_TSPACT_13 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1766 CONF_TSPACT_14 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1767 CONF_TSPACT_15 = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1768 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1769
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1770 /*******************************************************
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1771 Configure USB I/O pins
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1772 *******************************************************/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1773 void pin_configuration_usb(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1774 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1775 CONF_USB_BOOT = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1776 CONF_USB_DAT = MUX_CFG(0, PULLDOWN);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1777 CONF_USB_RCV = MUX_CFG(0, PULLDOWN);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1778 //CONF_USB_SE0 = MUX_CFG(0, PULLUP); // to reduce 130 uA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1779 CONF_USB_SE0 = MUX_CFG(0, PULLOFF); // to reduce 130 uA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1780 CONF_USB_TXEN = MUX_CFG(0, PULLOFF);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1781 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1782
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1783 /*******************************************************
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1784 Configure Camera and IrDA I/O pins
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1785 Mode = 0 : IrDA functional. Camera not functional
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1786 Mode = 1 : Camera functional. IrDA not functional
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1787 Use mode 1 ONLY when camera is active i.e. use
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1788 mode 0 during sleep
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1789 *******************************************************/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1790 void pin_configuration_camera_irda(int mode)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1791 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1792 GPIO_DIRECTION_OUT(17); GPIO_SET_OUTPUT(17); // CAM_PWDN
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1793 GPIO_DIRECTION_OUT(11); GPIO_SET_OUTPUT(11); // Golden eye sleep
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1794 GPIO_DIRECTION_OUT(35); GPIO_CLEAR_OUTPUT(35); // LED_TRCH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1795 GPIO_DIRECTION_OUT(4); GPIO_SET_OUTPUT(4); // nCAM_RST
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1796 GPIO_DIRECTION_OUT(20); GPIO_CLEAR_OUTPUT(20); // CAM_D_3
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1797 GPIO_DIRECTION_OUT(19); GPIO_CLEAR_OUTPUT(19); // CAM_HS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1798 GPIO_DIRECTION_OUT(21); GPIO_CLEAR_OUTPUT(21); // CAM_LCLK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1799 GPIO_DIRECTION_OUT(36); GPIO_SET_OUTPUT(36); // IrDA_SD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1800 CONF_GPIO_36 = MUX_CFG(0, PULLOFF); // IRDA_SD
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1801 CONF_GPIO_11 = MUX_CFG(1, PULLOFF); // Golden eye sleep (NEMU1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1802 CONF_GPIO_4 = MUX_CFG(0, PULLOFF); // CAM_RESET
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1803 CONF_GPIO_35 = MUX_CFG(0, PULLOFF); // LED_TORCH
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1804 CONF_GPIO_17 = MUX_CFG(0, PULLOFF); // CAM_PWDN
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1805 CONF_GPIO_23 = MUX_CFG(1, PULLDOWN); // SPI_CLK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1806 CONF_GPIO_24 = MUX_CFG(1, PULLDOWN); // SPI_DATA_MISO
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1807 CONF_GPIO_25 = MUX_CFG(1, PULLDOWN); // SPI_DATA_MOSI
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1808 CONF_GPIO_26 = MUX_CFG(1, PULLUP); // SPI_NCS0
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1809 CONF_GPIO_27 = MUX_CFG(1, PULLUP); // SPI_NCS1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1810 CONF_GPIO_22 = MUX_CFG(1, PULLOFF); // CAM_XCLK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1811 switch(mode)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1812 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1813 case 0: // IrDA or sleep
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1814 CONF_GPIO_47 = MUX_CFG(1, PULLUP); // IrDA RXIR
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1815 CONF_GPIO_0 = MUX_CFG(1, PULLOFF); // IrDA TXIR
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1816 CONF_GPIO_7 = MUX_CFG(5, PULLDOWN); // CAM_D_2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1817 CONF_GPIO_20 = MUX_CFG(0, PULLOFF); // CAM_D_3 = GPIO
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1818 CONF_ND_NWP = MUX_CFG(0, PULLOFF); // CAM_D_4 = ND_NWP
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1819 CONF_GPIO_30 = MUX_CFG(3, PULLDOWN); // CAM_D_5
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1820 CONF_GPIO_29 = MUX_CFG(3, PULLDOWN); // CAM_D_6
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1821 CONF_GPIO_28 = MUX_CFG(3, PULLUP); // CAM_D_7
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1822 CONF_GPIO_19 = MUX_CFG(0, PULLOFF); // CAM_HS = GPIO
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1823 CONF_GPIO_21 = MUX_CFG(0, PULLOFF); // CAM_LCLK = GPIO
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1824 break;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1825 case 1: // Camera
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1826 CONF_GPIO_47 = MUX_CFG(2, PULLOFF); // CAM_D_0 + IrDA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1827 CONF_GPIO_0 = MUX_CFG(2, PULLOFF); // CAM_D_1 + IrDA
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1828 CONF_GPIO_7 = MUX_CFG(5, PULLOFF); // CAM_D_2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1829 CONF_GPIO_20 = MUX_CFG(2, PULLOFF); // CAM_D_3
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1830 CONF_ND_NWP = MUX_CFG(2, PULLOFF); // CAM_D_4
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1831 CONF_GPIO_30 = MUX_CFG(3, PULLOFF); // CAM_D_5
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1832 CONF_GPIO_29 = MUX_CFG(3, PULLOFF); // CAM_D_6
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1833 CONF_GPIO_28 = MUX_CFG(3, PULLOFF); // CAM_D_7
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1834 CONF_GPIO_19 = MUX_CFG(1, PULLOFF); // CAM_HS
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1835 CONF_GPIO_21 = MUX_CFG(1, PULLOFF); // CAM_LCLK
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1836 break;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1837 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1838 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1839
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1840 //<-- Init Added for Power Management
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1841
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1842 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1843 * Init_Drivers
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1844 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1845 * Performs Drivers Initialization.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1846 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1847 void Set_Switch_ON_Cause(void);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1848 void Init_Drivers(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1849 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1850
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1851 #if (CHIPSET==15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1852 bspI2c_init();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1853 bspTwl3029_init();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1854
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1855 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1856 Set_Switch_ON_Cause();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1857 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1858
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1859
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1860 /* Turn on DRP We will make VRMCC to device group Modem
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1861 * And Switch it on.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1862 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1863 bspTwl3029_Power_setDevGrp(NULL,BSP_TWL3029_POWER_VRMMC,BSP_TWL3029_POWER_DEV_GRP_MODEM);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1864 wait_ARM_cycles(convert_nanosec_to_cycles(100000*2));
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1865 bspTwl3029_Power_enable(NULL,BSP_TWL3029_POWER_VRMMC,BSP_TWL3029_POWER_STATE_ACTIVE);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1866 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1867
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1868 #if (CHIPSET!=15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1869 #if ABB_SEMAPHORE_PROTECTION
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1870 // Create the ABB semaphore
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1871 ABB_Sem_Create();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1872 #endif // SEMAPHORE_PROTECTION
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1873 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1874
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1875 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1876 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1877 * Initialize FFS invoking restore procedure by MPU-S
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1878 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1879 #if ((BOARD == 35) || (BOARD == 46))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1880 GC_FfsRestore();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1881 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1882
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1883 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1884 * FFS main initialization.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1885 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1886
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1887 ffs_main_init();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1888
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1889
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1890 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1891 * Initialize Riviera manager and create tasks thanks to it.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1892 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1893 #if (CHIPSET!=15) || (REMU==0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1894 rvf_init();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1895 rvm_init(); /* A-M-E-M-D-E-D! */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1896 create_tasks();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1897 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1898 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1899 * SIM Main Initialization.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1900 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1901 #if (CHIPSET!=15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1902 SIM_Initialize ();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1903 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1904 bspUicc_bootInit();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1905 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1906 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1907 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1908
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1909 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1910 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1911 * l1_create_HISR
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1912 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1913 * Create L1 HISR.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1914 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1915 void l1_create_HISR (void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1916 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1917 STATUS status;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1918
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1919 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1920 // Fill the entire stack with the pattern 0xFE
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1921 memset (layer_1_sync_stack, 0xFE, LAYER_1_SYNC_STACK_SIZE);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1922 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1923
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1924 status = NU_Create_HISR (&layer_1_sync_HISR,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1925 "L1_HISR",
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1926 layer_1_sync_HISR_entry,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1927 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1928 1,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1929 layer_1_sync_stack,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1930 LAYER_1_SYNC_STACK_SIZE);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1931 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1932 1,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1933 layer_1_sync_stack,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1934 sizeof(layer_1_sync_stack));
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1935 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1936
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1937 #if (L1_EXT_AUDIO_MGT)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1938 // Create HISR for Ext MIDI activity
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1939 //==================================
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1940 status += NU_Create_HISR(&EXT_AUDIO_MGT_hisr,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1941 "H_EXT_AUDIO_MGT",
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1942 Cust_ext_audio_mgt_hisr,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1943 2,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1944 ext_audio_mgt_hisr_stack,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1945 sizeof(ext_audio_mgt_hisr_stack));
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1946 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1947
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1948 #if ( (L1_MP3 == 1) || (L1_MIDI == 1) || (L1_AAC == 1) || (L1_DYN_DSP_DWNLD == 1) ) // equivalent to an API_HISR flag
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1949 status += NU_Create_HISR(&apiHISR,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1950 "API_HISR",
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1951 api_hisr,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1952 2,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1953 API_HISR_stack,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1954 sizeof(API_HISR_stack));
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1955 #endif // (L1_MP3 == 1) || (L1_MIDI == 1) || (L1_AAC == 1) || (L1_DYN_DSP_DWNLD == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1956
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1957 #if (FF_L1_IT_DSP_USF == 1) || (FF_L1_IT_DSP_DTX == 1) // equivalent to an API_MODEM_HISR flag
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1958 // Create HISR for USF DSP interrupt !!!!. This HISR needs
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1959 // to have the highest priority since the USF status needs
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1960 // to be known before the next block starts.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1961 //========================================================
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1962 status += NU_Create_HISR(&api_modemHISR,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1963 "MODEM",
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1964 api_modem_hisr,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1965 1,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1966 API_MODEM_HISR_stack,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1967 sizeof(API_MODEM_HISR_stack));
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1968 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1969
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1970 assert (status == 0);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1971 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1972
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1973
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1974 void l1_create_ISR (void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1975 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1976 l1_create_HISR();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1977 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1978 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1979
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1980 #endif /* (CODE_VERSION != SIMULATION) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1981
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1982
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1983
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1984 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1985 * Init_Unmask_IT
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1986 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1987 * Unmask all used interrupts.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1988 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1989
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1990 void Init_Unmask_IT (void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1991 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1992 #if (CODE_VERSION != SIMULATION)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1993 /* Reset all current interrupts */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1994 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1995 F_INTH2_VALID_NEXT(C_INTH_IRQ); /* Reset current IT in INTH2 IRQ */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1996 F_INTH_VALID_NEXT(C_INTH_IRQ); /* Reset current IT in INTH IRQ */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1997 F_INTH_VALID_NEXT(C_INTH_FIQ); /* Reset current IT in INTH FIQ */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1998 F_INTH_RESET_ALL_IT; /* Reset all IRQ/FIQ source */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1999 #elif ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2000 INTH_RESETALLIT;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2001 INTH_CLEAR; /* reset IRQ/FIQ source */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2002 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2003
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2004 // Disable all the IRQs of ARM before unmasking the interrupts. And enable them once the unmasking is
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2005 // complete. This will ensure that no context switch happens due to coming of an already unmasked interrupt
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2006 // before completing the unmasking of the rest of the interrupts. If the context switch happens in
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2007 // before all the interrupts have been unmasked, then the control will never return to this function
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2008 //since it will go to TCT_Scheduler() and so some interrupts may remain masked.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2009 INT_DisableIRQ();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2010
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2011 // SL: TEMPORARY FIX FOR BUG ON P2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2012 // FRAME INTERRUPT STAY MASKED
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2013 #if ((BOARD == 35) || (BOARD == 46))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2014 INTH_ENABLEONEIT(IQ_FRAME);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2015 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2016 // TEMPORARY FIX FOR BUG ON P2
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2017
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2018
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2019 /* Enable Uart Modem and IrDA interrupts */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2020 #if ((((TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || \
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2021 (TESTMODE) || (TRACE_TYPE==7)) && (OP_L1_STANDALONE == 1)) || \
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2022 (OP_L1_STANDALONE == 0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2023
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2024 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2025 F_INTH_ENABLE_ONE_IT (C_INTH_UART_IRDA_IT); /* Enable UART_IRDA interrupts */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2026 #if (CHIPSET == 12)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2027 F_INTH_ENABLE_ONE_IT(C_INTH_UART_MODEM1_IT); /* Enable UART_MODEM interrupts */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2028 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2029 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2030 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || \
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2031 (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2032 #if ((BOARD != 35) && (BOARD != 46))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2033 INTH_ENABLEONEIT (IQ_UART_IRDA_IT); /* Enable UART_IRDA interrupts */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2034 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2035 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2036 INTH_ENABLEONEIT (IQ_UART_IT); /* Enable UART_MODEM interrupts */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2037 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2038
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2039 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2040 #if (CHIPSET == 12)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2041 F_INTH_ENABLE_ONE_IT (C_INTH_UART_MODEM2_IT); /* Enable UART_MODEM2 interrupts */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2042 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2043 #endif /* (OP_L1_STANDALONE == 1) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2044
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2045 #endif /* (TRACE_TYPE ...) || (OP_L1_STANDALONE == 0) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2046
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2047 /* Enable other interrupts */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2048 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2049 if (l1_config.pwr_mngt == PWR_MNGT)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2050 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2051
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2052 #if GEMINI_TIMER
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2053 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2054 F_INTH_ENABLE_ONE_IT(C_INTH_TIMER1_IT); /* Enable Timer1 interrupt */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2055 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2056 INTH_ENABLEONEIT(IQ_TIM1); /* Enable Timer1 interrupt */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2057 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2058 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2059
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2060 #if EXT_IRQ
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2061 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2062 F_INTH_ENABLE_ONE_IT (C_INTH_ABB_IRQ_IT); /* Enable ABB_IRQ_IT EXT_IRQ */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2063 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2064 INTH_ENABLEONEIT(IQ_EXT); /* Enable External interrupt */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2065 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2066 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2067 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2068
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2069 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2070 #if ((CHIPSET == 12) || (CHIPSET == 15))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2071 F_INTH_ENABLE_ONE_IT(C_INTH_KEYBOARD_IT);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2072 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2073 #if ((BOARD == 35) || (BOARD == 46))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2074 INTH_ENABLEONEIT (IQ_ICR);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2075 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2076 INTH_ENABLEONEIT (IQ_ARMIO); /* Enable Keypad/GPIO Interrupt */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2077 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2078 #endif /* (CHIPSET == 12) */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2079 #endif /* OP_L1_STANDALONE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2080
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2081
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2082 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2083 //enable LEAD2 interrupt
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2084 F_INTH_ENABLE_ONE_IT (C_INTH_API_IT);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2085 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2086 //enable LEAD2 interrupt
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2087 INTH_ENABLEONEIT(IQ_API);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2088 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2089
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2090
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2091 /* Enable TDMA interrupt */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2092 #if ((CHIPSET == 12) || (CHIPSET == 15))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2093 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2094 F_INTH_ENABLE_ONE_IT (C_INTH_FRAME_IT);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2095 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2096 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2097 INTH_ENABLEONEIT(IQ_FRAME);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2098 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2099 //--> to enable DMA Interrupt for Lite
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2100 #if ((CHIPSET == 15) )
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2101 #if (LOCOSTO_LITE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2102 F_INTH_ENABLE_ONE_IT (C_INTH_DMA_IT);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2103 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2104 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2105 //<-- to enable DMA Interrupt for Lite
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2106
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2107 #if ( (L1_MP3 == 1) || (L1_MIDI == 1) || (L1_AAC == 1) || (L1_DYN_DSP_DWNLD == 1) )
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2108 #if (CHIPSET == 12) || (CHIPSET == 15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2109 F_INTH_ENABLE_ONE_IT(C_INTH_API_IT); // Enable API interrupt
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2110 #elif (CHIPSET == 10)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2111 #if (L1_DYN_DSP_DWNLD == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2112
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2113 //enable interrupt
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2114 INTH_ENABLEONEIT (IQ_API);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2115
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2116 #endif // L1_DYN_DSP_DWNLD == 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2117 #endif // CHIPSET
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2118 #endif // (L1_MP3 == 1) || (L1_MIDI == 1) || (L1_AAC ==1) || (L1_DYN_DSP_DWNLD == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2119 // Enable the ARM IRQs once all the interrupts have been unmasked.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2120 INT_EnableIRQ();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2121 #endif /* NO SIMULATION */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2122 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2123
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2124
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2125 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2126 * Init_Serial_Flows
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2127 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2128 * Performs Serialswitch + related serial data flows initialization.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2129 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2130
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2131 void Init_Serial_Flows (void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2132 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2133 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2134
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2135 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2136 * Initialize Serial Switch module.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2137 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2138 #if ((BOARD==35) || (BOARD == 46))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2139 SER_InitSerialConfig (GC_GetSerialConfig());
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2140 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2141 SER_InitSerialConfig (&appli_ser_cfg_info);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2142 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2143 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2144 * Then Initialize the Serial Data Flows and the associated UARTs:
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2145 * - G2-3 Trace if GSM/GPRS Protocol Stack
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2146 * - AT-Cmd/Fax & Data Flow
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2147 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2148 * Layer1/Riviera Trace Flow and Bluetooth HCI Flow are initialized
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2149 * by the appropriate SW Entities.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2150 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2151 * G2-3 Trace => No more Used
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2152 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2153 SER_tr_Init(SER_PROTOCOL_STACK, TR_BAUD_38400, NULL);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2154
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2155 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2156 * Fax & Data / AT-Command Interpreter Serial Data Flow Initialization
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2157 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2158
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2159 #if ((BOARD != 35) && (BOARD != 46))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2160 (void) SER_fd_Initialize ();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2161 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2162 #else /* OP_L1_STANDALONE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2163
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2164 #if (TESTMODE || (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE==6) || (TRACE_TYPE==7))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2165 #if ((BOARD == 35) || (BOARD == 46))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2166 ser_cfg_info[UA_UART_0] = '0';
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2167 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2168 ser_cfg_info[UA_UART_0] = 'G';
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2169 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2170 #if (CHIPSET !=15)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2171 ser_cfg_info[UA_UART_1] = 'R'; // Riviear Demux on UART MODEM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2172 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2173 ser_cfg_info[UA_UART_0] = 'R'; // Riviear Demux on UART MODEM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2174 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2175
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2176 /* init Uart Modem */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2177 SER_InitSerialConfig (&appli_ser_cfg_info);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2178
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2179 #if TESTMODE || (TRACE_TYPE == 1) || (TRACE_TYPE == 7)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2180 SER_tr_Init (SER_LAYER_1, TR_BAUD_115200, rvt_activate_RX_HISR);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2181
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2182 rvt_register_id("OTHER",&trace_id,(RVT_CALLBACK_FUNC)NULL);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2183 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2184 SER_tr_Init (SER_LAYER_1, TR_BAUD_38400, NULL);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2185 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2186
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2187 L1_trace_string(" \n\r");
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2188
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2189 #endif /* TRACE_TYPE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2190
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2191 #endif /* OP_L1_STANDALONE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2192 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2193
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2194 // From this point, everything is compiled to execute in internal RAM
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2195
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2196 #if (((MOVE_IN_INTERNAL_RAM == 1) ^ (GSM_IDLE_RAM != 0)) && (GSM_IDLE_RAM != 0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2197 #pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_START
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2198 #if (CODE_VERSION != SIMULATION)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2199
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2200 #if ((CHIPSET == 12) || (CHIPSET==15))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2201
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2202 #if GSM_IDLE_RAM_DEBUG
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2203 void flash_access_handler(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2204 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2205 l1s.gsm_idle_ram_ctl.killing_flash_access++;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2206 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2207 void ext_ram_access_handler(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2208 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2209 l1s.gsm_idle_ram_ctl.killing_ext_ram_access++;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2210 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2211 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2212
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2213 void ext_ram_irq_inth_handler(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2214 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2215 if (!READ_TRAFFIC_CONT_STATE)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2216 CSMI_TrafficControllerOn();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2217 a_inth_config[F_INTH_GET_IRQ].d_it_handler();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2218 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2219
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2220 void ext_ram_fiq_inth_handler(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2221 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2222 if (!READ_TRAFFIC_CONT_STATE)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2223 CSMI_TrafficControllerOn();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2224 a_inth_config[F_INTH_GET_FIQ].d_it_handler();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2225 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2226 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2227 #endif // (CODE_VERSION != SIMULATION)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2228 #pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_END
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2229 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2230
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2231 #if !((MOVE_IN_INTERNAL_RAM == 1) && (GSM_IDLE_RAM !=0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2232 #pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_START
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2233
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2234 #if (PSP_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2235 /*-------------------------------------------------------*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2236 /* TP_FrameIntHandler() Low Interrupt service routine */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2237 /*-------------------------------------------------------*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2238 /* Parameters : */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2239 /* Return : */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2240 /* Functionality : activate Hisr on each frame interrupt*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2241 /*-------------------------------------------------------*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2242 void TP_FrameIntHandler(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2243 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2244
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2245 #if (OP_L1_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2246
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2247 #if (TRACE_TYPE==1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2248 if (trace_info.current_config->l1_dyn_trace & 1<<L1_DYN_TRACE_L1S_CPU_LOAD)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2249 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2250 TM_ResetTimer (2, 0xFFFF, 1, 0);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2251 TM_StartTimer (2);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2252 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2253 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2254
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2255 #if (TRACE_TYPE==6)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2256 TM_ResetTimer (2, 0xFFFF, 1, 0);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2257 TM_StartTimer (2);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2258 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2259
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2260 #if (TRACE_TYPE==7) /* CPU_LOAD */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2261 l1_cpu_load_start();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2262 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2263
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2264 #else
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2265
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2266 #if (TRACE_TYPE == 4) && (TI_NUC_MONITOR != 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2267 // TM_ResetTimer (2, TIMER_RESET_VALUE, 1, 0);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2268 // TM_StartTimer (2);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2269 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2270
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2271
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2272 #if (TI_NUC_MONITOR == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2273 /* Copy LISR buffer in Log buffer each end of HISR */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2274 ti_nuc_monitor_tdma_action();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2275 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2276
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2277 #if WCP_PROF == 1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2278 prf_LogFNSwitch(l1s.actual_time.fn_mod42432);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2279 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2280
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2281 #endif /* OP_L1_STANDALONE */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2282
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2283 NU_Activate_HISR(&layer_1_sync_HISR); /* Activate HISR interrupt */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2284
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2285 #if (OP_L1_STANDALONE == 0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2286 #if (WCP_PROF == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2287 #if (PRF_CALIBRATION == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2288 NU_Activate_HISR(&prf_CalibrationHISR);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2289 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2290 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2291 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2292
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2293 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2294 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2295
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2296 /*
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2297 * layer_1_sync_HISR_entry
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2298 *
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2299 * HISR associated to layer 1 sync.
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2300 */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2301
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2302 void layer_1_sync_HISR_entry (void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2303 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2304 #if (PSP_STANDALONE==0)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2305 // Call Synchronous Layer1
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2306 hisr();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2307 #endif
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2308 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2309 #pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_END
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2310 #endif // !((MOVE_IN_INTERNAL_RAM == 1) && (GSM_IDLE_RAM !=0))
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2311
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2312 #if (PSP_STANDALONE == 1)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2313
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2314 #include "nucleus.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2315 #include "tc_defs.h"
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2316
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2317 extern TC_PROTECT TCD_System_Protect;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2318
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2319 /*-------------------------------------------------------*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2320 /* int OS_system_protect() */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2321 /*-------------------------------------------------------*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2322 /* Parameters : none */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2323 /* Return : The Thread Control Block of the thread */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2324 /* which already owns the protection or */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2325 /* 0 if no protection */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2326 /* Functionality : Checks whether the system structures */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2327 /* are already protected or not */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2328 /*-------------------------------------------------------*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2329 void OS_system_protect (void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2330 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2331 NU_Protect((NU_PROTECT*) &TCD_System_Protect);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2332 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2333
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2334 /*-------------------------------------------------------*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2335 /* int OS_system_Unprotect() */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2336 /*-------------------------------------------------------*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2337 /* Parameters : none */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2338 /* Return : */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2339 /* Functionality : unprotect the system structures */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2340 /*-------------------------------------------------------*/
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2341 void OS_system_Unprotect (void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2342 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2343 NU_Unprotect();
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2344 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2345
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2346 void bspDummy_detect(void* a,int b, void* c)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2347 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2348 return;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2349 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2350
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2351 void bspDummy_remove(int a)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2352 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2353 return;
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2354 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2355
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2356 void Init_Watchdog_Timer(void)
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2357 {
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2358 /* This code is for PSP STANDALONE Build Only */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2359 /* WatchDog will be used by DAR enity, so using TIMER1 for OS Ticks
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2360 This will give tick period roughly equle to 4.5 ms which approx
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2361 Frame Interrupt timing */
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2362 Dtimer1_Init_cntl(0XE9, 1, 0x07, 1);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2363 Dtimer1_Start(1);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2364 F_INTH_ENABLE_ONE_IT(C_INTH_TIMER1_IT);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2365 bspUicc_drvRegister((BspUicc_CardPresentDetectHandler)bspDummy_detect,
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2366 (BspUicc_CardAbsentDetectHandler) bspDummy_remove);
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2367 }
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2368
0aa748b6413a src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2369 #endif