VxWorks BSP Reference : wrSbc8260
sysTffs [wrSbc8260] - Wind River SBC8260 system-dependent TrueFFS library
flFitInSocketWindow( ) - check whether the flash array fits in the socket window
flDelayLoop( ) - consume the specified time
sysTffsFormat( ) - format the flash memory above an offset
This library provides board-specific hardware access routines for TrueFFS. In effect, these routines comprise the socket component driver (or drivers) for your flash device hardware. At socket registration time, TrueFFS stores pointers to the functions of this socket component driver in an FLSocket structure. When TrueFFS needs to access the flash device, it uses these functions.
Because this file is, for the most part, a device driver that exports its functionality by registering function pointers with TrueFFS, very few of the functions defined here are externally callable. For the record, these external functions are flFitInSocketWindow( ) and flDelayLoop( ). You should never have any need to call these functions.
However, one of the most import functions defined in this file is neither referenced in an FLSocket structure, nor is it externally callable. This function is sysTffsInit( ). TrueFFS calls this function at initialization time to register socket component drivers for all the flash devices attached to your target. It is this call to sysTffs( ) that results in assigning drive numbers to the flash devices on your target hardware. Drive numbers are assigned by the order in which the socket component drivers are registered. The first to be registered is drive 0, the second is drive 1, and so on up to 4. As shipped, TrueFFS supports up to five flash drives.
After registering socket component drivers for a flash device, you may format the flash medium even though there is not yet a block device driver associated with the flash (see the reference entry for the tffsDevCreate( ) routine). To format the flash medium for use with TrueFFS, call tffsDevFormat( ) or, for some BSPs, sysTffsFormat( ).
The sysTffsFormat( ) routine is an optional but BSP-specific externally callable helper function. Internally, it calls tffsDevFormat( ) with a pointer to a FormatParams structure initialized to values that leave a space on the flash device for a boot image. This space is outside the region managed by TrueFFS. This special region is necessary for boot images because the normal translation and wear-leveling services of TrueFFS are incompatible with the needs of the boot program and the boot image it relies upon. To write a boot image (or any other data) into this area, use tffsBootImagePut( ).
Finally, this file also contains define statements for symbolic constants that determine which MTDs, translation layer modules, and other utilities are ultimately included in TrueFFS. These defines are as follows:
To exclude any of the modules mentioned above, edit sysTffs.c and undefine its associated symbolic constant.
- INCLUDE_TL_NFTL
- To include the NAND-based translation layer module.
- INCLUDE_TL_FTL
- To include the NOR-based translation layer module.
- INCLUDE_TL_SSFDC
- To include the SSFDC-appropriate translation layer module.
- INCLUDE_MTD_I28F016
- For Intel 28f016 flash devices.
- INCLUDE_MTD_I28F008
- For Intel 28f008 flash devices.
- INCLUDE_MTD_I28F008_BAJA
- For Intel 28f008 flash devices on the Heurikon Baja 4700.
- INCLUDE_MTD_AMD
- For AMD, Fujitsu: 29F0{40,80,16} 8-bit flash devices.
- INCLUDE_MTD_CDSN
- For Toshiba, Samsung: NAND CDSN flash devices.
- INCLUDE_MTD_DOC2
- For Toshiba, Samsung: NAND DOC flash devices.
- INCLUDE_MTD_CFISCS
- For CFI/SCS flash devices.
- INCLUDE_MTD_WAMD
- For AMD, Fujitsu 29F0{40,80,16} 16-bit flash devices.
- INCLUDE_TFFS_BOOT_IMAGE
- To include tffsBootImagePut( ) in TrueFFS for Tornado.
The function sysTffsFormat( ) is provided so one might seasily format the Flash SIMM to have the TFFS file system in one half of it.
flsocket.h, tffsDrv.h
flFitInSocketWindow( ) - check whether the flash array fits in the socket window
long int flFitInSocketWindow ( long int chipSize, /* size of single physical chip in bytes */ int interleaving, /* flash chip interleaving (1,2,4 etc) */ long int windowSize /* socket window size in bytes */ )
This routine checks whether the flash array fits in the socket window.
A chip size guaranteed to fit in the socket window.
flDelayLoop( ) - consume the specified time
void flDelayLoop ( int cycles )
This routine consumes the specified time.
N/A
sysTffsFormat( ) - format the flash memory above an offset
STATUS sysTffsFormat (void)
This routine formats the flash memory. Because this function defines the symbolic constant, HALF_FORMAT, the lower half of the specified flash memory is left unformatted. If the lower half of the flash memory was previously formated by TrueFFS, and you are trying to format the upper half, you need to erase the lower half of the flash memory before you format the upper half. To do this, you could use:
tffsRawio(0, 3, 0, 8)The first argument in the tffsRawio( ) command shown above is the TrueFFS drive number, 0. The second argument, 3, is the function number (also known as TFFS_PHYSICAL_ERASE). The third argument, 0, specifies the unit number of the first erase unit you want to erase. The fourth argument, 8, specifies how many erase units you want to erase.
OK, or ERROR if it fails.