annotate gsm-fw/serial/debug.c @ 923:10b4bed10192

gsm-fw/L1: fix for the DSP patch corruption bug The L1 code we got from the LoCosto fw contains a feature for DSP CPU load measurement. This feature is a LoCosto-ism, i.e., not applicable to earlier DBB chips (Calypso) with their respective earlier DSP ROMs. Most of the code dealing with that feature is conditionalized as #if (DSP >= 38), but one spot was missed, and the MCU code was writing into an API word dealing with this feature. In TCS211 this DSP API word happens to be used by the DSP code patch, hence that write was corrupting the patched DSP code.
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Mon, 19 Oct 2015 17:13:56 +0000
parents a2194416fd7c
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
311
a2194416fd7c gsm-fw: preparations for ARM exception handling (DAR disabled for now)
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 143
diff changeset
31 #if 0
136
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 freecalypso_lldbg_intinfo()
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 {
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 char strbuf[128];
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 extern unsigned IQ_TimerCount2;
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 extern unsigned TMD_System_Clock;
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 extern unsigned INT_Check_IRQ_Mask();
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 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
40 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
41 freecalypso_raw_dbgout(strbuf);
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
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 freecalypso_nucidle_dbghook()
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 {
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 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
47 freecalypso_lldbg_intinfo();
3b5c3f3646fb RV bring-up: lack of timer ticks fixed,
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 }
311
a2194416fd7c gsm-fw: preparations for ARM exception handling (DAR disabled for now)
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 143
diff changeset
49 #endif