cfi.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:4k
源码类别:

DVD

开发平台:

C/C++

  1. /****************************************************************************
  2. ** Notice       Copyright(c) 2001 LSI Logic Europe Ltd - All Rights Reserved
  3. **
  4. ** File Rev     $Revision: /main/1.6_integration/1 $
  5. **
  6. ** Date         $Date: 12-Feb-2003.14:12:41 $
  7. ** 
  8. ** Description  Header for the commmon flash interface.
  9. **
  10. ****************************************************************************/
  11. #ifndef _CFI_H
  12. #define _CFI_H
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #include "gendef.h"
  17. /*
  18. ** 
  19. */
  20. #define CFI_SECTOR_PROTECTED   (0x01)
  21. #define CFI_SECTOR_UNPROTECTED (0x00)
  22. /*
  23. ** Manufacturer Codes
  24. */
  25. #define CFI_MANUF_AMD          (0x01)
  26. #define CFI_MANUF_FUJITSU      (0x04)
  27. #define CFI_MANUF_INTEL        (0x89)
  28. #define CFI_MANUF_SST          (0xBF)
  29. #define CFI_MANUF_ST           (0x20)
  30. #define CFI_MANUF_TOSHIBA      (0x98)
  31. #define CFI_MANUF_SHARP        (0xB0)
  32. #define CFI_DEVICE_AM29LV400BT (0x22B9)
  33. #define CFI_DEVICE_AM29LV400BB (0x22BA)
  34. #define CFI_DEVICE_AM29LV800BT (0x22DA)
  35. #define CFI_DEVICE_AM29LV800BB (0x225B)
  36. #define CFI_DEVICE_AM29LV160DT (0x22C4)
  37. #define CFI_DEVICE_AM29LV160DB (0x2249)
  38. #define CFI_DEVICE_AM29LV320DT (0x22F6)
  39. #define CFI_DEVICE_AM29LV320DB (0x22F9)
  40. #define CFI_DEVICE_AM29LV640DU (0x22D7)
  41. #define CFI_DEVICE_AM29DL322DT (0x2255)
  42. #define CFI_DEVICE_AM29DL322DB (0x2256)
  43. #define CFI_DEVICE_AM29DL323DT (0x2250)
  44. #define CFI_DEVICE_AM29DL323DB (0x2253)
  45. #define CFI_DEVICE_AM29DL324DT (0x225C)
  46. #define CFI_DEVICE_AM29DL324DB (0x225F)
  47. #define CFI_DEVICE_MBM29LV160TE (0x22C4)
  48. #define CFI_DEVICE_MBM29LV160BE (0x2249)
  49. #define CFI_DEVICE_MBM29DL32TF_BF (0x227E)
  50. #define CFI_DEVICE_28F800C3T (0x88C0)
  51. #define CFI_DEVICE_28F800C3B (0x88C1)
  52. #define CFI_DEVICE_28F160C3T (0x88C2)
  53. #define CFI_DEVICE_28F160C3B (0x88C3)
  54. #define CFI_DEVICE_28F320C3T (0x88C4)
  55. #define CFI_DEVICE_28F320C3B (0x88C5)
  56. #define CFI_DEVICE_28F640C3T (0x88CC)
  57. #define CFI_DEVICE_28F640C3B (0x88CD)
  58. #define CFI_DEVICE_28F128J3A (0x18)
  59. #define CFI_DEVICE_28F640J3A (0x17)
  60. #define CFI_DEVICE_28F320J3A (0x16)
  61. #define CFI_DEVICE_M29W160DT (0x22C4)
  62. #define CFI_DEVICE_M29W160DB (0x2249)
  63. #define CFI_DEVICE_M29W320DT (0x22CA)
  64. #define CFI_DEVICE_M29W320DB (0x22CB)
  65. #define CFI_DEVICE_M29W640FT (0x22ED)
  66. #define CFI_DEVICE_SST39xF200A (0x2789)
  67. #define CFI_DEVICE_SST39xF400A (0x2780)
  68. #define CFI_DEVICE_SST39xF800A (0x2781)
  69. #define CFI_DEVICE_SST39xF160 (0x2782)
  70. #define CFI_DEVICE_TC58FVT160 (0xC2)
  71. #define CFI_DEVICE_TC58FVB160 (0x43)
  72. #define CFI_DEVICE_TC58FVT321 (0x9A)
  73. #define CFI_DEVICE_TC58FVB321 (0x9C)
  74. #define CFI_DEVICE_TC58FVT641 (0x93)
  75. #define CFI_DEVICE_TC58FVB641 (0x95)
  76. #define CFI_DEVICE_LH28F800BJ (0xED)
  77. #define CFI_DEVICE_LH28F160BJ (0xE9)
  78. #define CFI_DEVICE_LH28F320BJ (0xE3)
  79. #define CFI_DEVICE_LH28F160S3 (0xD0)
  80. typedef struct S_CFIRomDevice T_CFIRomDevice;
  81. struct S_CFIRomDevice
  82. {
  83. UINT32 manufacturerID;
  84. UINT32 deviceID;
  85. UINT32 baseAddress;
  86. UINT32 romSize;
  87. UINT32 romBaseMask;
  88. UINT32 commandSet;
  89. UINT32 writeBufferDepth;
  90. UINT32 numSectors;
  91. UINT32 sectorSize[512];
  92. UINT32 sector[512];
  93. UINT32 sectorAddr[512];
  94. char   *name;
  95. INT32 (*Busy)(T_CFIRomDevice *this);
  96. void (*Reset)(T_CFIRomDevice *this);
  97. void (*IDCodesEntry)(T_CFIRomDevice *this);
  98. INT32 (*EraseSector)(T_CFIRomDevice *this, UINT16 *targetAddress, UINT32 block);
  99. INT32 (*Program)(T_CFIRomDevice *this, UINT16 *targetAddress,
  100.  UINT8 *sourceData, UINT32 numBytes);
  101. };
  102. typedef enum
  103. {
  104. CFI_BLOCKING,
  105. CFI_NON_BLOCKING
  106. }T_CFIBlockingCommand;
  107. INT32 CFIIdentify(UINT16 *intRomAddress, T_CFIRomDevice *romDevice);
  108. #ifdef __cplusplus
  109. }
  110. #endif
  111. #endif