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.

151 lines
6.5 KiB

  1. /*
  2. * $Log: V:/Flite/archives/TrueFFS5/Src/DOCSYS.H_V $
  3. *
  4. * Rev 1.12 Apr 15 2002 07:36:04 oris
  5. * Reorganized for final release.
  6. *
  7. * Rev 1.11 Feb 19 2002 20:59:04 oris
  8. * Removed flflash.h include directive.
  9. *
  10. * Rev 1.10 Jan 28 2002 21:24:20 oris
  11. * Removed the use of back-slashes in macro definitions.
  12. * Replaced FLFlash argument with DiskOnChip memory base pointer.
  13. * Changed interface of write and set routines (those that handle more then 8/16 bits) so that instead of FLFlash record they receive the DiskOnChip memory window base pointer and offset (2 separated arguments). The previous implementation did not support address
  14. * shifting properly.
  15. * Changed memWinowSize to memWindowSize
  16. * Removed FL_ACCESS_NO_STRING.
  17. *
  18. * Rev 1.9 Jan 17 2002 22:59:46 oris
  19. * Completely revised, to support runtime customization and all M-Systems
  20. * DiskOnChip devices
  21. *
  22. * Rev 1.8 Nov 16 2001 00:19:58 oris
  23. * Added new line in the end, to remove warning.
  24. *
  25. * Rev 1.7 Sep 25 2001 15:35:04 oris
  26. * Restored to OSAK 4.3 implementation.
  27. *
  28. */
  29. /************************************************************************/
  30. /* */
  31. /* FAT-FTL Lite Software Development Kit */
  32. /* Copyright (C) M-Systems Ltd. 1995-2001 */
  33. /* */
  34. /************************************************************************/
  35. /************************************************************************/
  36. /* I M P O R T E N T */
  37. /* */
  38. /* The file contains DiskOnChip memory access routines and macros */
  39. /* defintions. */
  40. /* */
  41. /* In order to use the complete set of TrueFFS memory access routine */
  42. /* that allows runtime configuration of each socket access type make */
  43. /* sure the FL_NO_USE_FUNC is not defined in either: */
  44. /* FLCUSTOME.H - when using TrueFFS SDK based application */
  45. /* MTDSA.H - when using Boot SDK based application */
  46. /* */
  47. /* If you know the exact configuration of your application you can */
  48. /* uncomment the FL_NO_USE_FUNC definition and set the proper access */
  49. /* type using the macroe defintion bellow. */
  50. /************************************************************************/
  51. #ifndef DOCSYS_H
  52. #define DOCSYS_H
  53. #include "nanddefs.h"
  54. /*--------------------------------------------------------------------------*/
  55. /*--------------------------------------------------------------------------*/
  56. #ifdef FL_NO_USE_FUNC
  57. #error "current version does not support the FL_NO_USE_FUNC compilation flag\r\n"
  58. /*
  59. * If you chose to customize the memory access routine using macroes, simply
  60. * add your implementation here.
  61. */
  62. #define flWrite8bitReg(flash,offset,val)
  63. #define flRead8bitReg(flash,offset)
  64. #define docread
  65. #define docwrite
  66. #define docset
  67. /* DiskOnChip Plus memory access routines */
  68. #define flWrite8bitRegPlus(flash,offset,val)
  69. #define flRead8bitRegPlus(flash,offset) 0x0
  70. #define flWrite16bitRegPlus(flash,offset,val)
  71. #define flRead16bitRegPlus(flash,offset) 0x0
  72. #define docPlusRead(win,offset,dest,count)
  73. #define docPlusWrite(win,offset,src,count)
  74. #define docPlusSet(win,offset,count,val)
  75. #define DOC_WIN 0x2000
  76. #define setBusTypeOfFlash(flash,access) flOK
  77. #else
  78. /* DiskOnChip memory access routines */
  79. #define flWrite8bitReg(flash,offset,val) flash->memWrite8bit(flash->win,offset,val)
  80. #define flRead8bitReg(flash,offset) flash->memRead8bit(flash->win,offset)
  81. #define docread flash->memRead
  82. #define docwrite flash->memWrite
  83. #define docset flash->memSet
  84. /* DiskOnChip Plus memory access routines */
  85. #define flWrite8bitRegPlus(flash,offset,val) flash->memWrite8bit(flash->win,offset,val)
  86. #define flRead8bitRegPlus(flash,offset) flash->memRead8bit(flash->win,offset)
  87. #define flWrite16bitRegPlus(flash,offset,val) flash->memWrite16bit(flash->win,offset,val)
  88. #define flRead16bitRegPlus(flash,offset) flash->memRead16bit(flash->win,offset)
  89. #define docPlusRead(win,offset,dest,count) flash->memRead(win,offset,dest,count)
  90. #define docPlusWrite(win,offset,src,count) flash->memWrite(win,offset,src,count)
  91. #define docPlusSet(win,offset,count,val) flash->memSet(win,offset,count,val)
  92. #define DOC_WIN flash->memWindowSize()
  93. /*--------------------------------------------------------------------------*/
  94. /*--------------------------------------------------------------------------*/
  95. /*
  96. * DiskOnChip Access routines types
  97. */
  98. /* (public) types of DiskOnChip access configurations */
  99. #define FL_BUS_HAS_8BIT_ACCESS 0x00000001L /* Bus can access 8-bit */
  100. #define FL_BUS_HAS_16BIT_ACCESS 0x00000002L /* Bus can access 16-bit */
  101. #define FL_BUS_HAS_32BIT_ACCESS 0x00000004L /* Bus can access 32-bit */
  102. #define FL_BUS_HAS_XX_ACCESS_MASK 0x0000000FL /* Bus can access mask */
  103. #define FL_NO_ADDR_SHIFT 0x00000000L /* No address shift */
  104. #define FL_SINGLE_ADDR_SHIFT 0x00000010L /* Single address shift */
  105. #define FL_DOUBLE_ADDR_SHIFT 0x00000020L /* Double address shift */
  106. #define FL_XX_ADDR_SHIFT_MASK 0x000000F0L /* Address shift mask */
  107. /* (private) types of DiskOnChip access configurations */
  108. #define FL_8BIT_DOC_ACCESS 0x00000000L /* Has 8 data bits */
  109. #define FL_16BIT_DOC_ACCESS 0x00000100L /* Has 16 data bits */
  110. #define FL_XX_DATA_BITS_MASK 0x00000300L /* Mask of the above */
  111. #define FL_8BIT_FLASH_ACCESS 0x00000400L /* 8 bits of flash per cycle */
  112. #define FL_16BIT_FLASH_ACCESS 0x00000800L /* 16 bits of flash per cycle */
  113. #define FL_XX_FLASH_ACCESS_MASK 0x00000C00L /* Mask of the above */
  114. #define FL_ACCESS_USER_DEFINED 0x00001000L /* User defined routines */
  115. /* DiskOnChip routines prototypes */
  116. extern FLStatus setBusTypeOfFlash(FLFlash * flash,dword access);
  117. #endif /* FL_NO_USE_FUNC */
  118. #endif /* DOCSYS_H */