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

📄 davflash.h

📁 FDI Intel开发的FLASH文件系统,功能很强大
💻 H
字号:
/* Copyright (c) 1995-2002 Intel Corporation */
/* Intel Confidential                        */

/* ###########################################################################
###  FLASH
###
###  Module: davflash.h - Flash Include file for daVinci BIOS
###
###  $Workfile: davflash.h $
###  $Revision: 58 $
###  $NoKeywords: $
########################################################################### */

/*                                                               
 *****************************************************************
 * NOTICE OF LICENSE AGREEMENT                                    
 *                                                                
 * This code is provided by Intel Corp., and the use is governed  
 * under the terms of a license agreement. See license agreement  
 * for complete terms of license.                                 
 *                                                                
 * YOU MAY ONLY USE THE SOFTWARE WITH INTEL FLASH PRODUCTS.  YOUR 
 * USE OF THE SOFTWARE WITH ANY OTHER FLASH PRODUCTS IS EXPRESSLY 
 * PROHIBITED UNLESS AND UNTIL YOU APPLY FOR, AND ARE GRANTED IN  
 * INTEL'S SOLE DISCRETION, A SEPARATE WRITTEN SOFTWARE LICENSE   
 * FROM INTEL LICENSING ANY SUCH USE.                             
 *****************************************************************
 */
 

#ifndef __dav_flash_h  /* Sentry Header */
#define __dav_flash_h

#include "DavLib.h"

#if (DIRECT_ACCESS_VOLUME == TRUE)

#include "fdi_ext.h"
#include "fdi_err.h"

/*
#define FLASH_DISABLE_LEGACY
*/

/*### Global Declarations
#########################*/

typedef struct
{
   UINT32 FlashBase;     
   UINT32 TotalBlocks;   
   
   UINT32 UserFlashBase; 
   UINT32 UserTotalBlocks;
   
   UINT32 TotalChips;    
   UINT32 ChipSize;      
   UINT32 BlockSize;     
   UINT32 DeviceId;      
}  FLASH_Info, __FAR_ * FLASH_InfoPtr;

/*typedef FLASH_Info * FLASH_InfoPtr;*/



/* Flash Module Specific Error Codes */
typedef enum
{
   FLASH_VPPFail, /*= FLASH_BeginErrorList,*/
   FLASH_CmdSeqFail,
   FLASH_WriteFail,
   FLASH_EraseFail,
   FLASH_ReadError
} FLASH_Error;

/* macro to calculate the total
 * error codes associated with an interface.
 */
#define FLASH_TotalErrorCodes ((FLASH_ReadError - \
                                FLASH_VPPFail) + 1)

#define FLASH_PART_28F008COBRA    0xAA89
#define FLASH_PART_28F008FALCON   0xA289

#define FLASH_PART_FWH_2Mb        0xAF89
#define FLASH_PART_FWH_4Mb        0xAD89
#define FLASH_PART_FWH_8Mb        0xAC89

/*### Class File Support
##########################*/
extern SEM_MTX_ID  SEM_DAVReclLock;
extern SEM_ID      SEM_DAVReclRequest;
extern SEM_MTX_ID  SEM_DAVAPILock;


/* FDI_TryReclLock() allows FMM to check if it can lock Flash so it can 
   commence with reclaim.  If TRUE is returned, then DAV has exclusive 
   access for reclaiming and does not need to request a reclaim. If FALSE 
   is returned, then DAV must request permission to reclaim before
   proceeding. */
#define FDI_TryReclLock()    \
        (((SEM_MTX_TRY_WAIT(SEM_DAVReclLock))==ERR_NONE)?1:0)

/* FDI_ReclRequest() requests a reclaim and then waits for permission */
#define FDI_ReclRequest() \
        SEM_POST(SEM_DAVReclRequest);
        
#define FDI_ReclComplete()   \
        SEM_POST(SEM_DAVReclRequest);

/*### Global Functions        
#########################*/

ERR_CODE FLASH_InitRegion(UINT32  total_bytes);

#ifndef FLASH_DISABLE_LEGACY
/*  obsolete - provided for legacy support only.
 *  Use InitRegion for better init flow.
 */
ERR_CODE FLASH_GetDeviceInfo(FLASH_InfoPtr flash_info_ptr);

ERR_CODE FLASH_Initialize(FLASH_InfoPtr flash_info_ptr);
#endif

ERR_CODE FLASH_Exit(void);

ERR_CODE FLASH_EraseBlock(UINT32 addr32, BOOLEAN smart_erase);

ERR_CODE FLASH_WriteBuffer(UINT32    addr32,
                             UINT8_PTR buffer_ptr,
                             UINT32    byte_count);

ERR_CODE FLASH_ReadBuffer(UINT32    addr32,
                            UINT8_PTR buffer_ptr,
                            UINT32    byte_count);

ERR_CODE FLASH_CopyFlash(UINT32 src_addr32,
                           UINT32 dst_addr32,
                           UINT32 byte_count);

BOOLEAN    FLASH_IsBlockErased(UINT32 addr32);

BOOLEAN    FLASH_IsAreaErased(UINT32 start_addr, UINT32 end_addr);

int        FLASH_CheckBlockPresence(UINT32 flash_address);

ERR_CODE FLASH_Discover(FLASH_InfoPtr flash_info_ptr,
                          UINT32        top_of_flash,
                          int           max_flash_devices);

UINT16     FLASH_GetDeviceId(UINT32 flash_address);

ERR_CODE FLASH_CompatibilityCheck(void);

#endif /* DIRECT_ACCESS_VOLUME */

#endif /* __flash_h sentry header */


⌨️ 快捷键说明

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