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

VxWorks

开发平台:

C/C++

  1. /* m68360.h - Motorola MC68360 CPU control registers */
  2. /* Copyright 1994-1996 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01e,05dec96,db  fixed macro M360_DPR_TMR per SPR #7575.
  7. 01d,28may96,dat  fixed SPR #5616, new macros for SMC in GCI mode
  8. 01c,24jan94,dzb  fixed size of M360_CPM_GSMR_L3, M360_CPM_PSMR3, M360_CPM_PCINT.
  9. 01b,05oct93,dzb  added ethernet macros.  broke out CPM interrupt vectors.
  10.  added SCC_DEV abstraction.  added CPM command macros.
  11. 01a,04aug93,dzb  written.
  12. */
  13. /*
  14. This file contains I/O addresses and related constants for the MC68360.
  15. */
  16. #ifndef __INCm68360h
  17. #define __INCm68360h
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #ifndef _ASMLANGUAGE
  22. #ifndef INCLUDE_TY_CO_DRV_50
  23. #include "tyLib.h"
  24. #endif /* INCLUDE_TY_CO_DRV_50 */
  25. /* MC68360 Module Base Address Register fixed locations */
  26. #define M360_SIM_MBAR 0x0003ff00  /* master base address register */
  27. #define M360_SIM_MBAR_SLAVE 0x0003ff04  /* slave base address register */
  28. #define M360_SIM_MBARE 0x0003ff08  /* slave MBAR enable address */
  29. /* MC68360 Dual Ported Ram addresses */
  30. #define M360_DPR_SCC1(base) ((UINT32 *) (base + 0xc00))
  31. #define M360_DPR_MISC(base) ((UINT32 *) (base + 0xcb0))
  32. #define M360_DPR_SCC2(base) ((UINT32 *) (base + 0xd00))
  33. #define M360_DPR_TMR(base) ((UINT32 *) (base + 0xdb0))
  34. #define M360_DPR_SPI(base) ((UINT32 *) (base + 0xd80))
  35. #define M360_DPR_SCC3(base) ((UINT32 *) (base + 0xe00))
  36. #define M360_DPR_IDMA1(base) ((UINT32 *) (base + 0xe70))
  37. #define M360_DPR_SMC1(base) ((UINT32 *) (base + 0xe80))
  38. #define M360_DPR_SCC4(base) ((UINT32 *) (base + 0xf00))
  39. #define M360_DPR_IDMA2(base) ((UINT32 *) (base + 0xf70))
  40. #define M360_DPR_SMC2(base) ((UINT32 *) (base + 0xf80))
  41. /* GCI MODE Buffer Descriptors */
  42. #define M360_SMC1_M_RXBD(base) ((UINT16 *) (base + 0x0E80))
  43. #define M360_SMC1_M_TXBD(base) ((UINT16 *) (base + 0x0E82))
  44. #define M360_SMC1_CI_RXBD(base) ((UINT16 *) (base + 0x0E84))
  45. #define M360_SMC1_CI_TXBD(base) ((UINT16 *) (base + 0x0E86))
  46. #define M360_SMC2_M_RXBD(base) ((UINT16 *) (base + 0x0F80))
  47. #define M360_SMC2_M_TXBD(base) ((UINT16 *) (base + 0x0F82))
  48. #define M360_SMC2_CI_RXBD(base) ((UINT16 *) (base + 0x0F84))
  49. #define M360_SMC2_CI_TXBD(base) ((UINT16 *) (base + 0x0F86))
  50. /* MC68360 register addresses in parameter ram */
  51. #define M360_REGB_OFFSET 0x1000 /* offset to internal registers */
  52. /* System Integration Module register addresses */
  53. #define M360_SIM_MCR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x000))
  54. #define M360_SIM_AVR(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x008))
  55. #define M360_SIM_RSR(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x009))
  56. #define M360_SIM_CLKOCR(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x00c))
  57. #define M360_SIM_PLLCR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x010))
  58. #define M360_SIM_CDVCR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x014))
  59. #define M360_SIM_PEPAR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x016))
  60. #define M360_SIM_SYPCR(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x022))
  61. #define M360_SIM_SWIV(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x023))
  62. #define M360_SIM_PICR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x026))
  63. #define M360_SIM_PITR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x02a))
  64. #define M360_SIM_SWSR(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x02f))
  65. #define M360_SIM_BKAR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x030))
  66. #define M360_SIM_BKCR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x034))
  67. #define M360_SIM_GMR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x040))
  68. #define M360_SIM_MSTAT(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x044))
  69. #define M360_SIM_BR0(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x050))
  70. #define M360_SIM_OR0(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x054))
  71. #define M360_SIM_BR1(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x060))
  72. #define M360_SIM_OR1(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x064))
  73. #define M360_SIM_BR2(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x070))
  74. #define M360_SIM_OR2(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x074))
  75. #define M360_SIM_BR3(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x080))
  76. #define M360_SIM_OR3(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x084))
  77. #define M360_SIM_BR4(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x090))
  78. #define M360_SIM_OR4(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x094))
  79. #define M360_SIM_BR5(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x0a0))
  80. #define M360_SIM_OR5(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x0a4))
  81. #define M360_SIM_BR6(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x0b0))
  82. #define M360_SIM_OR6(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x0b4))
  83. #define M360_SIM_BR7(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x0c0))
  84. #define M360_SIM_OR7(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x0c4))
  85. /* Communication Processor Module register addresses */
  86. #define M360_CPM_ICCR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x500))
  87. #define M360_CPM_CMR1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x504))
  88. #define M360_CPM_SAPR1(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x508))
  89. #define M360_CPM_DAPR1(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x50c))
  90. #define M360_CPM_BCR1(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x510))
  91. #define M360_CPM_FCR1(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x514))
  92. #define M360_CPM_CMAR1(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x516))
  93. #define M360_CPM_CSR1(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x518))
  94. #define M360_CPM_SDSR(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x51c))
  95. #define M360_CPM_SDCR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x51e))
  96. #define M360_CPM_SDAR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x520))
  97. #define M360_CPM_CMR2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x526))
  98. #define M360_CPM_SAPR2(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x528))
  99. #define M360_CPM_DAPR2(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x52c))
  100. #define M360_CPM_BCR2(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x530))
  101. #define M360_CPM_FCR2(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x534))
  102. #define M360_CPM_CMAR2(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x536))
  103. #define M360_CPM_CSR2(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x538))
  104. #define M360_CPM_CICR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x540))
  105. #define M360_CPM_CIPR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x544))
  106. #define M360_CPM_CIMR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x548))
  107. #define M360_CPM_CISR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x54c))
  108. #define M360_CPM_PADIR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x550))
  109. #define M360_CPM_PAPAR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x552))
  110. #define M360_CPM_PAODR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x554))
  111. #define M360_CPM_PADAT(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x556))
  112. #define M360_CPM_PCDIR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x560))
  113. #define M360_CPM_PCPAR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x562))
  114. #define M360_CPM_PCSO(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x564))
  115. #define M360_CPM_PCDAT(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x566))
  116. #define M360_CPM_PCINT(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x568))
  117. #define M360_CPM_TGCR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x580))
  118. #define M360_CPM_TMR1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x590))
  119. #define M360_CPM_TMR2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x592))
  120. #define M360_CPM_TRR1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x594))
  121. #define M360_CPM_TRR2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x596))
  122. #define M360_CPM_TCR1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x598))
  123. #define M360_CPM_TCR2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x59a))
  124. #define M360_CPM_TCN1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x59c))
  125. #define M360_CPM_TCN2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x59e))
  126. #define M360_CPM_TMR3(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5a0))
  127. #define M360_CPM_TMR4(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5a2))
  128. #define M360_CPM_TRR3(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5a4))
  129. #define M360_CPM_TRR4(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5a6))
  130. #define M360_CPM_TCR3(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5a8))
  131. #define M360_CPM_TCR4(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5aa))
  132. #define M360_CPM_TCN3(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5ac))
  133. #define M360_CPM_TCN4(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5ae))
  134. #define M360_CPM_TER1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5b0))
  135. #define M360_CPM_TER2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5b2))
  136. #define M360_CPM_TER3(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5b4))
  137. #define M360_CPM_TER4(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5b6))
  138. #define M360_CPM_CR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5c0))
  139. #define M360_CPM_RCCR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5c4))
  140. #define M360_CPM_RTER(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5d6))
  141. #define M360_CPM_RTMR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x5da))
  142. #define M360_CPM_BRGC1(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x5f0))
  143. #define M360_CPM_BRGC2(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x5f4))
  144. #define M360_CPM_BRGC3(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x5f8))
  145. #define M360_CPM_BRGC4(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x5fc))
  146. #define M360_CPM_GSMR_L1(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x600))
  147. #define M360_CPM_GSMR_H1(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x604))
  148. #define M360_CPM_PSMR1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x608))
  149. #define M360_CPM_TODR1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x60c))
  150. #define M360_CPM_DSR1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x60e))
  151. #define M360_CPM_SCCE1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x610))
  152. #define M360_CPM_SCCM1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x614))
  153. #define M360_CPM_SCCS1(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x617))
  154. #define M360_CPM_GSMR_L2(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x620))
  155. #define M360_CPM_GSMR_H2(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x624))
  156. #define M360_CPM_PSMR2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x628))
  157. #define M360_CPM_TODR2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x62c))
  158. #define M360_CPM_DSR2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x62e))
  159. #define M360_CPM_SCCE2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x630))
  160. #define M360_CPM_SCCM2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x634))
  161. #define M360_CPM_SCCS2(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x637))
  162. #define M360_CPM_GSMR_L3(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x640))
  163. #define M360_CPM_GSMR_H3(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x644))
  164. #define M360_CPM_PSMR3(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x648))
  165. #define M360_CPM_TODR3(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x64c))
  166. #define M360_CPM_DSR3(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x64e))
  167. #define M360_CPM_SCCE3(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x650))
  168. #define M360_CPM_SCCM3(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x654))
  169. #define M360_CPM_SCCS3(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x657))
  170. #define M360_CPM_GSMR_L4(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x660))
  171. #define M360_CPM_GSMR_H4(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x664))
  172. #define M360_CPM_PSMR4(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x668))
  173. #define M360_CPM_TODR4(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x66c))
  174. #define M360_CPM_DSR4(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x66e))
  175. #define M360_CPM_SCCE4(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x670))
  176. #define M360_CPM_SCCM4(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x674))
  177. #define M360_CPM_SCCS4(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x677))
  178. #define M360_CPM_SMCMR1(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x682))
  179. #define M360_CPM_SMCE1(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x686))
  180. #define M360_CPM_SMCM1(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x68a))
  181. #define M360_CPM_SMCMR2(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x692))
  182. #define M360_CPM_SMCE2(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x696))
  183. #define M360_CPM_SMCM2(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x69a))
  184. #define M360_CPM_SPMODE(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x6a0))
  185. #define M360_CPM_SPIE(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x6a6))
  186. #define M360_CPM_SPIM(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x6aa))
  187. #define M360_CPM_SPCOM(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x6ad))
  188. #define M360_CPM_PIPC(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x6b2))
  189. #define M360_CPM_PTPR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x6b6))
  190. #define M360_CPM_PBDIR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x6b8))
  191. #define M360_CPM_PBPAR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x6bc))
  192. #define M360_CPM_PBODR(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x6c2))
  193. #define M360_CPM_PBDAT(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x6c4))
  194. #define M360_CPM_SIMODE(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x6e0))
  195. #define M360_CPM_SIGMR(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x6e4))
  196. #define M360_CPM_SISTR(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x6e6))
  197. #define M360_CPM_SICMR(base) ((UINT8  *) (base + M360_REGB_OFFSET + 0x6e7))
  198. #define M360_CPM_SICR(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x6ec))
  199. #define M360_CPM_SIRP(base) ((UINT32 *) (base + M360_REGB_OFFSET + 0x6f2))
  200. #define M360_CPM_SIRAM(base) ((UINT16 *) (base + M360_REGB_OFFSET + 0x700))
  201. /* SMC GCI Monitor Channel Receive Buffer Descriptor */
  202. #define SMC_GCI_MON_RXBD_E 0x8000
  203. #define SMC_GCI_MON_RXBD_L 0x4000
  204. #define SMC_GCI_MON_RXBD_ER 0x2000
  205. #define SMC_GCI_MON_RXBD_MS 0x1000
  206. #define SMC_GCI_MON_RXBD_AB 0x0200
  207. #define SMC_GCI_MON_RXBD_EB 0x0100
  208. /* SMC GCI  Monitor Channel Transmit Buffer Descriptor */
  209. #define SMC_GCI_MON_TXBD_R 0x8000
  210. #define SMC_GCI_MON_TXBD_L 0x4000
  211. #define SMC_GCI_MON_TXBD_AR 0x2000
  212. #define SMC_GCI_MON_TXBD_MS 0x1000
  213. #define SMC_GCI_MON_TXBD_AB 0x0200
  214. #define SMC_GCI_MON_TXBD_EB 0x0100
  215. /* SMC GCI C/I Channel Receive Buffer Descriptor */
  216. #define SMC_GCI_CI_RXBD_E 0x8000
  217. #define SMC_GCI_CI_DATA_MASK 0x003F
  218. /* SMC GCI  C/I Channel Transmit Buffer Descriptor */
  219. #define SMC_GCI_CI_TXBD_R 0x8000
  220. /* SMC GCI Event and Mask Register definitions */
  221. #define SMC_GCI_SMCX_CTXB 0x08
  222. #define SMC_GCI_SMCX_CRXB 0x04
  223. #define SMC_GCI_SMCX_MTXB 0x02
  224. #define SMC_GCI_SMCX_MRXB 0x01
  225. /* SMC MODE Register fields in GCI MODE */
  226. #define SMC_SMCMR_CLEN_1 0x0000
  227. #define SMC_SMCMR_CLEN_2 0x0800
  228. #define SMC_SMCMR_CLEN_3 0x1000
  229. #define SMC_SMCMR_CLEN_4 0x1800
  230. #define SMC_SMCMR_CLEN_5 0x2000
  231. #define SMC_SMCMR_CLEN_6 0x2800
  232. #define SMC_SMCMR_CLEN_7 0x3000
  233. #define SMC_SMCMR_CLEN_8 0x3800
  234. #define SMC_SMCMR_CLEN_9 0x4000
  235. #define SMC_SMCMR_CLEN_10 0x4800
  236. #define SMC_SMCMR_CLEN_11 0x5000
  237. #define SMC_SMCMR_CLEN_12 0x5800
  238. #define SMC_SMCMR_CLEN_13 0x6000
  239. #define SMC_SMCMR_CLEN_14 0x6800
  240. #define SMC_SMCMR_CLEN_15 0x7000
  241. #define SMC_SMCMR_CLEN_16 0x7800
  242. #define SMC_SMCMR_ME 0x0400
  243. #define SMC_SMCMR_MP 0x0200
  244. #define SMC_SMCMR_CN 0x0100
  245. #define SMC_SMCMR_CHAN1 0x0000
  246. #define SMC_SMCMR_CHAN2 0x0100
  247. #define SMC_SMCMR_SM_GCI 0x0000
  248. #define SMC_SMCMR_SM_UART 0x0020
  249. #define SMC_SMCMR_SM_TRANSPARENT 0x0030
  250. #define SMC_SMCMR_DM_NORMAL 0x0000
  251. #define SMC_SMCMR_DM_LCLOOP 0x0004
  252. #define SMC_SMCMR_DM_ECHO 0x0008
  253. #define SMC_SMCMR_TEN 0x0002
  254. #define SMC_SMCMR_REN 0x0001
  255. #define SMC_SMCMR_CRX_ENABLE 0x0004
  256. /* SI GLOBAL MODE register */
  257. #define SI_SIGMR_ENB 0x08
  258. #define SI_SIGMR_ENA 0x04
  259. #define SI_SIGMR_RDM_1CHN_64E 0x00
  260. #define SI_SIGMR_RDM_1CHN_32E 0x01
  261. #define SI_SIGMR_RDM_2CHN_32E 0x02
  262. #define SI_SIGMR_RDM_2CHN_16E 0x03
  263. /* SIRAM fields */
  264. #define SI_SWTR 0x4000
  265. #define SI_SSEL4 0x2000
  266. #define SI_SSEL3 0x1000
  267. #define SI_SSEL2 0x0800
  268. #define SI_SSEL1 0x0400
  269. #define SI_CSEL_NS1 0x0000
  270. #define SI_CSEL_SCC1 0x0040
  271. #define SI_CSEL_SCC2 0x0080
  272. #define SI_CSEL_SCC3 0x00C0
  273. #define SI_CSEL_SCC4 0x0100
  274. #define SI_CSEL_SMC1 0x0140
  275. #define SI_CSEL_SMC2 0x0180
  276. #define SI_CSEL_NS2 0x01C0
  277. #define SI_CNT_1 0x0000
  278. #define SI_CNT_2 0x0004
  279. #define SI_CNT_3 0x0008
  280. #define SI_CNT_4 0x000C
  281. #define SI_CNT_5 0x0010
  282. #define SI_CNT_6 0x0014
  283. #define SI_CNT_7 0x0018
  284. #define SI_CNT_8 0x001C
  285. #define SI_CNT_9 0x0020
  286. #define SI_CNT_10 0x0024
  287. #define SI_CNT_11 0x0028
  288. #define SI_CNT_12 0x002C
  289. #define SI_CNT_13 0x0030
  290. #define SI_CNT_14 0x0034
  291. #define SI_CNT_15 0x0038
  292. #define SI_CNT_16 0x003C
  293. #define SI_BYT 0x0002
  294. #define SI_LST 0x0001
  295. /* SIM - System Integration Module */
  296. /* SIM Module Configuration Register definitions */
  297. #define SIM_MCR_IARB_OFF 0x00000000 /* interrupt arb = off */
  298. #define SIM_MCR_IARB_LO 0x00000001 /* interrupt arb = 0x1 */
  299. #define SIM_MCR_IARB_HI 0x0000000f /* interrupt arb = 0xf */
  300. #define SIM_MCR_BCLRISM 0x00000070 /* bus clear in arb ID */
  301. #define SIM_MCR_BCLRIID 0x00000070 /* bus clear int service mask */
  302. #define SIM_MCR_SUPV 0x00000080 /* supervisor/user data space */
  303. #define SIM_MCR_SHEN 0x00000300 /* show cycle enable */
  304. #define SIM_MCR_BCLROID 0x00001c00 /* bus clear out arb ID */
  305. #define SIM_MCR_FRZ0 0x00002000 /* freeze enable - bus mon */
  306. #define SIM_MCR_FRZ1 0x00004000 /* freeze enable - SWE & PIT */
  307. #define SIM_MCR_ASTM 0x00008000 /* arb synch timing mode */
  308. #define SIM_MCR_BSTM 0x00010000 /* bus synch timing mode */
  309. #define SIM_MCR_BR040ID 0xe0000000 /* bus request 68040 arb ID */
  310. /* SIM Clock Out Control Register definitions */
  311. #define SIM_CLKOCR_COM1_FULL 0x00 /* CLKO1 full strength output */
  312. #define SIM_CLKOCR_COM1_TWO 0x01 /* CLKO1 two thirds strength */
  313. #define SIM_CLKOCR_COM1_ONE 0x02 /* CLKO1 one third strength */
  314. #define SIM_CLKOCR_COM1_DIS 0x03 /* CLKO1 disabled */
  315. #define SIM_CLKOCR_COM2_FULL 0x00 /* CLKO2 full strength output */
  316. #define SIM_CLKOCR_COM2_TWO 0x04 /* CLKO2 two thirds strength */
  317. #define SIM_CLKOCR_COM2_ONE 0x08 /* CLKO2 one third strength */
  318. #define SIM_CLKOCR_COM2_DIS 0x0c /* CLKO2 disabled */
  319. #define SIM_CLKOCR_RSTEN 0x20 /* loss of lock causes reset */
  320. #define SIM_CLKOCR_CLKOWP 0x80 /* CLKOCR write protect */
  321. /* SIM PLL Control Register definitions */
  322. #define SIM_PLLCR_MF 0x0fff /* multiplication factor */
  323. #define SIM_PLLCR_STSIM 0x1000 /* stop mode - VCO drives SIM */
  324. #define SIM_PLLCR_PREEN 0x2000 /* prescaller enable */
  325. #define SIM_PLLCR_PLLWP 0x4000 /* PLLCR write protect */
  326. #define SIM_PLLCR_PLLEN 0x8000 /* PLL enable */
  327. /* SIM Clock Divider Control Register defintions */
  328. #define SIM_CDVCR_CSRC 0x0001 /* high/low freq system clk */
  329. #define SIM_CDVCR_DFNH_1 0x0000 /* divide high freq clk by 1 */
  330. #define SIM_CDVCR_DFNH_2 0x0002 /* divide high freq clk by 2 */
  331. #define SIM_CDVCR_DFNH_4 0x0004 /* divide high freq clk by 4 */
  332. #define SIM_CDVCR_DFNH_8 0x0006 /* divide high freq clk by 8 */
  333. #define SIM_CDVCR_DFNH_16 0x0008 /* divide high freq clk by 16 */
  334. #define SIM_CDVCR_DFNH_32 0x000a /* divide high freq clk by 32 */
  335. #define SIM_CDVCR_DFNH_64 0x000c /* divide high freq clk by 64 */
  336. #define SIM_CDVCR_DFNL_2 0x0000 /* divide low freq clk by 2 */
  337. #define SIM_CDVCR_DFNL_4 0x0010 /* divide low freq clk by 4 */
  338. #define SIM_CDVCR_DFNL_8 0x0020 /* divide low freq clk by 8 */
  339. #define SIM_CDVCR_DFNL_16 0x0030 /* divide low freq clk by 16 */
  340. #define SIM_CDVCR_DFNL_32 0x0040 /* divide low freq clk by 32 */
  341. #define SIM_CDVCR_DFNL_64 0x0050 /* divide low freq clk by 64 */
  342. #define SIM_CDVCR_DFNL_256 0x0070 /* divide low freq clk by 256 */
  343. #define SIM_CDVCR_RRQEN 0x0080 /* RISC idle -> high freq clk */
  344. #define SIM_CDVCR_INTEN 0x0700 /* interrupt -> high freq clk */
  345. #define SIM_CDVCR_DFTM_1 0x0000 /* divide BRGCLK by 1 - norm */
  346. #define SIM_CDVCR_DFTM_4 0x0800 /* divide BRGCLK by 4 */
  347. #define SIM_CDVCR_DFTM_16 0x1000 /* divide BRGCLK by 16 */
  348. #define SIM_CDVCR_DFTM_64 0x1800 /* divide BRGCLK by 64 */
  349. #define SIM_CDVCR_DFSY_1 0x0000 /* divide SyncClk by 1 - norm */
  350. #define SIM_CDVCR_DFSY_4 0x2000 /* divide SyncClk by 4 */
  351. #define SIM_CDVCR_DFSY_16 0x4000 /* divide SyncClk by 16 */
  352. #define SIM_CDVCR_DFSY_64 0x6000 /* divide SyncClk by 64 */
  353. #define SIM_CDVCR_CDVWP 0x8000 /* CDVCR write protect */
  354. /* SIM Auto Vector Register definitions */
  355. #define SIM_AVR_LVL1 0x02 /* auto vector on IRQ1 */
  356. #define SIM_AVR_LVL2 0x04 /* auto vector on IRQ2 */
  357. #define SIM_AVR_LVL3 0x08 /* auto vector on IRQ3 */
  358. #define SIM_AVR_LVL4 0x10 /* auto vector on IRQ4 */
  359. #define SIM_AVR_LVL5 0x20 /* auto vector on IRQ5 */
  360. #define SIM_AVR_LVL6 0x40 /* auto vector on IRQ6 */
  361. #define SIM_AVR_LVL7 0x80 /* auto vector on IRQ7 */
  362. /* SIM Based Interrupt Autovector addresses */
  363. #define INT_VEC_AV1 0x19 /* vector location of AV1 */
  364. #define INT_VEC_AV2 0x1a /* vector location of AV2 */
  365. #define INT_VEC_AV3 0x1b /* vector location of AV3 */
  366. #define INT_VEC_AV4 0x1c /* vector location of AV4 */
  367. #define INT_VEC_AV5 0x1d /* vector location of AV5 */
  368. #define INT_VEC_AV6 0x1e /* vector location of AV6 */
  369. #define INT_VEC_AV7 0x1f /* vector location of AV7 */
  370. /* SIM Reset Status Register definitions */
  371. #define SIM_RSR_SRSTP 0x01 /* soft reset pin */
  372. #define SIM_RSR_SRST 0x02 /* soft reset */
  373. #define SIM_RSR_LOC 0x04 /* loss of clock reset */
  374. #define SIM_RSR_DBF 0x10 /* double bus fault reset */
  375. #define SIM_RSR_SW 0x20 /* software watchdog reset */
  376. #define SIM_RSR_POW 0x40 /* power up reset */
  377. #define SIM_RSR_EXT 0x80 /* external reset */
  378. /* SIM System Protection Control Register definitions (write once only) */
  379. #define SIM_SYPCR_BMT_1024 0x00 /* 1024 clk monitor timeout */
  380. #define SIM_SYPCR_BMT_512 0x01 /* 512 clk monitor timeout */
  381. #define SIM_SYPCR_BMT_256 0x02 /* 256 clk monitor timeout */
  382. #define SIM_SYPCR_BMT_128 0x03 /* 128 clk monitor timeout */
  383. #define SIM_SYPCR_BME 0x04 /* bus monitor enable */
  384. #define SIM_SYPCR_DBFE 0x08 /* double bus fault enable */
  385. #define SIM_SYPCR_SWT_9 0x00 /* 2^9  clk cycles (SWP=0) */
  386. #define SIM_SYPCR_SWT_11  0x10 /* 2^11 clk cycles (SWP=0) */
  387. #define SIM_SYPCR_SWT_13 0x20 /* 2^13 clk cycles (SWP=0) */
  388. #define SIM_SYPCR_SWT_15 0x30 /* 2^15 clk cycles (SWP=0) */
  389. #define SIM_SYPCR_SWT_18 0x00 /* 2^18 clk cycles (SWP=1) */
  390. #define SIM_SYPCR_SWT_20 0x10 /* 2^20 clk cycles (SWP=1) */
  391. #define SIM_SYPCR_SWT_22 0x20 /* 2^22 clk cycles (SWP=1) */
  392. #define SIM_SYPCR_SWT_24 0x30 /* 2^24 clk cycles (SWP=1) */
  393. #define SIM_SYPCR_SWRI 0x40 /* soft watchdog resets CPU */
  394. #define SIM_SYPCR_SWE 0x80 /* soft watchdog enable */
  395. /* SIM Periodic Interrupt Control Register definitions */
  396. #define SIM_PICR_PIV 0x00ff /* PIT int vector */
  397. #define SIM_PICR_PIRQL 0x0700 /* PIT int request level */
  398. /* SIM Periodic Interrupt Timer Register definitions */
  399. #define SIM_PITR_PITR_CNT 0x00ff /* PIT counter register */
  400. #define SIM_PITR_PTP 0x0100 /* PIT prescale bit */
  401. #define SIM_PITR_SWP 0x0200 /* soft watchdog prescale bit */
  402. /* SIM Software Watchdog Service Register definitions */
  403. #define SIM_SWSR_ACK1 0x55 /* software watchdog ack. 1 */
  404. #define SIM_SWSR_ACK2 0xaa /* software watchdog ack. 2 */
  405. /* EBI - External Bus Interface */
  406. /* EBI Port E Pin Assignment Register definitions */
  407. #define EBI_PEPAR_IACK5 0x0001 /* select IACK5* output func */
  408. #define EBI_PEPAR_IACK7 0x0002 /* select IACK7* output func */
  409. #define EBI_PEPAR_IACK1_2 0x0004 /* select IACK1,2 output func */
  410. #define EBI_PEPAR_IACK3_6 0x0010 /* select IACK3,6 output func */
  411. #define EBI_PEPAR_PWW 0x0020 /* PEPAR was written */
  412. #define EBI_PEPAR_AMUX 0x0040 /* select AMUX output func */
  413. #define EBI_PEPAR_WE 0x0080 /* select WE* output function */
  414. #define EBI_PEPAR_RAS1DD 0x0100 /* select RAS1DD* output func */
  415. #define EBI_PEPAR_CF1MODE 0x0600 /* CONFIG1/BCLRO*/RAS2DD* */
  416. #define EBI_PEPAR_SINTOUT 0x7000 /* slave interrupt out mode */
  417. /* MEMC - Memory Controller */
  418. /* MEMC Global Memory Register definitions */
  419. #define MEMC_GMR_GMAX 0x00000020 /* global address mux enable */
  420. #define MEMC_GMR_DW40 0x00000040 /* delay write for 68EC040 */
  421. #define MEMC_GMR_DWQ 0x00000080 /* delay write for QUICC */
  422. #define MEMC_GMR_NCS 0x00000100 /* suppress CS/RAS on CPU sp. */
  423. #define MEMC_GMR_TSS40 0x00000200 /* TS* sample for 68EC040 */
  424. #define MEMC_GMR_PBEE 0x00000400 /* parity bus error enable */
  425. #define MEMC_GMR_OPAR 0x00000800 /* odd/even parity */
  426. #define MEMC_GMR_EMWS 0x00001000 /* external master wait state */
  427. #define MEMC_GMR_SYNC 0x00002000 /* synch external accesses */
  428. #define MEMC_GMR_WBTQ 0x00004000 /* wait between QUICC trans */
  429. #define MEMC_GMR_WBT40 0x00008000 /* wait between 68EC040 trans */
  430. #define MEMC_GMR_DPS_32 0x00000000 /* DRAM port size is 32 bits */
  431. #define MEMC_GMR_DPS_16 0x00010000 /* DRAM port size is 16 bits */
  432. #define MEMC_GMR_DPS_EX 0x00030000 /* external DSACK* support */
  433. #define MEMC_GMR_PGS_128K 0x00000000 /* page size is 128Kbytes */
  434. #define MEMC_GMR_PGS_256K 0x00040000 /* page size is 256Kbytes */
  435. #define MEMC_GMR_PGS_512K 0x00080000 /* page size is 512Kbytes */
  436. #define MEMC_GMR_PGS_1M 0x000c0000 /* page size is 1Mbytes */
  437. #define MEMC_GMR_PGS_2M 0x00100000 /* page size is 2Mbytes */
  438. #define MEMC_GMR_PGS_4M 0x00140000 /* page size is 4Mbytes */
  439. #define MEMC_GMR_PGS_8M 0x00180000 /* page size is 8Mbytes */
  440. #define MEMC_GMR_PGS_16M 0x001c0000 /* page size is 16Mbytes */
  441. #define MEMC_GMR_RCYC_4 0x00000000 /* refresh cycle 4 clocks */
  442. #define MEMC_GMR_RCYC_6 0x00200000 /* refresh cycle 6 clocks */
  443. #define MEMC_GMR_RCYC_7 0x00400000 /* refresh cycle 7 clocks */
  444. #define MEMC_GMR_RCYC_8 0x00600000 /* refresh cycle 8 clocks */
  445. #define MEMC_GMR_RFEN 0x00800000 /* refresh enable */
  446. #define MEMC_GMR_RCNT 0xff000000 /* refresh counter period */
  447. /* MEMC Status Register definitions */
  448. #define MEMC_MSTAT_PER1 0x0001 /* write protect err - bank 1 */
  449. #define MEMC_MSTAT_PER2 0x0002 /* write protect err - bank 2 */
  450. #define MEMC_MSTAT_PER3 0x0004 /* write protect err - bank 3 */
  451. #define MEMC_MSTAT_PER4 0x0008 /* write protect err - bank 4 */
  452. #define MEMC_MSTAT_PER5 0x0010 /* write protect err - bank 5 */
  453. #define MEMC_MSTAT_PER6 0x0020 /* write protect err - bank 6 */
  454. #define MEMC_MSTAT_PER7 0x0040 /* write protect err - bank 7 */
  455. #define MEMC_MSTAT_PER8 0x0080 /* write protect err - bank 8 */
  456. #define MEMC_MSTAT_WPER 0x0100 /* write protect error */
  457. /* MEMC Base Register definitions */
  458. #define MEMC_BR_V 0x00000001 /* DRAM/SRAM bank is valid */
  459. #define MEMC_BR_WP 0x00000002 /* write protect */
  460. #define MEMC_BR_PAREN 0x00000004 /* parity checking enable */
  461. #define MEMC_BR_CSNTQ 0x00000008 /* CS negate timing - QUICC */
  462. #define MEMC_BR_CSNT40 0x00000010 /* CS negate timing - 68EC040 */
  463. #define MEMC_BR_BACK40 0x00000020 /* burst acknowledge 68EC040 */
  464. #define MEMC_BR_TRLXQ 0x00000040 /* timing relax */
  465. #define MEMC_BR_FC 0x00000780 /* function code spec */
  466. #define MEMC_BR_BA 0xfffff800 /* base address spec */
  467. /* MEMC Option Register definitions */
  468. #define MEMC_OR_DSSEL 0x00000001 /* DRAM/SRAM select */
  469. #define MEMC_OR_SPS_32 0x00000000 /* SRAM port size is 32 bits */
  470. #define MEMC_OR_SPS_16 0x00000002 /* SRAM port size is 16 bits */
  471. #define MEMC_OR_SPS_8 0x00000004 /* SRAM port size is 8 bits */
  472. #define MEMC_OR_SPS_EX 0x00000006 /* external DSACK* support */
  473. #define MEMC_OR_PGME 0x00000008 /* page mode enable (DRAM) */
  474. #define MEMC_OR_BCYC_1 0x00000000 /* burst cycle 1 clock */
  475. #define MEMC_OR_BCYC_2 0x00000020 /* burst cycle 2 clock */
  476. #define MEMC_OR_BCYC_3 0x00000040 /* burst cycle 3 clock */
  477. #define MEMC_OR_BCYC_4 0x00000060 /* burst cycle 4 clock */
  478. #define MEMC_OR_FC 0x00000780 /* function code mask */
  479. #define MEMC_OR_AM 0x0ffff800 /* addresss mask */
  480. #define MEMC_OR_TCYC 0xf0000000 /* bus cycle length in clocks */
  481. /*** CPM - register definitions for the Communication Processor Module ***/
  482. /* CPM - Communication Processor Module */
  483. /* CPM Configuration Register definitions */
  484. #define CPM_CR_FLG 0x0001 /* flag - command executing */
  485. #define CPM_CR_CHANNEL_SCC1 0x0000 /* SCC1 channel */
  486. #define CPM_CR_CHANNEL_SCC2 0x0040 /* SCC2 channel */
  487. #define CPM_CR_CHANNEL_SPI 0x0050 /* SPI channel */
  488. #define CPM_CR_CHANNEL_RTMR 0x0050 /* RISC timer channel */
  489. #define CPM_CR_CHANNEL_SCC3 0x0080 /* SCC3 channel */
  490. #define CPM_CR_CHANNEL_SMC1 0x0090 /* SMC1 channel */
  491. #define CPM_CR_CHANNEL_IDMA1 0x0090 /* IDMA1 channel */
  492. #define CPM_CR_CHANNEL_SCC4 0x00c0 /* SCC4 channel */
  493. #define CPM_CR_CHANNEL_SMC2 0x00d0 /* SMC2 channel */
  494. #define CPM_CR_CHANNEL_IDMA2 0x00d0 /* IDMA2 channel */
  495. #define CPM_CR_OPCODE 0x0f00 /* command opcode */
  496. #define CPM_CR_SCC_INIT_RT 0x0000 /* initialize SCC rx and tx*/
  497. #define CPM_CR_SCC_INIT_R 0x0100 /* initialize SCC rx only */
  498. #define CPM_CR_SCC_INIT_T 0x0200 /* initialize SCC tx only */
  499. #define CPM_CR_SCC_HUNT 0x0300 /* enter rx frame hunt mode */
  500. #define CPM_CR_SCC_STOP 0x0400 /* stop SCC tx */
  501. #define CPM_CR_SCC_GRSTOP 0x0500 /* gracefully stop SCC tx */
  502. #define CPM_CR_SCC_RESTART 0x0600 /* restart SCC tx */
  503. #define CPM_CR_SCC_CLOSE 0x0700 /* close SCC rx buffer */
  504. #define CPM_CR_SCC_SET_GROUP 0x0800 /* set SCC group address */
  505. #define CPM_CR_SCC_RESET_BCS 0x0a00 /* reset bisync seq calc */
  506. #define CPM_CR_RST 0x8000 /* software reset command */
  507. /* CPIC - CPM Interrupt Controller */
  508. /* CPM Interrupt Configuration Register definitions */
  509. #define CPIC_CICR_SPS 0x00000001 /* spread SCC priority scheme */
  510. #define CPIC_CICR_VBA 0x000000e0 /* vector base address */
  511. #define CPIC_CICR_HP 0x00001f00 /* highest priority source */
  512. #define CPIC_CICR_IRL 0x0000e000 /* interrupt request level */
  513. #define CPIC_CICR_SCaP_1 0x00000000 /* SCCa will be used by SCC1 */
  514. #define CPIC_CICR_SCaP_2 0x00010000 /* SCCa will be used by SCC2 */
  515. #define CPIC_CICR_SCaP_3 0x00020000 /* SCCa will be used by SCC3 */
  516. #define CPIC_CICR_SCaP_4 0x00030000 /* SCCa will be used by SCC4 */
  517. #define CPIC_CICR_SCbP_1 0x00000000 /* SCCb will be used by SCC1 */
  518. #define CPIC_CICR_SCbP_2 0x00040000 /* SCCb will be used by SCC2 */
  519. #define CPIC_CICR_SCbP_3 0x00080000 /* SCCb will be used by SCC3 */
  520. #define CPIC_CICR_SCbP_4 0x000c0000 /* SCCb will be used by SCC4 */
  521. #define CPIC_CICR_SCcP_1 0x00000000 /* SCCc will be used by SCC1 */
  522. #define CPIC_CICR_SCcP_2 0x00100000 /* SCCc will be used by SCC2 */
  523. #define CPIC_CICR_SCcP_3 0x00200000 /* SCCc will be used by SCC3 */
  524. #define CPIC_CICR_SCcP_4 0x00300000 /* SCCc will be used by SCC4 */
  525. #define CPIC_CICR_SCdP_1 0x00000000 /* SCCd will be used by SCC1 */
  526. #define CPIC_CICR_SCdP_2 0x00400000 /* SCCd will be used by SCC2 */
  527. #define CPIC_CICR_SCdP_3 0x00800000 /* SCCd will be used by SCC3 */
  528. #define CPIC_CICR_SCdP_4 0x00c00000 /* SCCd will be used by SCC4 */
  529. /* CPM Interrupt Pending, Mask, and In-Serivice Register definitions */
  530. #define CPIC_CIXR_PC11 0x00000002 /* PC11 interrupt source */
  531. #define CPIC_CIXR_PC10 0x00000004 /* PC10 interrupt source */
  532. #define CPIC_CIXR_SMC2 0x00000008 /* SMC2 interrupt source */
  533. #define CPIC_CIXR_SMC1 0x00000010 /* SMC1 interrupt source */
  534. #define CPIC_CIXR_SPI 0x00000020 /* SPI interrupt source */
  535. #define CPIC_CIXR_PC9 0x00000040 /* PC9 interrupt source */
  536. #define CPIC_CIXR_TMR4 0x00000080 /* TMR4 interrupt source */
  537. #define CPIC_CIXR_PC8 0x00000200 /* PC8 interrupt source */
  538. #define CPIC_CIXR_PC7 0x00000400 /* PC7 interrupt source */
  539. #define CPIC_CIXR_PC6 0x00000800 /* PC6 interrupt source */
  540. #define CPIC_CIXR_TMR3 0x00001000 /* TMR3 interrupt source */
  541. #define CPIC_CIXR_PC5 0x00004000 /* PC5 interrupt source */
  542. #define CPIC_CIXR_PC4 0x00008000 /* PC4 interrupt source */
  543. #define CPIC_CIXR_RTT 0x00020000 /* RTT interrupt source */
  544. #define CPIC_CIXR_TMR2 0x00040000 /* TMR2 interrupt source */
  545. #define CPIC_CIXR_IDMA2 0x00100000 /* IDMA2 interrupt source */
  546. #define CPIC_CIXR_IDMA1 0x00200000 /* IDMA1 interrupt source */
  547. #define CPIC_CIXR_SDMA 0x00400000 /* SDMA interrupt source */
  548. #define CPIC_CIXR_PC3 0x00800000 /* PC3 interrupt source */
  549. #define CPIC_CIXR_PC2 0x01000000 /* PC2 interrupt source */
  550. #define CPIC_CIXR_TMR1 0x02000000 /* TMR1 interrupt source */
  551. #define CPIC_CIXR_PC1 0x04000000 /* PC1 interrupt source */
  552. #define CPIC_CIXR_SCC4 0x08000000 /* SCC4 interrupt source */
  553. #define CPIC_CIXR_SCC3 0x10000000 /* SCC3 interrupt source */
  554. #define CPIC_CIXR_SCC2 0x20000000 /* SCC2 interrupt source */
  555. #define CPIC_CIXR_SCC1 0x40000000 /* SCC1 interrupt source */
  556. #define CPIC_CIXR_PC0 0x80000000 /* PC0 interrupt source */
  557. /* CPM Based Interrupt Vectors offsets */
  558. #define INT_OFF_ERR 0x0
  559. #define INT_OFF_PC11 0x1
  560. #define INT_OFF_PC10 0x2
  561. #define INT_OFF_SMC2 0x3
  562. #define INT_OFF_SMC1 0x4
  563. #define INT_OFF_SPI 0x5
  564. #define INT_OFF_PC9 0x6
  565. #define INT_OFF_TMR4 0x7
  566. #define INT_OFF_RES1 0x8
  567. #define INT_OFF_PC8 0x9
  568. #define INT_OFF_PC7 0xa
  569. #define INT_OFF_PC6 0xb
  570. #define INT_OFF_TMR3 0xc
  571. #define INT_OFF_RES2 0xd
  572. #define INT_OFF_PC5 0xe
  573. #define INT_OFF_PC4 0xf
  574. #define INT_OFF_RES3 0x10
  575. #define INT_OFF_RISC 0x11
  576. #define INT_OFF_TMR2 0x12
  577. #define INT_OFF_RES4 0x13
  578. #define INT_OFF_IDMA2 0x14
  579. #define INT_OFF_IDMA1 0x15
  580. #define INT_OFF_SDMA 0x16
  581. #define INT_OFF_PC3 0x17
  582. #define INT_OFF_PC2 0x18
  583. #define INT_OFF_TMR1 0x19
  584. #define INT_OFF_PC1 0x1a
  585. #define INT_OFF_SCC4 0x1b
  586. #define INT_OFF_SCC3 0x1c
  587. #define INT_OFF_SCC2 0x1d
  588. #define INT_OFF_SCC1 0x1e
  589. #define INT_OFF_PC0 0x1f
  590. /* CPM Based Interrupt Vectors addresses */
  591. #define INT_CPM_BASE(base) (*M360_CPM_CICR(base) & CPIC_CICR_VBA)
  592. #define INT_VEC_ERR(base) (INT_OFF_ERR   | INT_CPM_BASE(base))
  593. #define INT_VEC_PC11(base) (INT_OFF_PC11  | INT_CPM_BASE(base))
  594. #define INT_VEC_PC10(base) (INT_OFF_PC10  | INT_CPM_BASE(base))
  595. #define INT_VEC_SMC2(base) (INT_OFF_SMC2  | INT_CPM_BASE(base))
  596. #define INT_VEC_SMC1(base) (INT_OFF_SMC1  | INT_CPM_BASE(base))
  597. #define INT_VEC_SPI(base) (INT_OFF_SPI   | INT_CPM_BASE(base))
  598. #define INT_VEC_PC9(base) (INT_OFF_PC9   | INT_CPM_BASE(base))
  599. #define INT_VEC_TMR4(base) (INT_OFF_TMR4  | INT_CPM_BASE(base))
  600. #define INT_VEC_RES1(base) (INT_OFF_RES1  | INT_CPM_BASE(base))
  601. #define INT_VEC_PC8(base) (INT_OFF_PC8   | INT_CPM_BASE(base))
  602. #define INT_VEC_PC7(base) (INT_OFF_PC7   | INT_CPM_BASE(base))
  603. #define INT_VEC_PC6(base) (INT_OFF_PC6   | INT_CPM_BASE(base))
  604. #define INT_VEC_TMR3(base) (INT_OFF_TMR3  | INT_CPM_BASE(base))
  605. #define INT_VEC_RES2(base) (INT_OFF_RES2  | INT_CPM_BASE(base))
  606. #define INT_VEC_PC5(base) (INT_OFF_PC5   | INT_CPM_BASE(base))
  607. #define INT_VEC_PC4(base) (INT_OFF_PC4   | INT_CPM_BASE(base))
  608. #define INT_VEC_RES3(base) (INT_OFF_RES3  | INT_CPM_BASE(base))
  609. #define INT_VEC_RISC(base) (INT_OFF_RISC  | INT_CPM_BASE(base))
  610. #define INT_VEC_TMR2(base) (INT_OFF_TMR2  | INT_CPM_BASE(base))
  611. #define INT_VEC_RES4(base) (INT_OFF_RES4  | INT_CPM_BASE(base))
  612. #define INT_VEC_IDMA2(base) (INT_OFF_IDMA2 | INT_CPM_BASE(base))
  613. #define INT_VEC_IDMA1(base) (INT_OFF_IDMA1 | INT_CPM_BASE(base))
  614. #define INT_VEC_SDMA(base) (INT_OFF_SDMA  | INT_CPM_BASE(base))
  615. #define INT_VEC_PC3(base) (INT_OFF_PC3   | INT_CPM_BASE(base))
  616. #define INT_VEC_PC2(base) (INT_OFF_PC2   | INT_CPM_BASE(base))
  617. #define INT_VEC_TMR1(base) (INT_OFF_TMR1  | INT_CPM_BASE(base))
  618. #define INT_VEC_PC1(base) (INT_OFF_PC1   | INT_CPM_BASE(base))
  619. #define INT_VEC_SCC4(base) (INT_OFF_SCC4  | INT_CPM_BASE(base))
  620. #define INT_VEC_SCC3(base) (INT_OFF_SCC3  | INT_CPM_BASE(base))
  621. #define INT_VEC_SCC2(base) (INT_OFF_SCC2  | INT_CPM_BASE(base))
  622. #define INT_VEC_SCC1(base) (INT_OFF_SCC1  | INT_CPM_BASE(base))
  623. #define INT_VEC_PC0(base) (INT_OFF_PC0   | INT_CPM_BASE(base))
  624. /* IDMA - Independent Direct Memory Access */
  625.  
  626. /* IDMA Configuration Register definitions */
  627. #define IDMA_ICCR_IAID 0x0070 /* IDMA arbitration ID */
  628. #define IDMA_ICCR_ISM 0x0700 /* interrupt service mask */
  629. #define IDMA_ICCR_ARBP_1 0x0000 /* ch 1 priority over ch 2 */
  630. #define IDMA_ICCR_ARBP_2 0x1000 /* ch 2 priority over ch 1 */
  631. #define IDMA_ICCR_ARBP_ROT 0x2000 /* rotating priority of IDMAs */
  632. #define IDMA_ICCR_FRZ_DIS 0x0000 /* ignore the FREEZE signal */
  633. #define IDMA_ICCR_FRZ_EN 0x4000 /* freeze on FREEZE signal */
  634. #define IDMA_ICCR_STP 0x8000 /* stop sys clk to IDMA chnls */
  635. /* SDMA - Serial Direct Memory Access */
  636.  
  637. /* SDMA Configuration Register definitions */
  638. #define SDMA_SDCR_INTB 0x0001 /* breakpoint interrupt mask */
  639. #define SDMA_SDCR_INTE 0x0002 /* bus error interrupt mask */
  640. #define SDMA_SDCR_INTR 0x0004 /* reserved interrupt mask */
  641. #define SDMA_SDCR_SAID 0x0070 /* SDMA arbitration ID */
  642. #define SDMA_SDCR_SISM 0x0700 /* interrupt service mask */
  643. #define SDMA_SDCR_FRZ_DIS 0x0000 /* ignore the FREEZE signal */
  644. #define SDMA_SDCR_FRZ_EN 0x4000 /* freeze on FREEZE signal */
  645. /* TMR - Timers */
  646. /* TMR Global Configuration Register definitions */
  647. #define TMR_TGCR_RST1 0x0001 /* reset/enable timer 1 */
  648. #define TMR_TGCR_STP1 0x0002 /* stop timer 1 */
  649. #define TMR_TGCR_FRZ1 0x0004 /* halt timer 1 on FREEZE */
  650. #define TMR_TGCR_GM1 0x0008 /* normal gate mode on TGATE1 */
  651. #define TMR_TGCR_RST2 0x0010 /* reset/enable timer 2 */
  652. #define TMR_TGCR_STP2 0x0020 /* stop timer 2 */
  653. #define TMR_TGCR_FRZ2 0x0040 /* halt timer 2 on FREEZE */
  654. #define TMR_TGCR_CAS2 0x0080 /* cascade timers 1 and 2 */
  655. #define TMR_TGCR_RST3 0x0100 /* reset/enable timer 3 */
  656. #define TMR_TGCR_STP3 0x0200 /* stop timer 3 */
  657. #define TMR_TGCR_FRZ3 0x0400 /* halt timer 3 on FREEZE */
  658. #define TMR_TGCR_GM2 0x0800 /* normal gate mode on TGATE2 */
  659. #define TMR_TGCR_RST4 0x1000 /* reset/enable timer 4 */
  660. #define TMR_TGCR_STP4 0x2000 /* stop timer 4 */
  661. #define TMR_TGCR_FRZ4 0x4000 /* halt timer 4 on FREEZE */
  662. #define TMR_TGCR_CAS4 0x8000 /* cascade timers 3 and 4 */
  663. /* TMR Mode Register definitions */
  664. #define TMR_TMR_GE 0x0001 /* enable TGATE signal */
  665. #define TMR_TMR_ICLK_CAS 0x0000 /* input is output of timer */
  666. #define TMR_TMR_ICLK_CLK 0x0002 /* input is general sys clock */
  667. #define TMR_TMR_ICLK_CLK16 0x0004 /* input is sys clock div 16 */
  668. #define TMR_TMR_ICLK_TIN 0x0006 /* input is TIN pin */
  669. #define TMR_TMR_FRR 0x0008 /* free run/restart timer */
  670. #define TMR_TMR_ORI 0x0010 /* output interrupt enable */
  671. #define TMR_TMR_OM 0x0020 /* output mode */
  672. #define TMR_TMR_CE 0x00c0 /* capture edge for TIN input */
  673. #define TMR_TMR_PS 0xff00 /* prescaler value */
  674. /* TMR Event Register definitions */
  675. #define TMR_TER_CAP 0x0001 /* capture event occurred */
  676. #define TMR_TER_REF 0x0002 /* reference event occurred */
  677. /* SI - Serial Interface */
  678. /* SI Mode Register definitions */
  679. #define SI_SIMODE_TFSDa 0x00000003 /* transmit frame sync delay */
  680. #define SI_SIMODE_GMa 0x00000004 /* grant mode TDM a */
  681. #define SI_SIMODE_FEa 0x00000008 /* frame sync edge TDM a */
  682. #define SI_SIMODE_CEa 0x00000010 /* clock edge TDM a */
  683. #define SI_SIMODE_STZa 0x00000020 /* set L1TXDa to zero TDM a */
  684. #define SI_SIMODE_CRTa 0x00000040 /* common Rx/Tx pins TDM a */
  685. #define SI_SIMODE_DSCa 0x00000080 /* double speed clk TDM a */
  686. #define SI_SIMODE_RFSDa 0x00000300 /* receive frame sync delay */
  687. #define SI_SIMODE_SDMa 0x00000c00 /* SI diagnostic mode TDM a */
  688. #define SI_SIMODE_SMC1CS 0x00007000 /* SMC1 clk source (NMSI) */
  689. #define SI_SIMODE_SMC1 0x00008000 /* SMC1 connection (NMSI) */
  690. #define SI_SIMODE_TFSDb 0x00030000 /* transmit frame sync delay */
  691. #define SI_SIMODE_GMb 0x00040000 /* grant mode TDM b */
  692. #define SI_SIMODE_FEb 0x00080000 /* frame sync edge TDM b */
  693. #define SI_SIMODE_CEb 0x00100000 /* clock edge TDM b */
  694. #define SI_SIMODE_STZb 0x00200000 /* set L1TXDb to zero TDM b */
  695. #define SI_SIMODE_CRTb 0x00400000 /* common Rx/Tx pins TDM a */
  696. #define SI_SIMODE_DSCb 0x00800000 /* double speed clock TDM b */
  697. #define SI_SIMODE_RFSDb 0x03000000 /* receive frame sync delay */
  698. #define SI_SIMODE_SDMb 0x0c000000 /* SI diagnostic mode TDM b */
  699. #define SI_SIMODE_SMC2CS 0x70000000 /* SMC2 clk source (NMSI) */
  700. #define SI_SIMODE_SMC2 0x80000000 /* SMC2 connection (NMSI) */
  701. /* SI Clock Route Register definitions */
  702. #define SI_SICR_TCS 0x07 /* transmit clock source SCC */
  703. #define SI_SICR_RCS 0x38 /* receive clock source SCC */
  704. #define SI_SICR_SC 0x40 /* SCC connection (NMSI) */
  705. #define SI_SICR_GR 0x80 /* grant support by SCC */
  706. /* BRG - Baud Rate Generator */
  707. /* BRG Configuration Register definitions */
  708. #define BRG_CR_DIV16 0x00001 /* BRG clock prescale div 16 */
  709. #define BRG_CR_CD 0x01ffe /* clock divider */
  710. #define BRG_CR_ATB 0x02000 /* autobaud support */
  711. #define BRG_CR_EXT_BRGCLK 0x00000 /* external clk source BRGCLK */
  712. #define BRG_CR_EXT_CLK2 0x04000 /* external clk source CLK2 */
  713. #define BRG_CR_EXT_CLK6 0x08000 /* external clk source CLK6 */
  714. #define BRG_CR_EN 0x10000 /* enable BRG count */
  715. #define BRG_CR_RST 0x20000 /* perform reset on BRG */
  716. /* SCC - Serial Communication Controller */
  717. /* General SCC Mode Register definitions */
  718. #define SCC_GSMRL_HDLC 0x00000000 /* HDLC mode */
  719. #define SCC_GSMRL_APPLETALK 0x00000002 /* AppleTalk mode (LocalTalk) */
  720. #define SCC_GSMRL_SS7 0x00000003 /* SS7 mode (microcode) */
  721. #define SCC_GSMRL_UART 0x00000004 /* UART mode */
  722. #define SCC_GSMRL_PROFI_BUS 0x00000005 /* Profi-Bus mode (microcode) */
  723. #define SCC_GSMRL_ASYNC_HDLC 0x00000006 /* async HDLC mode (microcode)*/
  724. #define SCC_GSMRL_V14 0x00000007 /* V.14 mode */
  725. #define SCC_GSMRL_BISYNC 0x00000008 /* BISYNC mode */
  726. #define SCC_GSMRL_DDCMP 0x00000009 /* DDCMP mode (microcode) */
  727. #define SCC_GSMRL_ETHERNET 0x0000000c /* ethernet mode (SCC1 only) */
  728. #define SCC_GSMRL_ENT 0x00000010 /* enable transmitter */
  729. #define SCC_GSMRL_ENR 0x00000020 /* enable receiver */
  730. #define SCC_GSMRL_LOOPBACK 0x00000040 /* local loopback mode */
  731. #define SCC_GSMRL_ECHO 0x00000080 /* automatic echo mode */
  732. #define SCC_GSMRL_TENC 0x00000700 /* transmitter encoding method*/
  733. #define SCC_GSMRL_RENC 0x00003800 /* receiver encoding method */
  734. #define SCC_GSMRL_RDCR_X8 0x00004000 /* receive DPLL clock x8 */
  735. #define SCC_GSMRL_RDCR_X16 0x00008000 /* receive DPLL clock x16 */
  736. #define SCC_GSMRL_RDCR_X32 0x0000c000 /* receive DPLL clock x32 */
  737. #define SCC_GSMRL_TDCR_X8 0x00010000 /* transmit DPLL clock x8 */
  738. #define SCC_GSMRL_TDCR_X16 0x00020000 /* transmit DPLL clock x16 */
  739. #define SCC_GSMRL_TDCR_X32 0x00030000 /* transmit DPLL clock x32 */
  740. #define SCC_GSMRL_TEND 0x00040000 /* transmitter frame ending */
  741. #define SCC_GSMRL_TPP_00 0x00180000 /* Tx preamble pattern = 00 */
  742. #define SCC_GSMRL_TPP_10 0x00080000 /* Tx preamble pattern = 10 */
  743. #define SCC_GSMRL_TPP_01 0x00100000 /* Tx preamble pattern = 01 */
  744. #define SCC_GSMRL_TPP_11 0x00180000 /* Tx preamble pattern = 11 */
  745. #define SCC_GSMRL_TPL_NONE 0x00000000 /* no Tx preamble (default) */
  746. #define SCC_GSMRL_TPL_8 0x00200000 /* Tx preamble = 1 byte */
  747. #define SCC_GSMRL_TPL_16 0x00400000 /* Tx preamble = 2 bytes */
  748. #define SCC_GSMRL_TPL_32 0x00600000 /* Tx preamble = 4 bytes */
  749. #define SCC_GSMRL_TPL_48 0x00800000 /* Tx preamble = 6 bytes */
  750. #define SCC_GSMRL_TPL_64 0x00a00000 /* Tx preamble = 8 bytes */
  751. #define SCC_GSMRL_TPL_128 0x00c00000 /* Tx preamble = 16 bytes */
  752. #define SCC_GSMRL_TINV 0x01000000 /* DPLL transmit input invert */
  753. #define SCC_GSMRL_RINV 0x02000000 /* DPLL receive input invert */
  754. #define SCC_GSMRL_TSNC 0x0c000000 /* transmit sense */
  755. #define SCC_GSMRL_TCI 0x10000000 /* transmit clock invert */
  756. #define SCC_GSMRL_EDGE 0x60000000 /* adjustment edge +/- */
  757. #define SCC_GSMRH_RSYN 0x00000001 /* receive sync timing*/
  758. #define SCC_GSMRH_RTSM 0x00000002 /* RTS* mode */
  759. #define SCC_GSMRH_SYNL 0x0000000c /* sync length */
  760. #define SCC_GSMRH_TXSY 0x00000010 /* transmitter/receiver sync */
  761. #define SCC_GSMRH_RFW 0x00000020 /* Rx FIFO width */
  762. #define SCC_GSMRH_TFL 0x00000040 /* transmit FIFO length */
  763. #define SCC_GSMRH_CTSS 0x00000080 /* CTS* sampling */
  764. #define SCC_GSMRH_CDS 0x00000100 /* CD* sampling */
  765. #define SCC_GSMRH_CTSP 0x00000200 /* CTS* pulse */
  766. #define SCC_GSMRH_CDP 0x00000400 /* CD* pulse */
  767. #define SCC_GSMRH_TTX 0x00000800 /* transparent transmitter */
  768. #define SCC_GSMRH_TRX 0x00001000 /* transparent receiver */
  769. #define SCC_GSMRH_REVD 0x00002000 /* reverse data */
  770. #define SCC_GSMRH_TCRC 0x0000c000 /* transparent CRC */
  771. #define SCC_GSMRH_GDE 0x00010000 /* glitch detect enable */
  772. /* SCC UART protocol specific parameters */
  773. typedef struct /* SCC_UART_PROTO */
  774.     {
  775.     UINT32 res1; /* reserved */
  776.     UINT32 res2; /* reserved */
  777.     UINT16 maxIdl; /* maximum idle characters */
  778.     UINT16 idlc; /* temporary idle counter */
  779.     UINT16 brkcr; /* break count register (transmit) */
  780.     UINT16 parec; /* receive parity error counter */
  781.     UINT16 frmer; /* receive framing error counter */
  782.     UINT16 nosec; /* receive noise counter */
  783.     UINT16 brkec; /* receive break condition counter */
  784.     UINT16 brkln; /* last received break length */
  785.     UINT16 uaddr1; /* uart address character 1 */
  786.     UINT16 uaddr2; /* uart address character 2 */
  787.     UINT16 rtemp; /* temp storage */
  788.     UINT16 toseq; /* transmit out-of-sequence character */
  789.     UINT16 character1; /* control character 1 */
  790.     UINT16 character2; /* control character 2 */
  791.     UINT16 character3; /* control character 3 */
  792.     UINT16 character4; /* control character 4 */
  793.     UINT16 character5; /* control character 5 */
  794.     UINT16 character6; /* control character 6 */
  795.     UINT16 character7; /* control character 7 */
  796.     UINT16 character8; /* control character 8 */
  797.     UINT16 rccm; /* receive control character mask */
  798.     UINT16 rccr; /* receive control character register */
  799.     UINT16 rlbc; /* receive last break character */
  800.     } SCC_UART_PROTO;
  801. /* SCC UART Protocol Specific Mode Register definitions */
  802. #define SCC_UART_PSMR_TPM_ODD 0x0000 /* odd parity mode (Tx) */
  803. #define SCC_UART_PSMR_TPM_LOW 0x0001 /* low parity mode (Tx) */
  804. #define SCC_UART_PSMR_TPM_EVEN 0x0002 /* even parity mode (Tx) */
  805. #define SCC_UART_PSMR_TPM_HIGH 0x0003 /* high parity mode (Tx) */
  806. #define SCC_UART_PSMR_RPM_ODD 0x0000 /* odd parity mode (Rx) */
  807. #define SCC_UART_PSMR_RPM_LOW 0x0004 /* low parity mode (Rx) */
  808. #define SCC_UART_PSMR_RPM_EVEN 0x0008 /* even parity mode (Rx) */
  809. #define SCC_UART_PSMR_RPM_HIGH 0x000c /* high parity mode (Rx) */
  810. #define SCC_UART_PSMR_PEN 0x0010 /* parity enable */
  811. #define SCC_UART_PSMR_DRT 0x0040 /* disable Rx while Tx */
  812. #define SCC_UART_PSMR_SYN 0x0080 /* synchronous mode */
  813. #define SCC_UART_PSMR_RZS 0x0100 /* receive zero stop bits */
  814. #define SCC_UART_PSMR_FRZ 0x0200 /* freeze transmission */
  815. #define SCC_UART_PSMR_UM_NML 0x0000 /* noraml UART operation */
  816. #define SCC_UART_PSMR_UM_MULT_M 0x0400 /* multidrop non-auto mode */
  817. #define SCC_UART_PSMR_UM_MULT_A 0x0c00 /* multidrop automatic mode */
  818. #define SCC_UART_PSMR_CL_5BIT 0x0000 /* 5 bit character length */
  819. #define SCC_UART_PSMR_CL_6BIT 0x1000 /* 6 bit character length */
  820. #define SCC_UART_PSMR_CL_7BIT 0x2000 /* 7 bit character length */
  821. #define SCC_UART_PSMR_CL_8BIT 0x3000 /* 8 bit character length */
  822. #define SCC_UART_PSMR_SL 0x4000 /* 1 or 2 bit stop length */
  823. #define SCC_UART_PSMR_FLC 0x8000 /* flow control */
  824. /* SCC UART Event and Mask Register definitions */
  825. #define SCC_UART_SCCX_RX  0x0001 /* buffer received */
  826. #define SCC_UART_SCCX_TX  0x0002 /* buffer transmitted */
  827. #define SCC_UART_SCCX_BSY  0x0004 /* busy condition */
  828. #define SCC_UART_SCCX_CCR  0x0008 /* control character received */
  829. #define SCC_UART_SCCX_BRK_S  0x0020   /* break start */
  830. #define SCC_UART_SCCX_BRK_E  0x0040 /* break end */
  831. #define SCC_UART_SCCX_GRA  0x0080 /* graceful stop complete */
  832. #define SCC_UART_SCCX_IDL 0x0100 /* idle sequence stat changed */
  833. #define SCC_UART_SCCX_AB   0x0200 /* autobaud lock */
  834. #define SCC_UART_SCCX_GL_T  0x0800 /* glitch on Tx */
  835. #define SCC_UART_SCCX_GL_R  0x1000 /* glitch on Rx */
  836. /* SCC UART Receive Buffer Descriptor definitions */
  837. #define SCC_UART_RX_BD_CD 0x0001 /* carrier detect loss */
  838. #define SCC_UART_RX_BD_OV 0x0002 /* receiver overrun */
  839. #define SCC_UART_RX_BD_PR 0x0008 /* parity error */
  840. #define SCC_UART_RX_BD_FR 0x0010 /* framing error */
  841. #define SCC_UART_RX_BD_BR 0x0020 /* break received */
  842. #define SCC_UART_RX_BD_AM 0x0080 /* address match */
  843. #define SCC_UART_RX_BD_ID 0x0100 /* buf closed on IDLES */
  844. #define SCC_UART_RX_BD_CM 0x0200 /* continous mode */
  845. #define SCC_UART_RX_BD_ADDR 0x0400 /* buffer contains address */
  846. #define SCC_UART_RX_BD_CNT 0x0800 /* control character */
  847. #define SCC_UART_RX_BD_INT 0x1000 /* interrupt generated */
  848. #define SCC_UART_RX_BD_WRAP 0x2000 /* wrap back to first BD */
  849. #define SCC_UART_RX_BD_EMPTY 0x8000 /* buffer is empty */
  850. /* SCC UART Transmit Buffer Descriptor definitions */
  851. #define SCC_UART_TX_BD_CT 0x0001 /* cts was lost during tx */
  852. #define SCC_UART_TX_BD_NS 0x0080 /* no stop bit transmitted */
  853. #define SCC_UART_TX_BD_PREAMBLE 0x0100 /* enable preamble */
  854. #define SCC_UART_TX_BD_CM 0x0200 /* continous mode */
  855. #define SCC_UART_TX_BD_ADDR 0x0400 /* buffer contains address */
  856. #define SCC_UART_TX_BD_CTSR 0x0800 /* normal cts error reporting */
  857. #define SCC_UART_TX_BD_INT 0x1000 /* interrupt generated */
  858. #define SCC_UART_TX_BD_WRAP 0x2000 /* wrap back to first BD */
  859. #define SCC_UART_TX_BD_READY 0x8000 /* buffer is being sent */
  860. /* SCC Ethernet protocol specific parameters */
  861. typedef struct /* SCC_ETHER_PROTO */
  862.     {
  863.     UINT32 c_pres; /* preset CRC */
  864.     UINT32 c_mask; /* constant mask for CRC */
  865.     UINT32 crcec; /* CRC error counter */
  866.     UINT32 alec; /* alignment error counter */
  867.     UINT32 disfc; /* discard frame counter */
  868.     UINT16 pads; /* short frame pad value */
  869.     UINT16 ret_lim; /* retry limit threshold */
  870.     UINT16 ret_cnt; /* retry limit counter */
  871.     UINT16 mflr; /* maximum frame length register */
  872.     UINT16 minflr; /* minimum frame length register */
  873.     UINT16 maxd1; /* max DMA1 length register */
  874.     UINT16 maxd2; /* max DMA2 length register */
  875.     UINT16 maxd; /* Rx max DMA */
  876.     UINT16 dma_cnt; /* Rx DMA counter */
  877.     UINT16 max_b; /* max BD byte count */
  878.     UINT16 gaddr1; /* group address filter 1 */
  879.     UINT16 gaddr2; /* group address filter 2 */
  880.     UINT16 gaddr3; /* group address filter 3 */
  881.     UINT16 gaddr4; /* group address filter 4 */
  882.     UINT32 tbuf0_data0; /* save area 0 - current frame */
  883.     UINT32 tbuf0_data1; /* save area 1 - current frame */
  884.     UINT32 tbuf0_rba0; /* ? */
  885.     UINT32 tbuf0_crc; /* ? */
  886.     UINT16 tbuf0_bcnt; /* ? */
  887.     UINT16 paddr1_h; /* physical address 1 (MSB) */
  888.     UINT16 paddr1_m; /* physical address 1 */
  889.     UINT16 paddr1_l; /* physical address 1 (LSB) */
  890.     UINT16 p_per; /* persistence */
  891.     UINT16 rfbd_ptr; /* Rx first BD pointer */
  892.     UINT16 tfbd_ptr; /* Tx first BD pointer */
  893.     UINT16 tlbd_ptr; /* Tx last BD pointer */
  894.     UINT32 tbuf1_data0; /* save area 0 - next frame */
  895.     UINT32 tbuf1_data1; /* ? */
  896.     UINT32 tbuf1_rba0; /* ? */
  897.     UINT32 tbuf1_crc; /* ? */
  898.     UINT16 tbuf1_bcnt; /* ? */
  899.     UINT16 tx_len; /* Tx frame length counter */
  900.     UINT16 iaddr1; /* individual address filter 1 */
  901.     UINT16 iaddr2; /* individual address filter 2 */
  902.     UINT16 iaddr3; /* individual address filter 3 */
  903.     UINT16 iaddr4; /* individual address filter 4 */
  904.     UINT16 boff_cnt; /* backoff counter */
  905.     UINT16 taddr_h; /* temp address (MSB) */
  906.     UINT16 taddr_m; /* temp address */
  907.     UINT16 taddr_l; /* temp address (LSB) */
  908.     } SCC_ETHER_PROTO;
  909. /* SCC Ethernet Protocol Specific Mode Register definitions */
  910. #define SCC_ETHER_PSMR_NIB_13 0x0000 /* SFD 13 bits after TENA */
  911. #define SCC_ETHER_PSMR_NIB_14 0x0002 /* SFD 14 bits after TENA */
  912. #define SCC_ETHER_PSMR_NIB_15 0x0004 /* SFD 15 bits after TENA */
  913. #define SCC_ETHER_PSMR_NIB_16 0x0006 /* SFD 16 bits after TENA */
  914. #define SCC_ETHER_PSMR_NIB_21 0x0008 /* SFD 21 bits after TENA */
  915. #define SCC_ETHER_PSMR_NIB_22 0x000a /* SFD 22 bits after TENA */
  916. #define SCC_ETHER_PSMR_NIB_23 0x000c /* SFD 23 bits after TENA */
  917. #define SCC_ETHER_PSMR_NIB_24 0x000e /* SFD 24 bits after TENA */
  918. #define SCC_ETHER_PSMR_LCW 0x0100 /* late collision window */
  919. #define SCC_ETHER_PSMR_SIP 0x0200 /* sample input pins */
  920. #define SCC_ETHER_PSMR_LPB 0x0400 /* loopback operation */
  921. #define SCC_ETHER_PSMR_SBT 0x0800 /* stop backoff timer */
  922. #define SCC_ETHER_PSMR_BRO 0x0100 /* broadcast address */
  923. #define SCC_ETHER_PSMR_PRO 0x0200 /* promiscuous mode */
  924. #define SCC_ETHER_PSMR_CRC 0x0800 /* CRC selection */
  925. #define SCC_ETHER_PSMR_IAM 0x1000 /* individual address mode */
  926. #define SCC_ETHER_PSMR_RSH 0x2000 /* receive short frame */
  927. #define SCC_ETHER_PSMR_FC 0x4000 /* force collision */
  928. #define SCC_ETHER_PSMR_HBC 0x8000 /* heartbeat checking*/
  929. /* SCC Ethernet Event and Mask Register definitions */
  930. #define SCC_ETHER_SCCX_RXB  0x0001 /* buffer received event */
  931. #define SCC_ETHER_SCCX_TXB  0x0002 /* buffer transmitted event */
  932. #define SCC_ETHER_SCCX_BSY  0x0004 /* busy condition */
  933. #define SCC_ETHER_SCCX_RXF  0x0008 /* frame received event */
  934. #define SCC_ETHER_SCCX_TXE 0x0010 /* transmission error event */
  935. #define SCC_ETHER_SCCX_GRA  0x0080 /* graceful stop event */
  936. /* SCC Ethernet Receive Buffer Descriptor definitions */
  937. #define SCC_ETHER_RX_BD_CL 0x0001 /* collision condition */
  938. #define SCC_ETHER_RX_BD_OV 0x0002 /* overrun condition */
  939. #define SCC_ETHER_RX_BD_CR 0x0004 /* Rx CRC error */
  940. #define SCC_ETHER_RX_BD_SH 0x0008 /* short frame received */
  941. #define SCC_ETHER_RX_BD_NO 0x0010 /* Rx nonoctet aligned frame */
  942. #define SCC_ETHER_RX_BD_LG 0x0020 /* Rx frame length violation */
  943. #define SCC_ETHER_RX_BD_M 0x0100 /* miss bit for prom mode */
  944. #define SCC_ETHER_RX_BD_F 0x0400 /* buffer is first in frame */
  945. #define SCC_ETHER_RX_BD_L 0x0800 /* buffer is last in frame */
  946. #define SCC_ETHER_RX_BD_I 0x1000 /* interrupt on receive */
  947. #define SCC_ETHER_RX_BD_W 0x2000 /* last BD in ring */
  948. #define SCC_ETHER_RX_BD_E 0x8000 /* buffer is empty */
  949. /* SCC Ethernet Transmit Buffer Descriptor definitions */
  950. #define SCC_ETHER_TX_BD_CSL 0x0001 /* carrier sense lost */
  951. #define SCC_ETHER_TX_BD_UN 0x0002 /* underrun */
  952. #define SCC_ETHER_TX_BD_RC 0x003c /* retry count */
  953. #define SCC_ETHER_TX_BD_RL 0x0040 /* retransmission limit */
  954. #define SCC_ETHER_TX_BD_LC 0x0080 /* late collision */
  955. #define SCC_ETHER_TX_BD_HB 0x0100 /* heartbeat */
  956. #define SCC_ETHER_TX_BD_DEF 0x0200 /* defer indication */
  957. #define SCC_ETHER_TX_BD_TC 0x0400 /* auto transmit CRC */
  958. #define SCC_ETHER_TX_BD_L 0x0800 /* buffer is last in frame */
  959. #define SCC_ETHER_TX_BD_I 0x1000 /* interrupt on transmit */
  960. #define SCC_ETHER_TX_BD_W 0x2000 /* last BD in ring */
  961. #define SCC_ETHER_TX_BD_PAD 0x4000 /* auto pad short frames */
  962. #define SCC_ETHER_TX_BD_R 0x8000 /* buffer is ready */
  963. /* SCC - Serial Comunications Controller */
  964.  
  965. typedef struct          /* SCC_BUF */
  966.     {
  967.     UINT16 statusMode; /* status and control */
  968.     UINT16 dataLength; /* length of data buffer in bytes */
  969.     u_char * dataPointer; /* points to data buffer */
  970.     } SCC_BUF;
  971.  
  972. typedef struct          /* SCC_PARAM */
  973.     {
  974.     UINT16 rbase; /* Rx buffer descriptor base address */
  975.     UINT16 tbase; /* Tx buffer descriptor base address */
  976.     UINT8 rfcr; /* Rx function code */
  977.     UINT8 tfcr; /* Tx function code */
  978.     UINT16 mrblr; /* maximum receive buffer length */
  979.     UINT32 rstate; /* Rx internal state */
  980.     UINT32 res1; /* reserved/internal */
  981.     UINT16 rbptr; /* Rx buffer descriptor pointer */
  982.     UINT16 res2; /* reserved/internal */
  983.     UINT32 res3; /* reserved/internal */
  984.     UINT32 tstate; /* Tx internal state */
  985.     UINT32 res4; /* reserved/internal */
  986.     UINT16 tbptr; /* Tx buffer descriptor pointer */
  987.     UINT16 res5; /* reserved/internal */
  988.     UINT32 res6; /* reserved/internal */
  989.     UINT32 rcrc; /* temp receive CRC */
  990.     UINT32 tcrc; /* temp transmit CRC */
  991.     } SCC_PARAM;
  992.  
  993. typedef struct          /* SCC */
  994.     {
  995.     SCC_PARAM param; /* SCC parameters */
  996.     char prot[64]; /* protocol specific area */
  997.     } SCC;
  998. typedef struct          /* SCC_REG */
  999.     {
  1000.     UINT32 gsmrl; /* SCC general mode register - low */
  1001.     UINT32 gsmrh; /* SCC eneral mode register - high */
  1002.     UINT16 psmr; /* SCC protocol mode register */
  1003.     UINT16 res1; /* reserved */
  1004.     UINT16 todr; /* SCC transmit on demand */
  1005.     UINT16 dsr; /* SCC data sync. register */
  1006.     UINT16 scce; /* SCC event register */
  1007.     UINT16 res2; /* reserved */
  1008.     UINT16 sccm; /* SCC mask register */
  1009.     UINT8 res3; /* reserved */
  1010.     UINT8 sccs; /* SCC status register */
  1011.     } SCC_REG;
  1012. /* SCC device descriptor */
  1013. typedef struct          /* SCC_DEV */
  1014.     {
  1015.     int  sccNum; /* number of SCC device */
  1016.     int  txBdNum; /* number of transmit buf descriptors */
  1017.     int  rxBdNum; /* number of receive buf descriptors */
  1018.     SCC_BUF *  txBdBase; /* transmit BD base address */
  1019.     SCC_BUF *  rxBdBase; /* receive BD base address */
  1020.     u_char *  txBufBase; /* transmit buffer base address */
  1021.     u_char * rxBufBase; /* receive buffer base address */
  1022.     UINT32  txBufSize; /* transmit buffer size */
  1023.     UINT32  rxBufSize; /* receive buffer size */
  1024.     int txBdNext; /* next transmit BD to fill */
  1025.     int rxBdNext; /* next receive BD to read */
  1026.     volatile SCC * pScc; /* SCC parameter RAM */
  1027.     volatile SCC_REG * pSccReg; /* SCC registers */
  1028.     UINT32 intMask; /* interrupt acknowledge mask */
  1029.     } SCC_DEV;
  1030.  
  1031. #ifndef INCLUDE_TY_CO_DRV_50
  1032. /* UART SCC device descriptor */
  1033. typedef struct          /* TY_CO_DEV */
  1034.     {
  1035.     TY_DEV tyDev; /* tyLib will handle this portion */
  1036.     BOOL created; /* device has been created */
  1037.     char numChannels; /* number of channels to support */
  1038.     int clockRate; /* CPU clock frequency (Hz) */
  1039.     int  bgrNum; /* number of BRG being used */
  1040.     UINT32 * pBaud; /* BRG registers */
  1041.     UINT32 regBase; /* register/DPR base address */
  1042.     SCC_DEV uart; /* UART SCC device */
  1043.     } TY_CO_DEV;
  1044. /* function declarations */
  1045. #if defined(__STDC__) || defined(__cplusplus)
  1046. IMPORT  void    tyCoInt (TY_CO_DEV * pDv);
  1047. #else /* __STDC__ */
  1048. IMPORT void tyCoInt ();
  1049. #endif /* __STDC__ */
  1050. #endif /* INCLUDE_TY_CO_DRV_50 */
  1051. #endif /* _ASMLANGUAGE */
  1052. #ifdef __cplusplus
  1053. }
  1054. #endif
  1055. #endif /* __INCm68360h */