comparison src/cs/layer1/cust0/l1_rf12.c @ 69:50a15a54801e

src/cs/layer1: import from tcs211-l1-reconst project
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 01 Oct 2016 23:45:38 +0000
parents
children cbee8f31694a
comparison
equal deleted inserted replaced
68:838717193e09 69:50a15a54801e
1 #if (OP_L1_STANDALONE == 1)
2 // Define the correct enumeration of PA. Consult tpudrv12.h for the enumeration.
3 #if ((BOARD == 40) || (BOARD == 41) || (BOARD == 45)) // EvaRita + D-sample or EvaConso
4 #define RF_PA 3
5 #else
6 #define RF_PA 0
7 #endif
8 #else
9 #include "rf.cfg"
10 //#define RF_PA 3 // Hitachi
11 #endif
12
13 /*
14 * FreeCalypso: the following T_RF table perfectly matches
15 * between the MV100 source and the Leonardo binary object.
16 */
17
18 T_RF rf =
19 {
20 RF_RITA_10, //RF revision
21 RF_HW_BAND_SUPPORT, // radio_band_support E-GSM/DCS + PCS
22
23 { //RX structure
24 { //AGC structure
25 140, // low_agc_noise_thr;
26 110, // high_agc_sat_thr;
27 6, // low_agc;
28 34, // high_agc;
29 //IL2AGC tables
30 { // below is: il2agc_pwr[121];
31 // il2agc_max[121];
32 // il2agc_av[121];
33 // il2agc_pwr
34 // Note this is shared between PCN and EGSM.
35 14, /* EGSM_MAX IL=0 */
36 14, /* EGSM_MAX IL=-1 */
37 14, /* EGSM_MAX IL=-2 */
38 14, /* EGSM_MAX IL=-3 */
39 14, /* EGSM_MAX IL=-4 */
40 14, /* EGSM_MAX IL=-5 */
41 14, /* EGSM_MAX IL=-6 */
42 14, /* EGSM_MAX IL=-7 */
43 14, /* EGSM_MAX IL=-8 */
44 14, /* EGSM_MAX IL=-9 */
45 14, /* EGSM_MAX IL=-10 */
46 14, /* EGSM_MAX IL=-11 */
47 14, /* EGSM_MAX IL=-12 */
48 14, /* EGSM_MAX IL=-13 */
49 14, /* EGSM_MAX IL=-14 */
50 14, /* EGSM_MAX IL=-15 */
51 14, /* EGSM_MAX IL=-16 */
52 14, /* EGSM_MAX IL=-17 */
53 14, /* EGSM_MAX IL=-18 */
54 14, /* EGSM_MAX IL=-19 */
55 14, /* EGSM_MAX IL=-20 */
56 14, /* EGSM_MAX IL=-21 */
57 14, /* EGSM_MAX IL=-22 */
58 14, /* EGSM_MAX IL=-23 */
59 14, /* EGSM_MAX IL=-24 */
60 14, /* EGSM_MAX IL=-25 */
61 14, /* EGSM_MAX IL=-26 */
62 14, /* EGSM_MAX IL=-27 */
63 14, /* EGSM_MAX IL=-28 */
64 14, /* EGSM_MAX IL=-29 */
65 14, /* EGSM_MAX IL=-30 */
66 14, /* EGSM_MAX IL=-31 */
67 14, /* EGSM_MAX IL=-32 */
68 14, /* EGSM_MAX IL=-33 */
69 14, /* EGSM_MAX IL=-34 */
70 14, /* EGSM_MAX IL=-35 */
71 14, /* EGSM_MAX IL=-36 */
72 14, /* EGSM_MAX IL=-37 */
73 14, /* EGSM_MAX IL=-38 */
74 14, /* EGSM_MAX IL=-39 */
75 14, /* EGSM_MAX IL=-40 */
76 14, /* EGSM_MAX IL=-41 */
77 14, /* EGSM_MAX IL=-42 */
78 14, /* EGSM_MAX IL=-43 */
79 14, /* EGSM_MAX IL=-44 */
80 14, /* EGSM_MAX IL=-45 */
81 14, /* EGSM_MAX IL=-46 */
82 14, /* EGSM_MAX IL=-47 */
83 14, /* EGSM_MAX IL=-48 */
84 14, /* EGSM_MAX IL=-49 */
85 14, /* EGSM_MAX IL=-50 */
86 14, /* EGSM_MAX IL=-51 */
87 14, /* EGSM_MAX IL=-52 */
88 14, /* EGSM_MAX IL=-53 */
89 14, /* EGSM_MAX IL=-54 */
90 16, /* EGSM_MAX IL=-55 */
91 16, /* EGSM_MAX IL=-56 */
92 18, /* EGSM_MAX IL=-57 */
93 18, /* EGSM_MAX IL=-58 */
94 20, /* EGSM_MAX IL=-59 */
95 20, /* EGSM_MAX IL=-60 */
96 22, /* EGSM_MAX IL=-61 */
97 22, /* EGSM_MAX IL=-62 */
98 24, /* EGSM_MAX IL=-63 */
99 24, /* EGSM_MAX IL=-64 */
100 26, /* EGSM_MAX IL=-65 */
101 26, /* EGSM_MAX IL=-66 */
102 28, /* EGSM_MAX IL=-67 */
103 28, /* EGSM_MAX IL=-68 */
104 30, /* EGSM_MAX IL=-69 */
105 30, /* EGSM_MAX IL=-70 */
106 32, /* EGSM_MAX IL=-71 */
107 32, /* EGSM_MAX IL=-72 */
108 34, /* EGSM_MAX IL=-73 */
109 34, /* EGSM_MAX IL=-74 */
110 36, /* EGSM_MAX IL=-75 */
111 36, /* EGSM_MAX IL=-76 */
112 38, /* EGSM_MAX IL=-77 */
113 38, /* EGSM_MAX IL=-78 */
114 40, /* EGSM_MAX IL=-79 */
115 40, /* EGSM_MAX IL=-80 */
116 40, /* EGSM_MAX IL=-81 */
117 40, /* EGSM_MAX IL=-82 */
118 40, /* EGSM_MAX IL=-83 */
119 40, /* EGSM_MAX IL=-84 */
120 40, /* EGSM_MAX IL=-85 */
121 40, /* EGSM_MAX IL=-86 */
122 40, /* EGSM_MAX IL=-87 */
123 40, /* EGSM_MAX IL=-88 */
124 40, /* EGSM_MAX IL=-89 */
125 40, /* EGSM_MAX IL=-90 */
126 40, /* EGSM_MAX IL=-91 */
127 40, /* EGSM_MAX IL=-92 */
128 40, /* EGSM_MAX IL=-93 */
129 40, /* EGSM_MAX IL=-94 */
130 40, /* EGSM_MAX IL=-95 */
131 40, /* EGSM_MAX IL=-96 */
132 40, /* EGSM_MAX IL=-97 */
133 40, /* EGSM_MAX IL=-98 */
134 40, /* EGSM_MAX IL=-99 */
135 40, /* EGSM_MAX IL=-100 */
136 40, /* EGSM_MAX IL=-101 */
137 40, /* EGSM_MAX IL=-102 */
138 40, /* EGSM_MAX IL=-103 */
139 40, /* EGSM_MAX IL=-104 */
140 40, /* EGSM_MAX IL=-105 */
141 40, /* EGSM_MAX IL=-106 */
142 40, /* EGSM_MAX IL=-107 */
143 40, /* EGSM_MAX IL=-108 */
144 40, /* EGSM_MAX IL=-109 */
145 40, /* EGSM_MAX IL=-110 */
146 40, /* EGSM_MAX IL=-111 */
147 40, /* EGSM_MAX IL=-112 */
148 40, /* EGSM_MAX IL=-113 */
149 40, /* EGSM_MAX IL=-114 */
150 40, /* EGSM_MAX IL=-115 */
151 40, /* EGSM_MAX IL=-116 */
152 40, /* EGSM_MAX IL=-117 */
153 40, /* EGSM_MAX IL=-118 */
154 40, /* EGSM_MAX IL=-119 */
155 40 /* EGSM_MAX IL=-120 */
156 },
157 { // il2agc_max
158 // Note this is shared between PCN and EGSM.
159 14, /* EGSM_MAX IL=0 */
160 14, /* EGSM_MAX IL=-1 */
161 14, /* EGSM_MAX IL=-2 */
162 14, /* EGSM_MAX IL=-3 */
163 14, /* EGSM_MAX IL=-4 */
164 14, /* EGSM_MAX IL=-5 */
165 14, /* EGSM_MAX IL=-6 */
166 14, /* EGSM_MAX IL=-7 */
167 14, /* EGSM_MAX IL=-8 */
168 14, /* EGSM_MAX IL=-9 */
169 14, /* EGSM_MAX IL=-10 */
170 14, /* EGSM_MAX IL=-11 */
171 14, /* EGSM_MAX IL=-12 */
172 14, /* EGSM_MAX IL=-13 */
173 14, /* EGSM_MAX IL=-14 */
174 14, /* EGSM_MAX IL=-15 */
175 14, /* EGSM_MAX IL=-16 */
176 14, /* EGSM_MAX IL=-17 */
177 14, /* EGSM_MAX IL=-18 */
178 14, /* EGSM_MAX IL=-19 */
179 14, /* EGSM_MAX IL=-20 */
180 14, /* EGSM_MAX IL=-21 */
181 14, /* EGSM_MAX IL=-22 */
182 14, /* EGSM_MAX IL=-23 */
183 14, /* EGSM_MAX IL=-24 */
184 14, /* EGSM_MAX IL=-25 */
185 14, /* EGSM_MAX IL=-26 */
186 14, /* EGSM_MAX IL=-27 */
187 14, /* EGSM_MAX IL=-28 */
188 14, /* EGSM_MAX IL=-29 */
189 14, /* EGSM_MAX IL=-30 */
190 14, /* EGSM_MAX IL=-31 */
191 14, /* EGSM_MAX IL=-32 */
192 14, /* EGSM_MAX IL=-33 */
193 14, /* EGSM_MAX IL=-34 */
194 14, /* EGSM_MAX IL=-35 */
195 14, /* EGSM_MAX IL=-36 */
196 14, /* EGSM_MAX IL=-37 */
197 14, /* EGSM_MAX IL=-38 */
198 14, /* EGSM_MAX IL=-39 */
199 14, /* EGSM_MAX IL=-40 */
200 14, /* EGSM_MAX IL=-41 */
201 14, /* EGSM_MAX IL=-42 */
202 14, /* EGSM_MAX IL=-43 */
203 14, /* EGSM_MAX IL=-44 */
204 14, /* EGSM_MAX IL=-45 */
205 14, /* EGSM_MAX IL=-46 */
206 14, /* EGSM_MAX IL=-47 */
207 14, /* EGSM_MAX IL=-48 */
208 14, /* EGSM_MAX IL=-49 */
209 14, /* EGSM_MAX IL=-50 */
210 14, /* EGSM_MAX IL=-51 */
211 14, /* EGSM_MAX IL=-52 */
212 14, /* EGSM_MAX IL=-53 */
213 14, /* EGSM_MAX IL=-54 */
214 16, /* EGSM_MAX IL=-55 */
215 16, /* EGSM_MAX IL=-56 */
216 18, /* EGSM_MAX IL=-57 */
217 18, /* EGSM_MAX IL=-58 */
218 20, /* EGSM_MAX IL=-59 */
219 20, /* EGSM_MAX IL=-60 */
220 22, /* EGSM_MAX IL=-61 */
221 22, /* EGSM_MAX IL=-62 */
222 24, /* EGSM_MAX IL=-63 */
223 24, /* EGSM_MAX IL=-64 */
224 26, /* EGSM_MAX IL=-65 */
225 26, /* EGSM_MAX IL=-66 */
226 28, /* EGSM_MAX IL=-67 */
227 28, /* EGSM_MAX IL=-68 */
228 30, /* EGSM_MAX IL=-69 */
229 30, /* EGSM_MAX IL=-70 */
230 32, /* EGSM_MAX IL=-71 */
231 32, /* EGSM_MAX IL=-72 */
232 34, /* EGSM_MAX IL=-73 */
233 34, /* EGSM_MAX IL=-74 */
234 36, /* EGSM_MAX IL=-75 */
235 36, /* EGSM_MAX IL=-76 */
236 38, /* EGSM_MAX IL=-77 */
237 38, /* EGSM_MAX IL=-78 */
238 40, /* EGSM_MAX IL=-79 */
239 40, /* EGSM_MAX IL=-80 */
240 40, /* EGSM_MAX IL=-81 */
241 40, /* EGSM_MAX IL=-82 */
242 40, /* EGSM_MAX IL=-83 */
243 40, /* EGSM_MAX IL=-84 */
244 40, /* EGSM_MAX IL=-85 */
245 40, /* EGSM_MAX IL=-86 */
246 40, /* EGSM_MAX IL=-87 */
247 40, /* EGSM_MAX IL=-88 */
248 40, /* EGSM_MAX IL=-89 */
249 40, /* EGSM_MAX IL=-90 */
250 40, /* EGSM_MAX IL=-91 */
251 40, /* EGSM_MAX IL=-92 */
252 40, /* EGSM_MAX IL=-93 */
253 40, /* EGSM_MAX IL=-94 */
254 40, /* EGSM_MAX IL=-95 */
255 40, /* EGSM_MAX IL=-96 */
256 40, /* EGSM_MAX IL=-97 */
257 40, /* EGSM_MAX IL=-98 */
258 40, /* EGSM_MAX IL=-99 */
259 40, /* EGSM_MAX IL=-100 */
260 40, /* EGSM_MAX IL=-101 */
261 40, /* EGSM_MAX IL=-102 */
262 40, /* EGSM_MAX IL=-103 */
263 40, /* EGSM_MAX IL=-104 */
264 40, /* EGSM_MAX IL=-105 */
265 40, /* EGSM_MAX IL=-106 */
266 40, /* EGSM_MAX IL=-107 */
267 40, /* EGSM_MAX IL=-108 */
268 40, /* EGSM_MAX IL=-109 */
269 40, /* EGSM_MAX IL=-110 */
270 40, /* EGSM_MAX IL=-111 */
271 40, /* EGSM_MAX IL=-112 */
272 40, /* EGSM_MAX IL=-113 */
273 40, /* EGSM_MAX IL=-114 */
274 40, /* EGSM_MAX IL=-115 */
275 40, /* EGSM_MAX IL=-116 */
276 40, /* EGSM_MAX IL=-117 */
277 40, /* EGSM_MAX IL=-118 */
278 40, /* EGSM_MAX IL=-119 */
279 40 /* EGSM_MAX IL=-120 */
280 },
281 { // il2agc_av
282 // Note this is shared between PCN and EGSM.
283 14, /* EGSM_MAX IL=0 */
284 14, /* EGSM_MAX IL=-1 */
285 14, /* EGSM_MAX IL=-2 */
286 14, /* EGSM_MAX IL=-3 */
287 14, /* EGSM_MAX IL=-4 */
288 14, /* EGSM_MAX IL=-5 */
289 14, /* EGSM_MAX IL=-6 */
290 14, /* EGSM_MAX IL=-7 */
291 14, /* EGSM_MAX IL=-8 */
292 14, /* EGSM_MAX IL=-9 */
293 14, /* EGSM_MAX IL=-10 */
294 14, /* EGSM_MAX IL=-11 */
295 14, /* EGSM_MAX IL=-12 */
296 14, /* EGSM_MAX IL=-13 */
297 14, /* EGSM_MAX IL=-14 */
298 14, /* EGSM_MAX IL=-15 */
299 14, /* EGSM_MAX IL=-16 */
300 14, /* EGSM_MAX IL=-17 */
301 14, /* EGSM_MAX IL=-18 */
302 14, /* EGSM_MAX IL=-19 */
303 14, /* EGSM_MAX IL=-20 */
304 14, /* EGSM_MAX IL=-21 */
305 14, /* EGSM_MAX IL=-22 */
306 14, /* EGSM_MAX IL=-23 */
307 14, /* EGSM_MAX IL=-24 */
308 14, /* EGSM_MAX IL=-25 */
309 14, /* EGSM_MAX IL=-26 */
310 14, /* EGSM_MAX IL=-27 */
311 14, /* EGSM_MAX IL=-28 */
312 14, /* EGSM_MAX IL=-29 */
313 14, /* EGSM_MAX IL=-30 */
314 14, /* EGSM_MAX IL=-31 */
315 14, /* EGSM_MAX IL=-32 */
316 14, /* EGSM_MAX IL=-33 */
317 14, /* EGSM_MAX IL=-34 */
318 14, /* EGSM_MAX IL=-35 */
319 14, /* EGSM_MAX IL=-36 */
320 14, /* EGSM_MAX IL=-37 */
321 14, /* EGSM_MAX IL=-38 */
322 14, /* EGSM_MAX IL=-39 */
323 14, /* EGSM_MAX IL=-40 */
324 14, /* EGSM_MAX IL=-41 */
325 14, /* EGSM_MAX IL=-42 */
326 14, /* EGSM_MAX IL=-43 */
327 14, /* EGSM_MAX IL=-44 */
328 14, /* EGSM_MAX IL=-45 */
329 14, /* EGSM_MAX IL=-46 */
330 14, /* EGSM_MAX IL=-47 */
331 14, /* EGSM_MAX IL=-48 */
332 14, /* EGSM_MAX IL=-49 */
333 14, /* EGSM_MAX IL=-50 */
334 14, /* EGSM_MAX IL=-51 */
335 14, /* EGSM_MAX IL=-52 */
336 14, /* EGSM_MAX IL=-53 */
337 14, /* EGSM_MAX IL=-54 */
338 16, /* EGSM_MAX IL=-55 */
339 16, /* EGSM_MAX IL=-56 */
340 18, /* EGSM_MAX IL=-57 */
341 18, /* EGSM_MAX IL=-58 */
342 20, /* EGSM_MAX IL=-59 */
343 20, /* EGSM_MAX IL=-60 */
344 22, /* EGSM_MAX IL=-61 */
345 22, /* EGSM_MAX IL=-62 */
346 24, /* EGSM_MAX IL=-63 */
347 24, /* EGSM_MAX IL=-64 */
348 26, /* EGSM_MAX IL=-65 */
349 26, /* EGSM_MAX IL=-66 */
350 28, /* EGSM_MAX IL=-67 */
351 28, /* EGSM_MAX IL=-68 */
352 30, /* EGSM_MAX IL=-69 */
353 30, /* EGSM_MAX IL=-70 */
354 32, /* EGSM_MAX IL=-71 */
355 32, /* EGSM_MAX IL=-72 */
356 34, /* EGSM_MAX IL=-73 */
357 34, /* EGSM_MAX IL=-74 */
358 36, /* EGSM_MAX IL=-75 */
359 36, /* EGSM_MAX IL=-76 */
360 38, /* EGSM_MAX IL=-77 */
361 38, /* EGSM_MAX IL=-78 */
362 40, /* EGSM_MAX IL=-79 */
363 40, /* EGSM_MAX IL=-80 */
364 40, /* EGSM_MAX IL=-81 */
365 40, /* EGSM_MAX IL=-82 */
366 40, /* EGSM_MAX IL=-83 */
367 40, /* EGSM_MAX IL=-84 */
368 40, /* EGSM_MAX IL=-85 */
369 40, /* EGSM_MAX IL=-86 */
370 40, /* EGSM_MAX IL=-87 */
371 40, /* EGSM_MAX IL=-88 */
372 40, /* EGSM_MAX IL=-89 */
373 40, /* EGSM_MAX IL=-90 */
374 40, /* EGSM_MAX IL=-91 */
375 40, /* EGSM_MAX IL=-92 */
376 40, /* EGSM_MAX IL=-93 */
377 40, /* EGSM_MAX IL=-94 */
378 40, /* EGSM_MAX IL=-95 */
379 40, /* EGSM_MAX IL=-96 */
380 40, /* EGSM_MAX IL=-97 */
381 40, /* EGSM_MAX IL=-98 */
382 40, /* EGSM_MAX IL=-99 */
383 40, /* EGSM_MAX IL=-100 */
384 40, /* EGSM_MAX IL=-101 */
385 40, /* EGSM_MAX IL=-102 */
386 40, /* EGSM_MAX IL=-103 */
387 40, /* EGSM_MAX IL=-104 */
388 40, /* EGSM_MAX IL=-105 */
389 40, /* EGSM_MAX IL=-106 */
390 40, /* EGSM_MAX IL=-107 */
391 40, /* EGSM_MAX IL=-108 */
392 40, /* EGSM_MAX IL=-109 */
393 40, /* EGSM_MAX IL=-110 */
394 40, /* EGSM_MAX IL=-111 */
395 40, /* EGSM_MAX IL=-112 */
396 40, /* EGSM_MAX IL=-113 */
397 40, /* EGSM_MAX IL=-114 */
398 40, /* EGSM_MAX IL=-115 */
399 40, /* EGSM_MAX IL=-116 */
400 40, /* EGSM_MAX IL=-117 */
401 40, /* EGSM_MAX IL=-118 */
402 40, /* EGSM_MAX IL=-119 */
403 40 /* EGSM_MAX IL=-120 */
404 }
405 },
406 },
407 {
408 {0, 0}, // ramp up and down delays
409 GUARD_BITS, // number of guard bits needed for ramp up
410 PRG_TX // propagation delay PRG_TX
411 },
412 { //AFC parameters
413 EEPROM_AFC,
414 C_Psi_sta_inv, // (1/C_Psi_sta)
415 C_Psi_st, // C_Psi_sta * 0.8 F0.16
416 C_Psi_st_32, // F0.32
417 C_Psi_st_inv // (1/C_Psi_st)
418
419 #if (VCXO_ALGO==1)
420 ,C_AFC_DAC_CENTER, // VCXO startup parameter - best guess
421 C_AFC_DAC_MIN, // VCXO startup parameter - 15ppm
422 C_AFC_DAC_MAX, // VCXO startup parameter + 15ppm
423 C_AFC_SNR_THR // snr - Default threshold value
424 #endif
425 }
426 };
427
428 T_RF_BAND rf_band[GSM_BANDS]; //uninitialised rf struct for bands
429
430 /*
431 * The const T_RF_BAND rf_{900,1800,850,1900} structures that follow
432 * are the versions that appear in the .const section of l1_cust.obj
433 * in the l1_custom_int.lib Leonardo blob, used successfully in leo2moko.
434 * As revealed with objgrep, this .const section with these uncalibrated
435 * defaults in it also appears in the moko11 binary - I'm guessing that
436 * Openmoko probably had no source for this part either, and used TI's
437 * standard Leonardo binary lib. The pretty C formatting presented here
438 * is courtesy of the calextract utility.
439 */
440
441 #if (ORDER2_TX_TEMP_CAL != 1)
442 #error "Hard-coded T_RF_BAND structs expect ORDER2_TX_TEMP_CAL to be 1"
443 #endif
444
445 const T_RF_BAND rf_900 = {
446 { /* Rx structure */
447 { /* T_RX_CAL_PARAMS */
448 193,
449 40,
450 40,
451 44,
452 },
453 { /* T_RF_AGC_BANDs */
454 { 10, 0},
455 { 30, 0},
456 { 51, 0},
457 { 71, 0},
458 { 90, 0},
459 { 112, 0},
460 { 124, 0},
461 { 991, 0},
462 { 992, 0},
463 { 1023, 0},
464 },
465 { /* Rx temperature compensation */
466 { -15, 0},
467 { -5, 0},
468 { 6, 0},
469 { 16, 0},
470 { 25, 0},
471 { 35, 0},
472 { 45, 0},
473 { 56, 0},
474 { 66, 0},
475 { 75, 0},
476 { 100, 0},
477 },
478 },
479 { /* Tx structure */
480 { /* levels */
481 { 465, 0, 0}, /* 0 */
482 { 465, 0, 0}, /* 1 */
483 { 465, 0, 0}, /* 2 */
484 { 465, 0, 0}, /* 3 */
485 { 465, 0, 0}, /* 4 */
486 { 465, 0, 0}, /* 5 */
487 { 387, 1, 0}, /* 6 */
488 { 324, 2, 0}, /* 7 */
489 { 260, 3, 0}, /* 8 */
490 { 210, 4, 0}, /* 9 */
491 { 170, 5, 0}, /* 10 */
492 { 138, 6, 0}, /* 11 */
493 { 113, 7, 0}, /* 12 */
494 { 92, 8, 0}, /* 13 */
495 { 76, 9, 0}, /* 14 */
496 { 62, 10, 0}, /* 15 */
497 { 51, 11, 0}, /* 16 */
498 { 42, 12, 0}, /* 17 */
499 { 34, 13, 0}, /* 18 */
500 { 27, 14, 0}, /* 19 */
501 { 27, 14, 0}, /* 20 */
502 { 27, 14, 0}, /* 21 */
503 { 27, 14, 0}, /* 22 */
504 { 27, 14, 0}, /* 23 */
505 { 27, 14, 0}, /* 24 */
506 { 27, 14, 0}, /* 25 */
507 { 27, 14, 0}, /* 26 */
508 { 27, 14, 0}, /* 27 */
509 { 27, 14, 0}, /* 28 */
510 { 27, 14, 0}, /* 29 */
511 { 27, 14, 0}, /* 30 */
512 { 27, 14, 0}, /* 31 */
513 },
514 { /* channel calibration tables */
515 { /* calibration table 0 */
516 { 40, 128},
517 { 80, 128},
518 { 124, 128},
519 { 586, 128},
520 { 661, 128},
521 { 736, 128},
522 { 885, 128},
523 { 1023, 128},
524 },
525 { /* calibration table 1 */
526 { 40, 128},
527 { 80, 128},
528 { 124, 128},
529 { 586, 128},
530 { 661, 128},
531 { 736, 128},
532 { 885, 128},
533 { 1023, 128},
534 },
535 { /* calibration table 2 */
536 { 40, 128},
537 { 80, 128},
538 { 124, 128},
539 { 586, 128},
540 { 661, 128},
541 { 736, 128},
542 { 885, 128},
543 { 1023, 128},
544 },
545 { /* calibration table 3 */
546 { 40, 128},
547 { 80, 128},
548 { 124, 128},
549 { 586, 128},
550 { 661, 128},
551 { 736, 128},
552 { 885, 128},
553 { 1023, 128},
554 },
555 },
556 { /* ramps */
557 { /* profile 0 */
558 /* ramp-up */
559 { 0, 0, 0, 0, 0, 0, 0, 0, 9, 18, 25, 31, 30, 15, 0, 0},
560 /* ramp-down */
561 { 0, 11, 31, 31, 31, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
562 },
563 { /* profile 1 */
564 /* ramp-up */
565 { 0, 0, 0, 0, 0, 0, 1, 1, 7, 16, 28, 31, 31, 13, 0, 0},
566 /* ramp-down */
567 { 0, 8, 31, 31, 31, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
568 },
569 { /* profile 2 */
570 /* ramp-up */
571 { 0, 0, 0, 0, 0, 0, 1, 1, 8, 16, 29, 31, 31, 11, 0, 0},
572 /* ramp-down */
573 { 0, 8, 28, 31, 31, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
574 },
575 { /* profile 3 */
576 /* ramp-up */
577 { 0, 0, 0, 0, 0, 0, 2, 0, 6, 18, 28, 31, 31, 12, 0, 0},
578 /* ramp-down */
579 { 0, 9, 24, 31, 31, 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0},
580 },
581 { /* profile 4 */
582 /* ramp-up */
583 { 0, 0, 0, 0, 0, 0, 3, 0, 5, 19, 31, 31, 31, 8, 0, 0},
584 /* ramp-down */
585 { 0, 7, 31, 31, 31, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
586 },
587 { /* profile 5 */
588 /* ramp-up */
589 { 0, 0, 0, 0, 0, 0, 2, 0, 7, 18, 31, 31, 31, 8, 0, 0},
590 /* ramp-down */
591 { 0, 7, 31, 31, 31, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
592 },
593 { /* profile 6 */
594 /* ramp-up */
595 { 0, 0, 0, 0, 0, 0, 3, 0, 5, 20, 31, 31, 31, 7, 0, 0},
596 /* ramp-down */
597 { 0, 10, 21, 31, 31, 31, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0},
598 },
599 { /* profile 7 */
600 /* ramp-up */
601 { 0, 0, 0, 0, 0, 0, 4, 0, 9, 23, 22, 31, 31, 8, 0, 0},
602 /* ramp-down */
603 { 0, 9, 24, 30, 31, 30, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0},
604 },
605 { /* profile 8 */
606 /* ramp-up */
607 { 0, 0, 0, 0, 0, 0, 5, 0, 8, 21, 24, 31, 31, 8, 0, 0},
608 /* ramp-down */
609 { 0, 8, 23, 31, 31, 31, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0},
610 },
611 { /* profile 9 */
612 /* ramp-up */
613 { 0, 0, 0, 0, 0, 5, 0, 3, 1, 27, 22, 31, 31, 8, 0, 0},
614 /* ramp-down */
615 { 0, 8, 27, 25, 26, 31, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0},
616 },
617 { /* profile 10 */
618 /* ramp-up */
619 { 0, 0, 0, 0, 5, 0, 0, 2, 7, 22, 23, 31, 31, 7, 0, 0},
620 /* ramp-down */
621 { 0, 7, 25, 30, 31, 31, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0},
622 },
623 { /* profile 11 */
624 /* ramp-up */
625 { 0, 0, 0, 0, 0, 5, 0, 4, 8, 21, 21, 31, 31, 7, 0, 0},
626 /* ramp-down */
627 { 0, 8, 21, 31, 31, 31, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0},
628 },
629 { /* profile 12 */
630 /* ramp-up */
631 { 0, 0, 0, 0, 0, 7, 0, 0, 12, 22, 25, 31, 27, 4, 0, 0},
632 /* ramp-down */
633 { 0, 9, 12, 21, 31, 31, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0},
634 },
635 { /* profile 13 */
636 /* ramp-up */
637 { 0, 0, 0, 0, 0, 0, 7, 0, 8, 15, 31, 31, 31, 5, 0, 0},
638 /* ramp-down */
639 { 0, 6, 14, 23, 31, 31, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0},
640 },
641 { /* profile 14 */
642 /* ramp-up */
643 { 0, 0, 0, 0, 0, 20, 0, 0, 8, 15, 14, 31, 31, 9, 0, 0},
644 /* ramp-down */
645 { 0, 7, 31, 31, 31, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
646 },
647 { /* profile 15 */
648 /* ramp-up */
649 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
650 /* ramp-down */
651 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
652 },
653 },
654 { /* Tx temperature compensation */
655 { -11, 0, 0, 0},
656 { 9, 0, 0, 0},
657 { 39, 0, 0, 0},
658 { 59, 0, 0, 0},
659 { 127, 0, 0, 0},
660 },
661 },
662 //IQ swap
663 SWAP_IQ_GSM,
664 };
665
666 const T_RF_BAND rf_1800 = {
667 { /* Rx structure */
668 { /* T_RX_CAL_PARAMS */
669 188,
670 40,
671 40,
672 44,
673 },
674 { /* T_RF_AGC_BANDs */
675 { 548, 0},
676 { 622, 0},
677 { 680, 0},
678 { 745, 0},
679 { 812, 0},
680 { 860, 0},
681 { 885, 0},
682 { 991, 0},
683 { 992, 0},
684 { 1023, 0},
685 },
686 { /* Rx temperature compensation */
687 { -15, 0},
688 { -5, 0},
689 { 6, 0},
690 { 16, 0},
691 { 25, 0},
692 { 35, 0},
693 { 45, 0},
694 { 56, 0},
695 { 66, 0},
696 { 75, 0},
697 { 100, 0},
698 },
699 },
700 { /* Tx structure */
701 { /* levels */
702 { 436, 0, 0}, /* 0 */
703 { 363, 1, 0}, /* 1 */
704 { 310, 2, 0}, /* 2 */
705 { 253, 3, 0}, /* 3 */
706 { 205, 4, 0}, /* 4 */
707 { 168, 5, 0}, /* 5 */
708 { 138, 6, 0}, /* 6 */
709 { 113, 7, 0}, /* 7 */
710 { 93, 8, 0}, /* 8 */
711 { 76, 9, 0}, /* 9 */
712 { 61, 10, 0}, /* 10 */
713 { 50, 11, 0}, /* 11 */
714 { 40, 12, 0}, /* 12 */
715 { 32, 13, 0}, /* 13 */
716 { 26, 14, 0}, /* 14 */
717 { 20, 15, 0}, /* 15 */
718 { 20, 15, 0}, /* 16 */
719 { 20, 15, 0}, /* 17 */
720 { 20, 15, 0}, /* 18 */
721 { 20, 15, 0}, /* 19 */
722 { 20, 15, 0}, /* 20 */
723 { 20, 15, 0}, /* 21 */
724 { 20, 15, 0}, /* 22 */
725 { 20, 15, 0}, /* 23 */
726 { 20, 15, 0}, /* 24 */
727 { 20, 15, 0}, /* 25 */
728 { 20, 15, 0}, /* 26 */
729 { 20, 15, 0}, /* 27 */
730 { 20, 15, 0}, /* 28 */
731 { 20, 0, 0}, /* 29 */
732 { 20, 0, 0}, /* 30 */
733 { 20, 0, 0}, /* 31 */
734 },
735 { /* channel calibration tables */
736 { /* calibration table 0 */
737 { 554, 128},
738 { 722, 128},
739 { 746, 128},
740 { 774, 128},
741 { 808, 128},
742 { 851, 128},
743 { 870, 128},
744 { 885, 128},
745 },
746 { /* calibration table 1 */
747 { 554, 128},
748 { 722, 128},
749 { 746, 128},
750 { 774, 128},
751 { 808, 128},
752 { 851, 128},
753 { 870, 128},
754 { 885, 128},
755 },
756 { /* calibration table 2 */
757 { 554, 128},
758 { 722, 128},
759 { 746, 128},
760 { 774, 128},
761 { 808, 128},
762 { 851, 128},
763 { 870, 128},
764 { 885, 128},
765 },
766 { /* calibration table 3 */
767 { 554, 128},
768 { 722, 128},
769 { 746, 128},
770 { 774, 128},
771 { 808, 128},
772 { 851, 128},
773 { 870, 128},
774 { 885, 128},
775 },
776 },
777 { /* ramps */
778 { /* profile 0 */
779 /* ramp-up */
780 { 0, 0, 0, 0, 0, 0, 2, 3, 5, 16, 31, 31, 31, 9, 0, 0},
781 /* ramp-down */
782 { 0, 11, 31, 31, 31, 10, 11, 3, 0, 0, 0, 0, 0, 0, 0, 0},
783 },
784 { /* profile 1 */
785 /* ramp-up */
786 { 0, 0, 0, 0, 0, 0, 2, 3, 4, 17, 30, 31, 31, 10, 0, 0},
787 /* ramp-down */
788 { 0, 10, 31, 31, 31, 13, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0},
789 },
790 { /* profile 2 */
791 /* ramp-up */
792 { 0, 0, 0, 0, 0, 0, 4, 2, 2, 18, 31, 31, 31, 9, 0, 0},
793 /* ramp-down */
794 { 0, 10, 26, 31, 31, 16, 10, 4, 0, 0, 0, 0, 0, 0, 0, 0},
795 },
796 { /* profile 3 */
797 /* ramp-up */
798 { 0, 0, 0, 0, 0, 0, 3, 4, 4, 15, 31, 31, 31, 9, 0, 0},
799 /* ramp-down */
800 { 0, 9, 31, 31, 31, 13, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0},
801 },
802 { /* profile 4 */
803 /* ramp-up */
804 { 0, 0, 0, 0, 0, 0, 4, 3, 7, 11, 31, 31, 31, 10, 0, 0},
805 /* ramp-down */
806 { 0, 8, 31, 31, 31, 11, 9, 7, 0, 0, 0, 0, 0, 0, 0, 0},
807 },
808 { /* profile 5 */
809 /* ramp-up */
810 { 0, 0, 0, 0, 0, 4, 3, 2, 7, 14, 25, 31, 31, 11, 0, 0},
811 /* ramp-down */
812 { 0, 14, 31, 31, 31, 9, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0},
813 },
814 { /* profile 6 */
815 /* ramp-up */
816 { 0, 0, 0, 0, 0, 7, 1, 3, 10, 12, 25, 31, 31, 8, 0, 0},
817 /* ramp-down */
818 { 0, 7, 30, 31, 31, 14, 4, 6, 5, 0, 0, 0, 0, 0, 0, 0},
819 },
820 { /* profile 7 */
821 /* ramp-up */
822 { 0, 0, 0, 0, 3, 5, 0, 5, 8, 12, 26, 31, 31, 7, 0, 0},
823 /* ramp-down */
824 { 0, 7, 31, 31, 31, 15, 0, 8, 5, 0, 0, 0, 0, 0, 0, 0},
825 },
826 { /* profile 8 */
827 /* ramp-up */
828 { 0, 0, 0, 0, 0, 9, 0, 3, 10, 16, 21, 31, 31, 7, 0, 0},
829 /* ramp-down */
830 { 0, 11, 28, 31, 27, 10, 11, 0, 10, 0, 0, 0, 0, 0, 0, 0},
831 },
832 { /* profile 9 */
833 /* ramp-up */
834 { 0, 0, 0, 0, 0, 10, 0, 6, 9, 15, 22, 29, 31, 6, 0, 0},
835 /* ramp-down */
836 { 0, 9, 22, 31, 31, 12, 5, 0, 18, 0, 0, 0, 0, 0, 0, 0},
837 },
838 { /* profile 10 */
839 /* ramp-up */
840 { 0, 0, 0, 0, 14, 0, 0, 8, 6, 20, 21, 29, 24, 6, 0, 0},
841 /* ramp-down */
842 { 0, 8, 28, 29, 26, 14, 6, 0, 17, 0, 0, 0, 0, 0, 0, 0},
843 },
844 { /* profile 11 */
845 /* ramp-up */
846 { 0, 0, 0, 0, 16, 0, 3, 5, 8, 16, 31, 28, 18, 3, 0, 0},
847 /* ramp-down */
848 { 0, 6, 18, 26, 31, 16, 9, 7, 0, 15, 0, 0, 0, 0, 0, 0},
849 },
850 { /* profile 12 */
851 /* ramp-up */
852 { 0, 0, 0, 0, 19, 0, 3, 6, 8, 21, 24, 31, 14, 2, 0, 0},
853 /* ramp-down */
854 { 0, 0, 12, 31, 31, 27, 4, 0, 23, 0, 0, 0, 0, 0, 0, 0},
855 },
856 { /* profile 13 */
857 /* ramp-up */
858 { 0, 0, 0, 0, 0, 14, 14, 0, 0, 24, 31, 31, 14, 0, 0, 0},
859 /* ramp-down */
860 { 0, 0, 11, 31, 31, 22, 11, 3, 19, 0, 0, 0, 0, 0, 0, 0},
861 },
862 { /* profile 14 */
863 /* ramp-up */
864 { 0, 0, 0, 0, 0, 30, 1, 4, 8, 18, 31, 31, 5, 0, 0, 0},
865 /* ramp-down */
866 { 0, 0, 8, 31, 31, 22, 5, 0, 31, 0, 0, 0, 0, 0, 0, 0},
867 },
868 { /* profile 15 */
869 /* ramp-up */
870 { 0, 0, 0, 0, 0, 31, 13, 0, 0, 14, 31, 31, 8, 0, 0, 0},
871 /* ramp-down */
872 { 0, 0, 4, 31, 31, 25, 5, 0, 5, 26, 1, 0, 0, 0, 0, 0},
873 },
874 },
875 { /* Tx temperature compensation */
876 { -11, 0, 0, 0},
877 { 9, 0, 0, 0},
878 { 39, 0, 0, 0},
879 { 59, 0, 0, 0},
880 { 127, 0, 0, 0},
881 },
882 },
883 //IQ swap
884 SWAP_IQ_DCS
885 };
886
887 const T_RF_BAND rf_850 = {
888 { /* Rx structure */
889 { /* T_RX_CAL_PARAMS */
890 181,
891 40,
892 40,
893 44,
894 },
895 { /* T_RF_AGC_BANDs */
896 { 10, 0},
897 { 30, 0},
898 { 51, 0},
899 { 71, 0},
900 { 90, 0},
901 { 112, 0},
902 { 124, 0},
903 { 991, 0},
904 { 992, 0},
905 { 1023, 0},
906 },
907 { /* Rx temperature compensation */
908 { -15, 0},
909 { -5, 0},
910 { 6, 0},
911 { 16, 0},
912 { 25, 0},
913 { 35, 0},
914 { 45, 0},
915 { 56, 0},
916 { 66, 0},
917 { 75, 0},
918 { 100, 0},
919 },
920 },
921 { /* Tx structure */
922 { /* levels */
923 { 507, 0, 0}, /* 0 */
924 { 507, 0, 0}, /* 1 */
925 { 507, 0, 0}, /* 2 */
926 { 507, 0, 0}, /* 3 */
927 { 507, 0, 0}, /* 4 */
928 { 507, 0, 0}, /* 5 */
929 { 417, 1, 0}, /* 6 */
930 { 350, 2, 0}, /* 7 */
931 { 282, 3, 0}, /* 8 */
932 { 226, 4, 0}, /* 9 */
933 { 183, 5, 0}, /* 10 */
934 { 148, 6, 0}, /* 11 */
935 { 121, 7, 0}, /* 12 */
936 { 98, 8, 0}, /* 13 */
937 { 80, 9, 0}, /* 14 */
938 { 66, 10, 0}, /* 15 */
939 { 54, 11, 0}, /* 16 */
940 { 44, 12, 0}, /* 17 */
941 { 36, 13, 0}, /* 18 */
942 { 29, 14, 0}, /* 19 */
943 { 29, 14, 0}, /* 20 */
944 { 29, 14, 0}, /* 21 */
945 { 29, 14, 0}, /* 22 */
946 { 29, 14, 0}, /* 23 */
947 { 29, 14, 0}, /* 24 */
948 { 29, 14, 0}, /* 25 */
949 { 29, 14, 0}, /* 26 */
950 { 29, 14, 0}, /* 27 */
951 { 29, 14, 0}, /* 28 */
952 { 29, 14, 0}, /* 29 */
953 { 29, 14, 0}, /* 30 */
954 { 29, 14, 0}, /* 31 */
955 },
956 { /* channel calibration tables */
957 { /* calibration table 0 */
958 { 40, 128},
959 { 80, 128},
960 { 124, 128},
961 { 586, 128},
962 { 661, 128},
963 { 736, 128},
964 { 885, 128},
965 { 1023, 128},
966 },
967 { /* calibration table 1 */
968 #if 1
969 /*
970 * This bogon appears in the l1_custom_int.lib Leonardo blob
971 * and in Openmoko's official firmwares, from which it has
972 * propagated into the /gsm/rf/tx/calchan.850 file programmed
973 * into every produced GTA02 unit, or at least the units
974 * without the 850 MHz band. It also appears in the MV100 version
975 * of l1_rf12.c and in the "dead" rf_850 table in Pirelli's fw
976 * binary. Whew!
977 */
978 { 554, 130},
979 { 722, 128},
980 { 746, 129},
981 { 774, 131},
982 { 808, 132},
983 { 851, 134},
984 { 870, 138},
985 { 885, 140},
986 #else
987 /* make it the same as the others */
988 { 40, 128},
989 { 80, 128},
990 { 124, 128},
991 { 586, 128},
992 { 661, 128},
993 { 736, 128},
994 { 885, 128},
995 { 1023, 128},
996 #endif
997 },
998 { /* calibration table 2 */
999 { 40, 128},
1000 { 80, 128},
1001 { 124, 128},
1002 { 586, 128},
1003 { 661, 128},
1004 { 736, 128},
1005 { 885, 128},
1006 { 1023, 128},
1007 },
1008 { /* calibration table 3 */
1009 { 40, 128},
1010 { 80, 128},
1011 { 124, 128},
1012 { 586, 128},
1013 { 661, 128},
1014 { 736, 128},
1015 { 885, 128},
1016 { 1023, 128},
1017 },
1018 },
1019 { /* ramps */
1020 { /* profile 0 */
1021 /* ramp-up */
1022 { 0, 0, 0, 0, 0, 0, 0, 0, 9, 18, 25, 31, 30, 15, 0, 0},
1023 /* ramp-down */
1024 { 0, 11, 31, 31, 31, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1025 },
1026 { /* profile 1 */
1027 /* ramp-up */
1028 { 0, 0, 0, 0, 0, 0, 1, 1, 7, 16, 28, 31, 31, 13, 0, 0},
1029 /* ramp-down */
1030 { 0, 8, 31, 31, 31, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1031 },
1032 { /* profile 2 */
1033 /* ramp-up */
1034 { 0, 0, 0, 0, 0, 0, 1, 1, 8, 16, 29, 31, 31, 11, 0, 0},
1035 /* ramp-down */
1036 { 0, 8, 28, 31, 31, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1037 },
1038 { /* profile 3 */
1039 /* ramp-up */
1040 { 0, 0, 0, 0, 0, 0, 2, 0, 6, 18, 28, 31, 31, 12, 0, 0},
1041 /* ramp-down */
1042 { 0, 9, 24, 31, 31, 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1043 },
1044 { /* profile 4 */
1045 /* ramp-up */
1046 { 0, 0, 0, 0, 0, 0, 3, 0, 5, 19, 31, 31, 31, 8, 0, 0},
1047 /* ramp-down */
1048 { 0, 7, 31, 31, 31, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1049 },
1050 { /* profile 5 */
1051 /* ramp-up */
1052 { 0, 0, 0, 0, 0, 0, 2, 0, 7, 18, 31, 31, 31, 8, 0, 0},
1053 /* ramp-down */
1054 { 0, 7, 31, 31, 31, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1055 },
1056 { /* profile 6 */
1057 /* ramp-up */
1058 { 0, 0, 0, 0, 0, 0, 3, 0, 5, 20, 31, 31, 31, 7, 0, 0},
1059 /* ramp-down */
1060 { 0, 10, 21, 31, 31, 31, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1061 },
1062 { /* profile 7 */
1063 /* ramp-up */
1064 { 0, 0, 0, 0, 0, 0, 4, 0, 9, 23, 22, 31, 31, 8, 0, 0},
1065 /* ramp-down */
1066 { 0, 9, 24, 30, 31, 30, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1067 },
1068 { /* profile 8 */
1069 /* ramp-up */
1070 { 0, 0, 0, 0, 0, 0, 5, 0, 8, 21, 24, 31, 31, 8, 0, 0},
1071 /* ramp-down */
1072 { 0, 8, 23, 31, 31, 31, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1073 },
1074 { /* profile 9 */
1075 /* ramp-up */
1076 { 0, 0, 0, 0, 0, 5, 0, 3, 1, 27, 22, 31, 31, 8, 0, 0},
1077 /* ramp-down */
1078 { 0, 8, 27, 25, 26, 31, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1079 },
1080 { /* profile 10 */
1081 /* ramp-up */
1082 { 0, 0, 0, 0, 5, 0, 0, 2, 7, 22, 23, 31, 31, 7, 0, 0},
1083 /* ramp-down */
1084 { 0, 7, 25, 30, 31, 31, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1085 },
1086 { /* profile 11 */
1087 /* ramp-up */
1088 { 0, 0, 0, 0, 0, 5, 0, 4, 8, 21, 21, 31, 31, 7, 0, 0},
1089 /* ramp-down */
1090 { 0, 8, 21, 31, 31, 31, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1091 },
1092 { /* profile 12 */
1093 /* ramp-up */
1094 { 0, 0, 0, 0, 0, 7, 0, 0, 12, 22, 25, 31, 27, 4, 0, 0},
1095 /* ramp-down */
1096 { 0, 9, 12, 21, 31, 31, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1097 },
1098 { /* profile 13 */
1099 /* ramp-up */
1100 { 0, 0, 0, 0, 0, 0, 7, 0, 8, 15, 31, 31, 31, 5, 0, 0},
1101 /* ramp-down */
1102 { 0, 6, 14, 23, 31, 31, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1103 },
1104 { /* profile 14 */
1105 /* ramp-up */
1106 { 0, 0, 0, 0, 0, 20, 0, 0, 8, 15, 14, 31, 31, 9, 0, 0},
1107 /* ramp-down */
1108 { 0, 7, 31, 31, 31, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1109 },
1110 { /* profile 15 */
1111 /* ramp-up */
1112 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1113 /* ramp-down */
1114 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1115 },
1116 },
1117 { /* Tx temperature compensation */
1118 { -11, 0, 0, 0},
1119 { 9, 0, 0, 0},
1120 { 39, 0, 0, 0},
1121 { 59, 0, 0, 0},
1122 { 127, 0, 0, 0},
1123 },
1124 },
1125 //IQ swap
1126 SWAP_IQ_GSM850,
1127 };
1128
1129 const T_RF_BAND rf_1900 = {
1130 { /* Rx structure */
1131 { /* T_RX_CAL_PARAMS */
1132 188,
1133 40,
1134 40,
1135 44,
1136 },
1137 { /* T_RF_AGC_BANDs */
1138 { 548, 0},
1139 { 622, 0},
1140 { 680, 0},
1141 { 745, 0},
1142 { 812, 0},
1143 { 860, 0},
1144 { 885, 0},
1145 { 991, 0},
1146 { 992, 0},
1147 { 1023, 0},
1148 },
1149 { /* Rx temperature compensation */
1150 { -15, 0},
1151 { -5, 0},
1152 { 6, 0},
1153 { 16, 0},
1154 { 25, 0},
1155 { 35, 0},
1156 { 45, 0},
1157 { 56, 0},
1158 { 66, 0},
1159 { 75, 0},
1160 { 100, 0},
1161 },
1162 },
1163 { /* Tx structure */
1164 { /* levels */
1165 { 429, 0, 0}, /* 0 */
1166 { 353, 1, 0}, /* 1 */
1167 { 302, 2, 0}, /* 2 */
1168 { 246, 3, 0}, /* 3 */
1169 { 200, 4, 0}, /* 4 */
1170 { 164, 5, 0}, /* 5 */
1171 { 135, 6, 0}, /* 6 */
1172 { 111, 7, 0}, /* 7 */
1173 { 91, 8, 0}, /* 8 */
1174 { 75, 9, 0}, /* 9 */
1175 { 60, 10, 0}, /* 10 */
1176 { 49, 11, 0}, /* 11 */
1177 { 40, 12, 0}, /* 12 */
1178 { 33, 13, 0}, /* 13 */
1179 { 26, 14, 0}, /* 14 */
1180 { 26, 15, 0}, /* 15 */
1181 { 26, 15, 0}, /* 16 */
1182 { 26, 15, 0}, /* 17 */
1183 { 26, 15, 0}, /* 18 */
1184 { 26, 15, 0}, /* 19 */
1185 { 26, 15, 0}, /* 20 */
1186 { 26, 15, 0}, /* 21 */
1187 { 26, 15, 0}, /* 22 */
1188 { 26, 15, 0}, /* 23 */
1189 { 26, 15, 0}, /* 24 */
1190 { 26, 15, 0}, /* 25 */
1191 { 26, 15, 0}, /* 26 */
1192 { 26, 15, 0}, /* 27 */
1193 { 26, 15, 0}, /* 28 */
1194 { 26, 0, 0}, /* 29 */
1195 { 26, 0, 0}, /* 30 */
1196 { 26, 0, 0}, /* 31 */
1197 },
1198 { /* channel calibration tables */
1199 { /* calibration table 0 */
1200 { 554, 128},
1201 { 722, 128},
1202 { 746, 128},
1203 { 774, 128},
1204 { 808, 128},
1205 { 810, 128},
1206 { 810, 128},
1207 { 810, 128},
1208 },
1209 { /* calibration table 1 */
1210 { 554, 128},
1211 { 722, 128},
1212 { 746, 128},
1213 { 774, 128},
1214 { 808, 128},
1215 { 810, 128},
1216 { 810, 128},
1217 { 810, 128},
1218 },
1219 { /* calibration table 2 */
1220 { 554, 128},
1221 { 722, 128},
1222 { 746, 128},
1223 { 774, 128},
1224 { 808, 128},
1225 { 810, 128},
1226 { 810, 128},
1227 { 810, 128},
1228 },
1229 { /* calibration table 3 */
1230 { 554, 128},
1231 { 722, 128},
1232 { 746, 128},
1233 { 774, 128},
1234 { 808, 128},
1235 { 810, 128},
1236 { 810, 128},
1237 { 810, 128},
1238 },
1239 },
1240 { /* ramps */
1241 { /* profile 0 */
1242 /* ramp-up */
1243 { 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 31, 31, 31, 12, 0, 0},
1244 /* ramp-down */
1245 { 0, 13, 31, 31, 31, 18, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0},
1246 },
1247 { /* profile 1 */
1248 /* ramp-up */
1249 { 0, 0, 0, 0, 0, 0, 2, 3, 4, 17, 30, 31, 31, 10, 0, 0},
1250 /* ramp-down */
1251 { 0, 10, 31, 31, 31, 13, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0},
1252 },
1253 { /* profile 2 */
1254 /* ramp-up */
1255 { 0, 0, 0, 0, 0, 0, 4, 2, 2, 18, 31, 31, 31, 9, 0, 0},
1256 /* ramp-down */
1257 { 0, 10, 26, 31, 31, 16, 10, 4, 0, 0, 0, 0, 0, 0, 0, 0},
1258 },
1259 { /* profile 3 */
1260 /* ramp-up */
1261 { 0, 0, 0, 0, 0, 0, 3, 4, 4, 15, 31, 31, 31, 9, 0, 0},
1262 /* ramp-down */
1263 { 0, 9, 31, 31, 31, 13, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0},
1264 },
1265 { /* profile 4 */
1266 /* ramp-up */
1267 { 0, 0, 0, 0, 0, 0, 4, 3, 0, 18, 31, 31, 31, 10, 0, 0},
1268 /* ramp-down */
1269 { 0, 8, 31, 31, 31, 11, 9, 7, 0, 0, 0, 0, 0, 0, 0, 0},
1270 },
1271 { /* profile 5 */
1272 /* ramp-up */
1273 { 0, 0, 0, 0, 0, 4, 3, 2, 7, 14, 25, 31, 31, 11, 0, 0},
1274 /* ramp-down */
1275 { 0, 14, 31, 31, 31, 9, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0},
1276 },
1277 { /* profile 6 */
1278 /* ramp-up */
1279 { 0, 0, 0, 0, 0, 7, 1, 3, 10, 12, 25, 31, 31, 8, 0, 0},
1280 /* ramp-down */
1281 { 0, 7, 30, 31, 31, 14, 4, 6, 5, 0, 0, 0, 0, 0, 0, 0},
1282 },
1283 { /* profile 7 */
1284 /* ramp-up */
1285 { 0, 0, 0, 0, 3, 5, 0, 5, 8, 12, 26, 31, 31, 7, 0, 0},
1286 /* ramp-down */
1287 { 0, 7, 31, 31, 31, 15, 0, 8, 5, 0, 0, 0, 0, 0, 0, 0},
1288 },
1289 { /* profile 8 */
1290 /* ramp-up */
1291 { 0, 0, 0, 0, 0, 9, 0, 3, 10, 16, 21, 31, 31, 7, 0, 0},
1292 /* ramp-down */
1293 { 0, 11, 28, 31, 27, 10, 11, 0, 10, 0, 0, 0, 0, 0, 0, 0},
1294 },
1295 { /* profile 9 */
1296 /* ramp-up */
1297 { 0, 0, 0, 0, 0, 10, 0, 6, 9, 15, 22, 29, 31, 6, 0, 0},
1298 /* ramp-down */
1299 { 0, 9, 22, 31, 31, 12, 5, 0, 18, 0, 0, 0, 0, 0, 0, 0},
1300 },
1301 { /* profile 10 */
1302 /* ramp-up */
1303 { 0, 0, 0, 0, 14, 0, 0, 4, 10, 20, 21, 29, 24, 6, 0, 0},
1304 /* ramp-down */
1305 { 0, 8, 28, 29, 26, 14, 6, 0, 17, 0, 0, 0, 0, 0, 0, 0},
1306 },
1307 { /* profile 11 */
1308 /* ramp-up */
1309 { 0, 0, 0, 0, 16, 0, 3, 5, 8, 16, 31, 28, 18, 3, 0, 0},
1310 /* ramp-down */
1311 { 0, 6, 18, 26, 31, 16, 9, 7, 0, 15, 0, 0, 0, 0, 0, 0},
1312 },
1313 { /* profile 12 */
1314 /* ramp-up */
1315 { 0, 0, 0, 0, 19, 0, 3, 6, 8, 21, 24, 31, 14, 2, 0, 0},
1316 /* ramp-down */
1317 { 0, 0, 12, 31, 31, 27, 4, 0, 23, 0, 0, 0, 0, 0, 0, 0},
1318 },
1319 { /* profile 13 */
1320 /* ramp-up */
1321 { 0, 0, 0, 0, 0, 14, 14, 0, 0, 24, 31, 31, 14, 0, 0, 0},
1322 /* ramp-down */
1323 { 0, 0, 11, 31, 31, 22, 11, 3, 19, 0, 0, 0, 0, 0, 0, 0},
1324 },
1325 { /* profile 14 */
1326 /* ramp-up */
1327 { 0, 0, 0, 0, 0, 30, 1, 4, 8, 18, 31, 31, 5, 0, 0, 0},
1328 /* ramp-down */
1329 { 0, 0, 8, 31, 31, 22, 5, 0, 31, 0, 0, 0, 0, 0, 0, 0},
1330 },
1331 { /* profile 15 */
1332 /* ramp-up */
1333 { 0, 0, 0, 0, 0, 30, 1, 4, 8, 18, 31, 31, 5, 0, 0, 0},
1334 /* ramp-down */
1335 { 0, 0, 8, 31, 31, 22, 5, 0, 31, 0, 0, 0, 0, 0, 0, 0},
1336 },
1337 },
1338 { /* Tx temperature compensation */
1339 { -11, 0, 0, 0},
1340 { 9, 0, 0, 0},
1341 { 39, 0, 0, 0},
1342 { 59, 0, 0, 0},
1343 { 127, 0, 0, 0},
1344 },
1345 },
1346 //IQ swap
1347 SWAP_IQ_PCS
1348 };
1349
1350 /*------------------------------------------*/
1351 /* ABB Initialization words
1352 /*------------------------------------------*/
1353 #if (ANLG_FAM == 1)
1354 UWORD16 abb[ABB_TABLE_SIZE] =
1355 {
1356 C_AFCCTLADD, // Value at reset
1357 C_VBUCTRL, // Uplink gain amp 0dB, Sidetone gain to mute
1358 C_VBDCTRL, // Downlink gain amp 0dB, Volume control 0 dB
1359 C_BBCTRL, // value at reset
1360 C_APCOFF, // value at reset
1361 C_BULIOFF, // value at reset
1362 C_BULQOFF, // value at reset
1363 C_DAI_ON_OFF, // value at reset
1364 C_AUXDAC, // value at reset
1365 C_VBCTRL, // VULSWITCH=0, VDLAUX=1, VDLEAR=1
1366 C_APCDEL1 // value at reset
1367 };
1368 #elif (ANLG_FAM == 2)
1369 UWORD16 abb[ABB_TABLE_SIZE] =
1370 {
1371 C_AFCCTLADD,
1372 C_VBUCTRL,
1373 C_VBDCTRL,
1374 C_BBCTRL,
1375 C_BULGCAL,
1376 C_APCOFF,
1377 C_BULIOFF,
1378 C_BULQOFF,
1379 C_DAI_ON_OFF,
1380 C_AUXDAC,
1381 C_VBCTRL1,
1382 C_VBCTRL2,
1383 C_APCDEL1,
1384 C_APCDEL2
1385 };
1386
1387 #elif (ANLG_FAM == 3)
1388 UWORD16 abb[ABB_TABLE_SIZE] =
1389 {
1390 C_AFCCTLADD,
1391 C_VBUCTRL,
1392 C_VBDCTRL,
1393 C_BBCTRL,
1394 C_BULGCAL,
1395 C_APCOFF,
1396 C_BULIOFF,
1397 C_BULQOFF,
1398 C_DAI_ON_OFF,
1399 C_AUXDAC,
1400 C_VBCTRL1,
1401 C_VBCTRL2,
1402 C_APCDEL1,
1403 C_APCDEL2,
1404 C_VBPOP,
1405 C_VAUDINITD,
1406 C_VAUDCR,
1407 C_VAUOCR,
1408 C_VAUSCR,
1409 C_VAUDPLL
1410 };
1411
1412 #endif
1413
1414 /*------------------------------------------*/
1415 /* Gain table */
1416 /* specified in the TRF6053 spec */
1417 /* 2 dB steps - LNA always ON */
1418 /*------------------------------------------*/
1419 UWORD16 AGC_TABLE[AGC_TABLE_SIZE] =
1420 {
1421 0x00, //reserved
1422 0x01, //reserved
1423 0x02, //reserved
1424 0x03, //reserved
1425 0x04, //reserved
1426 0x05, //reserved
1427 0x06, //14 dB
1428 0x07, //16
1429 0x08, //18
1430 0x09, //20
1431 0x0a, //22
1432 0x0b, //24
1433 0x0c, //26
1434 0x0d, //28
1435 0x0e, //30
1436 0x0f, //32
1437 0x10, //34
1438 0x11, //36
1439 0x12, //38
1440 0x13, //40
1441 /*
1442 0x14, //reserved
1443 0x15, //reserved
1444 0x16, //reserved
1445 0x17, //reserved
1446 0x18, //reserved
1447 0x19, //reserved
1448 0x1a, //reserved
1449 0x1b, //reserved
1450 0x1c, //reserved
1451 0x1d, //reserved
1452 0x1e, //reserved
1453 0x1f, //reserved
1454 */
1455 };
1456
1457 // structure for ADC conversion (4 Internal channel + 5 Ext channels max.)
1458 T_ADC adc;
1459
1460 // MADC calibration structure
1461 T_ADCCAL adc_cal=
1462 { // a: 0,..,8
1463 // b, 0,..,8
1464 // cal_a = 4*1750 is the Typical value 1.75 V ref voltage , divide by 4
1465 7000, 8750, 7000, 7000, 7000, 7000, 7000, 256, 7000,
1466 0, 0, 0, 0, 0, 0, 0, 0, 0
1467 };
1468
1469 #if (BOARD == 41)
1470 // table which converts ADC value into RF temperature
1471 T_TEMP temperature[TEMP_TABLE_SIZE] =
1472 {
1473 // Temperature compensation for EVARITA - S.Glock, J.Demay 04/23/2003
1474 582, -40,
1475 640, -10,
1476 698, 25,
1477 756, 60,
1478 815, 90
1479 };
1480 #else
1481 // table which converts ADC value into RF temperature
1482 T_TEMP temperature[TEMP_TABLE_SIZE] =
1483 {
1484 7, -35,
1485 7, -34,
1486 8, -33,
1487 8, -32,
1488 9, -31,
1489 9, -30,
1490 10, -29,
1491 11, -28,
1492 11, -27,
1493 12, -26,
1494 13, -25,
1495 14, -24,
1496 14, -23,
1497 15, -22,
1498 16, -21,
1499 17, -20,
1500 18, -19,
1501 19, -18,
1502 21, -17,
1503 22, -16,
1504 23, -15,
1505 24, -14,
1506 26, -13,
1507 27, -12,
1508 29, -11,
1509 30, -10,
1510 32, -9,
1511 34, -8,
1512 36, -7,
1513 37, -6,
1514 39, -5,
1515 41, -4,
1516 44, -3,
1517 46, -2,
1518 48, -1,
1519 51, 0,
1520 53, 1,
1521 56, 2,
1522 59, 3,
1523 61, 4,
1524 64, 5,
1525 68, 6,
1526 71, 7,
1527 74, 8,
1528 78, 9,
1529 81, 10,
1530 85, 11,
1531 89, 12,
1532 93, 13,
1533 97, 14,
1534 101, 15,
1535 105, 16,
1536 110, 17,
1537 115, 18,
1538 119, 19,
1539 124, 20,
1540 130, 21,
1541 135, 22,
1542 140, 23,
1543 146, 24,
1544 152, 25,
1545 158, 26,
1546 164, 27,
1547 170, 28,
1548 176, 29,
1549 183, 30,
1550 190, 31,
1551 197, 32,
1552 204, 33,
1553 211, 34,
1554 219, 35,
1555 226, 36,
1556 234, 37,
1557 242, 38,
1558 250, 39,
1559 259, 40,
1560 267, 41,
1561 276, 42,
1562 285, 43,
1563 294, 44,
1564 303, 45,
1565 312, 46,
1566 322, 47,
1567 331, 48,
1568 341, 49,
1569 351, 50,
1570 361, 51,
1571 371, 52,
1572 382, 53,
1573 392, 54,
1574 403, 55,
1575 413, 56,
1576 424, 57,
1577 435, 58,
1578 446, 59,
1579 458, 60,
1580 469, 61,
1581 480, 62,
1582 492, 63,
1583 503, 64,
1584 515, 65,
1585 527, 66,
1586 539, 67,
1587 550, 68,
1588 562, 69,
1589 574, 70,
1590 586, 71,
1591 598, 72,
1592 611, 73,
1593 623, 74,
1594 635, 75,
1595 647, 76,
1596 659, 77,
1597 671, 78,
1598 683, 79,
1599 696, 80,
1600 708, 81,
1601 720, 82,
1602 732, 83,
1603 744, 84,
1604 756, 85,
1605 768, 86,
1606 780, 87,
1607 792, 88,
1608 804, 89,
1609 816, 90,
1610 827, 91,
1611 839, 92,
1612 851, 93,
1613 862, 94,
1614 873, 95
1615 };
1616 #endif