sysTffs

NAME

sysTffs - BSP-specific TrueFFS library

SYNOPSIS

flFitInSocketWindow( ) - check if flash array fits in socket window
flDelayLoop( ) - consume the specified time
long int flFitInSocketWindow  
(long int chipSize, int interleaving, long int windowSize) 
void flDelayLoop (int cycles)

DESCRIPTION

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 four. 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:

INCLUDE_TL_NFTL

INCLUDE_TL_FTL

INCLUDE_TL_SSFDC

INCLUDE_MTD_I28F016

INCLUDE_MTD_I28F008

INCLUDE_MTD_I28F008_BAJA

INCLUDE_MTD_AMD

INCLUDE_MTD_CDSN

INCLUDE_MTD_DOC2

INCLUDE_MTD_CFISCS

INCLUDE_MTD_WAMD

INCLUDE_TFFS_BOOT_IMAGE

To exclude any of the modules mentioned above, edit sysTffs.c and undefine its associated symbolic constant.

INCLUDE FILES

flsocket.h, tffsDrv.h

SEE ALSO

tffsDrv tffsConfig