FreeCalypso > hg > freecalypso-tools
annotate target-utils/compalstage/compalstage.S @ 1014:961efadd530a default tip
fc-shell TCH DL handler: add support for CSD modes
TCH DL capture mechanism in FC Tourmaline firmware has been extended
to support CSD modes in addition to speech - add the necessary support
on the host tools side.
It needs to be noted that this mechanism in its present state does NOT
provide the debug utility value that was sought: as we learned only
after the code was implemented, TI's DSP has a misfeature in that the
buffer we are reading (a_dd_0[]) is zeroed out when the IDS block
is enabled, i.e., we are reading all zeros and not the real DL bits
we were after. But since the code has already been written, we are
keeping it - perhaps we can do some tests with IDS disabled.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 26 Nov 2024 06:27:43 +0000 |
parents | 21eec7569eb8 |
children |
rev | line source |
---|---|
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 .text |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 .org 0 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 #if THUMB_ENTRY |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 .code 16 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 bx pc |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 nop |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #endif |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 .code 32 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 /* delay loop like OsmocomBB does */ |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 mov r1, #0xa0000 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 1: subs r1, r1, #1 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 bne 1b |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 /* enable the Calypso boot ROM */ |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 ldr r1, reg_addr |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 mov r2, #0x0100 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 strh r2, [r1] |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 /* jump to it! */ |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 mov pc, #0 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 reg_addr: |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 .word 0xFFFFFB10 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #if PAD_TO_1003 |
11
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
25 /* |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
26 * The older and most familiar versions of C139/140 boot code expect the |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
27 * signature bytes to be "1003" or greater, but a recently encountered |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
28 * newer version expects them to be "1004" or greater instead. As the |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
29 * actual comparison check in all currently known boot code versions is |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
30 * an inequality (the signature bytes in the downloaded image need to be |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
31 * greater than or equal to the hard-coded reference values), always |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
32 * putting "1004" in our compalstage image instead of "1003" should satisfy |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
33 * all existing C1xx boot code versions, or at least all currently known |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
34 * ones. However, having an image named compalstage-1003.bin with the |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
35 * corresponding -c 1003 loadtools option that is actually "1004" inside |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
36 * feels a little "wrong" in some sense, while getting rid of the -c 1003 |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
37 * option would break old user instructions, hence let's go ahead and do the |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
38 * silly exercise of building both "1003" and "1004" versions. |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
39 */ |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 .org 0x3be0 |
11
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
41 #if MAGIC_1004 |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
42 .ascii "1004" |
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
43 #else |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 .ascii "1003" |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 #endif |
11
21eec7569eb8
loadtools support for C139/140 target: -c 1004 compalstage variant
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
46 #endif |