FreeCalypso > hg > fc-selenite
annotate src/cs/layer1/cfile/l1_small_asm.S @ 104:82ae724ca0d7
OSL reconstruction fixed to support memory supervision
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 23 Jul 2018 01:47:29 +0000 |
parents | a2052ac75672 |
children | d43dadd91383 |
rev | line source |
---|---|
76
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * Assembly code extracted out of TI's l1_small.c |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * This code is correct ONLY for CHIPSET 10 or 11 as currently used |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * by FreeCalypso; see TI's original code for what changes would be |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * needed to support other CHIPSETs. |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 */ |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 .text |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 .code 32 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 /*-------------------------------------------------------*/ |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 /* _GSM_Small_Sleep */ |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 /* (formerly INT_Small_Sleep) */ |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 /*-------------------------------------------------------*/ |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 /* */ |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 /* Description: small sleep */ |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 /* ------------ */ |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 /* Called by TCT_Schedule main loop of Nucleus */ |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 /*-------------------------------------------------------*/ |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 #define SMALL_SLEEP 0x01 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #define ALL_SLEEP 0x04 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #define PWR_MNGT 0x01 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 .globl _GSM_Small_Sleep |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 _GSM_Small_Sleep: |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 ldr r0,Switch |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 ldr r0,[r0] |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 ldrb r1,[r0] |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 cmp r1,#PWR_MNGT |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 bne TCT_Schedule_Loop |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 ldr r0,Mode |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 ldr r0,[r0] |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 ldrb r1,[r0] |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 cmp r1,#SMALL_SLEEP |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 beq Small_sleep_ok |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 cmp r1,#ALL_SLEEP |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 bne TCT_Schedule_Loop |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 Small_sleep_ok: |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 // ***************************************************** |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 //reset the DEEP_SLEEP bit 12 of CNTL_ARM_CLK register |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 // (Cf BUG_1278) |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 ldr r0,addrCLKM @ pick up CNTL_ARM_CLK register address |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 ldrh r1,[r0] @ take the current value of the register |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 orr r1,r1,#0x1000 @ reset the bit |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 strh r1,[r0] @ store the result |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 ldr r0,addrCLKM @ pick up CLKM clock register address |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 ldrh r1,[r0] @ take the current value of the register |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 bic r1,r1,#1 @ disable ARM clock |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 strh r1,[r0] |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 B TCT_Schedule_Loop @ Return to TCT_Schedule main loop |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 addrCLKM: .word 0xfffffd00 @ CLKM clock register address |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 Mode: .word mode_authorized |
a2052ac75672
l1_small_asm.S: import from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 Switch: .word switch_PWR_MNGT |