20
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 FFS editor operated via fc-xram
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 ===============================
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 The software article presented in this repository is a tool for operating on
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 the flash file system (FFS) of Calypso devices running FreeCalypso firmware.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 Before explaining the tool itself, I need to explain why it is needed.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 Every FC firmware version includes our TI-based FFS implementation and maintains
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 an FFS instance in device flash memory; the standard way to operate on this FFS
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 is by way of our fc-fsio utility communicating with the running firmware over
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 its RVT/ETM interface. With our AT-command-controlled modem firmwares, most of
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 the time the modem fw itself is the only agent that actually operates on the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 FFS: if you need to perform low-level FFS operations such as formatting, simply
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 boot the firmware normally, but don't give it any AT commands, and instead poke
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 at it with fc-fsio. But when we start building firmware versions with handset
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 UI layers included, relying on the firmware itself as the sole FFS operating
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 agent becomes problematic: these UI-enabled firmwares launch into complex
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 high-level operations immediately upon boot, and it can be very desirable to be
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 able to get the FFS into a certain shape *before* the main firmware is allowed
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 to boot with it.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 The tool presented in this repository is intended to be a solution to this
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 problem. The present FFS editor is a very heavily stripped-down derivative of
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 our FC Selenite firmware, stripped heavily enough to fit entirely into RAM on
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 all of our targets, even the smallest Mot C11x. This FFS editor "firmware"
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 does not include any GSM functionality - no L1, no G23M PS and no ACI - and GPF
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 has been removed as well. The only fw components left are Nucleus, Riviera
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 (which is totally indepedent of GPF in our TCS211-based architecture), RVT (the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 component which manages the RVTMUX UART interface to which we interface via
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 rvinterf), ETM (the component to which fc-tmsh and fc-fsio talk) and FFS, the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 primary component of interest to us here. This FFS editor "firmware" is
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 compiled with gcc (Selenite-based), and is built only into a RAM-loadable image
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 to be run via fc-xram, no flashable images.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 The intended usage model is that you run this FFS editor like this:
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 fc-xram -h mytarget /dev/ttyXXX ffsagent-XXX.srec rvinterf
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 Cause the Calypso device to execute its boot path, fc-xram will load and run
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 the ffsagent image, and pass the serial channel to rvinterf - then you will
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 have rvinterf running on your host, talking to ffsagent running on the Calypso.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 The FFS editor "firmware" does nothing other than emit a few RV traces and
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 listen for ETM command packets, and at this point you run fc-fsio to talk to
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 this FFS agent and perform whatever FFS manipulations are needed. fc-tmsh can
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 also be used to read and write both Calypso and ABB registers.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 When you are done with the needed fc-fsio manipulations, you can command a Iota
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 power-off on the target with fc-shell poweroff (sends an ETM ABB register write
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 command hitting VRPCDEV), or you can kill rvinterf or unplug the serial cable
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 and let ffsagent on the target power off in 15 to 20 s upon keepalive timeout.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 Or you can press the RESET button on the board (FCDEV3B or Caramel) and cause
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 the flashed firmware to boot. (Powering off by pressing and holding PWON won't
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 work because the heavily stripped FFS editor "firmware" does not include the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 regular firmware's ABB interrupt handling code path.) In any case, when the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 flashed fw does boot, it will boot with the FFS content in whatever state you
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 brought it to with ffsagent and fc-fsio, which is the whole point of the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 exercise.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 Supported targets
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 =================
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 The present FFS editor is intended to run only on those Calypso targets which
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 run one of our full FreeCalypso GSM firmwares of the Magnetite/Selenite family.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 More specifically, it is intended to operate on FFS instances that are "owned"
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 by flashed FreeCalypso firmwares, *not* on FFS instances that are owned by
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 someone else's firmware. There is no mechanism for explicitly specifying FFS
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 location and geometry at a user level, as would be needed for operating on
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 arbitrary alien FFS instances, instead the FFS editor includes exactly the same
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 dev.c table of FFS configurations as our production firmwares. The few
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 different ffsagent build variants that are provided (run ./make-all.sh to
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 compile all of them) differ in which dev.c table is included, exactly the same
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 as in our production firmwares:
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 * ffsagent-fcfam-{irda,modem}.srec version is built with the CONFIG_TARGET_FCFAM
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 version of the dev.c table, appropriate for FCDEV3B.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 * ffsagent-ti26-{irda,modem}.srec version is built with TI/OM's original version
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 of the dev.c table, appropriate for Tango/Caramel/Luna and for Openmoko GTA0x.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 * compal and pirelli versions correspond to FreeCalypso aftermarket FFS configs
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 on those targets, *NOT* Compal's or Pirelli's original FFS!
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 compal-new vs. compal-old configs
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 =================================
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 Back in 2015 I (Mother Mychaela) made the decision to define FC aftermarket FFS
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 on Mot C139 phones as 64x3 (meaning 3 sectors of 64 KiB each), located at
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 0x3C0000. Right now I am thinking that we should change to a larger FFS config,
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 but I have not yet committed on any specific new config. When and if I make
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 the big switch, compal-new will be the new config, while compal-old will remain
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 the original 2015 config. At the present moment the two ffsagent-compal-*
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 images are identical.
|