comparison services/ffs/cfgffs.c @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /******************************************************************************
2 * Flash File System (ffs)
3 * Idea, design and coding by Mads Meisner-Jensen, mmj@ti.com
4 *
5 * FFS configuration
6 *
7 * $Id: cfgffs.c 1.27 Fri, 19 Dec 2003 12:00:13 +0100 tsj $
8 *
9 ******************************************************************************/
10
11 #include "../../include/config.h"
12 #include "ffs.h"
13 #include "drv.h"
14 #include "ramffs.h"
15 #include <string.h>
16
17 #if FFS_IN_RAM
18
19 struct dev_s dev = {
20 .base = _RAMFFS_area,
21 .manufact = MANUFACT_RAM,
22 .blocksize = RAMFFS_BLKSIZE_BYTES,
23 .blocksize_ld = RAMFFS_BLKSIZE_LOG2,
24 .driver = FFS_DRIVER_RAM,
25 .numblocks = RAMFFS_NBLOCKS,
26 };
27
28 #elif CONFIG_MOKOFFS
29
30 struct dev_s dev = {
31 .base = (char *) 0x380000,
32 .manufact = MANUFACT_SAMSUNG,
33 .device = 0x22A0,
34 .blocksize = 0x10000,
35 .blocksize_ld = 16,
36 .driver = FFS_DRIVER_AMD,
37 .numblocks = 7,
38 };
39
40 #elif CONFIG_AFTERMARKET_FFS
41
42 /* see ../../cfgmagic/feature.aftermarket-ffs */
43
44 #if CONFIG_TARGET_COMPAL
45
46 struct dev_s dev = {
47 .base = (char *) (CONFIG_AFTERMARKET_FFS_START * 0x10000),
48 .manufact = MANUFACT_INTEL,
49 .blocksize = 0x10000,
50 .blocksize_ld = 16,
51 .driver = FFS_DRIVER_INTEL_SB,
52 .numblocks = CONFIG_AFTERMARKET_FFS_NBLOCKS,
53 };
54
55 #elif CONFIG_TARGET_PIRELLI || CONFIG_TARGET_FCFAM
56
57 struct dev_s dev = {
58 .base = (char *) FLASH2_BASE_ADDR +
59 CONFIG_AFTERMARKET_FFS_START * 0x40000,
60 .manufact = MANUFACT_AMD,
61 .blocksize = 0x40000,
62 .blocksize_ld = 18,
63 .driver = FFS_DRIVER_AMD,
64 .numblocks = CONFIG_AFTERMARKET_FFS_NBLOCKS,
65 };
66
67 #else
68
69 #error "Unknown target for CONFIG_AFTERMARKET_FFS"
70
71 #endif
72
73 #else
74
75 #error "No valid FFS configuration defined"
76
77 #endif
78
79 /******************************************************************************
80 * ffs_is_modify_valid()
81 ******************************************************************************/
82
83 // This is function to be implemented by the application programmer. It is
84 // called by ffs when a read-only object is about to be modified or
85 // removed. It should return zero if the operation should be
86 // disallowed. Returning non-zero means go ahead.
87 effs_t ffs_is_modifiable(const char *name)
88 {
89 // default is to allow any modification of read-only objects.
90
91 /*
92 * TI's original code (conditioned out below) disallowed changing the
93 * IMEI of a device. FreeCalypso follows a different philosophy:
94 * 100% user empowerment, hence no artificial obstacles to hacking.
95 */
96 #if 0
97 // example of how to disallow modifying a specific object...
98 if (strcmp("IMEI", &name[strlen(name) - 4]) == 0)
99 return 0;
100 #endif
101
102 return 1;
103 }