📄 defs.h
字号:
#define CUSTOMER_ID_LEN 4
#define UNIQUE_ID_LEN 16
/* BBT block types */
#define BBT_GOOD_UNIT 0xff
#define BBT_UNMARKED_BAD_UNIT 0xf0
#define BBT_UNAVAIL_UNIT 0x1
#define BBT_BAD_UNIT 0x0
/* Unmarked bad blocks types */
#define FL_BLOCK_IS_MARKED_AS_UNERASABLE 0x55
#define FL_BLOCK_IS_MARKED_AS_UNWRITABLE 0x22
#define FL_BLOCK_IS_MARKED_AS_UNREADABLE 0x88
#define FL_BLOCK_IS_MARKED_AS_GOOD 0xff
#define FL_BLOCK_IS_MARKED_AS_NEED_ERASE 0xfe
#define FL_MAX_BIT_DISTANCE_DBB 0x20
/* Flag bit values */
#define SUSPEND_FOR_WRITE 1 /* MTD provides suspend for write */
#define NFTL_ENABLED 2 /* Flash can run NFTL */
#define INFTL_ENABLED 4 /* Flash can run INFTL */
#define EXTERNAL_EPROM 8 /* Can support external eprom */
#define SAFTL_ENABLED 0x10 /* Flash can run SAFTL */
/* Flash Technology types */
#define FL_SUPPORT_MLC 0x01
#define FL_SUPPORT_RELIABLE 0x02
#define FL_SUPPORT_FAST 0x04
#define FL_SUPPORT_NO_MATCHING 0x08
#define FL_SUPPORT_WRITE_CACHE 0x10
#define FL_2K_ADDRESS_SPACE 0x20
#define FL_SUPPORT_SEQUENTIAL_READ 0x40
/* Bus types */
#define FL_SRAM_MODE 0 /* Data bus and Address bus are diffrent buses */
#define FL_MUX_MODE 1 /* Data and Address buses are multiplexed on the same bus */
#define FL_LPC_MODE 2 /* Data and Address buses are both using the LPC bus */
#define FL_ICP_MODE 3
/* Debugging flags */
#define DEBUG_ERASE_OPERATION_ENTER 0 /* Before start of an erase operation */
#define DEBUG_ERASE_OPERATION_EXIT 3 /* After end of erase operation */
#define DEBUG_WRITE_OPERATION_ENTER 1 /* Before start of an write operation */
#define DEBUG_WRITE_OPERATION_EXIT 4 /* After end of write operation */
#define DEBUG_READ_OPERATION 2 /* Before read operation */
#define DEBUG_INIT_ENDED 5 /* Variables are initialized */
#define DEBUG_EXIT_CALLED 6 /* Variables are not initialized */
#define DEBUG_FORMAT_OPERATION_ENTER1 7 /* Before start format - 2 calls are */
#define DEBUG_FORMAT_OPERATION_ENTER2 8 /* required 2 pass 2 parameters. */
#define DEBUG_FORMAT_OPERATION_EXIT 9 /* After end format operation */
#define DEBUG_UNFORMAT_OPERATION_ENTER 10 /* Before start unformat operation */
#define DEBUG_UNFORMAT_OPERATION_EXIT 11 /* After end unformat operation */
#define DEBUG_ERASEBD_OPERATION_ENTER 12 /* Before start ERASE BD operation */
#define DEBUG_ERASEBD_OPERATION_EXIT 13 /* After end ERASE BD operation */
#define DEBUG_IS_GOOD_BLOCK 255 /* Called by MTD to check block */
/* prepareForPowerChanges routine flags */
#define FL_PREPARE_FOR_SUSPEND 2
/*************************************/
/* DMA type flags - FL_DMA_CONFIG */
/*************************************/
/* Note: DMA_Params_S is defined in flsystyp.h */
#define DMA_OPEN_CHANNEL 0
#define DMA_CONFIG_TRANSACTION 1
#define DMA_FREE_CHANNEL 2
#define DMA_WAIT_FOR_TRANSACTION_END 3
/****************************/
/* Special services API */
/****************************/
/*** MTD Soecial services values ***/
#define FL_DMA_WITHOUT_ECC 0x20
#define FL_DMA_WITH_ECC 0
/* Flash array identification structure */
typedef struct tFlash FLFlash; /* Forward definition */
/*=============================================================*/
/*=============================================================*/
/* from _flflash.h */
#define M512_SUBTYPE_G3 0x00
#define M512_SUBTYPE_G3_LP 0x01
#define H1_SUBTYPE_TSB_512MB 0x00
#define H1_SUBTYPE_SAM_256MB 0x01
#define H1_SUBTYPE_H_256MB 0x02
#define H1_SUBTYPE_H_512MB 0x03
#define H1_SUBTYPE_H_1GB 0x04
#define H1_SUBTYPE_H_2GB 0x05
/* The following are flags for the protection set routine */
#define DO_NOT_COMMIT_PROTECTION 0 /* The new values will take affect only after reset */
#define COMMIT_PROTECTION 1 /* The new values will take affect immediately */
#define MTD_ON_DPS_ONLY 2 /* The new protection will be placed only on the DPS */
#define MTD_READ_KEY 4 /* Report the key that is being used */
struct tFlash {
FLBoolean wasIdentified;
FlashType type;
FlashType subType;
FLByte mediaType;
FLDword busAccessType;
FLByte if_cfg;
FLByte bBusType;
FLWord flags;
void * mtdVars;
FLSocket * socket;
NDOC2window win;
void (*setPowerOnCallback)(FLFlash *);
FLStatus (*flashRead)(FLFlash *);
FLStatus (*setCallBack)(FLFlash *);
FLStatus (*dismount)(FLFlash *);
FLStatus (*prepareForPowerChanges) (FLFlash *,FLByte) ;
FLStatus (*clearCallBack)(FLFlash *);
FLStatus (*enterDeepPowerDownMode)(FLFlash *,FLWord state);
#ifndef FL_NO_USE_FUNC
FLMemWindowSize FAR1* memWindowSize; /* Doc memory window size */
FLMemRead FAR1* memRead; /* Doc memory read routine */
FLMemWrite FAR1* memWrite; /* Doc memory write routine */
FLMemSet FAR1* memSet; /* Doc memory set routine */
FLMemRead8bit FAR1* memRead8bit; /* Doc memory 8 bit read routine */
FLMemWrite8bit FAR1* memWrite8bit; /* Doc memory 8 bit write routine */
FLMemRead16bit FAR1* memRead16bit; /* Doc memory 16 bit read routine */
FLMemWrite16bit FAR1* memWrite16bit; /* Doc memory 16 bit write routine */
FLMemSetGetMode FAR1* memSetGetMode; /* Interleave change event - */
/* call back to plant new routines */
#endif /* FL_NO_USE_FUNC */
};
extern void docSocketInit(FLSocket * pVol);
/* Returns specific flash structure of the socket */
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
extern TFFS_DLL_API FLFlash * NAMING_CONVENTION flFlashOf(FLByte volNo);
/* See interface documentation of functions in flflash.c */
extern FLStatus flIdentifyFlash(FLSocket *socket, FLFlash *flash);
extern FLByte flHandleConversionTable[FL_SOCKETS][FL_MAX_TL_PARTITIONS];
#ifdef __cplusplus
}
#endif /* __cplusplus */
/*=============================================================*/
/*=============================================================*/
/*=== from nandefs.h */
/* Flash IDs*/
#define KM29N16000_FLASH 0xec64
#define KM29N32000_FLASH 0xece5
#define KM29V64000_FLASH 0xece6
#define KM29V128000_FLASH 0xec73
#define KM29V256000_FLASH 0xec75
#define KM29V512000_FLASH 0xec76
#define KM29V1024000_FLASH 0xec79
#define K9F1G08U0M_FLASH 0xecc1
#define K9F2G08U0M_FLASH 0xecda
#define K9F4G08U0M_FLASH 0xecdc
#define NM29N16_FLASH 0x8f64
#define NM29N32_FLASH 0x8fe5
#define NM29N64_FLASH 0x8fe6
#define TC5816_FLASH 0x9864
#define TC5832_FLASH 0x98e5
#define TC5864_FLASH 0x98e6
#define TC58128_FLASH 0x9873
#define TC58256_FLASH 0x9875
#define TC58512_FLASH 0x9876
#define TC581024_FLASH 0x9877
#define TC58100FT 0x9879
#define TC58010FT 0x9879
#define KF2816U0C 0xEC53
#define KF2832U0C 0xEC55
#define TC58020FT 0x98DA
#define TC58NVG0S3AFT05 0x98F1
#define TC58NVG1S3AFT05 0x98DA
#define TC58NVG2D4BFT00 0x98DC
#define HY27UF162G2M 0xADCA
#define HY27UT084G2M 0xADDC
/*=============================================================*/
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
FLStatus _flInit(void);
void flInitGlobalVars(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /*_DEFS_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -