annotate doc/Firmware_Architecture @ 27:3ecd6054a7f7

doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 12 Jun 2016 04:26:04 +0000
parents
children b56928f8c001
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 Our FreeCalypso GSM firmware follows the same architecture as TI's TCS211;
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 this document is an attempt to describe this architecture.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 Nucleus environment
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 ===================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 Like all classic TI firmwares, ours is based on the Nucleus PLUS RTOS. Just
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 like TI's original code on which we are based, we use only a small subset of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 the functionality provided by Nucleus - but because the latter is a library,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 the pieces we don't use simply don't get pulled into the link. The main
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 function we get out of Nucleus is the scheduling of threads, or tasks as
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 Nucleus calls them.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 Our entry point code as we receive control from the Calypso boot ROM or from
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 other bootloaders on crippled targets or from loadagent in the case of fc-xram
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 loadable builds does some absolutely minimal initialization (set up sensible
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 memory access timings, copy iram.text to IRAM and .data to XRAM if we are
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 booting from flash, zero out our two bss segments (int.bss and ext.bss)) and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 jumps to Nucleus' assembly init entry point. Prior to jumping to Nucleus, we
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 don't even have a stack (all init code prior to that point is pure assembly and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 uses only ARM registers); Nucleus then sets up the stack pointer for everything
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 running under its control.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 Aside from just a few exceptions (ARM exception handlers come to mind, never
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 mind the pun), every piece of code in the firmware executes in one of the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 following contexts:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 * Application_Initialize(): this function and everything called from it execute
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 just before Nucleus' thread scheduler starts; at this point interrupts are
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 disabled at the ARM7 core level (in the CPSR) and must not be enabled; the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 stack is Nucleus' "system stack" which is also used by the scheduler and LISRs
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 as explained below.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 * Regular threads or tasks: once Application_Initialize() finishes, all code
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 with the exception of interrupt handlers (LISRs and HISRs as explained below)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 runs in the context of some Nucleus task. Whenever you are trying to debug
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 or simply understand some piece of code in the firmware, the first question
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 you should ask is "which task does this code execute in?". Most functional
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 components run in their own tasks, i.e., a given piece of code is only
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 intended to run within the Nucleus task that belongs to the component in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 question. On the other hand, some components are implemented as APIs,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 functions to be called from other components: these don't have their own task
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 associated with them, and instead they run in the context of whatever task
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 they were called from. Some only get called from one task: for example, the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 "uartfax" driver API calls only get called from the protocol stack's UART
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 entity, which is its own task. Other component API functions like FFS and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 trace can get called from just about any task in the system. Many components
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 have both their own task and some API functions to be called from other tasks,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 and the API functions oftentimes post messages to the task to be worked on by
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 the latter; the just-mentioned FFS and trace functions work in this manner.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 In our current GSM firmware (just like in TCS211) every Nucleus task is
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 created either through Riviera or through GPF, and not in any other way - see
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 the description of Riviera and GPF below.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 * LISRs (Low level Interrupt Service Routines): these are the interrupt handlers
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 that run immediately when an ARM IRQ or FIQ comes in. The code at the IRQ and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 FIQ vector entry points calls Nucleus' magic stack switching function
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 (switches the CPU from IRQ/FIQ into SVC mode, saves the interrupted thread's
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 registers on that thread's stack, and switches to the "system" stack) and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 then calls TI's IRQ dispatcher implemented in C. The latter figures out
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 which Calypso interrupt needs to be handled and calls the handler configured
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 in the compiled-in table. Nucleus' LISR registration framework is not used
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 by the GSM fw, but these interrupt handlers should be viewed as LISRs
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 nonetheless.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 There is one additional difference between canonical Nucleus and TI's version
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 (we've replicated the latter): canonical Nucleus was designed to support
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 nested LISRs, i.e., IRQs re-enabled in the magic stack switching function,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 but in TI's version which we follow this IRQ re-enabling is removed: each LISR
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 runs with interrupts disabled and cannot be interrupted. (The corner case of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 an FIQ interruping an IRQ remains to be looked at more closely as bugs may be
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 hiding there, but Calypso doesn't really use FIQ interrupts.) There is really
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 no need for LISR nesting in our GSM fw, as each LISR is very short: most LISRs
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 do nothing more than trigger the corresponding HISR.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 * HISRs (High level Interrupt Service Routines): these hold an intermediate
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 place between LISRs and tasks, similar to softirqs in the Linux kernel. A
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 HISR can be activated by a LISR calling NU_Activate_HISR(), and when the LISR
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 returns, the HISR will run before the interrupted task (or some higher
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 priority task, see below) can resume. HISRs run with CPU interrupts enabled,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 thus more interrupts can occur, with their LISRs executing and possibly
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 triggering other HISRs. All triggered HISRs must complete and thereby go
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 "quiescent" before task scheduling resumes, i.e., all HISRs as a group have a
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 higher scheduling priority than tasks.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 Nucleus implements priority scheduling for tasks. Tasks have their priority set
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 when they are created (through Riviera or GPF, see below), and a higher priority
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 task will run until it gets blocked waiting for something, at which time lower
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 priority tasks will run. If a lower priority task sends a message to a higher
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 priority task, unblocking the latter which was waiting for incoming messages,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 the lower priority task will effectively suspend itself immediately while the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 higher priority task runs to process the message it was sent.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 HISRs oftentimes post messages to their associated tasks as well; if one of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 these messages unblocks a higher priority task, that unblocked task will run
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 upon the completion of the HISR instead of the original lower priority task
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 that was interrupted by the LISR that triggered the HISR. Nucleus' scheduler
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 is fun!
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 Major functional blocks
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 =======================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 At the highest level, all code in TI's classic firmwares and in our FreeCalypso
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 fw can be divided into 3 broad groupings:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 * GSM Layer 1: this code was developed by TI, is highly specific to TI's
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 baseband chipset family in general and to specific individual chips in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 particular (the code is liberally sprinkled with conditional compilation
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 based on DBB type, ABB type, DSP ROM version and so on), and is absolutely
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 necessary in order to operate a Calypso device as a GSM MS (mobile station)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 and not merely as a general purpose microprocessor platform. This code can
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 be considered to be the most important part of the entire firmware.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 L1 interties with Nucleus and with the G23M stack (with which it needs to
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 communicate) in a very peculiar way described later in this article.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 * G23M protocol stack: at the beginning of TI's involvement in the GSM baseband
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 chipset business, they only developed and maintained their own L1 code, while
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 the rest of the protocol stack (which is hardware-independent) was licensed
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 from another company called Condat. Later Condat as a company was fully
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 acquired by TI, and the once-customer of this code became its owner. The
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 name of TI/Condat's implementation of GSM layers 2&3 for the MS side is G23M,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 and it forms its own major division of the overall fw architecture.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 Underlying the G23M stack is a special layer called GPF, which was originally
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 Condat's Generic Protocol stack Framework. Apparently Condat was in the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 business of developing and maintaining a whole bunch of protocol stacks: GSM
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 MS side, GSM network side, TETRA and who knows what else. GPF was their
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 common underpinning for all of their protocol stack projects, which ran on top
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 of many different OS environments: Nucleus, pSOS, VxWorks, Unix/Linux, Win32
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 and who knows what else.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 In the case of FreeCalypso GSM fw, both the protocol stack and the underlying
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 OS environment are fixed: GSM and Nucleus, respectively. But GPF is still a
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 critically important layer in the firmware architecture: in addition to
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 serving as the glue between the G23M stack and Nucleus, it provides some
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 important support infrastructure for the protocol stack.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 * Miscellaneous peripheral accessories: under this category I (Space Falcon)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 place everything implemented through TI's Riviera framework. Historical
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 evidence indicates that TI's earliest firmwares did not have this part, i.e.,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 Riviera and everything built on top of it is a "non-essential" later
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 addition. It appears that TI originally invented Riviera in order to support
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 the development of fancy "feature phone" UI/application layers, complete with
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 Java, MMS, WAP, games and whatnot - things upon which our FreeCalypso project
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 looks with disdain - but in the TCS211 firmware from 2007 which I used as the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 reference for FreeCalypso this Riviera framework serves as the foundation for
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 some small but essential pieces of functionality: the FFS implementation, the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 SPI-based ABB access driver, the RTC driver and the debug trace facility.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 While it is certain that TI had some non-Riviera implementation of the just-
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 listed essential pieces in their earliest pre-Riviera days, trying to find
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 surviving sources from those days would be a "mission impossible" task. OTOH,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 reusing the Riviera code from TCS211 was quite easy, as the copy of TCS211 we
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 got has it in full source form with nothing omitted. Therefore, I took the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 sensible easy road and kept Riviera in FreeCalypso.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 The above division of the firmware into 3 broad functional groupings also
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 corresponds quite neatly with where each piece of our source code originally
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 came from. Our versions of L1 and G23M came in their entirety from TI's TCS3.2
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 program targeting their later LoCosto chipset (specifically from the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 TCS3.2_N5.24_M18_V1.11_M23BTH_PSL1_src.zip release from Peek/FGW), whereas
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 everything in the 3rd division (Riviera and everything built on top of it) came
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 from our TCS211/Leonardo source from Sotovik.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 The just-listed divisions of the firmware are really separate software
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 environments which are linked together into one final image, but which have
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 very little in the way of interties. Each of the 3 realms has its own very
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 different coding style, its own set of header files and its own defined types.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 It is very rare for a module from one realm to include any header files or call
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 any functions from another realm, and while they all ultimately run on top of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 Nucleus, they interface with Nucleus in different ways: G23M goes through GPF,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 everything in Riviera land goes through Riviera, and L1 uses its own bizarre
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 mechanism which in our fw ends up going through GPF but hasn't always been this
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 way - to be explained lated in this article.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 Also note that there is no mention of any handset UI code (or MMI in the GSM
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 industry's sexist speak) in the above breakdown of code divisions. This
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 document describes the architecture of TI's modem firmware in which the highest
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 layer is the AT command interface (part of the G23M suite, or its uppermost
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 layer to be precise), and which does not include any UI code. Our TI reference
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 sources do include their "MMI" code, but I haven't studied it closely enough
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 yet to comment on it properly, and the version of TCS211 which serves as our
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 primary reference is set up for the modem configuration without this "MMI" part.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 Making sense of TI's "MMI" code is a task to be tackled later in the project
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 when we have a working modem and are ready to start building a usable handset
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 with UI.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 Riviera and GPF
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 ===============
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 Riviera and GPF are two parallel/independent/competing wrappers around or
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 layers above Nucleus. The way in which they are treated in our FreeCalypso fw
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 architecture is somewhat inverted: originally GPF was the essential framework
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 underlying the G23M stack (and to which L1 was also attached in a hacky way)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 while Riviera was added to support non-essential frills, but in our current FC
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 fw Riviera is always included just like Nucleus, whereas GPF only needs to be
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 included in the build when building with feature gsm (full GSM MS functionality)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 or feature l1stand (L1 standalone) - but is not needed if one wishes to build
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 an "in vivo" FFS editing agent, for example.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 This peculiar arrangement happened because of the source code availability
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 situation we found ourselves in. TCS211 uses real Riviera that is fully
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 independent of GPF (see below), and our copy thereof came with this part in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 full source form. On the other hand, we never got the complete original source
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 for GPF in one piece, thus our FC version of GPF had to be reconstructed from
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 bits and pieces. For this reason I made the decision early on to include
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 Riviera and some RV-based components in the "mandatory core" part of our FC fw
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 architecture, while leaving GPF to be worked on later. And when I did get to
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 reintegrating GPF, at that point it was natural to make it into an "optional"
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 component that is included only when needed.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 At some point in their post-Calypso TCS3.x program TI decided to eliminate
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 Riviera as an independent framework and to reimplement Riviera APIs (used by
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 peripheral but necessary code such as FFS, ETM, various drivers etc) over GPF.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 This arrangement is used in the TCS3.2 LoCosto code from which we lifted our
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 versions of L1 and G23M. However, I (Space Falcon) chose not to adopt this
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 approach for FreeCalypso, and mimic the TCS211 way (Riviera entirely
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 independent of GPF) instead. The reasons were twofold: (1) there was no full
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 source for GPF and a painstaking reconstruction effort was required before we
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 could have our own working version of GPF in our gcc-built fw, and (2) I felt
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 more comfortable and familiar with following TCS211.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 Start-up process
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 ================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 I mentioned earlier that every Nucleus task in our firmware gets created and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 started either through Riviera or through GPF. All GPF tasks are created and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 placed into the runable state in the Application_Initialize() context: the work
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 is done by GPF init code in gsm-fw/gpf/frame/frame.c, and the top level GPF
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 init function called from Application_Initialize() is StartFrame(). Thus when
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 Application_Initialize() finishes and the Nucleus thread scheduler starts
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 running for the first time, all GPF tasks are there to be scheduled.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236 There is a compiled-in table of all protocol stack entities and the tasks in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 which they need to run which (in our fw) lives under gsm-fw/gpf/conf and which
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 logically belongs to GPF. Canonically each protocol stack entities runs in its
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239 own task, but sometimes two or more are combined to run in the same task: for
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 example, in the minimal GSM "voice only" configuration (no CSD, fax or GPRS)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 CC, SMS and SS entities share the same task named CM. Unlike Riviera, GPF does
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 not support dynamic starting and stopping of tasks.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 As each GPF task starts running (immediately upon entry into Nucleus' scheduling
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 loop as Application_Initialize() finishes), pf_TaskEntry() function in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 gsm-fw/gpf/frame/frame.c is the first code it runs. This function creates the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 queue for messages to be sent to all entities running within the task in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 question, calls each entity's pei_init() function (repeatedly until it succeeds:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 it will fail until the other entities to which this entity needs to send
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 messages have created their message queues), and then falls into the main body
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 of the task: for all "regular" entities/tasks except L1, this main body consists
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 of waiting for messages (or signals or timeouts) to arrive on the queue and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 dispatching each received message to the appropriate handler in the right
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 entity.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 Riviera tasks get started in a different way. The same Application_Initialize()
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 function that calls StartFrame() to create and start all GPF tasks also calls
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 create_tasks() (found in gsm-fw/riviera/init/create_RVtasks.c), the appinit-time
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259 function for starting the Riviera environment. But this function does not
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 create and start every configured Riviera task like StartFrame() does for GPF.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 Instead it creates a special helper task which will do this work once scheduled.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 Thus at the completion of Application_Initialize() and the beginning of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 scheduling the set of runable Nucleus tasks consists of all GPF ones plus the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 special RV starter task. Once the RV starter task gets scheduled, it will call
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 rvm_start_swe() to launch every configured Riviera SWE (SoftWare Entity), which
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 in turns entails creating the tasks in which these SWEs are to run.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 Dynamic memory allocation
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 =========================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 All dynamic memory allocation (i.e., all RAM usage beyond statically allocated
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 variables and buffers) is once again done either through Riviera or through GPF,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 and in no other way. Ultimately all areas of the physical RAM that will ever
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 be used by the fw in any way are allocated when the fw is compiled and linked:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275 the areas from which Riviera and GPF serve their dynamic memory allocations are
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 statically allocated as char arrays in the respective C modules and placed in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277 the int.ram or ext.ram section as appropriate; Riviera and GPF then provide
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 API functions that allocate memory dynamically from these statically allocated
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 large pools.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 Riviera and GPF have entirely separate memory pools from which they serve their
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282 respective clients, hence there is no possibility of one affecting the other.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 Riviera's memory allocation scheme is very much like the classic malloc&free:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 there is one large unstructured pool from which all allocations are made, one
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 can allocate a chunk of any size, free chunks are merged when physically
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 adjacent, and fragmentation is an issue: a memory allocation request may fail
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 even when there is enough memory available in total if it is too fragmented.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289 GPF's dynamic memory allocation facility is considerably more robust: while it
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 does maintain one or two (depending on configuration) memory pools of the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 traditional "dynamic" kind (like malloc&free, susceptible to fragmentation),
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 most GPF memory allocation works on "partition" memory instead. Here GPF
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 maintains 3 separate groups of pools: PRIM, TEST and DMEM; each allocation
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 request must specify the appropriate pool group and cannot affect the others.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295 Within each pool there is a fixed number of partitions of a fixed size: for
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 example, in TI's TCS211 GSM+GPRS configuration the PRIM pool group consists of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 190 partitions of 60 bytes, 110 partitions of 128 bytes, 50 partitions of 632
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 bytes and 7 partitions of 1600 bytes. An allocation request from a given pool
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 group (e.g., PRIM) can request any arbitrary size in bytes, but it gets rounded
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 up to the nearest partition size and allocated out of the respective pool. If
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 no free partitions are available, the requesting task is suspended until another
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 task frees on. Because these partitions are used primarily for intertask
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 communication, if none are free, it can only mean (assuming that the firmware
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 functions correcly) that all partitions have been allocated and sent to some
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 queue for some task to work on, hence eventually they will get freed.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 This scheme implemented in GPF is extremely robust in the opinion of this
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 author, and the other purely "dynamic" scheme is used (in the case of GPF) only
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 for init-time allocations which are never freed, such as task stacks - hence
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 the GPF-based part of the firmware is not suspectible at all to the problem of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 memory fragmentation. But Riviera does suffer from this problem, and the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 concern is more than just theoretical: one major user of Riviera-based dynamic
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 memory allocation is the trace facility (described in its own section below),
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 and my observation of the trace output from Pirelli's proprietary fw (which
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315 appears to use the same architecture with separate Riviera and GPF) suggests
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 that after the fw has been running for a while, Riviera memory gets fragmented
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 to a point where many traces are being dropped. Replacing Riviera's poor
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 dynamic memory allocation scheme with a GPF-like partition-based one is a to-do
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319 item for our project.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 Message-based intertask communication
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 =====================================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 Even though all entities of the G23M protocol stack are linked together into
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 one monolithic fw image and there is nothing to stop them from calling each
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 other's functions and accessing each other's variables, they don't work that
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 way. Instead all communication between entities is done through messages, just
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 as if they ran in separate address spaces or even on separate processors.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 Buffers for this message exchange are allocated from a GPF partition pool: an
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 entity that needs to send a message to another entity allocates a buffer of the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 needed size, fills it with the message to be sent, and posts it on the recipient
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 entity's message queue, all through GPF services. The other entity simply
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 processes the stream of messages that arrives on its message queue, freeing each
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 message (returning the buffer to the partition pool in came from) as it is
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 processed.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 Riviera-based tasks use a similar mechanism: unlike G23M protocol stack
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 entities, most Riviera-based functional modules provide APIs that are called as
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 functions from other tasks, but these API functions typically allocate a memory
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 buffer (through Riviera), fill it with the call parameters, and post it to the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 associated task's message queue (also in the Riviera land) to be worked on.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 Once the worker task gets the job done, it will either call a callback function
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 or post a response message back to the requestor - the latter option is only
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344 possible if the requesting entity is also Riviera-based.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 A closer look at GPF
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 ====================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 There are certain sublayers within GPF which need to be pointed out. The 3
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 major subdivisions within GPF are:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 * The meaty core of GPF: this part is the code under gsm-fw/gpf/frame in our
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 source tree. It appears that this part was originally intended to be both
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 project-independent (same for GSM, TETRA etc) and OS-independent (same for
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 Nucleus, pSOS, VxWorks etc). This is the part of GPF that matters for the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 G23M stack: all APIs called by PS entities are implemented here, and so are
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357 all other PS-facing functions such as startup. (PS = protocol stack)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 * OS adaptation layer (OSL): this is the part of GPF that adapts it to a given
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 underlying OS, in our case Nucleus.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 * Test interface: see the code under gsm-fw/gpf/tst_drv and gsm-fw/gpf/tst_pei.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 This part handles the trace output from all entities that run under GPF and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 the mechanism for sending external debug commands to the GPF+PS subsystem.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 GPF was a difficult step in our GSM firmware reintegration process because no
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 complete source for it could be found anywhere: apparently GPF was so stable
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 and so independent of firmware particulars (Calypso or LoCosto, GSM only or
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 GSM+GPRS, modem or complete phone with UI etc) that it appears to have been
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 used and distributed as prebuilt binary libraries even inside TI. All TI fw
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 (semi-)sources we have use GPF in prebuilt library form and are not set up to
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372 recompile any part of it from source. (They had to include all GPF header
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373 files though, as most of them are included by G23M C modules, and it would be
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 too much hassle to figure out which ones are or aren't needed, hence all were
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375 included.)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377 Fortunately though, we were able to find the sources for most parts of GPF:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 * The LoCosto source in TCS3.2_N5.24_M18_V1.11_M23BTH_PSL1_src.zip features the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 source for the "core" part of GPF under gpf/FRAME - these sources aren't
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 actually used by that fw's build system (it only uses the prebuilt binary
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382 libs for GPF), but they are there.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384 * Our TCS211 semi-src doesn't have any sources for the core part of GPF, but
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 instead it features the source for the test interface and some "misc" parts:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 under gpf/MISC and gpf/tst in that source tree - these sources are not present
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 in the LoCosto version from Peek.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389 But one critical piece was still missing: the OS adaptation layer. It appears
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390 that the GPF core (vsi_??? modules) and OSL (os_??? modules) were maintained
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 and built together, ending up together in frame_<blah>.lib files in the binary
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 form used to build firmwares, but the source for the "frame" part in the Peek
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393 find contained only vsi_*.c and others, but not any of os_*.c.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 Thus we had to reconstruct GPF from the shattered bits and pieces we had. I
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396 took the frame sources from Peek and the misc and tst sources from Sotovik, and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397 saw that they compiled w/o problems in our gcc environment. Attempting to link
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 any firmware that uses GPF would have been futile at this point, as it would
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399 have failed with undefined references to os_*() functions. Then I had to do
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 the hard work: disassemble the missing os_??? modules from the binary libs in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401 the TCS211 version (hey, at least this one was known to work reliably) and write
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402 new C code replicating the exact logic found in the disassembly of the known
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 working and fitting binary. This work is now mostly done (some non-essential
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404 functions have been stubbed out to be revisited later), and the version of GPF
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 used by FreeCalypso is a significant work of reconstruction, not merely lifted
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406 from a readily available source and plopped in.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 A closer look at L1
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 ===================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411 The L1 code is remarkable in how little intertie it has with the rest of the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 firmware it is linked into. It is almost entirely self-contained, expecting
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413 only 4 functions to be provided by the underlying OS environment:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415 os_alloc_sig -- allocate message buffer
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 os_free_sig -- free message buffer
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 os_send_sig -- send message to upper layers
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418 os_receive_sig -- receive message from upper layers
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 It helps to remember that at the beginning of TI's involvement in the GSM
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 baseband chipset business, L1 was the only thing they "owned", while Condat,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422 the maintainers of the higher level protocol stack, was a separate company.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 TI's "turnkey" solution must have consisted of their own L1 code plus G23M code
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 (including GPF etc) licensed from Condat, but I'm guessing that TI probably
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425 wanted to retain the ability to sell their chips with their L1 without being
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426 entangled by Condat: let the customer use their own GSM L23 stack, or perhaps
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 work out their own independent licensing arrangements with Condat. I'm
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428 guessing that L1 was maintained as its own highly independent and at least
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 conceptually portable entity for these reasons.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431 The way in which L1 is intertied into our FreeCalypso GSM fw is the same as how
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 it is done in TI's production firmwares, including both our TCS211 reference
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 and the TCS3.2 version from which we got our L1 source. There is a module
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434 called OSX, which is an extremely thin adaptation layer that implements the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 APIs expected by L1 in terms of GPF. Furthermore, this OSX layer provides
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 header file isolation: the only "outside" (non-L1) header included by L1 is
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 cust_os.h, and it defines the necessary interface to OSX *without* including
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 any other headers (no GPF headers in particular), using only the C language's
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 native types. Apart from this cust_os.h header, the entire OSX layer is
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 implemented in one C module (osx.c, which we had to reconstruct from osx.obj as
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441 the source was missing - but it's very simple) which does include some GPF
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 headers and implements the OSX API in terms of GPF services. Thus in TI's
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 production firmwares and in our FC GSM fw L1 does sit on top of GPF, but very
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 indirectly.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 More specifically, the "production" version of OSX implements its API in terms
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447 of *high-level* GPF functions, i.e., VSI. However, they also had an interesting
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 OP_L1_STANDALONE configuration which omitted not only all of G23M, but also the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 core of GPF and possibly the Riviera environment as well. We don't have a way
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 to recreate this configuration exactly as it existed inside TI because we don't
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 have the source bits specific to this configuration (our own standalone L1
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 configuration is implemented differently, see below), but we do have a little
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 bit of insight into how it worked.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 It appears that TI's OP_L1_STANDALONE build used a special "gutted" version of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 GPF in which the "meaty core" (VSI etc) was removed. The OS layer (os_???
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 modules implementing os_*() functions) that interfaces to Nucleus was kept, and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 so was OSX used by L1 - but this time the OSX API functions were implemented in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 terms of os_*() ones (low-level wrappers around Nucleus) instead of the higher-
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460 level VSI APIs provided by the "meaty core" of GPF. It is purely a guess on my
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 part, but perhaps this hack was also done in the days before TI's acquisition
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462 of Condat, and by omitting the "meaty core" of GPF, TI could claim that their
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 OP_L1_STANDALONE configuration did not contain any of Condat's "intellectual
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464 property".
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466 In FreeCalypso we do have a way to build a firmware image that includes L1 but
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467 not G23M: it is our own L1 standalone configuration, enabled with a
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468 feature l1stand line in build.conf. However, because IP considerations don't
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 apply to us (we operate under the doctrine of eminent domain), we are not
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470 replicating TI's gutting of GPF: *our* L1 standalone configuration includes the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471 full GPF (with OSX for L1 implemented in terms of VSI), but with a greatly
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472 reduced set of tasks when G23M is omitted.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474 Run-time structure of L1
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475 ========================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477 L1 consists of two major parts: L1S and L1A. L1S is the synchronous part where
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478 the most time-critical functions are performed; it runs as a Nucleus HISR. The
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479 hardware in the Calypso generates an interrupt on every TDMA frame (4.615 ms),
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480 and the LISR handler for this interrupt triggers the L1S HISR. L1S communicates
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 with L1A through a shared memory data structure, and also sometimes allocates
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482 message buffers and posts them to L1A's incoming message queue (both via OSX
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483 API functions, i.e., via GPF in disguise).
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485 L1A runs as a regular task under Nucleus, and includes a blocking call (to GPF
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 via OSX) to wait for incoming messages on its queue. It is one big loop that
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 waits for incoming messages, then processes each received message and commands
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488 L1S to do most of the work. The entry point to L1A in the L1 code proper is
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
489 l1a_task(), although the responsibility for running it as a task falls on some
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
490 "glue" code outside of L1 proper. TI's production firmwares with G23M included
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491 have an L1 protocol stack entity within G23M whose only job (aside from some
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492 initialization) is to run l1a_task() in the Nucleus task created by GPF for
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493 that protocol stack entity; we do the same in our firmware.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495 Communication between L1 and G23M
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496 =================================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 It is remarkable that L1 and G23M don't have any header files in common: L1
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499 uses its own (almost fully self-contained), whereas the G23M+GPF realm is its
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500 own world with its own header files. One has to ask then: how do they
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501 communicate? OK, we know they communicate through primitives (messages in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502 buffers allocated from GPF's PRIM partition memory pool) passes via message
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503 queues, but what about the data structures in these messages? Where are those
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504 defined if there are no header files in common between L1 and G23M?
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506 The answer is that there are separate definitions of the L1<->G23M interface on
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507 each side, and TI must have kept them in sync manually. Not exactly a
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508 recommended programming or software maintenance practice for sure, but TI took
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
509 care of it, and the existing proprietary products based on TI's firmware are
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
510 rock solid, so it is not really our place to complain.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
511
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
512 TI's firmwares from the era we are working with (the TCS3.2/LoCosto source from
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
513 20090327 from which we took our L1 and G23M and the binary libs version of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 TCS211 from 20070608 which serves as our reference) also include a component
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
515 called ALR. It resides in the G23M code realm: G23M coding style, uses Condat
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
516 header files, runs as its own protocol stack entity under GPF. This component
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517 appears to serve as a glue layer between the rest of the G23M stack (which is
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518 supposed to be truly hardware-independent) and TI's L1.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 Speaking of ALR, it is worth mentioning that there is a little naming
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 inconsistency here. ALR is known to the connect-by-name logic in GPF as "PL"
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522 (physical layer, apparently), while the ACI entity (Application Control
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523 Interface, the top level entity) is known to the same logic as "MMI". No big
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
524 deal really, but hopefully knowing this quirk will save someone some confusion.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
525
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526 Debug trace facility
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527 ====================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 See the RVTMUX document in the same directory as this one for general background
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530 information about the debug and development interface provided by TI-based
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531 firmwares. Our FreeCalypso GSM firmware implements an RVTMUX interface as well,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
532 and the most immediate use to which it is put is debug trace output. In this
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
533 section I'm going to describe how this debug trace output is generated inside
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
534 the fw.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
535
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536 The firmware component that "owns" the physical UART channel assigned to RVTMUX
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
537 is RVT, implemented in gsm-fw/riviera/rvt. It is a Riviera-based component,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
538 and it has a Nucleus task that is created and started through Riviera. All
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539 calls to the actual driver for the UART are made from RVT. In the case of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540 output from the Calypso GSM device to an external host, all such output is
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 performed in the context of RVT's Nucleus task; this task drains RVT's message
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542 queue and emits the content of allocated buffers posted to it, freeing them
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543 afterward. (The dynamic memory allocation system in this case is Riviera's,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544 which is susceptible to fragmentation - see discussion earlier in this article.)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 Therefore, every trace or other output packet emitted from a GSM device running
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546 our fw (or any of the proprietary firmwares based on the same architecture)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547 appears as a result of a message in a dynamically allocated buffer having been
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
548 posted to RVT's queue.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
549
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550 RVT exports several API functions that are intended to be called from other
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 tasks, it is by way of these functions that most output is submitted to RVT.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 One can call rvt_send_trace_cpy() with a fully prepared output message, and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
553 that function will allocate a buffer from Riviera's dynamic memory allocator
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
554 properly accounted to RVT, fill it and post it to the RVT task's queue.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555 Alternatively, one can can rvt_mem_alloc() to allocate the buffer, fill it in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
556 and then pass it to rvt_send_trace_no_cpy().
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
557
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558 At higher levels, there are a total of 3 kinds of debug traces that can be
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 emitted:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561 * Riviera traces: these are generated by various components implemented in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562 Riviera land, although in reality any component can generate a trace of this
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563 form by calling rvf_send_trace() - this function can be called from any task.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
564
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
565 * L1 traces: L1 has its own trace facility implemented in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
566 gsm-fw/L1/cfile/l1_trace.c; it generates its traces as ASCII messages and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
567 sends them out via rvt_send_trace_cpy().
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
569 * GPF traces: code that runs in GPF/G23M land and uses those header files and
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
570 coding conventions etc can emit traces through GPF. GPF's trace functions
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571 (implemented in gsm-fw/gpf/frame/vsi_trc.c) allocate a memory partition from
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 GPF's TEST pool, format the trace into it, and send the trace primitive to
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
573 GPF's special test interface task. That task receives trace and other GPF
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
574 test interface primitives on its queue, performs some manipulations on them,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
575 and ultimately generates RVT trace output, i.e., a new dynamic memory buffer
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
576 is allocated in the Riviera land, the trace is copied there, and the Riviera
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577 buffer goes to the RVT task for the actual output.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
579 Trace masking
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
580 =============
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
581
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
582 The RV trace facility invoked via rvf_send_trace() has a crude masking ability,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583 but by default all traces are enabled. In TI's standard firmwares most of the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 trace output comes from L1: L1's trace output is very voluminous, and appears
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585 to be fully enabled by default. I have yet to look more closely if there is
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586 any trace masking functionality in L1 and what the default trace verbosity
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587 level should be.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 On the other hand, GPF and therefore G23M traces are mostly disabled by default.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590 One can turn the trace verbosity level from any GPF-based entity up or down by
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
591 sending a "system primitive" command to the running fw, and another such command
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
592 can be used to save these masks in FFS, so that they will be restored on the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593 next boot cycle and be effective at the earliest possible time. Enabling *all*
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594 GPF trace output for all entities is generally not useful though, as it is so
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595 verbose that a developer trying to make sense of it will likely drown in it.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597 GPF compressed trace hack
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
598 =========================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
599
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
600 TI's Windows-based GSM firmware build systems include a hack called str2ind.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
601 Seeking to reduce the fw image size by eliminating trace ASCII strings from it,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
602 and seeking to reduce the load on the RVTMUX serial interface by eliminating
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
603 the transmission time of these strings, they passed their sources through an
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
604 ad hoc preprocessor that replaces these ASCII strings with numeric indices.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
605 The compilation process with this str2ind hack becomes very messy: each source
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
606 file is first passed through the C preprocessor, then the intermediate form is
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
607 passed through str2ind, and finally the de-string-ified form is compiled, with
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
608 the compiler being told not to run the C preprocessor again.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
609
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
610 TI's str2ind tool maintains a table of correspondence between the original trace
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
611 ASCII strings and the indices they've been turned into, and a copy of this table
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
612 becomes essential for making sense of GPF trace output: the firmware now emits
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
613 only numeric indices which are useless without this str2ind.tab mapping table.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
614
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
615 Our FreeCalypso firmware does not currently implement this str2ind aka
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
616 compressed trace hack, i.e., all GPF trace output from our fw is in full ASCII
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
617 string form. I have not bothered to implement compressed traces because:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
618
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
619 * We have not yet encountered a case of the full ASCII strings causing a problem
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
620 either with fw images not fitting into the available memory or excessive load
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
621 on the RVTMUX interface;
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
622
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
623 * Implementing the hack in question would require extra work: the str2ind tool
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
624 would have to be reimplemented anew, as of the original we have no source,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
625 only a Windows binary, and requiring our free fw build process to run a
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
626 Windows binary under Wine is a no-no;
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
627
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
628 * I don't feel like doing all that extra work for what appears to be no real
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
629 gain;
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
630
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
631 * Having to run gcc with separate cpp and actual compilation steps with str2ind
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
632 sandwiched in between would be ugly and gross;
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
633
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
634 * Having to keep track of which str2ind.tab goes with which fw image and supply
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
635 the right table to our rvinterf tools would likely be a pita.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
636
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
637 So we shall stick with full ASCII string traces until and unless we run into an
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
638 actual (as opposed to hypothetical) problem with either fw image size or serial
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
639 interface load.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
640
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
641 RVTMUX command input
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
642 ====================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
643
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
644 RVTMUX is not just debug trace output: it is also possible for an external host
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
645 to send commands to the running fw via RVTMUX.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
646
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
647 Inside the fw RVTMUX input is handled by the RVT entity by way of a Nucleus
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
648 HISR. This HISR gets triggered when Rx bytes arrive at the designated UART,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
649 and it calls the UART driver to collect the input. RVT code running in this
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
650 HISR parses the message structure and figures out which fw component the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
651 incoming message is addressed to. Any fw component can register to receive
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
652 RVTMUX packets, and provides a callback function with this registration; this
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
653 callback function is called in the context of the HISR.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
654
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
655 In our current FC GSM fw there are two components that register to receive
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
656 external host commands via RVTMUX: ETM and GPF. ETM is described in my earlier
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
657 RVTMUX write-up. ETM is implemented as a Riviera SWE and has its own Nucleus
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
658 task; the callback function that gets called from the RVT HISR posts received
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
659 messages onto ETM's own queue drained by its task. The ETM task gets scheduled,
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
660 picks up the command posted to its queue, executes it, and sends a response
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
661 message back to the external host through RVT.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
662
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
663 Because all ETM commands funnel through ETM's queue and task, and that task
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
664 won't start looking at a new command until it finished handling the previous
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
665 one, all ETM commands and responses are in strict lock-step: it is not possible
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
666 to send two commands and have their responses come in out of order, and it makes
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
667 no sense to send another ETM command prior to receiving the response to the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
668 previous one. (But there can still be debug traces or other traffic intermixed
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
669 on RVTMUX in between an ETM command and the corresponding response!)
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
670
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
671 The other component that can receive external commands is GPF. GPF's test
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
672 interface can receive so-called "system primitives", which are ASCII string
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
673 commands parsed and acted upon by GPF, and also binary protocol stack
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
674 primitives. Remember how all entities in the G23M stack communicate by sending
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
675 messages to each other? Well, GPF's test interface allows such messages to be
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
676 injected externally as well, directed to any entity in the running fw. System
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
677 primitive commands can also be used to cause entities to send their outgoing
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
678 primitives to the test interface, either instead of or in addition to the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
679 originally intended recipient.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
680
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
681 Firmware subsetting
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
682 ===================
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
683
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
684 We have built our firmware up incrementally, piece by piece, starting from a
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
685 very small skeleton. As we added pieces working toward full GSM MS
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
686 functionality, the ability to build less functional fw images corresponding to
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
687 our earlier stages of development has been retained. Each piece we added is
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
688 "optional" from the viewpoint of our build system, even if it is absolutely
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
689 required for normal usage, and is enabled by the appropriate feature line in
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
690 build.conf.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
691
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
692 Our minimal baseline with absolutely no "features" enabled consists of:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
693
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
694 * Nucleus
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
695 * Riviera
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
696 * TI's basic drivers for GPIO, ABB etc
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
697 * RVTMUX on the UART port chosen by the user (RVTMUX_UART_port Bourne shell
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
698 variable in build.conf) and the UART driver for it
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
699 * FFS code operating on a fake FFS image in RAM
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
700
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
701 If one runs this minimal "firmware" on a Calypso device, one will see some
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
702 startup messages in RV trace format followed by a System Time trace every 20 s.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
703 This "firmware" can't do anything more, there is not even a way to command it
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
704 to power off or reboot.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
705
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
706 Working toward full GSM MS functionality, pieces can be added to this skeleton
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
707 in this order:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
708
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
709 * GPF
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
710 * L1
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
711 * G23M
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
712
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
713 feature gsm enables all of the above for normal usage; feature l1stand can be
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
714 used alternatively to build an L1 standalone image without G23M - we expect
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
715 that we may end up using a ramImage form of the latter for RF calibration on
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
716 our own Calypso hardware.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
717
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
718 ETM and various FFS configurations are orthogonal features to the choice of
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
719 core functionality level.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
720
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
721 Further reading
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
722 ===============
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
723
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
724 Believe it or not, some of the documentation that was written by the original
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
725 vendors of the software in question and which we've been able to locate turns
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
726 out to be fairly relevant and helpful, such that I recommend reading it.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
727
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
728 Documentation for Nucleus PLUS RTOS:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
729
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
730 ftp://ftp.ifctf.org/pub/embedded/Nucleus/nucleus_manuals.tar.bz2
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
731
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
732 Quite informative, and fits our version of Nucleus just fine.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
733
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
734 Riviera environment:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
735
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
736 ftp://ftp.ifctf.org/pub/GSM/Calypso/riviera_preso.pdf
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
737
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
738 It's in slide presentation form, not a detailed technical document, but
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
739 it covers a lot of points, and all that Riviera stuff described in the
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
740 preso *is* present in our fw for real, hence it should be considered
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
741 relevant.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
742
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
743 GPF documentation:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
744
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
745 http://scottn.us/downloads/peek/SW%20doc/frame_users_guide.pdf
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
746 http://scottn.us/downloads/peek/SW%20doc/vsipei_api.pdf
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
747
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
748 Very good reading, helped me understand GPF when I first reached this
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
749 part of firmware reintegration.
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
750
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
751 TCS3.x/LoCosto fw architecture:
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
752
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
753 http://scottn.us/downloads/peek/SW%20doc/TCS2_1_to_3_2_Migration_v0_8.pdf
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
754 ftp://ftp.ifctf.org/pub/GSM/LoCosto/LoCosto_Software_Architecture_Specification_Document.pdf
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
755
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
756 These TI docs focus mostly on how they changed the fw architecture from
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
757 their TCS2.x program (Calypso) to their newer TCS3.x (LoCosto), but one
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
758 can still get a little insight into the "old" TCS211 architecture they
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
759 were moving away from, which is the architecture I've adopted for
3ecd6054a7f7 doc/Firmware_Architecture: copied from freecalypso-sw tree, not updated yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
760 FreeCalypso.