comparison rvinterf/etmsync/dspapidump.c @ 921:38c7078712ab

fc-dspapidump utility written, compiles
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sun, 18 Oct 2015 21:41:01 +0000
parents
children 2a867e5768e9
comparison
equal deleted inserted replaced
920:7cb0b32f1997 921:38c7078712ab
1 /*
2 * This utility uses ETM in synchronous mode to read and dump the contents
3 * of the DSP API RAM in a target Calypso GSM device while the firmware is
4 * running.
5 */
6
7 #include <sys/types.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <string.h>
11 #include <strings.h>
12 #include <endian.h>
13 #include "localtypes.h"
14 #include "exitcodes.h"
15
16 #define APIF_ADDR 0xFFD00000
17 #define API_SIZE_IN_WORDS 0x2000
18
19 single_op_main()
20 {
21 u16 buf[64], *linebase;
22 unsigned off;
23 int rc, i, j;
24
25 for (off = 0; off < API_SIZE_IN_WORDS; ) {
26 rc = do_memory_read_16(APIF_ADDR + off * 2, buf, 0x40);
27 if (rc)
28 return(rc);
29 for (i = 0; i < 8; i++) {
30 printf("%04X:", off);
31 linebase = buf + i * 8;
32 for (j = 0; j < 8; j++)
33 printf(" %04X", linebase[j]);
34 putchar('\n');
35 off += 8;
36 }
37 }
38 return(0);
39 }