⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oren_exp.h

📁 M-System DOC(Disk on a Chip) Flash芯片的诊断工具, 可以从Flash芯片中获取特定的数据信息, 用于判断芯片当前的状态.
💻 H
📖 第 1 页 / 共 3 页
字号:
 *   None 0  - Sticky lock activated (asserted)         
 *   0       - Sticky lock not activated (not asserted)   
 ***********************************************************************/
#define OREN_Is_StickyLOCK_Asserted(volume) \
        (OREN_Read8BitReg(volume,OREN_OUTPUT_CONTROL_REG) & OREN_SOFTWRAE_LOCK_ENABLED)

/***********************************************************************
 * Name : OREN_IsDPS0_KeyInserted                                                 
 *   Checks if the key is correct for DPS_0
 *
 * Returns:        
 *   None 0  - Key is correct The protected area is not locked          
 *   0       - Key is not the right one - DPS is protected 
 ***********************************************************************/
#define OREN_IsDPS0_KeyInserted(volume) \
        (OREN_Read8BitReg(volume,OREN_DPS0_STATUS_REG) & OREN_KEY_OK)

/***********************************************************************
 * Name : OREN_IsDPS1_KeyInserted
 *   Checks if the key is correct for DPS_1
 *
 * Returns:        
 *   NOT_LOCKED  - Key is correct The protected area is not locked          
 *   LOCKED      - Key is not the right one - DPS is protected 
 ***********************************************************************/
#define OREN_IsDPS1_KeyInserted(volume) \
        (OREN_Read8BitReg(volume,OREN_DPS1_STATUS_REG) & OREN_KEY_OK)


/************************************************************************
 **********************  Exported functions   ***************************
 ************************************************************************/

/***********************************************************************
 *  Name: OREN_Write16BitReg                                                                                   
 *    Write to 16 bit register                                 
 *                                                                      
 * Parameters:
 *      flashPtr             : Pointer identifying drive                      
 *      wOffset              : The Offset of register from base address
 *      wValue               : The 16 bit value that should be written 
 *                             to this register.
 * Returns: Value of the 16 bit register
 * Note:    In big endian the word in RAM memory as:
 *          Offset 0 - Msb byte 
 *          Offset 1 - Lsb byte  
 *          But the OREN 16 bit registers work in Little endian 
 *          which means that the data is stored as follows 
 *          Offset 0 - Lsb byte 
 *          Offset 1 - Msb byte  
 *          In order to convert wValue from big to little endian format
 *          we convert it to LEushort format which store the word in little
 *          endian format and write it to ASIC
 ***********************************************************************/
#ifndef FL_BIG_ENDIAN
#define OREN_Write16BitReg(flashPtr,wOffset,wValue) \
  OREN_DirectWrite16BitReg (flashPtr,wOffset,wValue) 
#else
#define OREN_Write16BitReg(flashPtr,wOffset,wValue) \
  { \
    LEushort LEus_Temp ; \
    toLE2 (LEus_Temp,wValue) ; \
    OREN_DirectWrite16BitReg (flashPtr,wOffset,*(FLWord *)LEus_Temp) ; \
  } 
#endif

/***********************************************************************
 *  Name: OREN_Read16BitReg
 *    Read 16 bit register                                 
 *                                                                      
 * Parameters:
 *      flashPtr             : Pointer identifying drive                      
 *      wOffset              : The Offset of register from base address
 * Returns: Value of the 16 bit register
 ***********************************************************************/
FLWord  OREN_Read16BitReg(FLFlash *flashPtr,FLWord wOffset) ; 

/***********************************************************************
 * Name : OREN_isGoodBlock
 *   Determines if a block is a good block or a bad block 
 *
 * Parameters:                                                            
 *   volume             : Pointer identifying drive    
 *   wUnit              : The Block that we wants to check
 *   bOpFlags           : USE_BBT_CACHE - Checks if the page is already in the 
 *                        MTD_VARS->buffer->flData (because it was read on the last call)
 *                        and if it does => Read the buffer witout accessing the flash
 *                        ALWAYS_READ_FROM_FLASH - When you are not sure that the 
 *                        MTD_VARS->buffer->flData holds the bbt information           
 *                        use this option which forces the routine to read the bbt page   
 *  Note : When u want to use the isGoodBlock in a routine 
 *         It is the safest to call the first time with ALWAYS_READ_FROM_FLASH 
 *         and in the next calls to use USE_BBT_CACHE  
 *  Returns: 
 *    fIsGoodBlock :
 *           TRUE  => Block is a good block. 
 *           FALSE => Block is a bad block.
 *   flOK on success, any other value on failure.
 ************************************************************************/
FLStatus  OREN_isGoodBlock          (FLFlash *volume,FLDword dwUnit,FLByte bOpFlags,FLBoolean *fIsGoodBlock) ;

/************************************************************************
 * Name:  OREN_asicSetMode                                              *
 *                                                                      *
 * Set the controller (ASIC) operation mode.                            *
 *                                                                      *
 * Parameters:                                                          *
 *      volume     : 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.                     *
 ************************************************************************/
void  OREN_asicSetMode          (FLFlash *volume, FL_AsicModeE AsicMode) ; 

/***********************************************************************
 * Name:  OREN_asicSetBank  
 *
 * Select with which bank you want to work (with no write protection)                                     
 *                                                                      
 * Parameters:                                                          
 *      volume     : Pointer identifying drive                             
 *
 ***********************************************************************/
void  OREN_asicSetBank          (FLFlash *volume,FLByte Bank) ;

/***********************************************************************
 * Name : OREN_erase_Seq 
 *   Executes the Erase sequence that can erase 1..N units in parallel
 * 
 * Parameters:                                                          
 *       flashPtr           : Pointer identifying drive           
 *       wUnitNoPtr         : An array that holds the units that should 
 *                            be erased,each unit should be in a different plane 
 *                            (Number of planes is 1..4 so this array is mamximum 4)
 *       bNoOfPhyUnits      : Number of units that should be erased (1..4)
 *       dwOpFlags          : MTD_DO_NOT_WAIT  - Do not poll waiting for R/B# to be Ready      
 *                            Ori - not supported yet.
 *       bFloor             : The specified floor 
 *       bBank              : The specified bank 
 *  Returns: 
 *  ErrorStatus:
 *      flOK on success, any other value on failure
 ***********************************************************************/
FLStatus OREN_erase_Seq (FLFlash *flashPtr,PhyUnitType *wUnitNoPtr,
                         FLByte bNoOfPhyUnits,FLDword dwOpFlags,
						 FLByte bFloor,FLByte bBank) ;

/***********************************************************************
 *  Name : OREN_read_Seq  
 *   Executes the FLASH Read sequence command for reading one sector  
 *   
 * Parameters:     
 *       volume                : Pointer identifying drive           
 * readArgs inputs :
 *       PhyUnit            : An pointer to the physical unit that the sector needed to be read is in 
 *       phyPage            : The page that would be read  
 *       MainBuffer         : The Pointer to user buffer containing the data
 *                            that should be written to the sector main area.
 *       ExtraBuffer        : Pointer to user buffer containing the data
 *                              that should be written to the sector info area. 
 *       dwOpFlags          : MTD_DATA      - Read from  the main  area of the physical sector 
 *                              MTD_EXTRA     - Read from the extra area of the physical sector
 *                            MTD_RAW_MODE  - Read with fixed offset and with no EDC/ECC correction
 * readArgs_OUTPUTS:
 *       MaxBitErrors       : The Maximum of bit errors found (0..5)
 *       FreeSectorsFound   : Number of free sectors found (0 or 1) 
 *       NoOfSectorsPassed  : Number of Sectors read successfully (0 or 1)  
 *  ErrorStatus:
 *  NOTE : It assumkes that page size is 512 => PAGE_SIZE=FL_SECTOR_SIZE   
 ***********************************************************************/
FLStatus   OREN_read_Seq             (FLFlash *volume,OREN_OperationArgsStructPtr READ_ARGS);

/***********************************************************************
 * Name : OREN_pageProgram_Seq 
 *   Executes the Page program sequence command                                                                     
 *   This routine can write in parallel to 1..N pages (N = Number of planes)
 * 
 * Parameters:                                                          
 *       volume             : Pointer identifying drive           
 *       PhyUnits           : An array that holds the number of the 1..N 
 *                            physical units that needs to be written in parallel
 *       phyPage            : The page that would be programmed in all units in parallel
 *       noOfPhySectors     : Number of physical sectors that needs to be programmeed                              
 *                              (This is the size of the PhySectors array)
 *       MainBuffer         : The Pointer to user buffer containing the data
 *                            that should be written to the sector main area.
 *       ExtraBuffer        : Pointer to user buffer containing the data
 *                              that should be written to the sector info area. 
 *       VerifyWriteMode    : An indicator of the read after write mode.
 *                              FL_ON will force a read after write operation
 *                            while FL_OFF will disable it !!!. 
 *       dwOpFlags            : MTD_DATA        - Write to the main  area of the physical sector 
 *                              MTD_EXTRA       - Write to the extra area of the physical sector 
 *                            MTD_DO_NOT_WAIT - Return without waiting for the R/B# to be ready
 *                                              in the last parallel PageProgram command   
 *                                        
 *          
 *  Returns: 
 *  ErrorStatus:
 *     
 ***********************************************************************/
FLStatus    OREN_pageProgram_Seq      (FLFlash *volume,OREN_OperationArgsStructPtr WRITE_ARGS);

/***********************************************************************
 * Name : OREN_phyWriteEraseMark 
 *   Writes the erase mark to the physical unit  
 * 
 * Parameters:    
 *   Inputs:
 *     flashPtr   : The flash struct
 *     phyUnit    : The physical unit to check erase mark 
 *    dwEraseMark : The erase Mark that would be written 
 *    bFloor      : The specified floor 
 *   Outputs:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -