FreeCalypso > hg > tcs211-l1-reconst
annotate chipsetsw/layer1/tpu_drivers/source/tpudrv.c @ 188:81064b792cc8
tpudrv.c: passes compilation, started disasm diffing
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 08 Jun 2016 03:05:09 +0000 |
parents | 7b2986d6f272 |
children | 8ab19f00e40d |
rev | line source |
---|---|
187
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
1 /************* Revision Controle System Header ************* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
2 * GSM Layer 1 software |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
3 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
4 * Filename tpudrv.c |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
5 * Copyright 2003 (C) Texas Instruments |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
6 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
7 ************* Revision Controle System Header *************/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
8 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
9 * TPUDRV.C |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
10 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
11 * TPU driver for Pole Star |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
12 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
13 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
14 * Copyright (c) Texas Instruments 1996 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
15 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
16 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
17 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
18 #include "l1_macro.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
19 #include "iq.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
20 #include "l1_confg.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
21 #include "l1_const.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
22 #include "l1_types.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
23 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
24 #if (AUDIO_TASK == 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
25 #include "l1audio_const.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
26 #include "l1audio_cust.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
27 #include "l1audio_defty.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
28 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
29 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
30 #if (L1_GTT == 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
31 #include "l1gtt_const.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
32 #include "l1gtt_defty.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
33 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
34 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
35 #if (L1_MIDI == 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
36 #include "l1midi_defty.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
37 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
38 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
39 #include "sys_types.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
40 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
41 #if TESTMODE |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
42 #include "l1tm_defty.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
43 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
44 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
45 #if (L1_MP3 == 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
46 #include "l1mp3_defty.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
47 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
48 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
49 #if (L1_MIDI == 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
50 #include "l1midi_defty.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
51 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
52 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
53 #if (L1_AAC == 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
54 #include "l1aac_defty.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
55 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
56 #include "l1_defty.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
57 #include "tpudrv.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
58 #include "sys_types.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
59 #include "clkm.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
60 #include "l1_time.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
61 #include "l1_varex.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
62 #include "l1_trace.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
63 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
64 #if (L1_MADC_ON == 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
65 #if (RF_FAM == 61) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
66 #include "drp_api.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
67 #include "l1_rf61.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
68 #include "drp_drive.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
69 #include "tpudrv61.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
70 extern T_DRP_REGS_STR *drp_regs; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
71 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
72 #endif //L1_MADC_ON |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
73 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
74 /* RFTime environment */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
75 #if defined (HOST_TEST) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
76 #include "hostmacros.h" |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
77 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
78 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
79 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
80 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
81 * VEGA and OMEGA receive windows - Defined in Customer-specific file |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
82 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
83 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
84 extern UWORD32 debug_tpu; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
85 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
86 #if ( OP_WCP == 1 ) && ( OP_L1_STANDALONE != 1 ) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
87 // WCS Patch : ADC during RX or TX |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
88 extern inline void GC_SetAdcInfo(unsigned char bTxBasedAdc); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
89 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
90 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
91 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
92 * Global Variables |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
93 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
94 // GSM1.5 : TPU MEMORY is 16-bit instead of 32 in Gemini/Polxx |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
95 //------------------------------------------------------------ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
96 SYS_UWORD16 *TP_Ptr = (SYS_UWORD16 *) TPU_RAM; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
97 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
98 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
99 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
100 /* TPU_Reset : Reset the TPU */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
101 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
102 /* Parameters : on/off(1/0) */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
103 /* Return : none */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
104 /* Functionality : ) Reset the TPU */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
105 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
106 void TPU_Reset(SYS_UWORD16 on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
107 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
108 if (on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
109 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
110 * ((volatile SYS_UWORD16 *) TPU_CTRL) |= TPU_CTRL_RESET; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
111 // WA for read/modify/write access problem with REG_TPU_CTRL present on Ulysse/Samson/Calypso |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
112 while (!((*(volatile SYS_UWORD16 *) TPU_CTRL) & TPU_CTRL_RESET)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
113 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
114 else |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
115 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
116 * ((volatile SYS_UWORD16 *) TPU_CTRL) &= ~TPU_CTRL_RESET; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
117 // WA for read/modify/write access problem with REG_TPU_CTRL present on Ulysse/Samson/Calypso |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
118 while (((*(volatile SYS_UWORD16 *) TPU_CTRL) & TPU_CTRL_RESET)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
119 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
120 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
121 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
122 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
123 /* TSP_Reset : Reset the TSP */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
124 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
125 /* Parameters : on/off(1/0) */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
126 /* Return : none */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
127 /* Functionality : ) Reset the TSP */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
128 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
129 void TSP_Reset(SYS_UWORD16 on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
130 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
131 if (on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
132 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
133 * ((volatile SYS_UWORD16 *) TPU_CTRL) |= TSP_CTRL_RESET; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
134 // WA for read/modify/write access problem with REG_TPU_CTRL present on Ulysse/Samson/Calypso |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
135 while (!((*(volatile SYS_UWORD16 *) TPU_CTRL) & TSP_CTRL_RESET)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
136 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
137 else |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
138 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
139 * ((volatile SYS_UWORD16 *) TPU_CTRL) &= ~TSP_CTRL_RESET; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
140 // WA for read/modify/write access problem with REG_TPU_CTRL present on Ulysse/Samson/Calypso |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
141 while (((*(volatile SYS_UWORD16 *) TPU_CTRL) & TSP_CTRL_RESET)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
142 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
143 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
144 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
145 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
146 /* TPU_SPIReset : Reset the SPI of the TPU */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
147 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
148 /* Parameters : on/off(1/0) */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
149 /* Return : none */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
150 /* Functionality : ) the SPI of the TPU */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
151 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
152 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
153 void TPU_SPIReset(SYS_UWORD16 on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
154 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
155 if (on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
156 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
157 * ((volatile SYS_UWORD16 *) TPU_CTRL) |= TPU_CTRL_SPI_RST; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
158 // WA for read/modify/write access problem with REG_TPU_CTRL present on Ulysse/Samson/Calypso |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
159 while (!((*(volatile SYS_UWORD16 *) TPU_CTRL) & TPU_CTRL_SPI_RST)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
160 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
161 else |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
162 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
163 * ((volatile SYS_UWORD16 *) TPU_CTRL) &= ~TPU_CTRL_SPI_RST; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
164 // WA for read/modify/write access problem with REG_TPU_CTRL present on Ulysse/Samson/Calypso |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
165 while (((*(volatile SYS_UWORD16 *) TPU_CTRL) & TPU_CTRL_SPI_RST)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
166 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
167 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
168 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
169 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
170 /* TPU_ClkEnable : */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
171 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
172 /* Parameters : on/off(1/0) */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
173 /* Return : none */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
174 /* Functionality : Enable the TPU clock */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
175 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
176 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
177 void TPU_ClkEnable(SYS_UWORD16 on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
178 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
179 if (on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
180 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
181 * ((volatile SYS_UWORD16 *) TPU_CTRL) |= TPU_CTRL_CLK_EN; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
182 // WA for read/modify/write access problem with REG_TPU_CTRL present on Ulysse/Samson/Calypso |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
183 while (!((*(volatile SYS_UWORD16 *) TPU_CTRL) & TPU_CTRL_CLK_EN)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
184 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
185 else |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
186 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
187 * ((volatile SYS_UWORD16 *) TPU_CTRL) &= ~TPU_CTRL_CLK_EN; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
188 // WA for read/modify/write access problem with REG_TPU_CTRL present on Ulysse/Samson/Calypso |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
189 while (((*(volatile SYS_UWORD16 *) TPU_CTRL) & TPU_CTRL_CLK_EN)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
190 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
191 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
192 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
193 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
194 /* TPU_Frame_ItOn : */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
195 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
196 /* Parameters : bit of it to enable */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
197 /* Return : none */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
198 /* Functionality : Enable frame it */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
199 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
200 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
201 /*-----------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
202 /* Warning read modify write access to TPU_INT_CTRL register */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
203 /* may generate problems using Hyperion. */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
204 /*-----------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
205 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
206 void TPU_FrameItOn(SYS_UWORD16 it) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
207 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
208 * ((volatile SYS_UWORD16 *) TPU_INT_CTRL) &= ~it; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
209 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
210 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
211 void TPU_FrameItEnable(void) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
212 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
213 #if W_A_ITFORCE |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
214 (*(volatile SYS_UWORD16 *)TPU_INT_CTRL) |= TPU_INT_ITD_F; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
215 #else |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
216 // enable IT_DSP generation on next frame |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
217 // reset by DSP when IT occurs |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
218 (*(volatile SYS_UWORD16 *) TPU_CTRL) |= TPU_CTRL_D_ENBL; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
219 // WA for read/modify/write access problem with REG_TPU_CTRL present on Ulysse/Samson/Calypso |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
220 while (!((*(volatile SYS_UWORD16 *) TPU_CTRL) & TPU_CTRL_D_ENBL)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
221 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
222 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
223 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
224 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
225 /* TPU_check_IT_DSP : */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
226 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
227 /* Parameters : none */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
228 /* Return : none */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
229 /* Functionality : check if an IT DSP still pending */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
230 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
231 BOOL TPU_check_IT_DSP(void) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
232 { // return TRUE if an IT DSP still pending. |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
233 return( (((*(volatile SYS_UWORD16 *) TPU_CTRL) & TPU_CTRL_D_ENBL) == TPU_CTRL_D_ENBL)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
234 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
235 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
236 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
237 /* TPU_DisableAllIt : */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
238 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
239 /* Parameters : none */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
240 /* Return : none */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
241 /* Functionality : Disabl all it */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
242 /*--------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
243 void TPU_DisableAllIt() |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
244 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
245 * ((volatile SYS_UWORD16 *) TPU_INT_CTRL) |= TPU_INT_ITF_M | TPU_INT_ITP_M | TPU_INT_ITD_M; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
246 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
247 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
248 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
249 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
250 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
251 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
252 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
253 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
254 * TP_Program |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
255 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
256 * Write a null-terminated scenario into TPU memory at a given start address |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
257 * (Do not write terminating 0) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
258 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
259 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
260 void *TP_Program(const SYS_UWORD16 *src) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
261 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
262 /* Write TPU instructions until SLEEP */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
263 while (*src) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
264 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
265 *TP_Ptr++ = *src++; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
266 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
267 #if (TOOL_CHOICE == 3) // 2.54 Migration |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
268 return((void *)NULL); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
269 #endif // TOOL_CHOICE == 3 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
270 // return((void *)NULL);//ompas00090550 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
271 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
272 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
273 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
274 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
275 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
276 void TP_Reset(SYS_UWORD16 on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
277 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
278 if (on) { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
279 * ((volatile SYS_UWORD16 *) TPU_CTRL) |= (TPU_CTRL_RESET | TSP_CTRL_RESET); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
280 while (!((*(volatile SYS_UWORD16 *) TPU_CTRL) & (TPU_CTRL_RESET | TSP_CTRL_RESET))); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
281 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
282 else { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
283 * ((volatile SYS_UWORD16 *) TPU_CTRL) &= ~(TPU_CTRL_RESET | TSP_CTRL_RESET); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
284 while (((*(volatile SYS_UWORD16 *) TPU_CTRL) & (TPU_CTRL_RESET | TSP_CTRL_RESET))); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
285 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
286 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
287 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
288 void TP_Enable(SYS_UWORD16 on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
289 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
290 if(on) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
291 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
292 * ((volatile SYS_UWORD16 *) TPU_CTRL) |= TPU_CTRL_T_ENBL; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
293 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
294 // Some time shall be wait before leaving the function to ensure that bit has been taken |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
295 // in account by the TPU. A while loop such as in function TP_reset can't be used as the |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
296 // ARM can be interrupted within this loop and in that case the pulse will be missed (CQ20781). |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
297 // The bit is updated in the worst case 24 cycles of 13MHz later it as been written by the MCU. |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
298 // 24 ticks of 13MHz = 1.84us. Lets take 3us to keep some margin. |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
299 wait_ARM_cycles(convert_nanosec_to_cycles(3000)); // wait 3us |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
300 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
301 else |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
302 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
303 * ((volatile SYS_UWORD16 *) TPU_CTRL) &= ~TPU_CTRL_T_ENBL; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
304 // Some time shall be wait before leaving the function to ensure that bit has been taken |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
305 // in account by the TPU. A while loop such as in function TP_reset can't be used as the |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
306 // ARM can be interrupted within this loop and in that case the pulse will be missed (CQ20781). |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
307 // The bit is updated in the worst case 24 cycles of 13MHz later it as been written by the MCU. |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
308 // 24 ticks of 13MHz = 1.84us. Lets take 3us to keep some margin. |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
309 wait_ARM_cycles(convert_nanosec_to_cycles(3000)); // wait 3us |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
310 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
311 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
312 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
313 |
188
81064b792cc8
tpudrv.c: passes compilation, started disasm diffing
Mychaela Falconia <falcon@freecalypso.org>
parents:
187
diff
changeset
|
314 #if 0 /* FreeCalypso: function not present in TCS211 */ |
187
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
315 /*-----------------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
316 /* Function name: TPU_wait_idle */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
317 /*-----------------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
318 /* */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
319 /* Parameters: None */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
320 /* */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
321 /* Return: None */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
322 /* */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
323 /*-----------------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
324 /* Description: Wait until TPU scenario execution is complete */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
325 /* */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
326 /*-----------------------------------------------------------------------*/ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
327 void TPU_wait_idle(void) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
328 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
329 while( ((*(volatile SYS_UWORD16 *) (TPU_CTRL)) & TPU_CTRL_TPU_IDLE) == TPU_CTRL_TPU_IDLE) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
330 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
331 wait_ARM_cycles(convert_nanosec_to_cycles(3000)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
332 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
333 } |
188
81064b792cc8
tpudrv.c: passes compilation, started disasm diffing
Mychaela Falconia <falcon@freecalypso.org>
parents:
187
diff
changeset
|
334 #endif |
187
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
335 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
336 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
337 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
338 * l1dmacro_idle |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
339 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
340 * Write SLEEP instruction, start TPU and reset pointer |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
341 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
342 void l1dmacro_idle (void) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
343 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
344 *TP_Ptr++ = TPU_SLEEP; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
345 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
346 /* start TPU */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
347 TP_Ptr = (SYS_UWORD16 *) TPU_RAM; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
348 TP_Enable(1); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
349 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
350 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
351 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
352 * l1dmacro_offset |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
353 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
354 * Set OFFSET register |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
355 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
356 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
357 void l1dmacro_offset (UWORD32 offset_value, WORD32 relative_time) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
358 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
359 // WARNING: 'relative time' and 'offset_value' must always be comprised |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
360 // between 0 and TPU_CLOCK_RANGE !!! |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
361 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
362 if (relative_time != IMM) // IMM indicates to set directly without AT |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
363 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
364 *TP_Ptr++ = TPU_FAT(relative_time); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
365 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
366 *TP_Ptr++ = TPU_OFFSET(offset_value); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
367 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
368 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
369 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
370 * l1dmacro_synchro |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
371 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
372 * Set synchro register |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
373 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
374 void l1dmacro_synchro (UWORD32 when, UWORD32 value) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
375 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
376 // WARNING: 'when' must always be comprised between 0 and TPU_CLOCK_RANGE !!! |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
377 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
378 trace_fct(CST_L1DMACRO_SYNCHRO, 1);//omaps00090550 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
379 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
380 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
381 if (value != IMM) // IMM indicates to set directly without AT |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
382 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
383 *TP_Ptr++ = TPU_FAT(when); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
384 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
385 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
386 *TP_Ptr++ = TPU_SYNC(value); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
387 l1s.tpu_offset_hw = value; // memorize the offset set into the TPU. |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
388 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
389 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
390 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
391 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
392 * l1dmacro_adc_read |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
393 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
394 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
395 void l1dmacro_adc_read_rx(void) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
396 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
397 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
398 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3)) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
399 // TSP needs to be configured in order to send serially to Omega |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
400 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
401 // *TP_Ptr++ = TPU_MOVE (TSP_SPI_SET1, TSP_CLK_RISE); // Clock configuration |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
402 *TP_Ptr++ = TPU_WAIT (5); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
403 *TP_Ptr++ = TPU_MOVE (TSP_CTRL1,6); // Device and Nb of bits configuration |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
404 *TP_Ptr++ = TPU_MOVE (TSP_TX_REG_1,STARTADC); // Load data to send |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
405 *TP_Ptr++ = TPU_MOVE (TSP_CTRL2, TC2_WR); // Start serialization command and adc conversion |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
406 *TP_Ptr++ = TPU_WAIT (5); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
407 *TP_Ptr++ = TPU_MOVE (TSP_TX_REG_1,0x00); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
408 *TP_Ptr++ = TPU_MOVE (TSP_CTRL2, TC2_WR); // Reset startadc pulse |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
409 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
410 #if (TRACE_TYPE==1)||(TRACE_TYPE ==4) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
411 #if (GSM_IDLE_RAM == 0) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
412 l1_trace_ADC(0); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
413 #else |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
414 l1_trace_ADC_intram(0); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
415 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
416 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
417 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
418 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
419 #if (L1_MADC_ON == 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
420 #if (ANLG_FAM == 11) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
421 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
422 #if (TRACE_TYPE==1)||(TRACE_TYPE ==4) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
423 #if (GSM_IDLE_RAM == 0) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
424 l1_trace_ADC(0); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
425 #else |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
426 l1_trace_ADC_intram(0); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
427 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
428 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
429 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
430 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
431 #if (OP_WCP == 1) && (OP_L1_STANDALONE != 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
432 // WCS patch: ADC during RX |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
433 GC_SetAdcInfo(0); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
434 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
435 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
436 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
437 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
438 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
439 #if (CODE_VERSION != SIMULATION) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
440 #if (L1_MADC_ON ==1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
441 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
442 * l1dmacro_adc_read_rx_cs_mode0 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
443 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
444 * Purpose: |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
445 * ====== |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
446 * MADC is not enabled during CS_MODE0 periodically. MADC is enabled in CS_MODE0 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
447 * when Layer 1 receives MPHC_RXLEV_REQ from L23. However in CS_MODE0, MPHC_RXLEV_REQ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
448 * is not received periodically. In case network is not found, the period between 2 MPHC_RXLEV_REQ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
449 * increases and can be as high as 360 seconds (Maximum Value) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
450 * This can result in battery related issues like phone powering off without MMI indication. |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
451 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
452 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
453 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
454 void l1dmacro_adc_read_rx_cs_mode0(void) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
455 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
456 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_U,START_ADC); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
457 *TP_Ptr++ = TPU_WAIT (2); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
458 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_U,0); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
459 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
460 #if (L1_MADC_ON == 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
461 #if (ANLG_FAM == 11) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
462 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
463 #if (TRACE_TYPE==1)||(TRACE_TYPE ==4) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
464 #if (GSM_IDLE_RAM == 0) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
465 l1_trace_ADC(0); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
466 #else |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
467 l1_trace_ADC_intram(0); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
468 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
469 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
470 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
471 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
472 #if (OP_WCP == 1) && (OP_L1_STANDALONE != 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
473 // WCS patch: ADC during RX |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
474 GC_SetAdcInfo(0); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
475 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
476 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
477 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
478 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
479 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
480 #endif //If MADC is enabled |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
481 #endif //If Not Simulation |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
482 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
483 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
484 * l1dmacro_adc_read_tx |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
485 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
486 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
487 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
488 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
489 #if (ANLG_FAM != 11) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
490 void l1dmacro_adc_read_tx(UWORD32 when) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
491 #else |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
492 void l1dmacro_adc_read_tx(UWORD32 when, UWORD8 tx_up_state) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
493 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
494 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
495 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
496 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3)) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
497 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
498 *TP_Ptr++ = TPU_FAT (when); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
499 *TP_Ptr++ = TPU_MOVE (TSP_CTRL1,6); // Device and Nb of bits configuration |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
500 *TP_Ptr++ = TPU_MOVE (TSP_TX_REG_1, STARTADC|BULON|BULENA); // Load data to send |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
501 *TP_Ptr++ = TPU_MOVE (TSP_CTRL2, TC2_WR); // Start serialization command and adc conversion |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
502 *TP_Ptr++ = TPU_WAIT (5); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
503 *TP_Ptr++ = TPU_MOVE (TSP_TX_REG_1, BULON|BULENA); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
504 *TP_Ptr++ = TPU_MOVE (TSP_CTRL2, TC2_WR); // Reset startadc pulse |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
505 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
506 #if (TRACE_TYPE==1)||(TRACE_TYPE ==4) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
507 l1_trace_ADC(1); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
508 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
509 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
510 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
511 #if (L1_MADC_ON == 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
512 #if (ANLG_FAM == 11) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
513 *TP_Ptr++ = TPU_FAT (when); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
514 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_U,tx_up_state | START_ADC); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
515 *TP_Ptr++ = TPU_WAIT (2); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
516 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_U,tx_up_state); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
517 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
518 #if 1 // TEMP MEASUREMENT - uncomment and test after MADC |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
519 #if (RF_FAM == 61) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
520 *TP_Ptr++ = TPU_MOVE(OCP_DATA_MSB, ((START_SCRIPT(DRP_TEMP_CONV))>>8) & 0xFF); \ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
521 *TP_Ptr++ = TPU_MOVE(OCP_DATA_LSB, (START_SCRIPT(DRP_TEMP_CONV)) & 0xFF); \ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
522 *TP_Ptr++ = TPU_MOVE(OCP_ADDRESS_MSB, (((UWORD16)( ((UWORD32)(&drp_regs->SCRIPT_STARTL))&0xFFFF)>>8) & 0xFF)); \ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
523 *TP_Ptr++ = TPU_MOVE(OCP_ADDRESS_LSB, ((UWORD16)( ((UWORD32)(&drp_regs->SCRIPT_STARTL))&0xFFFF)) & 0xFF); \ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
524 *TP_Ptr++ = TPU_MOVE(OCP_ADDRESS_START, 0x01); \ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
525 //TEMP_MEAS: Call TEMP Conv Script in DRP |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
526 //MOVE_REG_TSP_TO_RF(START_SCRIPT(DRP_TEMP_CONV),(UWORD16)(&drp_regs->SCRIPT_STARTL)); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
527 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
528 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
529 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
530 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
531 #if (TRACE_TYPE==1)||(TRACE_TYPE ==4) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
532 l1_trace_ADC(1); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
533 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
534 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
535 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
536 #endif //L1_MADC_ON |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
537 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
538 #if (OP_WCP == 1) && (OP_L1_STANDALONE != 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
539 // WCS patch: ADC during TX |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
540 GC_SetAdcInfo(1); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
541 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
542 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
543 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
544 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
545 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
546 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
547 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
548 #if (RF_FAM == 61) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
549 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
550 void l1dmacro_adc_read_tx(UWORD32 when, UWORD8 tx_up_state) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
551 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
552 int i; |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
553 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
554 *TP_Ptr++ = TPU_FAT (when); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
555 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_U,tx_up_state | START_ADC); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
556 *TP_Ptr++ = TPU_WAIT (2); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
557 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_U,tx_up_state); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
558 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
559 #if (TRACE_TYPE==1)||(TRACE_TYPE ==4) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
560 l1_trace_ADC(1); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
561 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
562 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
563 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
564 #if (OP_WCP == 1) && (OP_L1_STANDALONE != 1) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
565 // WCS patch: ADC during TX |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
566 GC_SetAdcInfo(1); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
567 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
568 } |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
569 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
570 #endif |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
571 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
572 |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
573 /* |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
574 * l1dmacro_set_frame_it |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
575 * |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
576 */ |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
577 void l1dmacro_set_frame_it(void) |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
578 { |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
579 TPU_FrameItEnable(); |
7b2986d6f272
tpudrv.c: initial import of LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
185
diff
changeset
|
580 } |