annotate doc/SE-K2x0-FFS @ 922:3152e23399a2

document SE K2x0 FFS quirks and our support for them
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 02 Jan 2023 00:50:19 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
922
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 Flash file system in Sony Ericsson K200/220 phones
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 ==================================================
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 SE K200/220 phones are based on our familiar Calypso chipset, their firmware is
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 based on the standard chipset reference fw from TI, and they use TIFFS as their
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 flexible data storage mechanism. Their TIFFS instance is located in the first
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 3328 KiB of the 2nd flash bank; the geometry is 256x13 or 64x52 depending on
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 which flash chip was used in each given phone. (Some specimen have Spansion
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 S71PL129NB0 chips with 256 KiB flash sectors, others feature Samsung K5L2931CAM
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 chips with 64 KiB flash sectors.)
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 Calibration data and self-regenerating ability
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 ==============================================
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 SE's FFS life cycle design on these phones is interesting in that vital per-unit
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 calibration data (RF, AFC and MADC calibrations) are stored in two places:
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 (1) in the FFS in TI's standard format and locations, and (2) in a dedicated
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 flash sector outside of FFS that appears to be written once at the factory and
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 never touched afterward.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 SE's firmware design allows the FFS to be fully erased without breaking the
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 phone: whenever the fw boots in a state where the FFS area of the flash is fully
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 erased (you can of course erase those FFS sectors with fc-loadtool, but it
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 appears that some official tools also provide the same operation) but the
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 separate factory calibration data sector is valid, the firmware formats and
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 initializes a new FFS, and furthermore copies all essential calibration records
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 from SE's proprietary sector structure into their standard TIFFS locations!
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 But it gets even more interesting - when we examine FFS images read out of
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 various SE K2x0 specimen, we see two different occurrences:
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 1) In some specimen the FFS content is exactly the same as what we would get by
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 erasing the FFS with fc-loadtool and letting the firmware regenerate a fresh
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 one on its next boot. We can thus reasonably assume that the FFS in these
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 specimen is indeed the product of such intervention at some point in the
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 phone's history.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 2) In other specimen we see some additional files beyond those that exist with
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 the life cycle of the previous paragraph. One readily noticeable addition
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 is the presence of /gsm/rf/tx/ramps.* files, which are absent in the self-
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 regenerated FFS where the phone's fw copied calibration records from SE's
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 dedicated calibration data sector. How are these Tx ramp tables different
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 from all other RF calibration records? Answer: in the present SE K2x0
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 design, and also in all other Calypso phone and modem designs known to this
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 Mother, Tx ramps are calibrated per design and not per unit. Because the
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 correct Tx ramp tables are compiled into the firmware, having them in FFS is
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 redundant.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 Based on the above evidence, I (Mother Mychaela) hereby make the following
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 reconstruction of how these two kinds of FFS found in the wild likely came into
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 being:
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 * In the case of Compal (Mot C1xx and SE J100) and Pirelli DP-L10 we know by
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 simple deductive reasoning that those firmwares must have had their l1_cust.c
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 code modified to read calibration records from their respective proprietary
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 flash data structures instead of TI's original FFS files. However, in the
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 case of SE K2x0 it is plausible that their l1_cust.c did NOT have to be
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 likewise modified - they could plausibly still have TI's original l1_cust.c
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 code that reads RF tables from FFS on initialization and writes them back
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 into FFS upon those special MISC_ENABLE commands that are issued at the end
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 of TI's original calibration procedures.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 * If my hypothesis above is correct, then it follows that when SE or their ODM
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 did their factory production line calibration, the results were initially
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 written into FFS and not into SE's separate factory calibration data sector.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 If they are using unmodified l1_cust.c code from TI, then the presence of
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 redundant /gsm/rf/tx/ramps.* files is explained - TI's standard calibration
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 procedure results in these files being written into FFS because the canonical
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 l1_cust.c code classifies them as "Tx calibration" rather than "Tx config" -
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 see our RF_tables article.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 * In a separate step after all standard calibration procedures, they must have
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 copied all important calibration records into their non-standard flash sector
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 at 0x01FD0000, specifically to produce a more durable copy that can persist
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 through full erasure of FFS. Tx ramp tables were not included because they
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 are relatively large and redundant, not actually calibrated per unit.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 * Those SE K2x0 specimen whose FFS contains /gsm/rf/tx/ramps.* files and some
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 other files that aren't found in auto-regenerated FFS probably exhibit the
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 original FFS from the factory production line that was never subjected to
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 being blown away and regenerated!
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 SE's non-standard extension to TIFFS
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 ====================================
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 There is one aspect of SE K2x0 FFS that creates a pain point for our tools:
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 they made their own non-standard extension to TIFFS in terms of extended UCS-2
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 filenames, and given our natural desire to be able to use our tiffs tool (TIFFS
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 IVA) to examine FFS images from these SE phones, we had to extend our tool so
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 that it parses SE's extension instead of throwing up errors like it did before.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 As explained in our TIFFS-Overview article, classic TIFFS requires every
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 elementary filename to consist of printable ASCII characters from the sensibly
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 narrow set of [A-Za-z0-9_.,+%$#-], further limited to a maximum of 20
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 characters. However, SE K2x0 FFS images often contain some files that violate
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 this constraint; deeper examination reveals that SE (or their ODM) devised a
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 feature to allow filenames composed of UCS-2 characters, implemented as follows:
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 * The first "character" of the filename written into TIFFS is \x02, i.e., NOT a
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 printable ASCII character;
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 * The next "character" in the TIFFS object name is another binary byte encoding
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 the length of the UCS-2 string: for example, if the "high-level" name consists
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 of 6 UCS-2 characters, this second TIFFS object name "character" is \x06;
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 * These two non-printable-ASCII chars are followed by a long string of [0-9A-F]
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 ASCII characters, encoding the "high-level" UCS-2 name in hex;
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 * The whole arrangement ends with a terminating NUL, allowing the rest of TIFFS
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 to work unchanged.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 Seen from TIFFS perspective, these extended filenames created by SE K2x0 fw
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 violate traditional canon in two ways:
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 1) The overall length of the mostly-hex-encoded filename string usually exceeds
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 the traditional 20 character limit;
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 2) The set of allowed characters is grossly violated: not an innocuous extension
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 of allowing some additional "sane" characters, but non-printable-ASCII binary
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 chars that are barely compatible with C string functions by virtue of not
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 containing zero bytes.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 Please see the new section titled "Support for SE K2x0 extended filenames" in
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 our TIFFS-IVA-usage article for the explanation of how we handle these extended
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 filenames in our TIFFS IVA tool.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 fc-fsio considerations
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 ======================
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 In addition to "in vitro" analysis with our tiffs tool, SE K2x0 FFS can also be
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 accessed "in vivo" with fc-fsio in the following two scenarios:
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 1) SE K2x0 firmware does not have RVTMUX enabled by default, but they have
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 non-volatile flags in their FFS (which can be set via a hidden menu entered
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 via secret MMI code #*87223564#) that enable RVTMUX on the MODEM UART that
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 is brought out, and their RVTMUX includes ETM and TMFFS2 protocols.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 2) We can run TI's original FFS code against SE K2x0 FFS bodies by adding the
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 necessary configuration to our fc-xram based FFS editor tool described in
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 our TIFFS-Overview article.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 The expected behaviour in scenario 2 can be predicted statically by studying
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 the code, whereas scenario 1 calls for experimentation. Experiments with
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 RVTMUX-enabled SE K2x0 original fw reveal that it does behave (at least as far
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 as visible behaviour over TMFFS2) exactly like TI's original FFS code in terms
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 of readdir output when listing directories with extended filenames in them: as
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 long as they fit into TMFFS2 string buffer, these extended filenames are
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 returned just as one would naively expect.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 In light of these observations, fc-fsio has also been patched up to behave
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 gracefully when faced with such previously unexpected readdir results from the
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 target. Specifically:
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 * The short form of 'ls' command will print whatever the target firmware
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 returns, including extended filenames; any non-printable-ASCII characters are
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 escaped in \x hex form.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 * 'ls -l' or 'll' will throw up an error if one attempts to list a directory
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 that contains one or more extended filenames, caught either at the level of
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 the readdir result not fitting into the buffer sized for standard TIFFS
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 filenames or (for SE K2x0 extended filenames of 4 or fewer UCS-2 characters)
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 at the level of this readdir result containing non-printable-ASCII chars.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 Finally, the following limitations need to be kept in mind:
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 * There is no way to address an FFS object with an extended filename by entering
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 a pathname in fc-fsio commands;
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 * File systems or subtrees containing extended filenames cannot be read out with
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 fc-fsio cpout command: it will fail just like ls -l;
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 * rm-subtree and cleandir commands will likewise fail and stop whenever they
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 encounter a filename longer than 20 characters (invalid for the purpose of
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 pathname generation based on fixed-length buffers) anywhere in the subtree to
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 be deleted.
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 The last limitation (inability to delete "bad" files) may seem like a serious
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 flaw in the design of fc-fsio at first, but please realize that the primary
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 mission of FreeCalypso is to work with our own hardware and firmware, not alien
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 - and the original FFS code from TI, which is what we use in FreeCalypso, will
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 never allow file system objects with such bad filenames to be created in the
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 first place. Therefore, the limitation of fc-fsio being unable to manipulate
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 certain files to the extent of not even being able to delete them is specific
3152e23399a2 document SE K2x0 FFS quirks and our support for them
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 to the peculiar scenario of operating on *alien* FFS from Sony Ericsson.