annotate chipsetsw/layer1/cfile/l1_small.c @ 277:c33c56a03312

l1audio_cust.c: initial import from LoCosto source
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 14 Mar 2017 04:20:44 +0000
parents d5b9ce5a392f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
117
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
3 #include "l1sw.cfg"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
4 #if (OP_L1_STANDALONE == 0)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
5 #include "debug.cfg"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
6 #include "rv_swe.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
7 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
8 #if (OP_L1_STANDALONE == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
9 #include "general.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
10 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
11 #include "l1_macro.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
12 #include "l1_confg.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
13
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
14 #if (CODE_VERSION == SIMULATION)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
15 #include <string.h>
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
16 #include "l1_types.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
17 #include "sys_types.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
18 #include "l1_const.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
19 #include "l1_time.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
20 #if TESTMODE
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
21 #include "l1tm_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
22 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
23 #if (AUDIO_TASK == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
24 #include "l1audio_const.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
25 #include "l1audio_cust.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
26 #include "l1audio_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
27 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
28 #if (L1_GTT == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
29 #include "l1gtt_const.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
30 #include "l1gtt_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
31 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
32 #if (L1_MP3 == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
33 #include "l1mp3_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
34 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
35 #if (L1_MIDI == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
36 #include "l1midi_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
37 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
38 #if (L1_AAC == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
39 #include "l1aac_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
40 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
41 #include "l1_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
42 #include "l1_varex.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
43 #include "cust_os.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
44 #include "l1_msgty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
45
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
46 #include <stdio.h>
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
47 #include "sim_cfg.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
48 #include "sim_cons.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
49 #include "sim_def.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
50 #include "sim_var.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
51
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
52 #else
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
53 #include <string.h>
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
54
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
55 #include "l1_types.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
56 #include "sys_types.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
57 #include "l1_const.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
58 #include "l1_time.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
59
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
60 #if TESTMODE
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
61 #include "l1tm_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
62 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
63 #if (AUDIO_TASK == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
64 #include "l1audio_const.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
65 #include "l1audio_cust.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
66 #include "l1audio_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
67 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
68 #if (L1_GTT == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
69 #include "l1gtt_const.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
70 #include "l1gtt_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
71 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
72 #if (L1_MP3 == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
73 #include "l1mp3_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
74 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
75 #if (L1_MIDI == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
76 #include "l1midi_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
77 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
78 #if (L1_AAC == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
79 #include "l1aac_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
80 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
81 #include "l1_defty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
82 #include "l1_varex.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
83 #include "cust_os.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
84 #include "l1_msgty.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
85 #include "tpudrv.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
86
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
87 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
88
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
89 #if (W_A_CALYPSO_PLUS_SPR_19599 == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
90 #include "sys_memif.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
91 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
92
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
93 #if (CHIPSET == 15)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
94 #include "sys_inth.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
95 #include "bspI2c.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
96 #include "clkm.h"
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
97
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
98 // This could be removed if i2c_pwr_interface is functional
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
99 extern volatile Bool bspI2c_busLocked[BSP_I2C_NUM_DEVICES] ;
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
100 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
101
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
102 /* NEW COMPILER MANAGEMENT
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
103 * With compiler V3.00, the .text section must be explicitely
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
104 * defined.
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
105 * Else the following code will be put in the .cinit section.
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
106 * The change is applied to all compilers.
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
107 */
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
108 asm(" .sect \".text\" ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
109
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
110
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
111 UWORD8 *mode_authorized = &(l1s.pw_mgr.mode_authorized);
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
112 UWORD8 *switch_PWR_MNGT = &(l1_config.pwr_mngt);
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
113
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
114 #if (W_A_CALYPSO_BUG_01435 == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
115
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
116 asm("SMALL_SLEEP .equ 01h");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
117 asm("BIG_SLEEP .equ 02h");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
118 asm("DEEP_SLEEP .equ 03h");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
119
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
120 void f_arm_sleep_cmd(UWORD8 d_sleep_mode)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
121 {
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
122 asm(" LDR R3, MPU_FREE_REG");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
123
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
124 // here below the C code:
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
125 // if ((d_sleep_mode == SMALL_SLEEP) || (d_sleep_mode == BIG_SLEEP))
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
126 // * (volatile UWORD16 *) 0xfffffd00 &= 0xfffe;
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
127 // else
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
128 // if (d_sleep_mode == DEEP_SLEEP)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
129 // * (volatile UWORD16 *) 0xfffffd00 &= 0xefff;
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
130
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
131 asm(" CMP R0, #SMALL_SLEEP");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
132 asm(" BEQ Small_or_Big_Sleep");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
133 asm(" CMP R0, #BIG_SLEEP");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
134 asm(" BEQ Small_or_Big_Sleep");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
135 asm(" CMP R0, #DEEP_SLEEP");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
136 asm(" BXNE LR");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
137
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
138 asm("Deep_Sleep: ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
139 asm(" LDR R0, CLKM_CNTL_ARM_CLK_REG");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
140 asm(" LDRH R12, [R0, #0]");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
141 asm(" AND R1, R12, #255");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
142 asm(" AND R12, R12, #61184");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
143 asm(" ORR R12, R1, R12");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
144 asm(" STRH R12, [R0, #0]");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
145 asm(" STMIA R3!, {R4-R7}");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
146 asm(" B End_Sleep");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
147
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
148 asm("Small_or_Big_Sleep: ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
149 asm(" LDR R12, CLKM_CNTL_ARM_CLK_REG");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
150 asm(" LDRH R0, [R12, #0]");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
151 asm(" MOV R0, R0, LSL #16");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
152 asm(" MOV R0, R0, LSR #17");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
153 asm(" MOV R0, R0, LSL #1");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
154 asm(" STRH R0, [R12, #0]");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
155 asm(" STMIA R3!, {R4-R7}");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
156
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
157 asm("End_Sleep: ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
158
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
159 } /* f_arm_sleep_cmd() */
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
160
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
161 asm("MPU_FREE_REG .word 0xffffff20");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
162 asm("CLKM_CNTL_ARM_CLK_REG .word 0xfffffd00");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
163 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
164
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
165 #if (CHIPSET == 15)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
166 void init_small_sleep()
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
167 {
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
168
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
169 /* Should not disable bridge_clk during small sleep when an I2C transaction is pending
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
170
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
171 In Locosto without BRIDGE_CLK, I2C interrupt is not generated */
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
172
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
173 // This could be removed if i2c_pwr_interface is functional
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
174
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
175 Uint8 sts=0, camera_sts = 0;
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
176
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
177 sts=i2c_pwr_interface(0);
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
178 #ifdef RVM_CAMD_SWE
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
179 #if(LOCOSTO_LITE == 0)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
180 #if (OP_L1_STANDALONE == 0)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
181 camera_sts = camera_pwr_interface(0);
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
182 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
183 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
184 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
185
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
186 if (sts != 0
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
187 #if(LOCOSTO_LITE == 0)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
188 || camera_sts != 0
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
189 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
190 )
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
191 {
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
192 sts=i2c_pwr_interface(2);//enable
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
193 *((volatile UINT16 *) CLKM_CNTL_CLK) &= ~CLKM_BRIDGE_DIS;
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
194 }
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
195 else
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
196 {
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
197 sts=i2c_pwr_interface(1);//disable
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
198 *((volatile UINT16 *) CLKM_CNTL_CLK) |= CLKM_BRIDGE_DIS;
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
199 F_INTH_ENABLE_ONE_IT(C_INTH_UART_WAKEUP_IT);
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
200 }
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
201 }
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
202
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
203
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
204
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
205 void exit_small_sleep()
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
206
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
207 {
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
208 i2c_pwr_interface(2);
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
209 return;
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
210 }
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
211
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
212
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
213 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
214
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
215 /*-------------------------------------------------------*/
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
216 /* INT_Small_Sleep() */
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
217 /*-------------------------------------------------------*/
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
218 /* */
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
219 /* Description: small sleep */
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
220 /* ------------ */
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
221 /* Called by TCT_Schedule main loop of Nucleus */
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
222 /*-------------------------------------------------------*/
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
223
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
224
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
225 asm(" .def INT_Small_Sleep ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
226 asm("INT_Small_Sleep ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
227
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
228 /* NEW COMPILER MANAGEMENT
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
229 * _switch_PWR_MNGT and _mode_authorized must be .def and not .ref
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
230 * as they are both defined in this file.
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
231 */
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
232 asm(" .def _switch_PWR_MNGT ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
233 asm(" .def _mode_authorized ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
234 asm("SMALL_SLEEP .equ 01h ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
235 asm("ALL_SLEEP .equ 04h ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
236 asm("PWR_MNGT .equ 01h ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
237 #if (OP_L1_STANDALONE == 0)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
238 // This code log the number of time the Small sleep
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
239 // function has been invoked
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
240 #if (TI_PROFILER == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
241 asm(" ldr r0, profiler_counter "); // pick counter
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
242 asm(" mov r1,#0 ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
243 asm(" str r1,[r0] ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
244 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
245
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
246 #if (TI_NUC_MONITOR == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
247 // Push registers on statck because R3 and R4 must not be modified
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
248 asm(" STMFD sp!,{r0-r5}");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
249 asm(" .global _ti_nuc_monitor_sleep ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
250 asm(" BL _ti_nuc_monitor_sleep");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
251 asm(" LDMFD sp!,{r0-r5}");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
252 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
253 // End log call
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
254 #endif // OP_L1_STANDALONE
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
255 //asm(" .ref TCT_Schedule_Loop ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
256 //asm(" B TCT_Schedule_Loop ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
257
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
258 asm(" ldr r0,Switch "); // pick up sleep mode
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
259 asm(" ldr r0,[r0] "); // take the current value of the register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
260 asm(" ldrb r1,[r0] "); // take the current value of the register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
261 asm(" cmp r1,#PWR_MNGT "); // take the current value of the register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
262 asm(" bne End_small_sleep ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
263
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
264 asm(" ldr r0,Mode "); // pick up sleep mode
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
265 asm(" ldr r0,[r0] "); // take the current value of the register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
266 asm(" ldrb r1,[r0] "); // take the current value of the register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
267 asm(" cmp r1,#SMALL_SLEEP "); // take the current value of the register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
268 asm(" beq Small_sleep_ok ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
269 asm(" cmp r1,#ALL_SLEEP "); // take the current value of the register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
270 asm(" bne End_small_sleep ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
271
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
272 asm("Small_sleep_ok ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
273
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
274 // *****************************************************
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
275 // CQ19599: For Calypso+ chipset, extended page mode
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
276 // shall be disabled before entering deep sleep and
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
277 // restored at wake up
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
278 // *****************************************************
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
279 #if (W_A_CALYPSO_PLUS_SPR_19599 == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
280 asm(" .ref _f_memif_extended_page_mode_read_bit ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
281 asm(" .ref _f_memif_extended_page_mode_disable ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
282
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
283 asm(" BL _f_memif_extended_page_mode_read_bit"); //read state of extended page mode
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
284 asm(" STMFD sp!,{r2}"); //save r2 in stack in case it was used before
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
285 asm(" MOV r2,r0"); //store the state in r2
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
286 asm(" BL _f_memif_extended_page_mode_disable"); //disable extended page mode
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
287 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
288
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
289 #if (CHIPSET == 15)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
290 //// Disable IRQs
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
291 asm(" MRS r1, CPSR ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
292 // asm(" MOV r2,r1"); // Copy the contents on CPSR register to r2
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
293 asm(" STMFD sp!,{r1}"); // Push r2 in the stack
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
294 asm(" ORR r1,r1,#00c0h "); // Disable IRQs
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
295 asm(" MSR CPSR,r1 ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
296
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
297 asm(" .ref _init_small_sleep");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
298 asm(" BL _init_small_sleep");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
299 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
300
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
301 // *****************************************************
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
302 //reset the DEEP_SLEEP bit 12 of CNTL_ARM_CLK register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
303 // (Cf BUG_1278)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
304 asm(" ldr r0,addrCLKM "); // pick up CNTL_ARM_CLK register address
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
305 asm(" ldrh r1,[r0] "); // take the current value of the register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
306 asm(" orr r1,r1,#1000h "); // reset the bit
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
307 asm(" strh r1,[r0] "); //store the result
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
308
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
309 asm(" ldr r0,addrCLKM "); // pick up CLKM clock register address
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
310 asm(" ldrh r1,[r0] "); // take the current value of the register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
311 asm(" bic r1,r1,#1 "); // disable ARM clock
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
312 asm(" strh r1,[r0] ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
313 // *****************************************************
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
314
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
315 #if (CHIPSET == 15)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
316 asm(" .ref _exit_small_sleep");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
317 asm(" BL _exit_small_sleep");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
318 //Enable IRQs
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
319 asm(" LDMFD sp!,{r1}"); //restore r2 from stack
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
320 //asm(" MOV r1,r2"); // Move r2 to r1
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
321 asm(" MSR CPSR,r1 "); // Copy the contents of r1 to CPSR register
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
322 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
323
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
324 #if (W_A_CALYPSO_BUG_01435 == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
325 asm(" MOV R0, #SMALL_SLEEP");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
326 asm(" BL _f_arm_sleep_cmd");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
327 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
328
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
329 // *****************************************************
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
330 // CQ19599: For Calypso+ chipset, restore the extended
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
331 // page mode if it was enabled before entering sleep
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
332 // *****************************************************
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
333 #if (W_A_CALYPSO_PLUS_SPR_19599 == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
334 asm(" .ref _f_memif_extended_page_mode_enable ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
335 asm(" CMP r2,#0"); //check if extended page mode was enabled
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
336 asm(" BEQ extended_page_mode_restored "); //if not, do nothing
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
337 asm(" BL _f_memif_extended_page_mode_enable"); //else restore it
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
338 asm("extended_page_mode_restored ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
339 asm(" LDMFD sp!,{r2}"); //restore r2
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
340 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
341
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
342 asm(" .ref TCT_Schedule_Loop ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
343 asm("End_small_sleep ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
344 asm(" B TCT_Schedule_Loop "); // Return to TCT_Schedule main loop
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
345
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
346 asm("addrCLKM .word 0xfffffd00 ");//CLKM clock register address
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
347
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
348 asm("Mode .word _mode_authorized ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
349 asm("Switch .word _switch_PWR_MNGT ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
350 #if (OP_L1_STANDALONE == 0)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
351 #if (TI_PROFILER == 1)
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
352 asm(" .ref _ti_profiler_nb_sleep_call ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
353 asm("profiler_counter .word _ti_profiler_nb_sleep_call ");
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
354 #endif
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
355 #endif // OP_L1_STANDALONE
d5b9ce5a392f l1_small.c: LoCosto module matches TCS211 w/o changes
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
356