vmechip.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:16k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* vmechip.h - Motorola MVME6000 VMEbus Interface Controller */
  2. /* Copyright 1991-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01f,29sep98,fle  doc : made it refgen parsable
  7. 01e,22sep92,rrr  added support for c++
  8. 01d,03jun92,ccc  added a few more constants.
  9. 01c,26may92,rrr  the tree shuffle
  10. 01b,02jan92,caf  fixed GLOBAL_0 bits. changed copyright notice.
  11. 01a,19dec91,caf  written.
  12. */
  13. #ifdef DOC
  14. #define INCvmechiph
  15. #endif /* DOC */
  16. #ifndef __INCvmechiph
  17. #define __INCvmechiph
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /*
  22. This file contains constants for the Motorola MVME6000 VMEbus Interface.
  23. The macro VMECHIP_BASE_ADRS must be defined when using local bus addresses
  24. defined in this header.  The macro GCSR_BUS_BASE_ADRS must be defined when
  25. using VMEbus addresses defined in this header.
  26. The following standards have been adopted in the creation of this file.
  27. Registers in the LCSR have the prefix "LCSR".
  28. Registers in the GCSR have the prefix "GCSR" when addressed locally and the
  29. prefix "GCSR_BUS" when addressed from the VMEbus.  The bit definitions are
  30. shared.
  31. The registers are listed in ascending (numerical) order; the definitions
  32. for each register start with a header, e.g.:
  33.  Register                Register Register Register
  34.  Mnemonic                Number   Address  Name
  35.     |                        |       |       |
  36.     v                        v       v       v
  37. *************************************************************************
  38. * SYS_CONF                  0x00    0x01    system controller config    *
  39. *************************************************************************
  40. In cases where a number of registers have the same definitions, the
  41. header looks like this:
  42. *************************************************************************
  43. * GP_CSR_0                  0x13    0x27    general purpose CSR 0       *
  44. * to                                                                    *
  45. * GP_CSR_4                  0x17    0x2f    general purpose CSR 4       *
  46. *************************************************************************
  47. The format of the definitions is as follows.  The define name always
  48. starts with the register mnemonic it is associated with.  The [7-0]
  49. number at the end of the comment indicates the bit position to which the
  50. the define applies.  In the definition of RQST_CONF_DWB, for example,
  51. the 7 indicates bit 7:
  52.                                                                       |
  53.                                                                       v
  54.  define RQST_CONF_DWB       0x80     * device wants bus               7 *
  55. If the define applies to more than one bit, then the applicable bit
  56. range is specified by two digits.  In the following example,
  57. TMO_CONF_VBTO_2048 applies to the two bit field, bits 5-4:
  58.                                                                       |
  59.                                                                       v
  60.  define TMO_CONF_VBTO_2048  0x10     * VMEbus time-out 2048 * T      54 *
  61. If no bit field is given, then the define applies to the whole register.
  62. */
  63. #ifdef _ASMLANGUAGE
  64. #define CAST
  65. #else
  66. #define CAST (char *)
  67. #endif /* _ASMLANGUAGE */
  68. #define VMECHIP_REG_INTERVAL            2
  69. #ifndef VMECHIP_ADRS    /* to permit alternative board addressing */
  70. #define VMECHIP_ADRS(reg) 
  71.                 (CAST (VMECHIP_BASE_ADRS + 1 + (reg * VMECHIP_REG_INTERVAL)))
  72. #endif /* VMECHIP_ADRS */
  73. /*
  74.  * Local Control and Status Register (LCSR) definitions.
  75.  *
  76.  * Only the local CPU can access the LCSR.
  77.  */
  78. #define LCSR_SYS_CONF       VMECHIP_ADRS(0x00)  /* system controller config  */
  79. #define LCSR_RQST_CONF      VMECHIP_ADRS(0x01)  /* requester configuration   */
  80. #define LCSR_MASTER_CONF    VMECHIP_ADRS(0x02)  /* master configuration      */
  81. #define LCSR_SLAVE_CONF     VMECHIP_ADRS(0x03)  /* slave configuration       */
  82. #define LCSR_TMO_CONF       VMECHIP_ADRS(0x04)  /* timer configuration       */
  83. #define LCSR_SLAVE_AM       VMECHIP_ADRS(0x05)  /* slave address modifier    */
  84. #define LCSR_MASTER_AM      VMECHIP_ADRS(0x06)  /* master address modifier   */
  85. #define LCSR_INT_MASK       VMECHIP_ADRS(0x07)  /* interrupt handler mask    */
  86. #define LCSR_UTIL_INT_MASK  VMECHIP_ADRS(0x08)  /* utility interrupt mask    */
  87. #define LCSR_UTIL_VEC_BASE  VMECHIP_ADRS(0x09)  /* utility interrupt vector  */
  88. #define LCSR_INT_REQ        VMECHIP_ADRS(0x0a)  /* interrupt request         */
  89. #define LCSR_INT_STATUS_ID  VMECHIP_ADRS(0x0b)  /* status/ID                 */
  90. #define LCSR_BERR_STATUS    VMECHIP_ADRS(0x0c)  /* bus error status          */
  91. #define LCSR_GCSR_BASE_ADRS VMECHIP_ADRS(0x0d)  /* GCSR base address         */
  92. /*
  93.  * Global Control and Status Register (GCSR) definitions.
  94.  *
  95.  * All registers of the GCSR are accessible to both the local processor
  96.  * and to other VMEbus masters.
  97.  */
  98. /* local addresses for the GCSR */
  99. #define GCSR_GLOBAL_0       VMECHIP_ADRS(0x10)  /* global 0                  */
  100. #define GCSR_GLOBAL_1       VMECHIP_ADRS(0x11)  /* global 1                  */
  101. #define GCSR_BOARD_ID       VMECHIP_ADRS(0x12)  /* board ID                  */
  102. #define GCSR_GP_CSR_0       VMECHIP_ADRS(0x13)  /* general purpose CSR 0     */
  103. #define GCSR_GP_CSR_1       VMECHIP_ADRS(0x14)  /* general purpose CSR 1     */
  104. #define GCSR_GP_CSR_2       VMECHIP_ADRS(0x15)  /* general purpose CSR 2     */
  105. #define GCSR_GP_CSR_3       VMECHIP_ADRS(0x16)  /* general purpose CSR 3     */
  106. #define GCSR_GP_CSR_4       VMECHIP_ADRS(0x17)  /* general purpose CSR 4     */
  107. /* VMEbus addresses for the GCSR */
  108. #define GCSR_BUS_REG_INTERVAL           2
  109. #ifndef GCSR_BUS_ADRS   /* to permit alternative off-board addressing */
  110. #define GCSR_BUS_ADRS(reg) 
  111.                 (CAST (GCSR_BUS_BASE_ADRS + 1 + (reg * GCSR_BUS_REG_INTERVAL)))
  112. #endif  /* GCSR_BUS_ADRS */
  113. #define GCSR_BUS_GLOBAL_0   GCSR_BUS_ADRS(0x00) /* global 0 on VMEbus        */
  114. #define GCSR_BUS_GLOBAL_1   GCSR_BUS_ADRS(0x01) /* global 1 on VMEbus        */
  115. #define GCSR_BUS_BOARD_ID   GCSR_BUS_ADRS(0x02) /* board ID on VMEbus        */
  116. #define GCSR_BUS_GP_CSR_0   GCSR_BUS_ADRS(0x03) /* general purp. 0 on VMEbus */
  117. #define GCSR_BUS_GP_CSR_1   GCSR_BUS_ADRS(0x04) /* general purp. 1 on VMEbus */
  118. #define GCSR_BUS_GP_CSR_2   GCSR_BUS_ADRS(0x05) /* general purp. 2 on VMEbus */
  119. #define GCSR_BUS_GP_CSR_3   GCSR_BUS_ADRS(0x06) /* general purp. 3 on VMEbus */
  120. #define GCSR_BUS_GP_CSR_4   GCSR_BUS_ADRS(0x07) /* general purp. 4 on VMEbus */
  121. /* SYS_CONF                  0x00    0x01    system controller config   */
  122. #define SYS_CONF_SCON       0x01    /* system controller on (status)  0 */
  123. #define SYS_CONF_SRESET     0x02    /* system reset                   1 */
  124. #define SYS_CONF_BRDFAIL    0x04    /* board fail                     2 */
  125. #define SYS_CONF_ROBIN      0x08    /* round robin select             3 */
  126. #define SYS_CONF_PRIORITY   0x00    /* priority mode select           3 */
  127. /* RQST_CONF                 0x01    0x03    requester configuration    */
  128. #define RQST_CONF_RQLEV     0x03    /* VMEbus request level (mask)   10 */
  129. #define RQST_CONF_RQLEV_0   0x00    /* VMEbus request level 0        10 */
  130. #define RQST_CONF_RQLEV_1   0x01    /* VMEbus request level 1        10 */
  131. #define RQST_CONF_RQLEV_2   0x02    /* VMEbus request level 2        10 */
  132. #define RQST_CONF_RQLEV_3   0x03    /* VMEbus request level 3        10 */
  133. #define RQST_CONF_RNEVER    0x08    /* release never                  3 */
  134. #define RQST_CONF_RWD       0x10    /* release when done              4 */
  135. #define RQST_CONF_ROR       0x00    /* release on request             4 */
  136. #define RQST_CONF_RONR      0x20    /* request on no request          5 */
  137. #define RQST_CONF_DHB       0x40    /* device has bus (status)        6 */
  138. #define RQST_CONF_DWB       0x80    /* device wants bus               7 */
  139. /* MASTER_CONF               0x02    0x05    master configuration       */
  140. #define MASTER_CONF_MASD16  0x01    /* master D16                     0 */
  141. #define MASTER_CONF_MASD32  0x00    /* master D32, D16, D8            0 */
  142. #define MASTER_CONF_MASA32  0x00    /* master A32                     1 */
  143. #define MASTER_CONF_MASA24  0x02    /* master A24                     1 */
  144. #define MASTER_CONF_MASA16  0x04    /* master A16                     2 */
  145. #define MASTER_CONF_MASUAT  0x08    /* master unaligned transfers     3 */
  146. #define MASTER_CONF_CFILL   0x10    /* cache fill                     4 */
  147. #define MASTER_CONF_MASWP   0x20    /* master write-posting (CAUTION) 5 */
  148. #define MASTER_CONF_020     0x40    /* local CPU is a 68020           6 */
  149. #define MASTER_CONF_DDTACK  0x80    /* extra delay for 33MHz 020/030  7 */
  150. /* SLAVE_CONF                0x03    0x07    slave configuration        */
  151. #define SLAVE_CONF_SLVD16   0x01    /* slave D16                      0 */
  152. #define SLAVE_CONF_SLVWP    0x20    /* slave write-posting (CAUTION)  5 */
  153. #define SLAVE_CONF_SLVEN    0x80    /* slave enable                   7 */
  154. #define SLAVE_CONF_SLVDIS   0x00    /* slave disable                  7 */
  155. /* TMO_CONF                  0x04    0x09    timer configuration        */
  156. #define TMO_CONF_LBTO       0x03    /* local bus time-out (mask)     10 */
  157. #define TMO_CONF_LBTO_1024  0x00    /* local bus time-out 1024 * T   10 */
  158. #define TMO_CONF_LBTO_2048  0x01    /* local bus time-out 2048 * T   10 */
  159. #define TMO_CONF_LBTO_4096  0x02    /* local bus time-out 4096 * T   10 */
  160. #define TMO_CONF_LBTO_DIS   0x03    /* local bus time-out disabled   10 */
  161. #define TMO_CONF_ACTO       0x0c    /* access time-out (mask)        32 */
  162. #define TMO_CONF_ACTO_1024  0x00    /* access time-out 1024 * T      32 */
  163. #define TMO_CONF_ACTO_16384 0x04    /* access time-out 16384 * T     32 */
  164. #define TMO_CONF_ACTO_524   0x08    /* access time-out 524290 * T    32 */
  165. #define TMO_CONF_ACTO_DIS   0x0c    /* access time-out disabled      32 */
  166. #define TMO_CONF_VBTO       0x30    /* VMEbus time-out (mask)        54 */
  167. #define TMO_CONF_VBTO_1024  0x00    /* VMEbus time-out 1024 * T      54 */
  168. #define TMO_CONF_VBTO_2048  0x10    /* VMEbus time-out 2048 * T      54 */
  169. #define TMO_CONF_VBTO_4096  0x20    /* VMEbus time-out 4096 * T      54 */
  170. #define TMO_CONF_VBTO_DIS   0x30    /* VMEbus time-out disabled      54 */
  171. #define TMO_CONF_ARBTO      0x40    /* arbitration timer              6 */
  172. /* SLAVE_AM                  0x05    0x0b    slave address modifier     */
  173. #define SLAVE_AM_DATA       0x01    /* respond to data                0 */
  174. #define SLAVE_AM_PROGRAM    0x02    /* respond to program             1 */
  175. #define SLAVE_AM_BLOCK      0x04    /* respond to block (never set)   2 */
  176. #define SLAVE_AM_SHORT      0x08    /* respond to short               3 */
  177. #define SLAVE_AM_STND       0x10    /* respond to standard            4 */
  178. #define SLAVE_AM_EXTED      0x20    /* respond to extended            5 */
  179. #define SLAVE_AM_USER       0x40    /* respond to user                6 */
  180. #define SLAVE_AM_SUPER      0x80    /* respond to supervisor          7 */
  181. /* MASTER_AM                 0x06    0x0d    master address modifier    */
  182. #define MASTER_AM_AM        0x3f    /* address modifier code (mask)  50 */
  183. #define MASTER_AM_AMSEL     0x80    /* address modifier select        7 */
  184. #define MASTER_AM_DYNAMIC   0x00    /* AM code dynamically determined 7 */
  185. /* INT_MASK                  0x07    0x0f    interrupt handler mask     */
  186. #define INT_MASK_IEN1       0x02    /* VMEbus IRQ1 interrupt enable   1 */
  187. #define INT_MASK_IEN2       0x04    /* VMEbus IRQ2 interrupt enable   2 */
  188. #define INT_MASK_IEN3       0x08    /* VMEbus IRQ3 interrupt enable   3 */
  189. #define INT_MASK_IEN4       0x10    /* VMEbus IRQ4 interrupt enable   4 */
  190. #define INT_MASK_IEN5       0x20    /* VMEbus IRQ5 interrupt enable   5 */
  191. #define INT_MASK_IEN6       0x40    /* VMEbus IRQ6 interrupt enable   6 */
  192. #define INT_MASK_IEN7       0x80    /* VMEbus IRQ7 interrupt enable   7 */
  193. #define INT_MASK_DISABLE    0x00    /* Disable VMEbus interrupts        */
  194. /* UTIL_INT_MASK               0x08  0x11    utility interrupt mask     */
  195. #define UTIL_INT_MASK_SIGLEN  0x02  /* signal low interrupt enable    1 */
  196. #define UTIL_INT_MASK_LM0EN   0x04  /* loc. monitor 0 intrpt. enable  2 */
  197. #define UTIL_INT_MASK_IACKEN  0x08  /* IACK interrupt enable          3 */
  198. #define UTIL_INT_MASK_LM1EN   0x10  /* loc. monitor 1 intrpt. enable  4 */
  199. #define UTIL_INT_MASK_SIGHEN  0x20  /* signal high interrupt enable   5 */
  200. #define UTIL_INT_MASK_SFIEN   0x40  /* SYSFAIL interrupt enable       6 */
  201. #define UTIL_INT_MASK_WPERREN 0x80  /* write posting bus error enable 7 */
  202. #define UTIL_INT_MASK_DISABLE 0x00  /* Disable utility interrupts       */
  203. /* UTIL_VEC_BASE               0x09  0x13    utility interrupt vector   */
  204. #define UTIL_VEC_BASE_UID     0x07  /* utility interrupt ID (mask)   20 */
  205. #define UTIL_VEC_BASE_SIGLP   0x01  /* signal low                    20 */
  206. #define UTIL_VEC_BASE_LM0     0x02  /* location monitor 0            20 */
  207. #define UTIL_VEC_BASE_IACK    0x03  /* IACK                          20 */
  208. #define UTIL_VEC_BASE_LM1     0x04  /* location monitor 1            20 */
  209. #define UTIL_VEC_BASE_SIGHP   0x05  /* signal high                   20 */
  210. #define UTIL_VEC_BASE_SYSFAIL 0x06  /* SYSFAIL                       20 */
  211. #define UTIL_VEC_BASE_WPBERR  0x07  /* write post bus error          20 */
  212. #define UTIL_VEC_BASE_UVB     0xf8  /* utility vector base (mask)    73 */
  213. /* INT_REQ                   0x0a    0x15    interrupt request          */
  214. #define INT_REQ_UID         0x07    /* interrupt request (mask)      20 */
  215. #define INT_REQ_NONE        0x00    /* none                          20 */
  216. #define INT_REQ_IRQ1        0x01    /* IRQ1                          20 */
  217. #define INT_REQ_IRQ2        0x02    /* IRQ2                          20 */
  218. #define INT_REQ_IRQ3        0x03    /* IRQ3                          20 */
  219. #define INT_REQ_IRQ4        0x04    /* IRQ4                          20 */
  220. #define INT_REQ_IRQ5        0x05    /* IRQ5                          20 */
  221. #define INT_REQ_IRQ6        0x06    /* IRQ6                          20 */
  222. #define INT_REQ_IRQ7        0x07    /* IRQ7                          20 */
  223. /* INT_STATUS_ID             0x0b    0x17    status/ID                  */
  224. /* none */
  225. /* BERR_STATUS               0x0c    0x19    bus error status           */
  226. #define BERR_STATUS_LBTO    0x01    /* local bus time-out             0 */
  227. #define BERR_STATUS_ACTO    0x02    /* access time-out                1 */
  228. #define BERR_STATUS_VBERR   0x04    /* VMEbus bus error               2 */
  229. #define BERR_STATUS_RMCERR  0x08    /* RMC lock error                 3 */
  230. /* GCSR_BASE_ADRS            0x0d    0x1b    GCSR base address          */
  231. #define GCSR_BASE_ADRS      0x0f    /* GCSR base address (mask)      30 */
  232. #define GCSR_BASE_ADRS_NONE 0x0f    /* GCSR not mapped on VMEbus     30 */
  233. /* GLOBAL_0                  0x10    0x21    global 0                   */
  234. #define GLOBAL_0_CHIP_ID    0x0f    /* chip ID (mask)                30 */
  235. #define GLOBAL_0_LM0        0x10    /* location monitor 0             4 */
  236. #define GLOBAL_0_LM1        0x20    /* location monitor 1             5 */
  237. #define GLOBAL_0_LM2        0x40    /* location monitor 2             6 */
  238. #define GLOBAL_0_LM3        0x80    /* location monitor 3             7 */
  239. /* GLOBAL_1                  0x11    0x23    global 1                   */
  240. #define GLOBAL_1_SIGLP      0x01    /* signal low priority            0 */
  241. #define GLOBAL_1_SIGHP      0x02    /* signal high priority           1 */
  242. #define GLOBAL_1_BRDFAIL    0x10    /* board fail                     4 */
  243. #define GLOBAL_1_ISF        0x20    /* inhibit SYSFAIL                5 */
  244. #define GLOBAL_1_SCON       0x40    /* system controller on (status)  6 */
  245. #define GLOBAL_1_R_AND_H    0x80    /* reset and hold                 7 */
  246. /* BOARD_ID                  0x12    0x25    board ID                   */
  247. /* none */
  248. /*
  249.  * GP_CSR_0                  0x13    0x27    general purpose CSR 0
  250.  * to
  251.  * GP_CSR_4                  0x17    0x2f    general purpose CSR 4
  252.  */
  253. /* none */
  254. #ifdef __cplusplus
  255. }
  256. #endif
  257. #endif /* __INCvmechiph */