comparison rvinterf/etmsync/dspapidump.c @ 0:e7502631a0f9

initial import from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 11 Jun 2016 00:13:35 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e7502631a0f9
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 <stdint.h>
13 #include <endian.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 uint16_t 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", le16toh(linebase[j]));
34 putchar('\n');
35 off += 8;
36 }
37 }
38 return(0);
39 }