summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/board/pirelli_dpl10/init.c
diff options
context:
space:
mode:
authorMychaela Falconia <mychaela.falconia@gmail.com>2019-02-12 15:21:33 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-02-19 15:18:56 +0700
commit947369922990195bccb59cae88cccbd7eefac9c8 (patch)
tree12ae3f62f0c22adc90d9a69a89e8ba3b7e8e5dea /src/target/firmware/board/pirelli_dpl10/init.c
parentedabc799edcc893fcdef707ee861de9807dc78e7 (diff)
firmware/lib: introduce TIFFS filesystem support
All known TI GSM firmwares implement some kind of flash file system, or FFS. We call it TIFFS (Texas Instruments FFS) because it is TI's invention. TIFFS is a file system with a hierarchical directory tree structure, and with Unixy forward-slash-separated, case-sensitive pathnames; the semantics of "what is a file" and "what is a directory" are exactly the same as in UNIX; and TIFFS even supports symlinks, although that support is a little under-developed, and apparently no FFS symlinks were ever used in any production GSM device. Thus the FFS implemented in TI-based GSM devices (modems and "dumbphone" handsets) is really no different from, for example, JFFS2 in embedded Linux systems. The FFS in a GSM device typically stores two kinds of content: - Factory data: IMEI, RF calibration values, device make/model/revision ID strings etc. These files are expected to be programmed on the factory production line and not changed afterward. - Dynamic data written into the FFS in normal device operation: contacts, settings / preferences, call history, received SMS, etc. It should be noted that both Compal (Mot C1xx) and Foxconn (Pirelli DP-L10) vendors moved their vital per-unit factory data out of the FFS into their own ad hoc flash data structures, leaving their FFS only for less critical data. However, we do enable TIFFS access for them anyway. The location of TIFFS within the flash memory of a given GSM device is defined by the firmware design of that device, but is always some integral number of contiguous flash sectors. - On Motorola/Compal C139/140 phones, the FFS used by the original proprietary firmware occupies 5 sectors of 64 KiB each (320 KiB in total), starting at 0x370000. C11x/123 use smaller FFS configurations, whereas C155/156 seem to have switched to some other FFS format, different from our familiar TIFFS. - On the Pirelli DP-L10, the FFS used by the original proprietary firmware occupies 18 sectors of 256 KiB each (for 4.5 MiB in total), starting at the beginning of the 2nd flash chip select (0x02000000 in the ARM7 address space). - On FCDEV3B (FreeCalypso hardware), the FFS is located in the first 8 sectors (of 256 KiB each) in the 2nd flash chip select bank, which appears at 0x01800000 in the ARM7 address space. - On the GTA01/02 GSM modem, FFS occupies 7 sectors of 64 KiB each, starting at flash offset 0x380000. For more information, please refer to the FreeCalypso project documentation, from where this great contribution comes from. Please note that existing MediaTek targets most likely use different storage format as they have nothing from TI Calypso. Also, we don't (yet) know the location of TIFFS on SE J100i and Compal E99 targets. The TIFFS support is needed for the follow-up change, that implements reading of the factory RF calibration values. Tweaked (coding style changes) by Vadim Yanitskiy <axilirator@gmail.com> Change-Id: If6e212baeb10953129fb0d5253d263567f5e12d6 Related: OS#3582
Diffstat (limited to 'src/target/firmware/board/pirelli_dpl10/init.c')
-rw-r--r--src/target/firmware/board/pirelli_dpl10/init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/target/firmware/board/pirelli_dpl10/init.c b/src/target/firmware/board/pirelli_dpl10/init.c
index da233088..1af6e7c9 100644
--- a/src/target/firmware/board/pirelli_dpl10/init.c
+++ b/src/target/firmware/board/pirelli_dpl10/init.c
@@ -31,6 +31,7 @@
#include <keypad.h>
#include <console.h>
#include <flash/cfi_flash.h>
+#include <tiffs.h>
#include <calypso/irq.h>
#include <calypso/clock.h>
@@ -156,4 +157,7 @@ void board_init(int with_irq)
/* enable LEDB driver of Iota for keypad backlight */
twl3025_reg_write(AUXLED, 0x02);
+
+ /* Initialize TIFFS reader (18 sectors of 256 KiB each) */
+ tiffs_init(0x02000000, 0x40000, 18);
}