FreeCalypso > hg > freecalypso-tools
annotate doc/Compal-calibration @ 300:0cfb2e3aeda4
started documenting c1xx-calextr
| author | Mychaela Falconia <falcon@freecalypso.org> | 
|---|---|
| date | Sun, 19 Nov 2017 21:45:12 +0000 | 
| parents | |
| children | e05563f0dfcf | 
| rev | line source | 
|---|---|
| 300 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 1 Reading factory RF calibration values out of Mot C1xx phones | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 2 ============================================================ | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 3 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 4 Motorola C1xx phones are based on the Calypso+Iota+Rita chipset from TI and | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 5 their firmware is also loosely based on TI's reference, but Compal (Motorola's | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 6 ODM and the maker of these phones) have made lots and lots of changes moving | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 7 away from TI's canonical way of doing things. When it comes to RF calibration, | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 8 Mot/Compal have performed it on each individual unit on their factory production | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 9 line just like all other GSM phone and modem manufacturers, but instead of | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 10 storing the results of this calibration in TI's flash file system, Mot/Compal | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 11 have put these calibration values into a completely different flash data | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 12 structure of their own invention. | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 13 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 14 We don't know the proper name for Mot/Compal's flash data structure that has no | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 15 counterpart in TI's canonical solution, but we know its location in the flash: | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 16 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 17 * On C1xx phones with 2 MiB flash (most C11x/12x variants), it is the 8 KiB | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 18 flash sector at 0x1FC000; | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 19 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 20 * On C139/140 phones and the rare C11x/12x variants with 4 MiB flash, it is the | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 21 8 KiB flash sector at 0x3FC000; | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 22 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 23 * On C155/156 phones with 8 MiB flash, the data structure in question is | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 24 contained in the first 8 KiB of the 64 KiB physical flash sector at 0x7E0000. | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 25 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 26 The flash sector in question contains record-structured data; we don't know the | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 27 meaning of most of these records, but we have been able to find the RF | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 28 calibration records among them and locate the actual calibration values of | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 29 interest inside those records. | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 30 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 31 In order to extract the RF calibration values from your C1xx phone for use with | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 32 FreeCalypso, you will need a dump of your phone's flash, or at least a dump of | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 33 the specific 8 KiB sector at the model-dependent offset given above. As a | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 34 specific example, if your phone is a C139/140 or a C11x/12x variant with 4 MiB | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 35 flash and you have a complete dump of that flash, execute a command like the | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 36 following: | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 37 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 38 c1xx-calextr -b rfbin flashdump.bin 0x3FC000 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 39 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 40 The c1xx-calextr utility locates the RF calibration records in the flash dump | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 41 binary, extracts the specific calibration values of primary importance (Rx | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 42 "magic gain" and Tx APC DAC values), and converts them to TI's canonical format | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 43 for use with FreeCalypso firmware. The numeric argument after the flash image | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 44 filename is the offset within that image file where the magic sector should be | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 45 sought, and the -b option directs the tool to save the converted RF calibration | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 46 tables in binary format (the alternative is -a for ASCII format) in the | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 47 directory named after the option, named rfbin in this example. | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 48 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 49 If you use the binary output option as recommended here, the resulting output | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 50 directory will have two subdirectories in it, named rx and tx. The rx | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 51 subdirectory will have two files named agcparams.BAND where BAND is 900 and 1800 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 52 for EU-band phones or 850 and 1900 for US-band ones, and the tx subdirectory | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 53 will have two files named levels.BAND. This directory structure and these | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 54 names for the binary files correspond directly to the /gsm/rf directory subtree | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 55 in the flash file system (FFS) of TI's canonical solution, hence once the C1xx | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 56 phone in question is converted to FreeCalypso (i.e., runs FreeCalypso fw with | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 57 an aftermarket FFS created for it), you can upload the extracted and converted | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 58 RF calibration values into it like this: | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 59 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 60 fc-fsio upload-subtree rfbin /gsm/rf | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 61 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 62 Limitations | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 63 =========== | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 64 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 65 In the traditional RF calibration procedure performed by most GSM phone and | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 66 modem manufacturers including Motorola, the Rx "magic gain" and the Tx APC DAC | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 67 values (Tx power levels) are calibrated for the center frequency of each band | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 68 at first, and then additional measurements are performed at other frequencies | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 69 within the band to arrive at channel-dependent corrections for both Rx and Tx. | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 70 On devices that follow TI's canonical way of doing things, you can find these | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 71 channel correction tables in /gsm/rf/rx/calchan.* and /gsm/rf/tx/calchan.* | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 72 files in the FFS. | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 73 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 74 However, in the case of C1xx phones, Mot/Compal have changed the way in which | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 75 they do these channel corrections (both Rx and Tx) from TI's canon, and the | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 76 channel correction values stored in their factory calibration records do not | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 77 naturally translate to TI's Rx calchan and Tx calchan tables. | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 78 | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 79 In the case of Rx calibration, Mot/Compal have calibrated the channel | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 80 corrections with much finer granularity than is called for in TI's canonical | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 81 version. In TI's canon each band is divided into up to 10 subbands for the | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 82 purpose of Rx channel compensation, but Mot/Compal used much narrower subbands | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 83 of only 6 ARFCNs each, resulting in 21 subbands in the narrowest GSM850 band | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 84 and 63 subbands in the widest DCS (1800 MHz) band. We can see where the | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 85 channel correction values for each of these tiny subbands are stored, but | 
| 
0cfb2e3aeda4
started documenting c1xx-calextr
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 86 making use of them in FreeCalypso is not easy. | 
