FreeCalypso > hg > freecalypso-tools
comparison doc/Target-boot-control @ 582:deda54106c0e
doc/Target-boot-control: first draft
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 03 Feb 2020 01:25:31 +0000 |
parents | |
children | d3e2b23ebf1d |
comparison
equal
deleted
inserted
replaced
581:d43dc6dfb44c | 582:deda54106c0e |
---|---|
1 There is a new feature in loadtools (fc-loadtool & friends) and rvinterf as of | |
2 fc-host-tools-r12: target boot control. In a typical development environment | |
3 where FC host tools run on a general-purpose PC or laptop and communicate with | |
4 various Calypso targets via general-purpose serial or USB-serial ports, adapters | |
5 and cables, there is generally no way for the host computer running FC host | |
6 tools to directly command the Calypso target to power on and/or reboot - instead | |
7 such control must be performed "out of band" by the operator pressing the PWON | |
8 or RESET button on the target device; some targets may even require complex | |
9 battery manipulations. However, there may be more elaborate (less casual) | |
10 setups where FC host tools run on a special kind of host system which does have | |
11 some means to directly control power and reset to an associated Calypso target: | |
12 | |
13 * The Mother has a plan to produce a special FreeCalypso UART+JTAG Adapter, or | |
14 FC-UJA. This FC-UJA will be a special FT2232D adapter whose Channel A will | |
15 operate in MPSSE mode, connecting to the Calypso target's JTAG and nTESTRESET | |
16 signals, whereas Channel B will act as a standard UART, i.e., a ttyUSB device. | |
17 This FC-UJA needs to be built as a prerequisite before embarking on the | |
18 ambitious HSMBP (Handset Motherboard Prototype) project, as the special | |
19 adapter will be required for working with the HSMBP in development. When | |
20 FC-UJA becomes a reality, FC host tools running on a development host with | |
21 this adapter will need to be given the ability to issue nTESTRESET pulses to | |
22 the target through the adapter's MPSSE+GPIO channel; this nTESTRESET pulse | |
23 will cause the Calypso target to deep-reset, power on and boot. | |
24 | |
25 * FC host tools (particularly fc-loadtool) may run on the application processor | |
26 of a smartphone such as Openmoko GTA02. In such environments the AP will have | |
27 special ad hoc control signals (typically GPIOs) to the modem, at the minimum | |
28 controlling the modem's PWON line. OM GTA02 added an overriding control of | |
29 overall power to the modem; other designs may reasonably add control of the | |
30 modem's RESET line. | |
31 | |
32 * There may be special commercial applications in which one or more Calypso | |
33 modems are subservient to a control processor that acts similarly to the AP | |
34 of a smartphone, with that control processor not only communicating with its | |
35 slave modems via UARTs, but also controlling their power and reset. | |
36 | |
37 Where does the desire for target boot control in loadtools and rvinterf come | |
38 from? Consider the conventional usage model where no target boot control | |
39 exists: you first run fc-loadtool or fc-iram or fc-xram or rvinterf on your | |
40 target /dev/ttyXXX, then press the PWON or RESET button on the target. Now | |
41 suppose that the finger-actuated button has been replaced with some magic | |
42 command that can be executed on the host system to produce the same effect - | |
43 now what? If the usage model stays the same, then you have to first run your | |
44 fc-loadtool or fc-iram or fc-xram or rvinterf command same as before, then as | |
45 it sits there waiting for the target to boot, you have to open another terminal | |
46 window, get another ssh session into the system or whatever, and run the magic | |
47 command that replaces the manual button press. Very cumbersome, hence the | |
48 desire for a better way. | |
49 | |
50 Support for target boot control in FC host tools consists of a new -P option | |
51 implemented in all of loadtools programs and in rvinterf, as well as a special | |
52 configuration file which needs to be manually created. The working model is as | |
53 follows: | |
54 | |
55 * There exist one or more "magic commands": a magic command is any shell command | |
56 (anything that can be passed to /bin/sh -c) whose execution causes a connected | |
57 Calypso target device to power on and boot. Naturally these commands will be | |
58 very specific to your custom system; they are NOT part of FC host tools! | |
59 | |
60 * These magic commands may be long, and requiring the user to include each magic | |
61 command in full on fc-loadtool, rvinterf etc invokation lines is undesirable. | |
62 To save typing, we associate a short name (which you choose yourself as you | |
63 see fit) with each magic command, and we have a configuration file (which you | |
64 need to create) that defines the mapping. | |
65 | |
66 * The argument to the new -P option is the short name to be looked up in the | |
67 configuration file. | |
68 | |
69 The configuration file needs to be created in /opt/freecalypso/bootctrl.conf; | |
70 let us illustrate it with some examples. | |
71 | |
72 Example 1: FC-UJA | |
73 ================= | |
74 | |
75 When FC-UJA becomes a reality, there will be a program called fc-testreset that | |
76 will locate the attached FC-UJA by its USB ID, connect to FT2232D Channel A and | |
77 generate the desired reset pulse on its output. The configuration in | |
78 /opt/freecalypso/bootctrl.conf may look as follows: | |
79 | |
80 uja fc-testreset | |
81 | |
82 This configuration associates boot control name 'uja' with shell command | |
83 fc-testreset. A developer would then run fc-loadtool like this: | |
84 | |
85 fc-loadtool -h fcfam -Puja /dev/ttyUSB0 | |
86 | |
87 if ttyUSB0 is where FC-UJA's UART channel ended up. fc-loadtool would run | |
88 normally, sending beacons to /dev/ttyUSB0 and waiting for a Calypso boot ROM | |
89 response, but it would also execute the fc-testreset command listed in the | |
90 configuration file, and if everything is connected correctly, the resulting | |
91 nTESTRESET pulse will cause the target to boot. | |
92 | |
93 The possibility of a single host talking to multiple Calypso targets is fully | |
94 supported: if you have multiple FC-UJA adapters with different USB descriptor | |
95 serial numbers programmed in their EEPROMs connected to respective Calypso | |
96 targets, you could have a /opt/freecalypso/bootctrl.conf setup like this: | |
97 | |
98 uja1 fc-testreset -d serial1 | |
99 uja2 fc-testreset -d serial2 | |
100 | |
101 and then run fc-loadtool accordingly: | |
102 | |
103 fc-loadtool -h fcfam -Puja1 /dev/ttyUSB3 | |
104 fc-loadtool -h fcfam -Puja2 /dev/ttyUSB4 |