📄 flstruct.h
字号:
/* version to the other. */
/* */
/*---------------------------------------------------------*/
typedef struct {
/******************************************/
/* Fields that belong to the entire media */
/******************************************/
FLDword dwStructSize; /* INPUT - Size of the given structure */
FLDword dwTLType; /* See definitions in flflash.h */
FLDword dwFormatFlags; /* Format attributes for the entire media */
FLDword dwTrueFFSVersion; /* Version of OSAK used to format the media */
FLDword dwFlashTechnology; /* Flash technology supported properties */
FLDword dwType; /* Flash type */
FLDword dwSubType; /* Sub Flash type */
FLByte bMediaType; /* Controller family */
FLByte bNoOfFloors; /* Number of floors in the device */
FLByte bNoOfPlanes; /* Number of flash planes */
FLByte bNoOfBanks; /* Number of flash banks */
FLByte bDataBusWidth; /* Value of the IF_CFG (either 8 or 16 bits)*/
FLByte bSectorsPerPage; /* Number of sectors in a flash page */
FLByte bSharedSectors; /* The minimal number of logical sectors */
/* that might be affected by one another */
/* write operation. */
FLByte bFastAreaSharedSectors; /* Minimal number of sectors that can affect */
/* one another when written in fast mode. */
FLByte bMaxRelatedSectors; /* Max number of sectors that might share */
/* the same write operation or might be */
/* affected by each other write operation. */
FLDword dwIPLSize; /* Number of bytes of SRAM in the device */
FLByte bChangeableProtectedAreas; /* Number of protection areas capable */
/* of changing. */
FLByte btotalProtectedAreas; /* Total number of protection areas */
FLDword dwUnitsInFirstFloor; /* Number of units in the first floor */
FLDword dwUnitSize; /* Size of logical erasable unit */
FLDword dwMaxBadPercentage; /* Flash guaranteed worst bad blocks percentage */
FLByte bNoOfBinaryPartitions; /* Number of binary partition on the media */
FLByte bNoOfDiskPartitions; /* Number of disk partition on the media */
FLByte bBlockMultiplierBits; /* no of bits used to represent the time a */
/* flash logical unit fits inside in a TL */
/* erasable unit. */
FLByte dwPercentUsed; /* Percent of the media to be exported */
FLByte bHeaderUnits; /* Number of units reserved in the begining */
/* of each floor for the media header */
FLWord wHeaderLocation; /* Unit number where the header of the */
/* current floor resides. In case all floors*/
/* are requested, the value should indicate */
/* the location of the header in the first */
/* floor. */
FLByte bProgrammerNamePtr[4]; /* Programmer name */
FLByte bProgrammerVersionPtr[4]; /* Programmer version */
/************************************************/
/* Fields that belong to the specific partition */
/************************************************/
FLDword dwVirtualUnits; /* Virtual size exported by the translation layer */
/* Note some units are smaller then others */
FLDword dwFastUnits; /* Number of virtual units that are fast units */
FLDword dwFirstQuickMountUnit; /* First unit used for the quick mount data */
FLDword dwFirstUnit; /* First unit of the partition */
FLDword dwLastUnit; /* Last unit of the partition */
FLDword dwSpareUnits; /* Number of spare units requested by the user */
FLDword dwTransferUnits; /* Number of transfer units used for chaining */
FLDword dwPartitionFlags;/* See list above "Partition flags" */
FLDword dwNormalAreaUnitSize; /* Logical size of a TL normal unit */
FLDword dwFastAreaLogicalUnitSize; /* Logical size of a TL fast unit */
FLDword dwFastAreaVirtualFactor; /* Virtual unit factor between fast */
/* and normal area (power of 2) */
FLByte bMinSectorsForFolding; /* Number of sectors to be copied */
/* together in a folding operation */
FLByte bMinSectorsForNextWrite; /* For performance reasons the TL */
/* decide to reduce the above value */
FLByte bfastAreaMinSectorsForNextWrite; /* For performance reasons the TL */
/* decide to reduce the above value */
/******************************************/
/* Fields that are valid only after mount */
/******************************************/
FLDword dwUsedUnits; /* Number of used virtual chains */
FLDword dwFreeUnits; /* Number of currently free units */
FLByte bNeededFreeUnits; /* Minimal number of free units */
/* before folding */
FLDword dwUMDBBTSector; /* Location of latest UMDBBT sector */
} FLExtendedDiskInfo;
/* media types */
#define FL_NOT_DOC 0
#define FL_DOC 1
#define FL_MDOC 2
#define FL_DOC2000TSOP 3
#define FL_MDOCP_16 4
#define FL_MDOCP 5
#define FL_DOC_H1 6
#define FL_MDOC512_G3 7
#define FL_MDOC256_P3 8
#define FL_MDOC256_G3 9
#define FL_MDOC128_P3 10
#define FL_AMD_NOR 11
#define FL_SEIJA 12
#define FL_MDOC_G4 13
#define FL_MDOC_P4 14
#define FL_H3 15
/*Defines for flExtendedDiskInfo*/
#define SAFTL_ADVANCED_MATCHING 0x00100000L
#define SAFTL_QUICK_MOUNT 0x10000000L
#define FL_BDK_PARTITION 1
#define FL_DISK_PARTITION 0
#define FL_ALL_FLOORS 0xff
#define BINARY_SPARE_BLOCKS_SIGN "S4BB" /* Must be the same as BINARY_SPARE_BLOCKS_SIGN (FLFORMAT.H) */
#define FL_EXT_INFO_NO_SPEC_PART 0xFF /*Indicates SDK not to retrieve specific partition info*/
/**************************************************************************/
/* Structures and defines for Format routines: */
/**************************************************************************/
typedef FLStatus (*FLProgressCallback)(FLWord totalUnitsToFormat, FLWord totalUnitsFormattedSoFar);
/*----------------------------------------------*/
/* User BDTL Partition Format Parameters record */
/*----------------------------------------------*/
typedef struct {
FLDword length;
/* The size in bytes of the usable storage space. The size
rounded upwards to a multiplication of a block size.
The size of the last partition will calculated automatically,
but if the requested size is greater then the remaining space
an error code will be returned,. Requesting zero size for any
partition but the last will generate an flBadParameters status. */
FLDword fastAreaLength;
FLWord lengthType;
FLWord fastAreaLengthType;
FLWord fastAreaVirtualFactor; /* Should be set to FL_NORMAL_SPACING */
FLWord noOfSpareUnits;
/* BDTL needs at least one spare erase unit in order to function
as a read/write media. It is possible to specify more than one
spare unit, which takes more media space. The advantage of
specifying more than one spare unit is that if one of the flash
erase units becomes bad and un-erasable in the future, then one
of the spare units can replace it. In that case, a second spare
unit enables TrueFFS to continue its read/write functionality,
whereas if no second spare unit is available the media goes into
read-only mode. The standard value used is 3 */
FLDword BDTLFP_0_RFU_0; /* Reserved 0 */
FLDword BDTLFP_1_RFU_0; /* Reserved 0 */
FLDword BDTLFP_2_RFU_0; /* Reserved 0 */
FLDword BDTLFP_3_RFU_0; /* Reserved 0 */
FLByte protectionKey[8]; /* The key for the protection*/
FLByte protectionType;
/* PROTECTABLE - Can receive protection */
/* READ_PROTECTED - Protect against read operations */
/* WRITE_PROTECTED - Protect against write operations */
/* LOCK_ENABLED - Enables the hardware lock signal */
/* PROTECTABLE - This partition can be protected */
/* CHANGEABLE_PROTECTION - protection type can be changed */
/* The ratio between the real media size and the virtual size
reported to the file system when compression is active. */
} BDTLPartitionFormatParams3;
/*------------------------------------------------*/
/* User binary Partition Format Parameters record */
/*------------------------------------------------*/
typedef struct {
FLDword length; /* Required number of usable bytes (rounded to units) */
/* in the partition. */
FLWord lengthType; /* Must be FL_LENGTH_IN_BYTES */
FLByte sign[4]; /* signature of the binary partition to format.
The signature 0xFFFF FFFF is not a valid signature */
FLDword flags; /* TL_NORMAL_FORMAT / TL_SPL_FORMAT */
FLWord spareBlocks; /* Spare blocks for DBB support */
FLDword BDKFP_0_RFU_0; /* Reserved 0 */
FLDword BDKFP_1_RFU_0; /* Reserved 0 */
FLDword BDKFP_2_RFU_0; /* Reserved 0 */
FLDword BDKFP_3_RFU_0; /* Reserved 0 */
/* TL_NORMAL_FORMAT / TL_SPL_FORMAT */
FLByte protectionKey[8]; /* The key for the protection*/
FLByte protectionType;
/* PROTECTABLE - Can receive protection */
/* READ_PROTECTED - Protect against read operations */
/* WRITE_PROTECTED - Protect against write operations */
/* LOCK_ENABLED - Enables the hardware lock signal */
/* PROTECTABLE - This partition can be protected */
/* CHANGEABLE_PROTECTION - protection type can be changed */
} BinaryPartitionFormatParams3;
/*---------------------------------------------------------*/
/* User Format Parameters record for flFlashFormat routine */
/*---------------------------------------------------------*/
typedef struct {
/*****************************/
/* Device formatting section */
/*****************************/
FLByte percentUse;
/* NAND flash inherently contains some bad blocks. TrueFFS handles
* those blocks by managing a pool of spare blocks also called transfer
* units. This format parameter specifies the percentage of the media
* to use.
*
* Starting from TrueFFS 6.3.0 alpha 4 this field is no longer a
* configurable formatting argument. You must set this field to
* TL_DEFAULT_PERCENTAGE, letting TrueFFS to choose this value for you.
*/
FLByte noOfBDTLPartitions;
/* Indicates the number of Disk partition (1 to 4). */
FLByte noOfBinaryPartitions;
/* Indicates the number of binary partitions (up to 3). 0 will
* cause formatting with no binary partition. This value is ignored
* if TL_LEAVE_BINARY_AREA flag is set in the irFlags field the ioreq
*/
BDTLPartitionFormatParams3 FAR2* BDTLPartitionInfo;
/* BDTL partition information array */
BinaryPartitionFormatParams3 FAR2* binaryPartitionInfo;
/* Binary partition information array*/
/***********************************/
/* Special format features section */
/***********************************/
FLByte cascadedDeviceNo; /* Not used */
FLByte noOfCascadedDevices; /* Not used */
FLProgressCallback progressCallback;
/* Progress callback routine, will be called if not NULL.
The callback routine is called after erasing each unit,
and its parameters are the total number of erase units
to format and the number erased so far.
The callback routine returns a Status value. A value of
OK (0) allows formatting to continue. Any other value
will abort the formatting with the returned status code. */
/* In case the FL_REPORT_MOUNT_PROGRESS compilation flag is set the
routine will also report the mount progress of the mount routine
for each of the Disk partitions. A 0,0 return values will report
the end of a format status and of a mount operation */
FLDword FP_0_RFU_0; /* Reserved 0 */
FLDword FP_1_RFU_0; /* Reserved 0 */
/* Note the following section is not used by for DiskOnChips */
/*************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -