view gsm-fw/cfgmagic/feature.pirhack-ffs @ 437:1d78af921a5a

os_mem_ir.c: os_PartitionCheck() done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 22 Jun 2014 21:01:32 +0000
parents 6e7410f7975c
children 042c178ebac5
line wrap: on
line source

# Concerning the FFS, there is one fundamental difference between the gtamodem
# and pirelli targets: whereas the content of Openmoko's modem FFS is directly
# fit for reuse by our fw (resulting from the phylogenetic proximity of the two
# firmwares), Pirelli's original FFS has the same format, but its content is so
# different that trying to reuse it would be more trouble than it is worth.
# (And Pirelli's FFS contains no IMEI or RF calibration data to boot!)
#
# Therefore, I (FC developer Space Falcon) have decided that when targeting the
# Pirelli, it would be better for us to start from our own blank FFS than to
# deal with the original.  However, because there is no single correct answer
# as to which region of the flash chip we should use (other than needing to be
# in the flash2 bank so we can use the more efficient multibank flash driver),
# this feature pirhack-ffs takes two required arguments: the number of the
# first flash2 sector to be used for the FFS and the total number of sectors
# to be used.  For example, this setting:
#
# feature pirhack-ffs 24 7
#
# will configure our GSM fw to put its FFS in the last 7 256 KiB sectors of the
# 2nd flash chip select, which coincidentally form an independent read/write
# bank, and are part of the flash2 region which appears to be "unused" by the
# original firmware.  Or you can use all of this "unused" area like this:
#
# feature pirhack-ffs 18 13
#
# The sum of the two numbers must not exceed 31, i.e., the end of our FFS must
# be at or before the end of the "large sectors" main part of flash2.
# Specifying feature pirhack-ffs 0 18 will make our FFS use the same sectors
# as the original, but attempting to reuse the original FFS without reformatting
# is NOT recommended or supported.

if [ $TARGET != pirelli ]
then
	echo \
	"Error: feature pirhack-ffs is applicable only to target pirelli" 1>&2
	exit 1
fi

if [ $# != 3 ]
then
	echo "feature pirhack-ffs: two arguments required" 1>&2
	exit 1
fi

FFS_IN_RAM=0
CONFIG_PIRHACK_FFS=1
CONFIG_PIRHACK_FFS_START=$2
CONFIG_PIRHACK_FFS_NBLOCKS=$3
CONFIG_FLASH_WRITE=1
export_to_c	CONFIG_PIRHACK_FFS
export_to_c	CONFIG_PIRHACK_FFS_START
export_to_c	CONFIG_PIRHACK_FFS_NBLOCKS
export_to_c	CONFIG_FLASH_WRITE