Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

222 lines
9.3 KiB

  1. /*
  2. * $Log: V:/Flite/archives/TrueFFS5/Src/DISKONC.H_V $
  3. *
  4. * Rev 1.8 Jan 17 2002 22:58:12 oris
  5. * Removed EXTRA_LEN
  6. *
  7. * Rev 1.7 Nov 08 2001 10:44:40 oris
  8. * Added BBT_MAX_DISTANCE definition
  9. *
  10. * Rev 1.6 Jul 13 2001 00:59:52 oris
  11. * Moved VERIFY_WRITE and VERIFY_ERASE compilation flag to flcustom.h.
  12. * Added file header.
  13. *
  14. */
  15. /*******************************************************************
  16. *
  17. * DESCRIPTION: basic mtd functions for the DiskOnChip 2000 family
  18. *
  19. * AUTHOR: Dimitry Shmidt
  20. *
  21. * HISTORY: OSAK 1.23
  22. *
  23. *******************************************************************/
  24. /***********************************************************************************/
  25. /* M-Systems Confidential */
  26. /* Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2001 */
  27. /* All Rights Reserved */
  28. /***********************************************************************************/
  29. /* NOTICE OF M-SYSTEMS OEM */
  30. /* SOFTWARE LICENSE AGREEMENT */
  31. /* */
  32. /* THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE */
  33. /* AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT */
  34. /* FOR THE SPECIFIC TERMS AND CONDITIONS OF USE, */
  35. /* OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE: */
  36. /* E-MAIL = [email protected] */
  37. /***********************************************************************************/
  38. #ifndef DISKONC_H
  39. #define DISKONC_H
  40. #include "docsys.h"
  41. #ifndef MTD_STANDALONE
  42. extern FLBoolean checkWinForDOC(unsigned driveNo, NDOC2window memWinPtr);
  43. #endif /* MTD_STANDALONE */
  44. /*���������������������������.*/
  45. /* Feature list */
  46. /*���������������������������.*/
  47. /* #define MULTI_ERASE */ /* use multiple block erase feature */
  48. /* #define WIN_FROM_SS */ /* call Socket Services to get window location */
  49. /* #define BIG_PAGE_ENABLED */ /* compile support for 2MB flashes */
  50. /* #define SEPARATED_CASCADED */ /* export each floor as a SEPARATED device */
  51. #define BUSY_DELAY 30000
  52. #define START_ADR 0xC8000L
  53. #define STOP_ADR 0xF0000L
  54. #define PAGES_PER_BLOCK 16 /* 16 pages per block on a single chip */
  55. #define CHIP_PAGE_SIZE 0x100 /* Page Size of 2 Mbyte Flash */
  56. /* miscellaneous limits */
  57. /*#define MAX_FLASH_DEVICES_MDOC 2 *//* Removed in osak 5.0 */
  58. #define MAX_FLASH_DEVICES_DOC 16
  59. #define MAX_FLOORS 4
  60. #define CHIP_ID_DOC 0x20
  61. #define CHIP_ID_MDOC 0x30
  62. #define MDOC_ALIAS_RANGE 0x100
  63. #define ALIAS_RESOLUTION (MAX_FLASH_DEVICES_DOC + 10)
  64. /*������������������������������������Ŀ
  65. Definition for writing boot image
  66. */
  67. #define SPL_SIZE 0x2000 /* 8 KBytes */
  68. #define MAX_CODE_MODULES 6 /* max number of code modules in boot area (incl. SPL) */
  69. /*������������������������������������Ŀ
  70. Definition for doc2000 tsop bbt
  71. */
  72. #define BBT_SIGN_SIZE 8
  73. #define BBT_SIGN "MSYS_BBT"
  74. #define MAX_BAD_PER_512 40
  75. #define BBT_MAX_DISTANCE 0x20
  76. /*���������������������������������������Ŀ
  77. Definition of DOC 2000 memory window
  78. */
  79. /*
  80. DOC 2000 memory window layout :
  81. 0000 .... 003F IPL ROM ( part 1 )
  82. 0040 .... 07FF (aliased 20H times)
  83. 0800 .... 083F IPL ROM ( part 2 )
  84. 0840 .... 0FFF (aliased 20H times)
  85. 1000 Chip Id
  86. 1001 DOC_Status_reg
  87. 1002 DOC_Control_reg
  88. 1003 ASIC_Control_reg
  89. CDSN window -----> 1004 CDSN_Control_reg
  90. 1005 CDSN_Device_Selector
  91. 1006 ECC_Config_reg
  92. 1007 ECC_Status_reg
  93. 1008 .... 100C Test registers [5]
  94. 100D CDSN_Slow_IO_reg
  95. 100E .... 100F reserved ( 2 bytes )
  96. 1010 .... 1015 ECC_Syndrom [6]
  97. 1016 .... 17FF reserved ( 2027 bytes )
  98. 1800 .... 1FFF CDSN_IO (aliased 800H times)
  99. */
  100. /*-----------------------------------------
  101. | Definition of MDOC 2000 memory window |
  102. ----------------------------------------*/
  103. /* MDOC 2000 memory window layout :
  104. 0000 .... 01FF IPL SRAM ( part 1 )
  105. 0200 .... 07FF (aliased 4 times)
  106. 0800 .... 0FFF CDSN_IO (aliased 800H times)
  107. 1000 Chip Id
  108. 1001 DOC_Status_reg
  109. 1002 DOC_Control_reg
  110. 1003 ASIC_Control_reg
  111. CDSN window -----> 1004 CDSN_Control_reg
  112. 1005 CDSN_Device_Selector
  113. 1006 ECC_Config_reg
  114. 1007 .... 100C reserved ( 6 bytes )
  115. 100D CDSN_Slow_IO_reg
  116. 100E .... 100F reserved ( 2 bytes )
  117. 1010 .... 1015 ECC_Syndrom [6]
  118. 1016 .... 101A reserved ( 5 bytes )
  119. 101B Alias_Resolution_reg
  120. 101C Config_Input_reg
  121. 101D Read_Pipeline_Init_reg
  122. 101E Write_Pipeline_Term_reg
  123. 101F Last_Data_Read_reg
  124. 1020 NOP_reg
  125. 1021 .... 103E reserved ( 30 )
  126. 103F Foundary_Test_reg
  127. 1040 .... 17FF reserved ( 1984 bytes (7C0) )
  128. 1800 .... 19FF IPL SRAM ( part 1 )
  129. 1A00 .... 1FFF (aliased 4 times)
  130. */
  131. #define NIPLpart1 0x0 /* read */
  132. #define NIPLpart2 0x800 /* read */
  133. #define NchipId 0x1000 /* read */
  134. #define NDOCstatus 0x1001 /* read */
  135. #define NDOCcontrol 0x1002 /* write */
  136. #define NASICselect 0x1003 /* read write */
  137. #define Nsignals 0x1004 /* read write */
  138. #define NdeviceSelector 0x1005 /* read write */
  139. #define NECCconfig 0x1006 /* write */
  140. #define NECCstatus 0x1007 /* read */
  141. #define NslowIO 0x100d /* read write */
  142. #define Nsyndrom 0x1010 /* read */
  143. #define NaliasResolution 0x101B /* read write MDOC only */
  144. #define NconfigInput 0x101C /* read write - || - */
  145. #define NreadPipeInit 0x101D /* read - || - */
  146. #define NwritePipeTerm 0x101E /* write - || - */
  147. #define NreadLastData 0x101F /* read write - || - */
  148. #define NNOPreg 0x1020 /* read write - || - */
  149. #define NfoudaryTest 0x103F /* write */
  150. #define Nio 0x1800 /* read write */
  151. /* bits for writing to DOC2window.DOCcontrol reg */
  152. #define ASIC_NORMAL_MODE 0x85
  153. #define ASIC_RESET_MODE 0x84
  154. #define ASIC_CHECK_RESET 0x00
  155. /* bits for writing to DOC2window.signals ( CDSN_Control reg ) */
  156. #define CE 0x01 /* 1 - Chip Enable */
  157. #define CLE 0x02 /* 1 - Command Latch Enable */
  158. #define ALE 0x04 /* 1 - Address Latch Enable */
  159. #define WP 0x08 /* 1 - Write-Protect flash */
  160. #define FLASH_IO 0x10
  161. #define ECC_IO 0x20 /* 1 - turn ECC on */
  162. #define PWDO 0x40
  163. /* bits for reading from DOC2window.signals ( CDSN_Control reg ) */
  164. #define RB 0x80 /* 1 - ready */
  165. /* bits for writing to DOC2window.ECCconfig */
  166. #define ECC_RESET 0x00
  167. #define ECC_IGNORE 0x01
  168. #define ECC_RESERVED 0x02 /* reserved bits */
  169. #define ECC_EN (0x08 | ECC_RESERVED) /* 1 - enable ECC */
  170. #define ECC_RW (0x20 | ECC_RESERVED) /* 1 - write mode, 0 - read mode */
  171. /* bits for reading from DOC2window.ECCstatus */
  172. #define ECC_ERROR 0x80
  173. #define TOGGLE 0x04 /* used for DOC 2000 detection */
  174. #define MDOC_ASIC 0x08 /* MDOC asic */
  175. /*----------------------------------------------------------------------*/
  176. /* c h e c k W i n F o r D o c */
  177. /* */
  178. /* Checks if a given window is valid DOC window. */
  179. /* */
  180. /* Parameters: */
  181. /* memWinPtr host base address of the window */
  182. /* */
  183. /* Returns: */
  184. /* TRUE if there is DOC FALSE otherwise */
  185. /*----------------------------------------------------------------------*/
  186. /* extern FLBoolean checkWinForDOC(unsigned driveNo, NDOC2window memWinPtr); */
  187. #endif /* DISKONC_H */