📄 oren_exp.h
字号:
* EraseCount : The Erase count of the physical erase unit
*
***********************************************************************/
FLStatus OREN_phyWriteEraseMark (FLFlash *flashPtr,PhyUnitType phyUnit,FLByte bEraseMark,
FLByte bFloor,FLByte bBank) ;
/***********************************************************************
* Name : OREN_phyGetEraseCount
* Gets the Number of times a logical erase unit has been erased
*
* Parameters:
* Inputs:
* volume : The flash struct
* StartUnit : The physical unit to check erase count
* Outputs:
* EraseCount: The Erase count of the physical erase unit
*
***********************************************************************/
FLStatus OREN_phyGetEraseCount (FLFlash *volume,PhyUnitType phyUnit,FLDword *dwEraseCount) ;
/***********************************************************************
* Name : OREN_phyGetEraseMark
* Reads the erase mark from the physical unit
*
* Parameters:
* Inputs:
* flashPtr : The flash struct
* phyUnit : The physical unit to check erase mark
* bEraseMark : The erase Mark that was read
* bPage : The page offset in the unit
* bFloor : The floor
* bBank : The bank
* Outputs:
* EraseCount : The Erase count of the physical erase unit
***********************************************************************/
FLStatus OREN_phyGetEraseMark (FLFlash *flashPtr,PhyUnitType phyUnit,
FLByte FAR1 *bEraseMark,FLByte bPage,FLByte bFloor,FLByte bBank) ;
/***********************************************************************
* Name: OREN_DPS_Read
* Read DPS data structure from DPS unit of the current floor
*
* Parameters:
* volume : Pointer identifying drive
* bDPS_No : The dps number
* bFlags : OREN_COPY_0-Read the 1st copy
* OREN_COPY_1-Read the 2nd copy
* OREN_COPY_2-Read the 3rd copy
* OREN_COPY_3-Read the 4th copy
* OREN_FIRST_GOOD_COPY- Read the first good copy
* find the first one that is good.
* Returns:
* FLStatus : 0 on success, otherwise failed.
***********************************************************************/
FLStatus OREN_DPS_Read (FLFlash *volume,DPS_StructPtr DPS_PTR,
FL_DPS_IndexE DPS_No,FLByte Flags,FLByte Floor);
/***********************************************************************
* Name: OREN_DPS_Write
* Writes a new DPS to the flash
* It erases the main and redundency units , writes
* a new DPS struct
* Parameters:
* volume : Pointer identifying drive
* DPS_No : The dps number
* DPS_PTR : The DPS struct
* bFloor : The Asic FLOOR
* Returns:
* FLStatus : 0 on success, otherwise failed.
* Assumption : If SYS_INTLV=2 than the interleave would be written
* as 0
* INTLV_2_CASCADED always
***********************************************************************/
FLStatus OREN_DPS_Write (FLFlash *volume,DPS_StructPtr DPS,
FL_DPS_IndexE DPS_No,FLByte Floor);
/************************************************************************
* Name: OREN_tryKey
* Try to write the KEY to the DPS_0/DPS_ 1 KEY Register
*
* Parameters:
* volume : Pointer identifying drive
* bDPS_No : The DPS number 0/1
* bKey : The 8 bytes key
* bFloor : The floor in which the DPS is in
************************************************************************/
FLStatus OREN_tryKey (FLFlash *volume,FLByte bDPS_No,FLByte FAR1* bKey,
FLByte bFloor);
/***********************************************************************
* Name: OREN_protectionKeyInsert
* Sends protection key only to protected areas.
*
* Parameters:
* flashPtr - FLFlash struct
* bDPS_No : indicated which protection area to work on. 0 or 1.
* Key : An 8 FLByte long array containing the protection password.
* Notes
* 1. The key should be sent to all of the device's floors even if
* one of the floors indicated that the key did not fit.
* The key should not be sent to a floor that indicates that
* it's key was already inserted.
* This way allows us to open partition that might have different
* keys for different floors as a result of a bug or a power failure.
* 2. Before sending the given key the MTD will try and send "00000000"
* (Ascii) key.
***********************************************************************/
FLStatus OREN_protectionKeyInsert(FLFlash *flashPtr,FLByte bDPS_No,FLByte FAR1* Key);
/********************************************************************************
* Name : OREN_phyDoc2Identify
* This routine does the following
* 1. Initialization of volume->mtdVars pointer
* 2. Find the interleave & if_cfg
* 2. Hooking the correct access routines according to the flash interleave & IF_CFG
* 3. DOC init - Insert DOC into NORMAL mode.
* 4 Find board & bank properties
* - Find the system interleave 1/2
* - Find how many floors exist
* - Find how many banks are in each floor
* - Find how many banks are in the last floor
* - Find floor size
* 5. Find Logical Block properties
* - Find LogicalUnitsInBank
* - Find LogicalUnitsInFloor
* 6. Find Logical Sector Properties
* - Find SectorsInPage
* - Find SectorsInUnit
* - Find SectorsInLogicalUnit
* - Find SectorsInChip
* - Find SectorsInBank
* - Find SectorsInFloor
* 7. Update FLFLASH struct
* 8. Update pointers to MTD exported functions
*
* volume: The flash struct.
* Status:
* Assumptions : It assumes that all flashes are of the same kind (MAKER & CODE ID)
*******************************************************************************/
FLStatus OREN_phyDoc2Identify (FLFlash *volume) ;
/************************************************************************
* Name: OREN_docSearchForWindow *
* *
* The routine searches for DOC and if found it updates relevant *
* socket struct fields *
* *
* Parameters: *
* dwLowAddress : Low range of search *
* dwHighAddress: High range of search *
* *
* Returns: *
* FLStatus : 0 on success, otherwise failure *
* Note:This routine is used in the BDK only *
************************************************************************/
FLStatus OREN_docSearchForWindow (FLSocket *socket, FLDword dwLowAddress,
FLDword dwHighAddress);
/*----------------------------------------------------------------------*/
/* Name: OREN_docPlusFreeWindow */
/* */
/* Free any resources used for the DiskOnChip window */
/* */
/* Parameters: */
/* socket : Record used to store the sockets parameters */
/* */
/* Returns: None */
/* */
/* NOTE: This routine is used only by virtual memory systems in order */
/* to unmap the DiskOnChip window. */
/* */
/*----------------------------------------------------------------------*/
void OREN_docPlusFreeWindow(FLSocket * socket);
/************************************************************************
* Name: OREN_asicSetInNormalMode *
* *
* Set the controller (ASIC) In Normal mode *
* *
* Parameters: *
* flashPtr : Pointer identifying drive *
* mode : One of the modes below: *
* RESET_MODE = 0 *
* NORMAL_MODE = 1 *
* POWER_DOWN_MODE = 2 *
* *
* Note: The mode is common to all cascaded floors. *
************************************************************************/
FLStatus OREN_asicSetInNormalMode (FLFlash *flashPtr) ;
/***********************************************************************
* Name : OREN_download
* Forces a software download of the controller in all floors,
* the routine waits until download finishes & put the chip in normal
* mode.
*
* Parameters:
* flashPtr : The flash struct
* flashPtr->noOfFloors : No of floors in the device
* The routine return the following error codes:
* flOK : Success
* flBadDownload : Download failed or failed to identify the controller
*
***********************************************************************/
FLStatus OREN_download (FLFlash *flashPtr) ;
/***********************************************************************
* Name : OREN_completeOperation
* Completes the Erase flash operation
* 1. Operates the EraseCallBackPtr routine
***********************************************************************/
FLStatus OREN_completeOperation (FLFlash *flashPtr) ;
#endif /* _OREN_EXP_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -