📄 _flflash.h
字号:
/* The default routine maps by socket mapping, and is suitable for all */
/* NOR Flash. */
/* NAND or other type Flash should use map-through-copy emulation: Read */
/* a block of Flash to an internal buffer and return a pointer to that */
/* buffer. */
/* */
/* Parameters: */
/* vol : Pointer identifying drive */
/* address : Card address to map */
/* length : Length to map */
/* */
/* Returns: */
/* Pointer to required card address */
/*----------------------------------------------------------------------*/
void FAR0 * (*map)(FLFlash *, CardAddress, int);
/*----------------------------------------------------------------------*/
/* f l a s h . s e t P o w e r O n C a l l b a c k */
/* */
/* Register power on callback routine. Default: no routine is */
/* registered. */
/* */
/* Parameters: */
/* vol : Pointer identifying drive */
/* */
/*----------------------------------------------------------------------*/
void (*setPowerOnCallback)(FLFlash *);
/*----------------------------------------------------------------------*/
/* f l a s h R e a d */
/* */
/* MTD specific Flash read routine */
/* */
/* The default routine reads by copying from a mapped window, and is */
/* suitable for all NOR Flash. */
/* */
/* Parameters: */
/* flash : Pointer identifying drive */
/* */
/* The routine uses the following inputs: */
/* flash.args.noOfSectors : The number of sectors to read. */
/* flash.args.startSector : First sector to start reading from */
/* flash.args.readMainBuf : Pointer to user buffer */
/* flash.args.extraBuf : Pointer to user buffer */
/* flash.args.opFlags : Available flags are: */
/* MTD_DATA : Read from sector info area to mainBuf. */
/* MTD_EXTRA : Read from sector extra area to extraBuf. */
/* MTD_FAST_MODE : Save data using fast mode. */
/* MTD_REL_MODE : Save data using relaible mode. */
/* MTD_SW_EDC : Read data while applying the SW EDC. */
/* MTD_NO_EDC : Disable EDC/ECC. */
/* */
/* The routine sets the following outputs: */
/* flash.args.maxBitsError : */
/* flash.args.freeSectorsFound : */
/* flash.args.noOfSectorsPassed: */
/* The routine return the following error codes: */
/* flOK : Success */
/* flDataError : At least one of the sectors has an */
/* unrecoverable EDC error unless only the extra */
/* area was requested and the sector is "free". */
/* A sector is considered "free" if it has 2 or */
/* less '0' bits */
/* flHWProtection : A protection violation has occurred while */
/* attempting to reading one of the sectors. */
/* flTimedOut : The maximum delay time has expired, but the */
/* device is not ready yet. */
/* */
/* */
/*----------------------------------------------------------------------*/
FLStatus (*flashRead)(FLFlash *);
/*----------------------------------------------------------------------*/
/* f l a s h W r i t e */
/* */
/* MTD specific Flash write routine */
/* */
/* The default routine returns a write-protect error. */
/* */
/* Parameters: */
/* flash : Pointer identifying drive */
/* */
/* The routine uses the following inputs: */
/* flash.args.noOfSectors : The number of sectors to read. */
/* flash.args.startSector : First sector to start reading from */
/* flash.args.writeMainBuf: Pointer to user buffer */
/* flash.args.extraBuf : Pointer to user buffer */
/* flash.args.verifyWriteMode: An indicator of the read after */
/* write mode. FL_ON will force a */
/* read after write operation while */
/* FL_OFF will disable it. */
/* flash.args.delayedStatus : A pointer to where the output of */
/* the operation will be returned, */
/* when adding the MTD_DO_NOT_WAIT */
/* flag. */
/* flash.args.opFlags : Available flags are: */
/* MTD_DATA : Write to sector info area to mainBuf. */
/* MTD_EXTRA : Write to sector extra area to extraBuf. */
/* MTD_FAST_MODE : Save data using fast mode. */
/* MTD_REL_MODE : Save data using relaible mode. */
/* MTD_SW_EDC : Write data while applying the SW EDC. */
/* MTD_DO_NOT_WAIT : Forces the MTD to return without polling */
/* the last sector write operation. */
/* */
/* The routine sets the following outputs: */
/* flash.args.maxBitsError : Returns maximum bit error found */
/* in read after write operation */
/* flash.args.noOfSectorsPassed: The number of sectors that were */
/* successfully written. */
/* */
/* The routine return the following error codes: */
/* Returns: */
/* flOK : Success */
/* flWriteFault : The write operation failed to one of the */
/* required sectors. */
/* flHWProtection : A protection violation has occurred while */
/* attempting to write to one of the sectors.. */
/* flTimedOut : The maximum delay time has expired, but the */
/* device is not ready yet. */
/* */
/*----------------------------------------------------------------------*/
FLStatus (*flashWrite)(FLFlash *);
/*----------------------------------------------------------------------*/
/* f l a s h E r a s e */
/* */
/* Erase one or more contiguous Flash erasable blocks */
/* */
/* The default routine returns a write-protect error. */
/* */
/* Parameters: */
/* flash : Pointer identifying drive */
/* */
/* The routine uses the following inputs: */
/* flash.args.noOfUnits */
/* flash.args.startUnit */
/* flash.args.delayedStatus */
/* flash.args.opFlags : Available flags are: */
/* MTD_FAST_MODE : Save data using fast mode. */
/* MTD_REL_MODE : Save data using relaible mode. */
/* MTD_DO_NOT_WAIT : Forces the MTD to return without polling */
/* the last erase unit operation. */
/* MTD_ADD_ERASE_MARK : The MTD should add the erase mark after */
/* the completion of the erase operation */
/* Disable EDC/ECC. */
/* */
/* The routine sets the following outputs: */
/* flash.args.noOfUnitsPassed: The number of logical units that */
/* have been successfully erased. */
/* */
/* The routine return the following error codes: */
/* flOK : Success */
/* flWriteFault : The erase operation failed to one of the */
/* required blocks. */
/* flHWProtection : protection violation has occurred due to the */
/* erasing of one of the required blocks. */
/* */
/*----------------------------------------------------------------------*/
FLStatus (*flashErase)(FLFlash *);
/*----------------------------------------------------------------------*/
/* f l a s h . d e f i n e P a r t i t i o n s */
/* */
/* Instruct the MTD how the TL plans to partition the media. This */
/* routine is used both to initialize the internal MTD logical to */
/* physical addressing algorithm and for checking if the media has */
/* enough good blocks for the wanted division. */
/* */
/* Parameters: */
/* flash : Pointer identifying drive */
/* */
/* The routine uses the following inputs: */
/* flash.args.noOfPartitions :Indicate no of partition in media */
/* flash.args.noOfSkippedUnits:Indicate the no of good logical */
/* units at the begining of each */
/* floor that are saved for TL's */
/* media header. */
/* flash.args.noOfUnitsArray :This array indicates the number */
/* of logical good units found in */
/* each of the media partitions. */
/* Only the first noOfPartitions */
/* cells will be used. */
/* flash.args.partitionsFlags :This array indicates the format */
/* type of the indicated partition. */
/* values are MTD_SM-simple matching*/
/* MTD_AM - addvanced matching */
/* */
/* The routine sets the following outputs: */
/* flash.args.unusedBlocks :The number of logical units that */
/* are not belong to any partition. */
/* If negative number returned, */
/* there are units missing. */
/* flash.args.noOfFirstUnitsArray:This array indicates the first */
/* logical unit of each partition. */
/* Only the first noOfPartitions */
/* cells will be used. */
/* */
/* The routine return the following error codes: */
/* flOK : Success */
/* flBadBBT : Could not read the BBT. */
/* */
/*----------------------------------------------------------------------*/
FLStatus (*definePartitions)(FLFlash *);
/*----------------------------------------------------------------------*/
/* f l a s h . r e a d B B T */
/* */
/* MTD specific Flash routine returning the media units status */
/* Note that a unit can contain more then 1 erase block */
/* */
/* No default routine is implemented for this routine. */
/* */
/* Parameters: */
/* flash : Pointer identifying drive */
/* */
/* The routine uses the following inputs: */
/* flash.args.readMainBuf : Pointer to user buffer where Bad */
/* blocks table should be written. */
/* flash.args.startUnit : The first logical unitnumber to */
/* start the BBT report */
/* flash.args.noOfUnits : How many units to report. */
/* */
/* The routine sets the following outputs: */
/* For each logical unit starting from startUnit and ending at */
/* noOfUnits a byte specify one of the followinf values: */
/* BBT_GOOD_UNIT - Good logical unit. */
/* BBT_BAD_UNIT - Bad logical unit. */
/* BBT_UNAVAIL_UNIT - unit is used by the controller (i.e IPL, OTP)*/
/* */
/* */
/* */
/* The routine return the following error codes: */
/* flOK : Success */
/* flBadBBT : Could not read the BBT. */
/* */
/*----------------------------------------------------------------------*/
FLStatus (*readBBT)(FLFlash *);
FLStatus (*getEraseCount)(FLFlash *);
FLStatus (*getEraseMark)(FLFlash *);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -