📄 m512_exp.h
字号:
* volume : The flash struct
* phyUnit : A pointer to the physical unit array
* bEraseMark : The erase Mark that was read
* bFloor : The floor
* Outputs:
* EraseCount : The Erase count of the physical erase unit
*
***********************************************************************/
FLStatus M512_phyGetEraseMark (FLFlash *volume,PhyUnitType *phyUnit,FLByte *bEraseMark,FLByte bFloor) ;
/***********************************************************************
* Name: M512_DPS_Read
* Read DPS data structure from DPS unit of the current floor
*
* Parameters:
* volume : Pointer identifying drive
* bDPS_No : The dps number
* bFlags : M512_COPY_0-Read the 1st copy
* M512_COPY_1-Read the 2nd copy
* M512_COPY_2-Read the 3rd copy
* M512_COPY_3-Read the 4th copy
* M512_FIRST_GOOD_COPY- Read the first good copy
* find the first one that is good.
* Returns:
* FLStatus : 0 on success, otherwise failed.
***********************************************************************/
FLStatus M512_DPS_Read (FLFlash *volume,DPS_StructPtr DPS_PTR,
FL_DPS_IndexE DPS_No,FLByte Flags,FLByte Floor);
/***********************************************************************
* Name: M512_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 M512_DPS_Write (FLFlash *volume,DPS_StructPtr DPS,
FL_DPS_IndexE DPS_No,FLByte Floor);
/************************************************************************
* Name: M512_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 M512_tryKey (FLFlash *volume,FLByte bDPS_No,FLByte FAR1* bKey,
FLByte bFloor);
/***********************************************************************
* Name: M512_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 M512_protectionKeyInsert(FLFlash *flashPtr,FLByte bDPS_No,FLByte FAR1* Key);
/********************************************************************************
* Name : M512_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 M512_phyDoc2Identify (FLFlash *volume) ;
/************************************************************************
* Name: M512_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 M512_docSearchForWindow (FLSocket *socket, FLDword dwLowAddress,
FLDword dwHighAddress);
/*----------------------------------------------------------------------*/
/* Name: M512_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 M512_docPlusFreeWindow(FLSocket * socket);
/***********************************************************************
* Name : M512_set_Fast_Mode_Seq
*
* Auxiliary routine for setting FAST mode sequence
*
* Parameters:
* flashPtr : Pointer identifying drive
* Returns:
* flOK : On success
* flSequanceError : On sequance error
***********************************************************************/
FLStatus M512_set_Fast_Mode_Seq (FLFlash *flashPtr) ;
/***********************************************************************
* Name : M512_set_ReliableMode_Seq
*
* Auxiliary routine for setting Reliable mode sequence
*
* Parameters:
* flashPtr : Pointer identifying drive
* Returns:
* flOK : On success
* flSequanceError : On sequance error
***********************************************************************/
FLStatus M512_set_ReliableMode_Seq (FLFlash *flashPtr);
/***********************************************************************
* Name : M512_reset_Seq
*
* Auxiliary routine for Reset
*
* Parameters:
* flashPtr : Pointer identifying drive
* Returns:
* flOK : On success
* flGeneralFailure : On sequance error that could not be fixed
* flSequanceError : On sequance error
* flTimedOut : Busy signal did not turn off
***********************************************************************/
FLStatus M512_reset_Seq (FLFlash *flashPtr);
/***********************************************************************
* Name : M512_Read8BitReg
* Read 8 bit register in two stages
* 1. Write the address to the M512_ADDRESS_REG
* 2. Read from the specified address (only important for debugging)
*
* Parameters:
* flashPtr: The flash struct.
* wOffset: The offset of the FLASH_DATA_REGISTER
*
* Returns: The value of this register
***********************************************************************/
FLByte M512_Read8BitReg(FLFlash *flashPtr,FLWord wOffset) ;
#endif /* _M512_EXP_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -