FreeCalypso > hg > fc-magnetite
annotate src/cs/system/Main/init.c @ 281:852b8410431d
mem_load.c: removal of checksum changes produces perfect reconstruction
of TCS211 mem_load.obj except for register allocator diffs
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 07 Aug 2017 05:34:38 +0000 |
parents | 8fb920215a46 |
children | 840113655bbf |
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 #ifndef _WINDOWS |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "l1sw.cfg" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #include "rf.cfg" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #include "chipset.cfg" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #include "board.cfg" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 #include "swconfig.cfg" |
271
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
20 #include "fc-target.cfg" |
265
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 #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
|
22 #include "rv.cfg" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "sys.cfg" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "debug.cfg" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #ifdef BLUETOOTH_INCLUDED |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #include "btemobile.cfg" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #ifdef BLUETOOTH |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 #include "bluetooth.cfg" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #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
|
34 #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
|
35 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 /* Include Files */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 #include <assert.h> |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #include <ctype.h> |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 #include <stdarg.h> |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 #include <stdlib.h> |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 #include <string.h> |
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 "nucleus.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 #include "sys_types.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 #include "l1_types.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 #include "l1_confg.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 #include "l1_const.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 #if TESTMODE |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 #include "l1tm_defty.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 #endif // TESTMODE |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 #if (AUDIO_TASK == 1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 #include "l1audio_const.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 #include "l1audio_cust.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 #include "l1audio_defty.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 #endif // AUDIO_TASK |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 #if (L1_GTT == 1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 #include "l1gtt_const.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 #include "l1gtt_defty.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 #if (L1_MP3 == 1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 #include "l1mp3_defty.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 #if (L1_MIDI == 1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 #include "l1midi_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_AAC == 1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 #include "l1aac_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 #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
|
79 #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
|
80 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 #if (TRACE_TYPE == 4) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 #include "l1_defty.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 #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
|
88 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 #if (AUDIO_TASK == 1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 #include "l1audio_signa.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 #include "l1audio_msgty.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 #endif // AUDIO_TASK |
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 #if (L1_GTT == 1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 #include "l1gtt_signa.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 #include "l1gtt_msgty.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 #include "l1_defty.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 #include "cust_os.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 #include "l1_msgty.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 #include "nu_main.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 #include "l1_varex.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 #include "l1_proto.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 #include "hw_debug.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 #include "l1_trace.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 #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
|
109 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 #include "armio/armio.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 #include "timer/timer.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 #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
|
115 #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
|
116 #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
|
117 #include "sim/sim.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 #include "abb/abb.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 #include "inth/iq.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 #include "tpudrv.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 #include "memif/mem.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 #include "clkm/clkm.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 #include "inth/inth.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 |
267
f62b71017afd
init.c: initial preen at the module level
Mychaela Falconia <falcon@freecalypso.org>
parents:
265
diff
changeset
|
128 #if (OP_L1_STANDALONE == 1) |
f62b71017afd
init.c: initial preen at the module level
Mychaela Falconia <falcon@freecalypso.org>
parents:
265
diff
changeset
|
129 #include "uart/serialswitch_core.h" |
f62b71017afd
init.c: initial preen at the module level
Mychaela Falconia <falcon@freecalypso.org>
parents:
265
diff
changeset
|
130 #else |
f62b71017afd
init.c: initial preen at the module level
Mychaela Falconia <falcon@freecalypso.org>
parents:
265
diff
changeset
|
131 #include "uart/serialswitch.h" |
265
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 #endif |
267
f62b71017afd
init.c: initial preen at the module level
Mychaela Falconia <falcon@freecalypso.org>
parents:
265
diff
changeset
|
133 #include "uart/traceswitch.h" |
265
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 #include "dma/dma.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 #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
|
138 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 #include "ulpd/ulpd.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 #if (PSP_STANDALONE == 0) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 #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
|
143 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
|
144 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
|
145 #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
|
146 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
|
147 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 #if WCP_PROF == 1 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 #if PRF_CALIBRATION == 1 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 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
|
152 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 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
|
157 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
|
158 #endif /* (OP_L1_STANDALONE) */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 #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
|
162 #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
|
163 #include "uart/uart.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 * Serial Configuration set up. |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 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
|
169 #include "rvt_gen.h" |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 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
|
171 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 #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
|
173 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 * Serial Configuration set up. |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 ** One config is: |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 ** {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
|
181 ** 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
|
182 ** 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
|
183 ** XXX_TRACE}, // Trace PS |
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 ** 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
|
186 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 #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
|
189 (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
|
190 #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
|
191 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
|
192 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 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
|
194 #endif /* OP_L1_STANDALONE */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 { |
273
8fb920215a46
init.c & components/main-init: put RVTMUX on MODEM on C139 like before
Mychaela Falconia <falcon@freecalypso.org>
parents:
272
diff
changeset
|
196 #ifdef CONFIG_RVTMUX_ON_MODEM |
8fb920215a46
init.c & components/main-init: put RVTMUX on MODEM on C139 like before
Mychaela Falconia <falcon@freecalypso.org>
parents:
272
diff
changeset
|
197 {DUMMY_BT_HCI, |
8fb920215a46
init.c & components/main-init: put RVTMUX on MODEM on C139 like before
Mychaela Falconia <falcon@freecalypso.org>
parents:
272
diff
changeset
|
198 DUMMY_FAX_DATA, |
8fb920215a46
init.c & components/main-init: put RVTMUX on MODEM on C139 like before
Mychaela Falconia <falcon@freecalypso.org>
parents:
272
diff
changeset
|
199 UART_MODEM_TRACE, |
8fb920215a46
init.c & components/main-init: put RVTMUX on MODEM on C139 like before
Mychaela Falconia <falcon@freecalypso.org>
parents:
272
diff
changeset
|
200 DUMMY_TRACE}, // 0x0248 |
8fb920215a46
init.c & components/main-init: put RVTMUX on MODEM on C139 like before
Mychaela Falconia <falcon@freecalypso.org>
parents:
272
diff
changeset
|
201 #else // RVTMUX_ON_MODEM |
265
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 {DUMMY_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 UART_MODEM_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 UART_IRDA_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 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
|
206 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 #ifdef BTEMOBILE |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 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
|
209 #else // BTEMOBILE |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 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
|
211 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 { |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 // 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
|
214 {DUMMY_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 DUMMY_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 DUMMY_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 UART_IRDA_TRACE}, // 0x1048 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 {DUMMY_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 DUMMY_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 DUMMY_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 UART_MODEM_TRACE}, // 0x2048 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 // 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
|
223 {DUMMY_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 DUMMY_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 UART_IRDA_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 DUMMY_TRACE}, // 0x0148 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 {DUMMY_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 DUMMY_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 UART_MODEM_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 DUMMY_TRACE}, // 0x0248 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 // 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
|
232 {DUMMY_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 UART_MODEM_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 DUMMY_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 DUMMY_TRACE}, // 0x0068 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 // 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
|
237 {DUMMY_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 DUMMY_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 UART_MODEM_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 UART_IRDA_TRACE}, // 0x1248 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 {DUMMY_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 DUMMY_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 UART_IRDA_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 UART_MODEM_TRACE}, // 0x2148 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 // 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
|
246 {DUMMY_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 UART_MODEM_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 DUMMY_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 UART_IRDA_TRACE}, // 0x1068 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 #ifdef BTEMOBILE |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 // 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
|
252 {UART_IRDA_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 DUMMY_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 UART_MODEM_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 DUMMY_TRACE}, // 0x0249 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 {UART_MODEM_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 DUMMY_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 UART_IRDA_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 DUMMY_TRACE}, // 0x014A |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 // 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
|
261 {UART_IRDA_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 UART_MODEM_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 DUMMY_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 DUMMY_TRACE}, // 0x0069 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 #endif // BTEMOBILE |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 // 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
|
267 {DUMMY_BT_HCI, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
268 UART_MODEM_FAX_DATA, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
269 UART_IRDA_TRACE, |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 DUMMY_TRACE} // 0x0168 |
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 #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
|
274 |
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 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 * Init_Target |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 * |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
279 * 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
|
280 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
281 void Init_Target(void) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
282 { |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
283 #if (BOARD == 5) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
284 #define WS_ROM (1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
285 #define WS_RAM (1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
286 #define WS_APIF (1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
287 #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
|
288 #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
|
289 #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
|
290 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
291 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
|
292 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
|
293 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
294 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
|
295 IQ_SetupInterrupts (); /* IRQ priorities. */ |
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 TM_DisableWatchdog (); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
298 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
299 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 * 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
|
301 */ |
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 AI_ResetTspIO (); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
304 AI_ResetDbgReg (); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
305 AI_ResetIoConfig (); |
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 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
308 * 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
|
309 * 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
|
310 * 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
|
311 * 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
|
312 * register 0x505808). |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
313 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
314 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
315 AI_ResetTspIO(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
316 AI_ResetDbgReg(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 AI_ResetIoConfig(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
319 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
320 * 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
|
321 */ |
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 AI_ConfigBitAsInput (1); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
324 AI_EnableBit (1); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
325 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
326 AI_ConfigBitAsOutput (2); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
327 AI_EnableBit (2); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
328 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
329 AI_ConfigBitAsInput (11); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
330 AI_EnableBit (11); |
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 AI_ConfigBitAsOutput (13); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
333 AI_EnableBit (13); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
334 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
335 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
|
336 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
337 #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
|
338 (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
|
339 (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
|
340 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
341 #if (PSP_STANDALONE == 0) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
342 // 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
|
343 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
344 #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
|
345 #if ((CHIPSET >= 3)) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
346 #if (CHIPSET == 12) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
347 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
|
348 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
|
349 #elif (CHIPSET == 15) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
350 //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
|
351 #if (L1_DRP == 1) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
352 // 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
|
353 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
354 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
355 #if (BOARD==35) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 *((volatile SYS_UWORD16 *) ASIC_CONF) = 0x2000; |
271
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
357 #elif defined(CONFIG_TARGET_PIRELLI) /* from disasm of original fw */ |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
358 *((volatile SYS_UWORD16 *) ASIC_CONF) = 0x6050; |
265
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
359 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
360 *((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
|
361 #endif /* (BOARD == 35) */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
362 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
363 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
364 #endif /* ANLG(ANALOG)) */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
365 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
366 #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
|
367 #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
|
368 (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
|
369 // 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
|
370 AI_ConfigBitAsOutput (1); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
371 AI_SetBit(1); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
372 #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
|
373 //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
|
374 // 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
|
375 // FIXME |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
377 #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
|
378 #endif /* PSP_STANDALONE ==0 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
379 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
380 // Watchdog |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
381 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
382 TM_DisableWatchdog(); /* Disable Watchdog */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
383 #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
|
384 TM_SEC_DisableWatchdog(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
385 #endif |
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 ((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
|
388 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
389 #if (CHIPSET == 12) |
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 #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
|
392 #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
|
393 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
394 /* TPU_FRAME, NMIIT, IACKn */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
395 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
|
396 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
397 /* 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
|
398 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
|
399 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
|
400 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
|
401 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
|
402 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
|
403 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
|
404 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
|
405 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
|
406 /* DMA_REQ_S(2)*/ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
407 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
|
408 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
409 /* 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
|
410 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
|
411 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
|
412 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
413 /* XIO_nREADY */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
414 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
|
415 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
416 /* 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
|
417 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
|
418 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
|
419 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
|
420 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
421 /* RHEA_nREADY , RHEA_nSTROBE */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
422 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
|
423 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
|
424 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
425 /* XIO_STROBE */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
426 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
|
427 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
428 /* DMA_CLK_REQ */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
429 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
|
430 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
431 /* 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
|
432 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
|
433 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
|
434 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
|
435 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
|
436 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
437 #endif /* (BOARD == 6) */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
438 #endif /* DMA debug example */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
439 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
440 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
441 * 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
|
442 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
443 // (*( 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
|
444 // (*( 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
|
445 // (*( 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
|
446 #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
|
447 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
448 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
449 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
450 * 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
|
451 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
452 // 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
|
453 // 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
|
454 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
455 #if (CHIPSET == 12) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
456 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
|
457 #elif (CHIPSET == 15) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
458 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
|
459 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
460 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
461 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
|
462 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
463 // Select VTCXO input frequency |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
464 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
465 CLKM_UNUSED_VTCXO_26MHZ; |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
466 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
467 // 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
|
468 #if (RF_FAM == 12) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
469 CLKM_USE_VTCXO_26MHZ; |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
470 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
471 // 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
|
472 #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
|
473 CLKM_USE_VTCXO_26MHZ; |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
474 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
475 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
476 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
477 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
478 // 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
|
479 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
480 *((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
|
481 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
482 /* |
269
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
483 * The following part has been reconstructed from disassembly. |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
484 */ |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
485 RHEA_INITRHEA(0,0,0xFF); |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
486 DPLL_INIT_BYPASS_MODE(DPLL_BYPASS_DIV_1); |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
487 DPLL_INIT_DPLL_CLOCK(DPLL_LOCK_DIV_1, 8); |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
488 CLKM_InitARMClock(0x00, 2, 0); /* no low freq, no ext clock, div by 1 */ |
271
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
489 /* |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
490 * FreeCalypso change: memory timings and widths |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
491 * are target-dependent. |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
492 */ |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
493 #ifdef CONFIG_TARGET_PIRELLI |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
494 /* |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
495 * Pirelli's version of this Init_Target() function |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
496 * in their fw does the following: |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
497 */ |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
498 MEM_INIT_CS0(4, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
499 MEM_INIT_CS1(4, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
500 MEM_INIT_CS2(5, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
501 MEM_INIT_CS3(4, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
502 MEM_INIT_CS4(7, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
503 #elif defined(CONFIG_TARGET_FCFAM) |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
504 /* |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
505 * The settings currently adopted for the FreeCalypso |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
506 * hardware family, only nCS0, nCS1 and nCS2 are used |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
507 * presently. |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
508 */ |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
509 MEM_INIT_CS0(4, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
510 MEM_INIT_CS1(4, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
511 MEM_INIT_CS2(4, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
512 MEM_INIT_CS3(4, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
513 MEM_INIT_CS4(4, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
514 #else |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
515 /* |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
516 * The original settings from Openmoko, |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
517 * only nCS0 and nCS1 are actually used, |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
518 * same as on Mot C1xx phones, |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
519 * the nCS2/3/4 settings are dummies from TI. |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
520 */ |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
521 MEM_INIT_CS0(3, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
522 MEM_INIT_CS1(3, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
523 MEM_INIT_CS2(5, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
524 MEM_INIT_CS3(3, MEM_DVS_16, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
525 MEM_INIT_CS4(0, MEM_DVS_8, MEM_WRITE_EN, 0); |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
526 #endif |
269
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
527 MEM_INIT_CS6(0, MEM_DVS_32, MEM_WRITE_EN, 0); |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
528 MEM_INIT_CS7(0, MEM_DVS_32, MEM_WRITE_DIS, 0); |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
529 RHEA_INITAPI(0,1); |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
530 RHEA_INITARM(0,0); |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
531 DPLL_SET_PLL_ENABLE; |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
532 |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
533 /* |
265
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
534 * 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
|
535 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
536 #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
|
537 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
|
538 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
|
539 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
|
540 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
|
541 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
|
542 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
543 INTH_DISABLEALLIT; |
269
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
544 #if 0 /* not present in our reference binary object */ |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
545 INTH_RESETALLIT; |
a498108254c9
init.c: Init_Target() reconstructed, perfect match to original object
Mychaela Falconia <falcon@freecalypso.org>
parents:
268
diff
changeset
|
546 #endif |
265
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
547 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
|
548 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
549 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
550 // INTH |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
551 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
552 #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
|
553 #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
|
554 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
|
555 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
556 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
|
557 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
558 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
559 IQ_SetupInterrupts(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
560 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
561 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
562 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
563 #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
|
564 #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
|
565 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
566 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
|
567 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
568 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
|
569 #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
|
570 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
|
571 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
|
572 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
573 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
574 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
575 // DMA |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
576 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
577 // 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
|
578 #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
|
579 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
|
580 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
581 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
582 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
583 /* 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
|
584 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
585 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
586 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
587 // RHEA Bridge |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
588 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
589 // 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
|
590 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
|
591 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
592 #if (CHIPSET == 6) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
593 // 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
|
594 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
|
595 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
596 // 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
|
597 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
|
598 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
599 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
600 // 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
|
601 RHEA_INITARM(0,0); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
602 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
603 // INTH |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
604 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
605 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
|
606 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
|
607 IQ_SetupInterrupts(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
608 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
609 // DMA |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
610 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
611 // 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
|
612 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
|
613 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
614 #if (CHIPSET == 6) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
615 // 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
|
616 //----------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
617 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
|
618 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
619 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
620 // CLKM |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
621 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
622 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
|
623 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
624 #if (CHIPSET == 6) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
625 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
|
626 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
627 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
|
628 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
629 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
630 #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
|
631 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
632 // Freeze ULPD timer .... |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
633 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
634 *((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
|
635 *((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
|
636 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
637 // 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
|
638 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
639 #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
|
640 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
|
641 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
642 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
|
643 // 26000 --> 166 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
644 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
|
645 // 26000 --> 43691 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
646 #endif /* OP_L1_STANDALONE */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
647 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
648 // program ULPD WAKE-UP .... |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
649 //================================================= |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
650 #if (CHIPSET == 2) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
651 *((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
|
652 *((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
|
653 *((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
|
654 *((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
|
655 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
656 *((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
|
657 *((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
|
658 *((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
|
659 *((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
|
660 *((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
|
661 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
662 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
663 // 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
|
664 //================================================= |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
665 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
|
666 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
|
667 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
668 // 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
|
669 //================================================= |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
670 #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
|
671 #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
|
672 *(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
|
673 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
674 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
675 #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
|
676 *((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
|
677 #elif (BOARD == 7) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
678 *((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
|
679 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
680 #endif /* OP_L1_STANDALONE */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
681 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
682 // 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
|
683 //-------------------------------------------------- |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
684 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
|
685 { |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
686 volatile UWORD32 j; |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
687 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
|
688 /* wait for gauging it*/ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
689 // 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
|
690 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
|
691 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
|
692 } |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
693 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
694 #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
|
695 AI_ClockEnable (); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
696 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
697 #if (BOARD == 7) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
698 // 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
|
699 AI_InitIOConfig(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
700 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
701 // 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
|
702 *((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
|
703 // 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
|
704 *((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
|
705 #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
|
706 // 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
|
707 AI_InitIOConfig(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
708 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
709 // 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
|
710 *((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
|
711 #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
|
712 AI_InitIOConfig(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
713 // CSMI INTERFACE |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
714 // 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
|
715 // and Fax/Data services |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
716 CSMI_Init(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
717 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
|
718 CU_Initialize(); // Trace initialization |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
719 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
|
720 #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
|
721 // 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
|
722 AI_InitIOConfig(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
723 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
724 #ifdef BTEMOBILE |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
725 // 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
|
726 *((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
|
727 *((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
|
728 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
729 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
730 // set the debug latch to 0x0000. |
271
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
731 /* |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
732 * FreeCalypso change: this write is only correct when running |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
733 * on an actual D-Sample board, but not on any of the real-world |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
734 * Calypso target devices. |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
735 */ |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
736 #if 0 |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
737 *((volatile SYS_UWORD16 *) 0x2700000) = 0x0000; |
e18367b5427e
init.c: applied our necessary FreeCalypso changes to reconstructed Init_Target()
Mychaela Falconia <falcon@freecalypso.org>
parents:
270
diff
changeset
|
738 #endif |
265
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
739 #endif // BOARD |
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 // 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
|
742 TM_EnableTimer (1); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
743 TM_EnableTimer (2); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
744 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
745 #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
|
746 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
747 #endif /* #if (BOARD == 5) */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
748 } |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
749 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
750 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
751 * Init_Drivers |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
752 * |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
753 * Performs Drivers Initialization. |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
754 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
755 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
|
756 void Init_Drivers(void) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
757 { |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
758 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
759 #if (CHIPSET==15) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
760 bspI2c_init(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
761 bspTwl3029_init(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
762 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
763 #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
|
764 Set_Switch_ON_Cause(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
765 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
766 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
767 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
768 /* 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
|
769 * And Switch it on. |
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 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
|
772 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
|
773 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
|
774 #endif |
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 #if (CHIPSET!=15) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
777 #if ABB_SEMAPHORE_PROTECTION |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
778 // Create the ABB semaphore |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
779 ABB_Sem_Create(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
780 #endif // SEMAPHORE_PROTECTION |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
781 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
782 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
783 #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
|
784 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
785 * 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
|
786 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
787 #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
|
788 GC_FfsRestore(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
789 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
790 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
791 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
792 * FFS main initialization. |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
793 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
794 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
795 ffs_main_init(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
796 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
797 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
798 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
799 * 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
|
800 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
801 #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
|
802 rvf_init(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
803 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
|
804 create_tasks(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
805 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
806 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
807 * SIM Main Initialization. |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
808 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
809 #if (CHIPSET!=15) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
810 SIM_Initialize (); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
811 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
812 bspUicc_bootInit(); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
813 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
814 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
815 } |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
816 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
817 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
818 * Init_Serial_Flows |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
819 * |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
820 * 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
|
821 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
822 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
|
823 { |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
824 #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
|
825 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
826 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
827 * Initialize Serial Switch module. |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
828 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
829 #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
|
830 SER_InitSerialConfig (GC_GetSerialConfig()); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
831 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
832 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
|
833 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
834 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
835 * 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
|
836 * - 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
|
837 * - 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
|
838 * |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
839 * 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
|
840 * 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
|
841 * |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
842 * 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
|
843 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
844 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
|
845 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
846 /* |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
847 * 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
|
848 */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
849 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
850 #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
|
851 (void) SER_fd_Initialize (); |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
852 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
853 #else /* OP_L1_STANDALONE */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
854 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
855 #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
|
856 #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
|
857 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
|
858 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
859 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
|
860 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
861 #if (CHIPSET !=15) |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
862 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
|
863 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
864 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
|
865 #endif |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
866 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
867 /* init Uart Modem */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
868 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
|
869 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
870 #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
|
871 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
|
872 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
873 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
|
874 #else |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
875 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
|
876 #endif |
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 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
|
879 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
880 #endif /* TRACE_TYPE */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
881 |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
882 #endif /* OP_L1_STANDALONE */ |
0aa748b6413a
src/cs/system/Main/init.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
883 } |
270
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
884 |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
885 /* |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
886 * Init_Unmask_IT |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
887 * |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
888 * Unmask all used interrupts. |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
889 */ |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
890 void Init_Unmask_IT (void) |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
891 { |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
892 IQ_Unmask(IQ_FRAME); |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
893 IQ_Unmask(IQ_UART_IRDA_IT); |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
894 IQ_Unmask(IQ_UART_IT); |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
895 IQ_Unmask(IQ_ARMIO); |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
896 #if (L1_DYN_DSP_DWNLD == 1) |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
897 IQ_Unmask(IQ_API); |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
898 #endif |
d5a34ea92f2a
init.c: Init_Unmask_IT() reconstructed the trivial way
Mychaela Falconia <falcon@freecalypso.org>
parents:
269
diff
changeset
|
899 } |