annotate nuc-fw/serial/debug.c @ 136:3b5c3f3646fb

RV bring-up: lack of timer ticks fixed, still investigating the lack of "system time" messages from the RVT task
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 04 Nov 2013 23:35:11 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
136
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 * This module is a FreeCalypso addition for very low-level debugging.
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 * The functions implemented in this module produce "forced" serial output
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 * on the RVTMUX UART without going through the normal RV trace mechanism.
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 * Calls to these FC debug functions should be added during difficult
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 * debug sessions, but should never remain in stable checked-in code:
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 * these functions are too disruptive to be used in "production" fw images.
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 */
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 #include "../include/config.h"
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 #include "../include/sys_types.h"
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 #include "serialswitch.h"
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 #include <string.h>
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 freecalypso_raw_dbgout(char *string)
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 {
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 char *p;
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 int l, cc;
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 p = string;
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 l = strlen(p);
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 while (l) {
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 cc = SER_tr_WriteNBytes(SER_LAYER_1, p, l);
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 p += cc;
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 l -= cc;
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 }
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 }
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 freecalypso_lldbg_intinfo()
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 {
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 char strbuf[128];
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 extern unsigned IQ_TimerCount2;
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 extern unsigned TMD_System_Clock;
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 extern unsigned INT_Check_IRQ_Mask();
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 sprintf(strbuf, "*CPSR=%08x, IQ_TimerCount2=%u, TMD_System_Clock=%u",
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 INT_Check_IRQ_Mask(), IQ_TimerCount2, TMD_System_Clock);
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 freecalypso_raw_dbgout(strbuf);
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 }
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43 freecalypso_nucidle_dbghook()
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 {
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 freecalypso_raw_dbgout("*In Nucleus idle loop");
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 freecalypso_lldbg_intinfo();
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 }