FreeCalypso > hg > freecalypso-sw
annotate rvinterf/etmsync/dspapidump.c @ 929:ad6f1504465d
l1_{dis,en}able_dsp_trace functions: breakage-causing LoCosto-ism fixed
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Sat, 24 Oct 2015 06:54:08 +0000 |
parents | 38c7078712ab |
children | 2a867e5768e9 |
rev | line source |
---|---|
921
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * This utility uses ETM in synchronous mode to read and dump the contents |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 * of the DSP API RAM in a target Calypso GSM device while the firmware is |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 * running. |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 */ |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 #include <sys/types.h> |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 #include <stdio.h> |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 #include <stdlib.h> |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 #include <string.h> |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 #include <strings.h> |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 #include <endian.h> |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 #include "localtypes.h" |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 #include "exitcodes.h" |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 #define APIF_ADDR 0xFFD00000 |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 #define API_SIZE_IN_WORDS 0x2000 |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 single_op_main() |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 { |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 u16 buf[64], *linebase; |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 unsigned off; |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 int rc, i, j; |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 for (off = 0; off < API_SIZE_IN_WORDS; ) { |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 rc = do_memory_read_16(APIF_ADDR + off * 2, buf, 0x40); |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 if (rc) |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 return(rc); |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 for (i = 0; i < 8; i++) { |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 printf("%04X:", off); |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 linebase = buf + i * 8; |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 for (j = 0; j < 8; j++) |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 printf(" %04X", linebase[j]); |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 putchar('\n'); |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 off += 8; |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 } |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 } |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 return(0); |
38c7078712ab
fc-dspapidump utility written, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 } |