VxWorks BSP Reference : ebony

sysTffs [ebony]

NAME

sysTffs [ebony] - Ebony BSP stub for TrueFFS Socket Component Driver

ROUTINES

flFitInSocketWindow( ) - check whether the flash array fits in the socket window
flDelayLoop( ) - consume the specified time

DESCRIPTION

This library must provide board-specific hardware access routines for TrueFFS. In effect, these routines comprise the socket component driver (or drivers) for your flash device. At socket registration time, TrueFFS stores the functions provided by 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, the only external functions are flFitInSocketWindow( ) and flDelayLoop( ), and you should never have to call them.

However, one of the most important functions defined in this file is neither referenced in an FLSocket structure, nor is it externally callable. This function is sysTffsInit( ) and it should only be called by TrueFFS. 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,BSP-specific helper routine that can be called externally. Internally, sysTffsFormat( ) calls tffsDevFormat( ) with a pointer to a FormatParams structure that is 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( ).

The function sysTffsFormat( ) is only provided when a Flash SIMM has to have the TrueFFS file system in some desired fraction of it. It is provided only for the purpose of simplifying the process of formatting a Flash part that that should be subdivided.

The Flash SIMM might also be referred to as RFA (Resident Flash Array) in the following text.

Example implentations of sysTffs.c can be found in the directory

    $(WIND_BASE)/target/src/drv/tffs/sockets

The files sds860-sysTffs.c and pc386-sysTffs.c have support for single and dual socketed PCMCIA devices as well if that might be useful to you. They both support multiple sockets.

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_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_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.
To exclude any of the modules mentioned above, edit sysTffs.c and undefine its associated symbolic constant.

INCLUDE FILES

flsocket.h, tffsDrv.h


ebony : Routines

flFitInSocketWindow( )

NAME

flFitInSocketWindow( ) - check whether the flash array fits in the socket window

SYNOPSIS

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 */
    )

DESCRIPTION

This routine checks whether the flash array fits in the socket window.

RETURNS

A chip size guaranteed to fit in the socket window.

SEE ALSO

sysTffs


ebony : Routines

flDelayLoop( )

NAME

flDelayLoop( ) - consume the specified time

SYNOPSIS

void flDelayLoop
    (
    int cycles
    )

DESCRIPTION

This routine delays for the specified time.

RETURNS

N/A

SEE ALSO

sysTffs