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.

548 lines
12 KiB

  1. /*
  2. * $Log: V:/Flite/archives/TrueFFS5/Custom/FLCUSTOM.H_V $
  3. *
  4. * Rev 1.12 Jan 29 2002 20:11:56 oris
  5. * Changed LOW_LEVEL compilation flag with FL_LOW_LEVEL to prevent definition clashes.
  6. *
  7. * Rev 1.11 Jan 20 2002 20:42:34 oris
  8. * FL_NO_USE_FUNC is now commented.
  9. *
  10. * Rev 1.10 Jan 20 2002 12:03:46 oris
  11. * Updated driverVersion and OSAKVersion to 5.1
  12. * Removed FAT- lite (FILES 0)
  13. * Changed VOLUMES to 4*SOCKETS
  14. * Commented WRITE_EXB_IMAGE / WRITE_PROTECTION.
  15. * Uncommneted VERIFY_WRITE (for protection against power failures).
  16. * Changed MAX_VOLUME_MBYTES to 1GB
  17. * Changed TLS to 2 (since multi-doc was removed)
  18. * Removed QUICK_MOUNT_FEATURE (since it is defained by default in flchkdfs)
  19. * Removed MULTI_DOC / SEPERATED_CASCADED / FL_BACKGROUND
  20. * Added FL_NO_USE_FUNC definition.
  21. *
  22. * Rev 1.9 Nov 16 2001 00:33:44 oris
  23. * Added NO_NFTL_2_INFTL compilation flag enabling 4.3 format converter.
  24. *
  25. * Rev 1.8 Jul 13 2001 00:56:58 oris
  26. * Added VERIFY_ERASE and VERIFY_WRITE.
  27. *
  28. * Rev 1.7 Jun 17 2001 16:43:46 oris
  29. * Improved documentation.
  30. *
  31. * Rev 1.6 Jun 17 2001 08:13:10 oris
  32. * Rearranged compilation flags orders.
  33. *
  34. * Rev 1.5 May 16 2001 23:07:02 oris
  35. * Increased number of Translation Layers to support Multi-DOC.
  36. *
  37. * Rev 1.4 May 09 2001 00:47:46 oris
  38. * Removed nested comments.
  39. * Added NO_PHYSICAL_IO, NO_IPL_CODE and NO_INQUIRE_CAPABILITIES compilation flag
  40. * to reduce code.
  41. *
  42. * Rev 1.3 Feb 12 2001 12:19:50 oris
  43. * Added Multi-DOC compilation flag
  44. *
  45. * Rev 1.2 Feb 08 2001 09:19:06 oris
  46. * Changed DRIVES to SOCKETS and VOLUMES
  47. * Moved SECTOR_SIZE_BITS to flbase.h
  48. * Added WRITE_EXB_IMAGE, QUICK_MOUNT_FEATURE, HW_OTP, HW_PROTECTION and BINARY_PARTITIONS
  49. * compilation flags. Added SEPERATED_CASCADED compilation flag.
  50. *
  51. * Rev 1.1 Feb 05 2001 18:46:50 oris
  52. * Moved compilation flag sanity check to a different file in order to preserve backward
  53. * compatibility.
  54. *
  55. * Rev 1.0 Feb 05 2001 12:21:36 oris
  56. * Initial revision.
  57. *
  58. */
  59. /************************************************************************/
  60. /* */
  61. /* FAT-FTL Lite Software Development Kit */
  62. /* Copyright (C) M-Systems Ltd. 1995-2001 */
  63. /* */
  64. /************************************************************************/
  65. #ifndef FLCUSTOM_H
  66. #define FLCUSTOM_H
  67. /* Driver & TrueFFS (OSAK) Version numbers */
  68. #define driverVersion "OS Less 5.1"
  69. #define OSAKVersion "5.1"
  70. #define NT5PORT
  71. #define D2000
  72. #define DOC_DRIVES 4
  73. /*
  74. *
  75. * File System Customization
  76. * -------------------------
  77. */
  78. /* Number of sockets
  79. *
  80. * Defines the maximum number of physical drives supported.
  81. *
  82. * The actual number of sockets depends on which socket controllers are
  83. * actually registered and the number of sockets in the system.
  84. */
  85. #define SOCKETS 8
  86. /* Number of volumes
  87. *
  88. * Defines the maximum number of logical drives supported.
  89. *
  90. * The actual number of drives depends on which socket controllers are
  91. * actually registered, the amount of devices in the system and the
  92. * TL format of each device.
  93. */
  94. #define VOLUMES (DOC_DRIVES * 4 ) + SOCKETS - DOC_DRIVES
  95. /* Number of open files
  96. *
  97. * Defines the maximum number of files that can be open at a time.
  98. */
  99. #define FILES 0
  100. /* Low level operations
  101. *
  102. * Uncomment the following line if you want to do low level operations
  103. * (i.e. read from a physical address, write to a physical address,
  104. * erase a unit according to its physical unit number, OTP and unique ID
  105. * operations.
  106. */
  107. #define FL_LOW_LEVEL
  108. /* Remove all write functions from the source. */
  109. /* #define FL_READ_ONLY */
  110. #ifndef FL_READ_ONLY
  111. /* Placing EXB files
  112. *
  113. * Uncomment the following line if you need to place M-Systems firmware
  114. * (DOCxx.EXB file) on the media. The file will install itself as a
  115. * BIOS extension driver, hooking INT13h to emulate a HD.
  116. */
  117. #define WRITE_EXB_IMAGE
  118. /* Formatting
  119. *
  120. * Uncomment the following line if you need to format the media.
  121. */
  122. #define FORMAT_VOLUME
  123. /* Defragmentation
  124. *
  125. * Uncomment the following line if you need to defragment with
  126. * flDefragmentVolume.
  127. */
  128. #define DEFRAGMENT_VOLUME
  129. #endif /* FL_READ_ONLY */
  130. /* Sub-directories
  131. *
  132. * Uncomment the following line if you need support for sub-directories
  133. * using the FAT-FLITE file system.
  134. */
  135. /*#define SUB_DIRECTORY*/
  136. /* Rename file
  137. *
  138. * Uncomment the following line if you need to rename files with
  139. * flRenameFile.
  140. */
  141. /*#define RENAME_FILE**/
  142. /* Split / join file
  143. *
  144. * Uncomment the following line if you need to split or join files with
  145. * flSplitFile and flJoinFile.
  146. */
  147. /* #define SPLIT_JOIN_FILE */
  148. /* 12-bit FAT support
  149. *
  150. * Comment the following line if you do not need support for DOS media with
  151. * 12-bit FAT (typically media of 8 MBytes or less).
  152. */
  153. #define FAT_12BIT
  154. /* Parse path function
  155. *
  156. * Uncomment the following line if you need to parse DOS-like path names
  157. * with flParsePath.
  158. */
  159. /*#define PARSE_PATH*/
  160. /* Maximum supported medium size.
  161. *
  162. * Define here the largest Flash medium size (in MBytes) you want supported.
  163. *
  164. * This define is used for the static memory allocation configuration
  165. * of the driver. If your TrueFFS based application or driver are using
  166. * dynamic allocation you should keep this define as large as possible (288L).
  167. *
  168. * Note: This define also dictates the size of the TrueFFS internal
  169. * "sectorNo" type forcing it to 2 bytes when MAX_VOLUME_MBYTES is less
  170. * then 64L. Using a smaller size than your actual device might cause
  171. * casting problems even when using dynamic allocation.
  172. */
  173. #define MAX_VOLUME_MBYTES 1024L
  174. /* Assumed card parameters.
  175. *
  176. * This issue is relevant only if you are not defining any dynamic allocation
  177. * routines in flsystem.h.
  178. *
  179. * The following are assumptions about parameters of the Flash media.
  180. * They affect the size of the heap buffer allocated for the translation
  181. * layer.
  182. */
  183. /* NAND flash */
  184. #define ASSUMED_NFTL_UNIT_SIZE 0x2000l /* NAND */
  185. /* NOR flash */
  186. #define ASSUMED_FTL_UNIT_SIZE 0x20000l /* Intel interleave-2 (NOR) */
  187. #define ASSUMED_VM_LIMIT 0x10000l /* limit at 64 KB */
  188. /* Absolute read & write
  189. *
  190. * Uncomment the following line if you want to be able to read & write
  191. * sectors by absolute sector number (i.e. without regard to files and
  192. * directories).
  193. */
  194. #define ABS_READ_WRITE
  195. /* Application exit
  196. *
  197. * If the FLite application ever exits, it needs to call flEXit before
  198. * exiting. Uncomment the following line to enable this.
  199. */
  200. #define EXIT
  201. /* Number of sectors per FAT cluster
  202. *
  203. * Define the minimum cluster size in sectors.
  204. */
  205. #define MIN_CLUSTER_SIZE 4
  206. /*
  207. *
  208. * Socket Hardware Customization
  209. * -----------------------------
  210. */
  211. /* Vpp voltage
  212. *
  213. * If your socket does not supply 12 volts, comment the following line. In
  214. * this case, you will be able to work only with Flash devices that do not
  215. * require external 12 Volt Vpp.
  216. *
  217. */
  218. #define SOCKET_12_VOLTS
  219. /* Fixed or removable media
  220. *
  221. * If your Flash media is fixed, uncomment the following line.
  222. */
  223. /*#define FIXED_MEDIA*/
  224. /* Interval timer
  225. *
  226. * The following defines a timer polling interval in milliseconds. If the
  227. * value is 0, an interval timer is not installed.
  228. *
  229. * If you select an interval timer, you should provide an implementation
  230. * for 'flInstallTimer' defined in flsysfun.h.
  231. *
  232. * An interval timer is not a must, but it is recommended. The following
  233. * will occur if an interval timer is absent:
  234. *
  235. * - Card changes can be recognized only if socket hardware detects them.
  236. * - The Vpp delayed turn-off procedure is not applied. This may downgrade
  237. * write performance significantly if the Vpp switching time is slow.
  238. * - The watchdog timer that guards against certain operations being stuck
  239. * indefinitely will not be active.
  240. */
  241. /* Polling interval in millisec. If 0, no polling is done */
  242. #define POLLING_INTERVAL 1500
  243. /* Maximum MTD's and Translation Layers
  244. *
  245. * Define here the maximum number of Memory Technology Drivers (MTD) and
  246. * Translation Layers (TL) that may be installed. Note that the actual
  247. * number installed is determined by which components are installed in
  248. * 'flRegisterComponents' (flcustom.c).
  249. */
  250. #define MTDS 10 /* Up to 5 MTD's */
  251. #define TLS 3 /* Up to 3 Translation Layers */
  252. /* BDTL cash
  253. *
  254. * Enable Block Device Translation Layer cache.
  255. *
  256. * Turning on this option improves performance but requires additional
  257. * RAM resources.
  258. *
  259. * The NAND Flash Translation Layer (NFTL) and (INFTL) are specifications
  260. * for storing data on the DiskOnChip in a way that enables accessing the
  261. * DiskOnChip as a Virtual Block Device. If this option is on, then the BDTL
  262. * keeps in RAM a table that saves some of the flash accesses.
  263. * Whenever it is needed to change table entry, the BDTL updates it in the
  264. * RAM table and on the DiskOnChip. If NFTL has to read table entry, then you
  265. * can save time on reading sector from DiskOnChip.
  266. */
  267. /* #define NFTL_CACHE */
  268. /* Environment Variables
  269. *
  270. * Enable environment variables control of the TrueFFS features.
  271. *
  272. */
  273. #define ENVIRONMENT_VARS
  274. /* IO Controll Interface
  275. *
  276. * Support standard IOCTL interface.
  277. *
  278. */
  279. #define IOCTL_INTERFACE
  280. /* S/W Write protection
  281. *
  282. * Enable S/W write protection of the device.
  283. *
  284. */
  285. #define WRITE_PROTECTION
  286. /* Definitions required for write protection. */
  287. #ifdef WRITE_PROTECTION
  288. #define ABS_READ_WRITE
  289. #define SCRAMBLE_KEY_1 647777603l
  290. #define SCRAMBLE_KEY_2 232324057l
  291. #endif
  292. /* H/W OTP
  293. *
  294. * Enable H/W One Time Programing capability including unique ID/
  295. *
  296. */
  297. #define HW_OTP
  298. /* H/W Protection
  299. *
  300. * Enable H/W protection of the device.
  301. *
  302. */
  303. #define HW_PROTECTION
  304. /* Read after write
  305. *
  306. * Add read after every write verifing data integrity. Make sure that
  307. * flVerifyWrite variable is also set to 1.
  308. *
  309. */
  310. #define VERIFY_WRITE
  311. /* Verify entire volume
  312. *
  313. * Scan the entire disk partition for power failures symptoms and correct them.
  314. *
  315. */
  316. #define VERIFY_VOLUME
  317. /* Read after erase
  318. *
  319. * Add read after every erase operation verifing data integrity.
  320. *
  321. */
  322. /* #define VERIFY_ERASE */
  323. /* Binary Partition
  324. *
  325. * Enables access to the Binary partition.
  326. *
  327. */
  328. #define BDK_ACCESS
  329. /* Definitions required for BDK operations. */
  330. #ifdef BDK_ACCESS
  331. /* Number of Binary partitions on the DiskOnChip.
  332. *
  333. * Defines Maximum Number of Binary partitions on the DiskOnChip.
  334. *
  335. * The actual number of partitions depends on the format placed
  336. * on each device.
  337. */
  338. #define BINARY_PARTITIONS 3
  339. #endif /* BDK_ACCESS */
  340. /* Remove runtime controll over memory access routines
  341. *
  342. * If defined memory access routines will be set at compile time using
  343. * dedicated defintions in flsystem.h
  344. * Note : when compile time customization is chosen, you must sepcify
  345. * the bus width even when working with DiskOnChip Millennium Plus.
  346. * Refer to Trueffs manual for more infromation.
  347. */
  348. /* #define FL_NO_USE_FUNC */
  349. /* Remove IPL code.
  350. *
  351. * Removes the IPL code (This applies only to DiskOnChip Millennium Plus
  352. * and DiskOnChip 2000 TSOP).
  353. *
  354. */
  355. /* #define NO_IPL_CODE */
  356. /*
  357. * Removes Physical access code
  358. *
  359. */
  360. /* #define NO_PHYSICAL_IO */
  361. /*
  362. * Removes the inquire capability code.
  363. *
  364. */
  365. /* #define NO_INQUIRE_CAPABILITIES */
  366. /*
  367. * Removes read Bad Block Table code.
  368. *
  369. */
  370. /* #define NO_READ_BBT_CODE */
  371. /*
  372. * Removes read Bad Block Table code.
  373. *
  374. */
  375. /* #define NO_NFTL_2_INFTL */
  376. #endif /* FLCUSTOM_H */