FreeCalypso > hg > freecalypso-tools
comparison doc/Target-utils @ 528:81a3fc069301
doc/Target-utils: ABB support documented
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Sun, 16 Jun 2019 05:53:04 +0000 |
| parents | aa4f70e36cbd |
| children | 30bec872824a |
comparison
equal
deleted
inserted
replaced
| 527:aa4f70e36cbd | 528:81a3fc069301 |
|---|---|
| 128 designed, otherwise they will be longer. In the case of pirexplore the strict | 128 designed, otherwise they will be longer. In the case of pirexplore the strict |
| 129 timing requirement is satisfied by loading and running the program via fc-iram | 129 timing requirement is satisfied by loading and running the program via fc-iram |
| 130 -h pirelli, resulting in the correct 52 MHz clock configuration; in all other | 130 -h pirelli, resulting in the correct 52 MHz clock configuration; in all other |
| 131 cases running at a frequency below 52 MHz or running out of flash (the | 131 cases running at a frequency below 52 MHz or running out of flash (the |
| 132 flash-boot-test special case) produces longer-than-needed delays. | 132 flash-boot-test special case) produces longer-than-needed delays. |
| 133 | |
| 134 Common interactive commands | |
| 135 =========================== | |
| 136 | |
| 137 The exact set of implemented commands is different for each target-utils | |
| 138 program, including commands specific to each program's unique function, but the | |
| 139 following basic commands are included in most programs: | |
| 140 | |
| 141 abbinit Initialize ABB communication | |
| 142 abbpage2 Unlock access to ABB register page 2 | |
| 143 abbr pg reg Read ABB register <reg> on page <pg> | |
| 144 abbw pg reg val Write <val> into register <reg> on page <pg> | |
| 145 dump hex-start hex-len Display a human-oriented memory dump in hex and ASCII | |
| 146 jump addr Jump to given address with BX | |
| 147 poweroff Execute Iota ABB soft poweroff (DEVOFF) | |
| 148 r8 addr Read an 8-bit register or memory location | |
| 149 r16 addr Read a 16-bit register or memory location | |
| 150 r32 addr Read a 32-bit register or memory location | |
| 151 w8 addr data Write an 8-bit register or memory location | |
| 152 w16 addr data Write a 16-bit register or memory location | |
| 153 w32 addr data Write a 32-bit register or memory location | |
| 154 | |
| 155 For further details, please refer to the source code - if you are playing with | |
| 156 such low-level components, you need to put on the hat of a developer rather | |
| 157 than a mere user. | |
| 158 | |
| 159 ABB support in target-utils | |
| 160 =========================== | |
| 161 | |
| 162 Our target-utils suite includes code for initializing and executing SPI | |
| 163 communication with the Iota ABB device (TWL3014 or TWL3025), Calypso's analog | |
| 164 and power management companion chip. Only Iota ABB type is supported, not | |
| 165 Omega/Nausica or Syren. The primary reason for having this infrastructure is | |
| 166 to be able to perform a soft poweroff operation, i.e., to return the Calypso | |
| 167 phone or modem to its switched-off state after flashing or various standalone | |
| 168 debug operations, but once implemented, this same ABB SPI communication | |
| 169 infrastructure is also used in model-specific hardware exploration utilities | |
| 170 for functions like keypad backlight and vibrator control which are implemented | |
| 171 via the ABB on some models, and it is used in simtest to control the part of | |
| 172 the SIM interface that resides in the Iota ABB. | |
| 173 | |
| 174 Aside from specialized programs like c139explore that are specific to target | |
| 175 devices known to use the Iota ABB, most target-utils programs do not execute | |
| 176 any ABB or SPI communication code (not even initialization) until they receive | |
| 177 one of the ABB commands: abbinit, abbr, abbw or poweroff. This way if someone | |
| 178 comes across a Calypso device that has a different ABB type or needs to debug a | |
| 179 board with broken ABB communication, one can explore other functions without | |
| 180 touching ABB commands. | |
| 181 | |
| 182 The abb_init() function invoked by the abbinit command may be invoked multiple | |
| 183 times: it maintains an internal flag remembering if the initialization steps | |
| 184 have already been done or not, and repeated invokations do nothing. User- | |
| 185 friendly abbr, abbw and poweroff commands invoke abb_init() internally, but the | |
| 186 special abbpage2 command does not - if you are interested in exploring the | |
| 187 undocumented register page 2, you need to execute abbinit manually first, then | |
| 188 abbpage2, then explore with abbr and abbw. | |
| 189 | |
| 190 poweroff operation details: VRPCAUX and VRPCDEV | |
| 191 =============================================== | |
| 192 | |
| 193 The abb_power_off() function invoked by the poweroff command performs the | |
| 194 following sequence of steps: | |
| 195 | |
| 196 * Calls abb_init() to establish ABB communication in the case that it hasn't | |
| 197 already been done; | |
| 198 | |
| 199 * Executes the magic writes to TAPCTRL and TAPREG registers that unlock access | |
| 200 to register page 2 - this step is factored out into the abb_unlock_page2() | |
| 201 function which is also accessible as the abbpage2 command; | |
| 202 | |
| 203 * Writes 0x007 into the undocumented VRPCAUX register to clear the erratic | |
| 204 state that will be there if we got booted via nTESTRESET rather than PWON; | |
| 205 | |
| 206 * Flushes all UART output, i.e., waits for it to finish going out on the wire; | |
| 207 | |
| 208 * Writes 0x001 into the VRPCDEV register, which is the actual DEVOFF command. | |
| 209 | |
| 210 The step of writing into VRPCAUX and its prerequisite page 2 unlock steps are a | |
| 211 recent addition as of fc-host-tools-r11; these steps have been added to fix the | |
| 212 erratic behaviour that was occurring on TI/FC development boards (D-Sample and | |
| 213 FCDEV3B) when fc-loadtool (or fc-iram with some specialized target-utils | |
| 214 program) was entered via the RESET button rather than PWON, followed by the | |
| 215 soft poweroff operation and another switch-on via PWON. For more details, | |
| 216 please refer to the Calypso-test-reset article in the freecalypso-docs | |
| 217 repository. | |
| 218 | |
| 219 If you are interested in doing some experiments of your own with this | |
| 220 undocumented quirk of the Calypso+Iota chipset and the odd behaviour it can | |
| 221 cause, you can do the following: | |
| 222 | |
| 223 * To see the content of the undocumented VRPCAUX register resulting from | |
| 224 different boot modes, execute these commands: | |
| 225 | |
| 226 abbinit | |
| 227 abbpage2 | |
| 228 abbr 2 30 | |
| 229 | |
| 230 Our abbr and abbw commands support page 2, but if you don't issue the magic | |
| 231 register writes encapsulated in the abbpage2 command, the Iota chip itself | |
| 232 disallows access to page 2. | |
| 233 | |
| 234 * To perform a DEVOFF operation without cleaning up VRPCAUX first (to see the | |
| 235 resulting erratic behaviour with your own eyes), do it manually as follows: | |
| 236 | |
| 237 abbw 0 30 1 | |
| 238 | |
| 239 flash-boot-test | |
| 240 =============== | |
| 241 |
