- /****************************************************************************
- ** Notice Copyright(c) 2001 LSI Logic Europe Ltd - All Rights Reserved
- **
- ** File Rev $Revision: /main/1.6_integration/1 $
- **
- ** Date $Date: 12-Feb-2003.14:12:41 $
- **
- ** Description Header for the commmon flash interface.
- **
- ****************************************************************************/
- #ifndef _CFI_H
- #define _CFI_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "gendef.h"
- /*
- **
- */
- #define CFI_SECTOR_PROTECTED (0x01)
- #define CFI_SECTOR_UNPROTECTED (0x00)
- /*
- ** Manufacturer Codes
- */
- #define CFI_MANUF_AMD (0x01)
- #define CFI_MANUF_FUJITSU (0x04)
- #define CFI_MANUF_INTEL (0x89)
- #define CFI_MANUF_SST (0xBF)
- #define CFI_MANUF_ST (0x20)
- #define CFI_MANUF_TOSHIBA (0x98)
- #define CFI_MANUF_SHARP (0xB0)
- #define CFI_DEVICE_AM29LV400BT (0x22B9)
- #define CFI_DEVICE_AM29LV400BB (0x22BA)
- #define CFI_DEVICE_AM29LV800BT (0x22DA)
- #define CFI_DEVICE_AM29LV800BB (0x225B)
- #define CFI_DEVICE_AM29LV160DT (0x22C4)
- #define CFI_DEVICE_AM29LV160DB (0x2249)
- #define CFI_DEVICE_AM29LV320DT (0x22F6)
- #define CFI_DEVICE_AM29LV320DB (0x22F9)
- #define CFI_DEVICE_AM29LV640DU (0x22D7)
- #define CFI_DEVICE_AM29DL322DT (0x2255)
- #define CFI_DEVICE_AM29DL322DB (0x2256)
- #define CFI_DEVICE_AM29DL323DT (0x2250)
- #define CFI_DEVICE_AM29DL323DB (0x2253)
- #define CFI_DEVICE_AM29DL324DT (0x225C)
- #define CFI_DEVICE_AM29DL324DB (0x225F)
- #define CFI_DEVICE_MBM29LV160TE (0x22C4)
- #define CFI_DEVICE_MBM29LV160BE (0x2249)
- #define CFI_DEVICE_MBM29DL32TF_BF (0x227E)
- #define CFI_DEVICE_28F800C3T (0x88C0)
- #define CFI_DEVICE_28F800C3B (0x88C1)
- #define CFI_DEVICE_28F160C3T (0x88C2)
- #define CFI_DEVICE_28F160C3B (0x88C3)
- #define CFI_DEVICE_28F320C3T (0x88C4)
- #define CFI_DEVICE_28F320C3B (0x88C5)
- #define CFI_DEVICE_28F640C3T (0x88CC)
- #define CFI_DEVICE_28F640C3B (0x88CD)
- #define CFI_DEVICE_28F128J3A (0x18)
- #define CFI_DEVICE_28F640J3A (0x17)
- #define CFI_DEVICE_28F320J3A (0x16)
- #define CFI_DEVICE_M29W160DT (0x22C4)
- #define CFI_DEVICE_M29W160DB (0x2249)
- #define CFI_DEVICE_M29W320DT (0x22CA)
- #define CFI_DEVICE_M29W320DB (0x22CB)
- #define CFI_DEVICE_M29W640FT (0x22ED)
- #define CFI_DEVICE_SST39xF200A (0x2789)
- #define CFI_DEVICE_SST39xF400A (0x2780)
- #define CFI_DEVICE_SST39xF800A (0x2781)
- #define CFI_DEVICE_SST39xF160 (0x2782)
- #define CFI_DEVICE_TC58FVT160 (0xC2)
- #define CFI_DEVICE_TC58FVB160 (0x43)
- #define CFI_DEVICE_TC58FVT321 (0x9A)
- #define CFI_DEVICE_TC58FVB321 (0x9C)
- #define CFI_DEVICE_TC58FVT641 (0x93)
- #define CFI_DEVICE_TC58FVB641 (0x95)
- #define CFI_DEVICE_LH28F800BJ (0xED)
- #define CFI_DEVICE_LH28F160BJ (0xE9)
- #define CFI_DEVICE_LH28F320BJ (0xE3)
- #define CFI_DEVICE_LH28F160S3 (0xD0)
- typedef struct S_CFIRomDevice T_CFIRomDevice;
- struct S_CFIRomDevice
- {
- UINT32 manufacturerID;
- UINT32 deviceID;
- UINT32 baseAddress;
- UINT32 romSize;
- UINT32 romBaseMask;
- UINT32 commandSet;
- UINT32 writeBufferDepth;
- UINT32 numSectors;
- UINT32 sectorSize[512];
- UINT32 sector[512];
- UINT32 sectorAddr[512];
- char *name;
- INT32 (*Busy)(T_CFIRomDevice *this);
- void (*Reset)(T_CFIRomDevice *this);
- void (*IDCodesEntry)(T_CFIRomDevice *this);
- INT32 (*EraseSector)(T_CFIRomDevice *this, UINT16 *targetAddress, UINT32 block);
- INT32 (*Program)(T_CFIRomDevice *this, UINT16 *targetAddress,
- UINT8 *sourceData, UINT32 numBytes);
- };
- typedef enum
- {
- CFI_BLOCKING,
- CFI_NON_BLOCKING
- }T_CFIBlockingCommand;
- INT32 CFIIdentify(UINT16 *intRomAddress, T_CFIRomDevice *romDevice);
- #ifdef __cplusplus
- }
- #endif
- #endif