comparison gsm-fw/cfgmagic/feature.pirhack-ffs @ 269:6e7410f7975c

gsm-fw feature pirhack-ffs: require explicit selection of sectors to be used
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 06 Feb 2014 03:09:39 +0000
parents 4d706a4134b0
children 042c178ebac5
comparison
equal deleted inserted replaced
268:debdb5f926d8 269:6e7410f7975c
3 # fit for reuse by our fw (resulting from the phylogenetic proximity of the two 3 # fit for reuse by our fw (resulting from the phylogenetic proximity of the two
4 # firmwares), Pirelli's original FFS has the same format, but its content is so 4 # firmwares), Pirelli's original FFS has the same format, but its content is so
5 # different that trying to reuse it would be more trouble than it is worth. 5 # different that trying to reuse it would be more trouble than it is worth.
6 # (And Pirelli's FFS contains no IMEI or RF calibration data to boot!) 6 # (And Pirelli's FFS contains no IMEI or RF calibration data to boot!)
7 # 7 #
8 # Therefore, I (FC developer Michael Spacefalcon) have decided that when 8 # Therefore, I (FC developer Space Falcon) have decided that when targeting the
9 # targeting the Pirelli, it would be better for us to start from our own blank 9 # Pirelli, it would be better for us to start from our own blank FFS than to
10 # FFS than to deal with the original. This feature pirhack-ffs configures our 10 # deal with the original. However, because there is no single correct answer
11 # GSM fw to put its FFS in the last 7 256 KiB sectors of the 2nd flash chip 11 # as to which region of the flash chip we should use (other than needing to be
12 # select: these sectors form an independent read/write bank, and are not used 12 # in the flash2 bank so we can use the more efficient multibank flash driver),
13 # for FFS by Pirelli's fw, eliminating the possibility of accidental FFS 13 # this feature pirhack-ffs takes two required arguments: the number of the
14 # cross-contamination between the two very different firmwares on the same hw. 14 # first flash2 sector to be used for the FFS and the total number of sectors
15 # to be used. For example, this setting:
15 # 16 #
16 # If you want to use some other sectors for FC FFS on the Pirelli, invoke 17 # feature pirhack-ffs 24 7
17 # feature pirhack-ffs first, then change CONFIG_PIRHACK_FFS_START and 18 #
18 # CONFIG_PIRHACK_FFS_NBLOCKS to taste. 19 # will configure our GSM fw to put its FFS in the last 7 256 KiB sectors of the
20 # 2nd flash chip select, which coincidentally form an independent read/write
21 # bank, and are part of the flash2 region which appears to be "unused" by the
22 # original firmware. Or you can use all of this "unused" area like this:
23 #
24 # feature pirhack-ffs 18 13
25 #
26 # The sum of the two numbers must not exceed 31, i.e., the end of our FFS must
27 # be at or before the end of the "large sectors" main part of flash2.
28 # Specifying feature pirhack-ffs 0 18 will make our FFS use the same sectors
29 # as the original, but attempting to reuse the original FFS without reformatting
30 # is NOT recommended or supported.
19 31
20 if [ $TARGET != pirelli ] 32 if [ $TARGET != pirelli ]
21 then 33 then
22 echo \ 34 echo \
23 "Error: feature pirhack-ffs is applicable only to target pirelli" 1>&2 35 "Error: feature pirhack-ffs is applicable only to target pirelli" 1>&2
24 exit 1 36 exit 1
25 fi 37 fi
26 38
39 if [ $# != 3 ]
40 then
41 echo "feature pirhack-ffs: two arguments required" 1>&2
42 exit 1
43 fi
44
27 FFS_IN_RAM=0 45 FFS_IN_RAM=0
28 CONFIG_PIRHACK_FFS=1 46 CONFIG_PIRHACK_FFS=1
29 CONFIG_PIRHACK_FFS_START=24 47 CONFIG_PIRHACK_FFS_START=$2
30 CONFIG_PIRHACK_FFS_NBLOCKS=7 48 CONFIG_PIRHACK_FFS_NBLOCKS=$3
31 CONFIG_FLASH_WRITE=1 49 CONFIG_FLASH_WRITE=1
32 export_to_c CONFIG_PIRHACK_FFS 50 export_to_c CONFIG_PIRHACK_FFS
33 export_to_c CONFIG_PIRHACK_FFS_START 51 export_to_c CONFIG_PIRHACK_FFS_START
34 export_to_c CONFIG_PIRHACK_FFS_NBLOCKS 52 export_to_c CONFIG_PIRHACK_FFS_NBLOCKS
35 export_to_c CONFIG_FLASH_WRITE 53 export_to_c CONFIG_FLASH_WRITE