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

VxWorks

开发平台:

C/C++

  1. /* ppc860Cpm.h - Motorola PPC860 Communication Processor Module header file */
  2. /* Copyright 1984-1998 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01g,11jan99,cn   Corrected/added defines for CP commands (SPR# 20337),
  7.  added qualifier volatile where needed (SPR# 24295).
  8. 01f,09nov98,cn   Added support for Fast Ethernet Controller.
  9. 01e,20apr98,map  fixed SIMODE definitions [SPR# 20157]
  10. 01d,13apr98,map  added more SCC definitions.
  11. 01c,25mar98,map  added SCC, PIP, I2C, CPCR, definitions.
  12. 01b,09may96,dzb  added CPM_CR_... flags for the CPM command register.
  13. 01a,24apr96,tpr  created.
  14. */
  15. /*
  16.  * This file contains constants of the Communication Processor Unit (SIU) for
  17.  * the Motorola MPC860 PowerPC microcontroller.
  18.  */
  19. #ifndef __INCppc860Cpmh
  20. #define __INCppc860Cpmh
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.     
  25. /* device and channel structures */
  26. /* 
  27.  * The PPC860SMC_CHAN structure defines a serial I/O channel which
  28.  * describes the (TBD) registers for a given channel. 
  29.  * Also the various SIO driver functions ( ioctl, txStarup, callbackInstall,
  30.  * pollInput, polloutput ) that this channel could utilize are declared 
  31.  * here.
  32.  */
  33. #ifdef _ASMLANGUAGE
  34. #  define SMC_ADRS(reg) (MPC860SMC1_BASE + (reg * MPC860SMC1_REG_OFFSET))
  35. #else
  36. #  define SMC_ADRS(reg) ((VCHAR *)MPC860SMC1_BASE+(reg*MPC860SMC1_REG_OFFSET))
  37. #endif /* _ASMLANGUAGE */
  38. /* SIO -- mpc860 serial channel chip -- register definitions */
  39. /* Buffer Descriptor Pointer Definitions */
  40. /* Receive BD status bits 16-bit value */
  41. #define BD_RX_EMPTY_BIT 0x8000 /* buffer is empty */
  42. #define BD_RX_WRAP_BIT 0x2000 /* last BD in chain */
  43. #define BD_RX_INTERRUPT_BIT 0x1000 /* set interrupt when filled */
  44. #define BD_RX_CON_MODE_BIT 0x0200 /* Continuous Mode bit */
  45. #define BD_RX_IDLE_CLOSE_BIT 0x0100 /* Close on IDLE recv bit */
  46. #define BD_RX_BREAK_CLOSE_BIT 0x0020 /* Close on break recv bit */
  47. #define BD_RX_FRAME_CLOSE_BIT 0x0010 /* Close on frame error bit */
  48. #define BD_RX_PARITY_ERROR_BIT 0x0008 /* Parity error in last byte */
  49. #define BD_RX_OVERRUN_ERROR_BIT 0x0002 /* Overrun occurred */
  50. /* Transmit BD status bits 16-bit value */
  51. #define BD_TX_READY_BIT 0x8000 /* Transmit ready/busy bit */
  52. #define BD_TX_WRAP_BIT 0x2000 /* last BD in chain */
  53. #define BD_TX_INTERRUPT_BIT 0x1000 /* set interrupt when emptied */
  54. #define BD_TX_CON_MODE_BIT 0x0200 /* Continuous Mode bit */
  55. #define BD_TX_PREABMLE_BIT 0x0100 /* send preamble sequence */
  56. #define BD_STATUS_OFFSET 0x00 /* two bytes */
  57. #define BD_DATA_LENGTH_OFFSET 0x02 /* two bytes */
  58. #define BD_BUF_POINTER_OFFSET 0x04 /* four bytes */
  59. /* SDMA Configuraton Register bit definition (SDCR - 0x30) */
  60. #define SDCR_FRZ_MSK 0x00006000 /* Freeze mask */
  61. #define SDCR_RAID_MSK 0x00000003 /* Risc Controller Arbitration ID */
  62. #define SDCR_FAID_MSK   0x0000000c      /* FEC Arbitration ID mask */
  63. #define SDCR_FAM_EN     0x00000040      /* FEC Agressive Mode Enable */
  64. #define SDCR_FAID_BR6   0x00000000      /* FEC Arbitration ID U-Bus priority 6*/
  65. #define SDCR_FAID_BR5   0x00000004      /* FEC Arbitration ID U-Bus priority 5*/
  66. #define SDCR_FAID_BR2   0x00000008      /* FEC Arbitration ID U-Bus priority 2*/
  67. #define SDCR_FAID_BR1   0x0000000c      /* FEC Arbitration ID U-Bus priority 1*/
  68. #define SDCR_RAID_BR6 0x00000000 /* U-BUS arbitration priority 6 (BR6) */
  69. #define SDCR_RAID_BR5 0x00000001 /* U-BUS arbitration priority 5 (BR5) */
  70. #define SDCR_RAID_BR2 0x00000002 /* U-BUS arbitration priority 2 (BR2) */
  71. #define SDCR_RAID_BR1 0x00000003 /* U-BUS arbitration priority 1 (BR1) */
  72. /* SDMA Status Register bit definition (SDSR - 0x908) */
  73. #define SDSR_SBER 0x80 /* Channel Bus Error */
  74. #define SDSR_RINT 0x40 /* Reserved Interrupt */
  75. #define SDSR_DSP2 0x02 /* DSP chain interrupt 2 */
  76. #define SDSR_DSP1 0x01 /* DSP chain interrupt 1 */
  77. /* IDMA Status Register bit definition (IDSR - 0x910) */
  78. #define IDSR_OB 0x04 /* Out of Buffer */
  79. #define IDSR_DONE 0x02 /* IDMA transfert Done */
  80. #define IDSR_AD 0x01 /* Auxiliry Done */
  81. /* Timer Global Configuration Register bit definition (TGCR - 0x980) */
  82. #define TGCR_CAS4 0x8000 /* Cascade Timer 3 and 4 */
  83. #define TGCR_FRZ4 0x4000 /* Freeze timer 4 */
  84. #define TGCR_STP4 0x2000 /* Stop timer 4 */
  85. #define TGCR_RST4 0x1000 /* Reset timer 4 */
  86. #define TGCR_GM2 0x0800 /* Gate Mode for Pin 2 */
  87. #define TGCR_FRZ3 0x0400 /* Freeze timer 3 */
  88. #define TGCR_STP3 0x0200 /* Stop timer 3 */
  89. #define TGCR_RST3 0x0100 /* Reset timer 3 */
  90. #define TGCR_CAS2 0x0080 /* Cascade Timer 1 and 2 */
  91. #define TGCR_FRZ2 0x0040 /* Freeze timer 2 */
  92. #define TGCR_STP2 0x0020 /* Stop timer 2 */
  93. #define TGCR_RST2 0x0010 /* Reset timer 2 */
  94. #define TGCR_GM1 0x0008 /* Gate Mode for Pin 1 */
  95. #define TGCR_FRZ1 0x0004 /* Freeze timer 1 */
  96. #define TGCR_STP1 0x0002 /* Stop timer 1 */
  97. #define TGCR_RST1 0x0001 /* Reset timer 1 */
  98. /* Timer Mode Register bit definition (TMRx - 0x990) */
  99. #define TMR_PS_MSK 0xff00 /* Prescaler Value */
  100. #define TMR_CE_MSK 0x00c0 /* Capture Edge and Enable Interrupt */
  101. #define TMR_CE_INTR_DIS 0x0000 /* Disable Interrupt on capture event */
  102. #define TMR_CE_RISING 0x0040 /* Capture on Rising TINx edge only */
  103. #define TMR_CE_FALLING 0x0080 /* Capture on Falling TINx edge only */
  104. #define TMR_CE_ANY 0x00c0 /* Capture on any TINx edge */
  105. #define TMR_OM 0x0020 /* Output Mode */
  106. #define TMR_ORI 0x0010 /* Output Reference Interrupt Enable */
  107. #define TMR_FRR 0x0008 /* Free Run/Restart */
  108. #define TMR_ICLK_MSK 0x0006 /* Timer Input Clock Source mask */
  109. #define TMR_ICLK_IN_CAS 0x0000 /* Internally cascaded input */
  110. #define TMR_ICLK_IN_GEN 0x0002 /* Internal General system clock */
  111. #define TMR_ICLK_IN_GEN_DIV16 0x0004 /* Internal General system clk div 16 */
  112. #define TMR_ICLK_TIN_PIN 0x0006 /* TINx pin */
  113. #define TMR_GE 0x0001 /* Gate Enable */
  114. /* Timer Event Register bit definition (TERx - 0x9B0) */
  115. #define TER_REF 0x0002 /* Output Reference Event */
  116. #define TER_CAP 0x0001 /* Capture Event */
  117. /* BDG Configuratioon REgister bit definition (BRGC - 0x9F0) */
  118. #define BRGC_RST 0x20000 /* Reset BRG */
  119. #define BRGC_EN 0x10000 /* Enable BRG count */
  120. #define BRGC_EXTC_MSK 0x08000 /* External Clock Source Mask */
  121. #define BRGC_EXTC_BRGCLK 0x00000 /* Baud Rate Gen clock source */
  122. #define BRGC_EXTC_CLK2  0x04000 /* CLK2 pin = BRG source */
  123. #define BRGC_EXTC_CLK6 0x08000 /* CLK6 pin = BRG source */
  124. #define BRGC_ATB 0x02000 /* 1 = Autobaud on Rx */
  125. /* 0 = normal operation */
  126. #define BRGC_CD_MSK 0x01FFE /* clock divider 12 bit value */
  127. #define BRGC_CD_SHIFT 0x1 /* shifted up one bit */
  128. #define BRGC_DIV16 0x00001 /* BRG Clock divide by 16 */
  129. /* UART Mode Register bit definition (PSMR - 0x0A08) */
  130. #define PSMR_FLC 0x8000 /* Flow Control */
  131. #define PSMR_SL 0x4000 /* Stop Length */
  132. #define PSMR_CL_MSK 0x3000 /* Character Length Mask */
  133. #define PSMR_CL_5_BITS 0x0000 /* Character Length: 5 bits */
  134. #define PSMR_CL_6_BITS 0x1000 /* Character Length: 6 bits */
  135. #define PSMR_CL_7_BITS 0x2000 /* Character Length: 7 bits */
  136. #define PSMR_CL_8_BITS 0x3000 /* Character Length: 8 bits */
  137. #define PSMR_UM_MSK 0x0c00 /* UART Mode Mask */
  138. #define PSMR_UM_NORMAL 0x0000 /* UART Mode: normal */
  139. #define PSMR_UM_NON_AUTO 0x0400 /* UART Mode: multidrop non-automatic */
  140. #define PSMR_UM_AUTO 0x0c00 /* UART Mode: multidrop automatic */
  141. #define PSMR_FRZ 0x0200 /* Freeze Transmission */
  142. #define PSMR_RZS 0x0100 /* Receive Zero Stop bits */
  143. #define PSMR_SYN 0x0080 /* Synchronous Mode */
  144. #define PSMR_DRT 0x0040 /* Disable Receiver While Transmitting*/
  145. #define PSMR_PEN 0x0010 /* Parity Enable */
  146. #define PSMR_RPN_MSK 0x000c /* Receiver Parity Mode Mask */
  147. #define PSMR_RPN_ODD 0x0000 /* Receiver Parity Mode: Odd parity */
  148. #define PSMR_RPN_LOW 0x0004 /* Receiver Parity Mode: Low parity */
  149. #define PSMR_RPN_EVEN 0x0008 /* Receiver Parity Mode: Even parity */
  150. #define PSMR_RPN_HIGH 0x000c /* Receiver Parity Mode: High parity */
  151. #define PSMR_TPN_MSK 0x0003 /* Transmitter Parity Mode Mask */
  152. #define PSMR_TPN_ODD 0x0000 /* Transmit Parity Mode: Odd parity */
  153. #define PSMR_TPN_LOW 0x0001 /* Transmit Parity Mode: Low parity */
  154. #define PSMR_TPN_EVEN 0x0002 /* Transmit Parity Mode: Even parity */
  155. #define PSMR_TPN_HIGH 0x0003 /* Transmit Parity Mode: High parity */
  156. /* CPM - Communication Processor Module */
  157. /* Command Register definitions (CPCR - 0x9C0) */    
  158.  
  159. #define CPM_CR_FLG              0x0001 /* flag - command executing */ 
  160. #define CPM_CR_RESET 0x8000 /* software reset command */
  161. #define CPM_CR_OPCODE           0x0f00 /* command opcode */
  162. #define CPM_CR_CHAN(x) (((x) & 0x000f) << 4)
  163. #define CPM_CR_OP(x) (((x) & 0x000f) << 8)
  164.     
  165. /* CPCR - Channel Numbers */
  166. #define CPM_CR_CHANNEL_SCC1     CPM_CR_CHAN(0x0) /* SCC1 channel */ 
  167. #define CPM_CR_CHANNEL_I2C CPM_CR_CHAN(0x1) /* I2C channel */
  168. #define CPM_CR_CHANNEL_SCC2     CPM_CR_CHAN(0x4) /* SCC2 channel */
  169. #define CPM_CR_CHANNEL_SPI      CPM_CR_CHAN(0x5) /* SPI channel */ 
  170. #define CPM_CR_CHANNEL_RTMR     CPM_CR_CHAN(0x5) /* RISC timer channel */
  171. #define CPM_CR_CHANNEL_SCC3     CPM_CR_CHAN(0x8) /* SCC3 channel */ 
  172. #define CPM_CR_CHANNEL_SMC1     CPM_CR_CHAN(0x9) /* SMC1 channel */ 
  173. #define CPM_CR_CHANNEL_IDMA1    CPM_CR_CHAN(0x1) /* IDMA1 channel */ 
  174. #define CPM_CR_CHANNEL_SCC4     CPM_CR_CHAN(0xc) /* SCC4 channel */ 
  175. #define CPM_CR_CHANNEL_SMC2     CPM_CR_CHAN(0xd) /* SMC2 channel */ 
  176. #define CPM_CR_CHANNEL_PIP CPM_CR_CHAN(0xd) /* PIP channel */
  177. #define CPM_CR_CHANNEL_IDMA2    CPM_CR_CHAN(0x5) /* IDMA2 channel */ 
  178. #define CPM_CR_CHANNEL_DSP1     CPM_CR_CHAN(0x9) /* DSP1 channel */ 
  179. #define CPM_CR_CHANNEL_DSP2     CPM_CR_CHAN(0xd) /* DSP2 channel */ 
  180.  
  181. /* CPCR - opcodes */
  182.  
  183. #define CPM_CR_OPCODE_INIT_RT   CPM_CR_OP(0x0) /* Init rx and tx */
  184. #define CPM_CR_OPCODE_INIT_R    CPM_CR_OP(0x1) /* init rx only */
  185. #define CPM_CR_OPCODE_INIT_T    CPM_CR_OP(0x2) /* init tx only */
  186. #define CPM_CR_OPCODE_HUNT      CPM_CR_OP(0x3) /* rx frame hunt mode */
  187. #define CPM_CR_OPCODE_STOP      CPM_CR_OP(0x4) /* stop tx */
  188. #define CPM_CR_OPCODE_GRSTOP    CPM_CR_OP(0x5) /* gracefully stop tx */
  189. #define CPM_CR_OPCODE_IDMA_INIT CPM_CR_OP(0x5) /* init idma */
  190. #define CPM_CR_OPCODE_RESTART   CPM_CR_OP(0x6) /* restart tx */
  191. #define CPM_CR_OPCODE_CLOSE     CPM_CR_OP(0x7) /* close rx buffer */
  192. #define CPM_CR_OPCODE_SET_GROUP CPM_CR_OP(0x8) /* set group address */
  193. #define CPM_CR_OPCODE_SET_ITMR CPM_CR_OP(0x8) /* set itimer */
  194. #define CPM_CR_OPCODE_GCI_TMO CPM_CR_OP(0x9) /* gci timeout */
  195. #define CPM_CR_OPCODE_RESET_BCS CPM_CR_OP(0xa) /* blk chk seq reset */
  196. #define CPM_CR_OPCODE_GCI_ABRT CPM_CR_OP(0xa) /* gci abort request */
  197. #define CPM_CR_OPCODE_IDMA_STOP CPM_CR_OP(0xb) /* stop idma */
  198. #define CPM_CR_OPCODE_DSP_START CPM_CR_OP(0xc) /* start DSP */
  199. #define CPM_CR_OPCODE_DSP_INIT CPM_CR_OP(0xd) /* init DSP */    
  200. #define CPM_CR_SCC_INIT_RT      CPM_CR_OPCODE_INIT_RT /* rx and tx init */
  201. #define CPM_CR_SCC_INIT_R       CPM_CR_OPCODE_INIT_R /* init rx only */
  202. #define CPM_CR_SCC_INIT_T       CPM_CR_OPCODE_INIT_T /* init tx only */
  203. #define CPM_CR_SCC_HUNT         CPM_CR_OPCODE_HUNT /* rx frm hunt mode */
  204. #define CPM_CR_SCC_STOP         CPM_CR_OPCODE_STOP /* stop tx */
  205. #define CPM_CR_SCC_GRSTOP       CPM_CR_OPCODE_GRSTOP /* graceful stop tx */
  206. #define CPM_CR_SCC_RESTART      CPM_CR_OPCODE_RESTART /* restart tx */
  207. #define CPM_CR_SCC_CLOSE        CPM_CR_OPCODE_CLOSE /* close rx buffer */
  208. #define CPM_CR_SCC_SET_GROUP    CPM_CR_OPCODE_SET_GROUP /* set group adrs */
  209. #define CPM_CR_SCC_RESET_BCS    CPM_CR_OPCODE_RESET_BCS /* reset BCS */
  210.  
  211. #define CPM_CR_SMC_INIT_RT      CPM_CR_OPCODE_INIT_RT /* rx and tx init */
  212. #define CPM_CR_SMC_INIT_R       CPM_CR_OPCODE_INIT_R /* init rx only */
  213. #define CPM_CR_SMC_INIT_T       CPM_CR_OPCODE_INIT_T /* init tx only */
  214. #define CPM_CR_SMC_HUNT         CPM_CR_OPCODE_HUNT /* rx frm hunt mode */
  215. #define CPM_CR_SMC_STOP         CPM_CR_OPCODE_STOP /* stop tx */
  216. #define CPM_CR_SMC_RESTART CPM_CR_OPCODE_RESTART /* restart tx */
  217. #define CPM_CR_SMC_CLOSE        CPM_CR_OPCODE_CLOSE /* close rx buffer */
  218. #define CPM_CR_SMC_GCI_INIT_RT CPM_CR_OPCODE_INIT_RT /* rx and tx init */
  219. #define CPM_CR_SMC_GCI_TMO CPM_CR_OPCODE_GCI_TMO /* GCI timeout */
  220. #define CPM_CR_SMC_GCI_ABORT    CPM_CR_OPCODE_GCI_ABRT /* GCI abort */
  221. #define CPM_CR_SPI_INIT_RT      CPM_CR_OPCODE_INIT_RT /* rx and tx init */
  222. #define CPM_CR_SPI_INIT_R       CPM_CR_OPCODE_INIT_R /* init rx only */
  223. #define CPM_CR_SPI_INIT_T       CPM_CR_OPCODE_INIT_T /* init tx only */
  224. #define CPM_CR_SPI_CLOSE        CPM_CR_OPCODE_CLOSE /* close rx buffer */
  225. #define CPM_CR_I2C_INIT_RT      CPM_CR_OPCODE_INIT_RT /* rx and tx init */
  226. #define CPM_CR_I2C_INIT_R       CPM_CR_OPCODE_INIT_R /* init rx only */
  227. #define CPM_CR_I2C_INIT_T       CPM_CR_OPCODE_INIT_T /* init tx only */
  228. #define CPM_CR_I2C_CLOSE        CPM_CR_OPCODE_CLOSE /* close rx buffer */
  229. #define CPM_CR_IDMA_INIT CPM_CR_OPCODE_IDMA_INIT /* IDMA init */
  230. #define CPM_CR_IDMA_STOP CPM_CR_OPCODE_IDMA_STOP /* IDMA stop */
  231. #define CPM_CR_DSP_START CPM_CR_OPCODE_DSP_START /* DSP start */
  232. #define CPM_CR_DSP_INIT CPM_CR_OPCODE_DSP_INIT /* DSP init */
  233. #define CPM_CR_TIMER_SET CPM_CR_OPCODE_SET_ITMR /* TIMER set */
  234. /* UART Even Register bit definition (SCCE - 0x0A10) */
  235. #define SCCE_GLR 0x1000 /* Glitch on Receiver */
  236. #define SCCE_GLT 0x0800 /* Glitch on Transmitter */
  237. #define SCCE_AB 0x0200 /* Auto Baud */
  238. #define SCCE_IDL 0x0100 /* Idle Sequence Status Changed */
  239. #define SCCE_GRA 0x0080 /* Graceful stop complete */
  240. #define SCCE_BRKE 0x0040 /* Break End */
  241. #define SCCE_BRKS 0x0020 /* Break Start */
  242. #define SCCE_CCR 0x0008 /* Control Character Received */
  243. #define SCCE_BSY 0x0004 /* Busy Condition */
  244. #define SCCE_TX 0x0002 /* Transmitter Buffer */
  245. #define SCCE_RX 0x0001 /* Receiver Buffer */
  246. /* SCC Status Register bit definition (SCCS - 0x0A17) */
  247. #define SCCS_ID 0x01 /* Idle Status */
  248. /* SI Mode Register bit definition (SIMODE - 0xAE0) */
  249. #define SIMODE_SMC2_MUX 0x80000000 /* connected to mux SI */
  250. #define SIMODE_SMC2_NMSI 0x00000000 /* NMSI mode */
  251. #define SIMODE_SMC2CS_BRG1 0x00000000 /* BRG1 is clock source */
  252. #define SIMODE_SMC2CS_BRG2 0x10000000 /* BRG2 is clock source */
  253. #define SIMODE_SMC2CS_BRG3 0x20000000 /* BRG3 is clock source */
  254. #define SIMODE_SMC2CS_BRG4 0x30000000 /* BRG4 is clock source */
  255. #define SIMODE_SMC2CS_CLK5 0x40000000 /* CLK5 is clock source */
  256. #define SIMODE_SMC2CS_CLK6 0x50000000 /* CLK6 is clock source */
  257. #define SIMODE_SMC2CS_CLK7 0x60000000 /* CLK7 is clock source */
  258. #define SIMODE_SMC2CS_CLK8 0x70000000 /* CLK8 is clock source */
  259. #define SIMODE_SDMB_MSK 0x0c000000 /* SI Diagnostic Mode - TDM B */
  260. #define SIMODE_SDMB_NORM 0x00000000 /* Diag Mode-normal operation */
  261. #define SIMODE_SDMB_ECHO 0x04000000 /* Diag Mode-auto echo */
  262. #define SIMODE_SDMB_LOOP 0x08000000 /* Diag Mode-internal loopback*/
  263. #define SIMODE_SDMB_LCTR 0x0C000000 /* Diag Mode-loopback control */
  264. #define SIMODE_RFSDB_MSK 0x03000000 /* Receive Frame Delay TDM B */
  265. #define SIMODE_RFSDB_NO_DELAY 0x00000000 /* Receive Delay - No Delay */
  266. #define SIMODE_RFSDB_1BIT 0x01000000 /* Receive Delay - 1bit delay */
  267. #define SIMODE_RFSDB_2BIT 0x02000000 /* Receive Delay - 2bit delay */
  268. #define SIMODE_RFSDB_3BIT 0x03000000 /* Receive Delay - 3bit delay */
  269. #define SIMODE_DSCB 0x00800000 /* Double Speed Clocl TDM B */
  270. #define SIMODE_CRTB 0x00400000 /* Common Rcv and Trans. pins */
  271. #define SIMODE_STZB 0x00200000 /* Set L1TxDx to Zero TDM B */
  272. #define SIMODE_CEB_FALLING 0x00000000 /* Clock Edge - falling */
  273. #define SIMODE_CEB_RISING 0x00100000 /* Clock Edge - rising */
  274. #define SIMODE_FEB_FALLING 0x00000000 /* Frame Sync Edge - falling  */
  275. #define SIMODE_FEB_RISING 0x00080000 /* Frame Sync Edge - rising */
  276. #define SIMODE_GMB_GCI_SCIT 0x00000000 /* Grant Mode - GCI/SCIT */
  277. #define SIMODE_GMB_IDL 0x00040000 /* Grant Mode - idle */
  278. #define SIMODE_TFSDB_MSK 0x00030000 /* Transmit Frame Sync Delay */
  279. #define SIMODE_TFSDB_NO_DELAY 0x00000000 /* Transmit Delay - No Delay */
  280. #define SIMODE_TFSDB_1BIT 0x00010000 /* Transmit Delay - 1bit */
  281. #define SIMODE_TFSDB_2BIT 0x00020000 /* Transmit Delay - 2bit */
  282. #define SIMODE_TFSDB_3BIT 0x00030000 /* Transmit Delay - 3bit */
  283. #define SIMODE_SMC1_MUX 0x00008000 /* connected to mux SI */
  284. #define SIMODE_SMC1_NMSI 0x00000000 /* NMSI mode */
  285. #define SIMODE_SMC1CS_BRG1 0x00000000 /* BRG1 is clock source */
  286. #define SIMODE_SMC1CS_BRG2 0x00001000 /* BRG2 is clock source */
  287. #define SIMODE_SMC1CS_BRG3 0x00002000 /* BRG3 is clock source */
  288. #define SIMODE_SMC1CS_BRG4 0x00003000 /* BRG4 is clock source */
  289. #define SIMODE_SMC1CS_CLK1 0x00004000 /* CLK1 is clock source */
  290. #define SIMODE_SMC1CS_CLK2 0x00005000 /* CLK2 is clock source */
  291. #define SIMODE_SMC1CS_CLK3 0x00006000 /* CLK3 is clock source */
  292. #define SIMODE_SMC1CS_CLK4 0x00007000 /* CLK4 is clock source */
  293. #define SIMODE_SDMA_MSK 0x00000c00 /* SI Diagnostic Mode - TDM B */
  294. #define SIMODE_SDMA_NORM 0x00000000 /* Diag Mode-normal operation */
  295. #define SIMODE_SDMA_ECHO 0x00000400 /* Diag Mode-auto echo */
  296. #define SIMODE_SDMA_LOOP 0x00000800 /* Diag Mode-internal loopback*/
  297. #define SIMODE_SDMA_LCTR 0x00000C00 /* Diag Mode-loopback control */
  298. #define SIMODE_RFSDA_MSK 0x00000300 /* Receive Frame Delay TDM A */
  299. #define SIMODE_RFSDA_NO_DELAY 0x00000000 /* Receive Delay - No Delay */
  300. #define SIMODE_RFSDA_1BIT_DELAY 0x00000100 /* Receive Delay - 1bit delay */
  301. #define SIMODE_RFSDA_2BIT_DELAY 0x00000200 /* Receive Delay - 2bit delay */
  302. #define SIMODE_RFSDA_3BIT_DELAY 0x00000300 /* Receive Delay - 3bit delay */
  303. #define SIMODE_DSCA 0x00000080 /* Double Speed Clocl TDM A */
  304. #define SIMODE_CRTA 0x00000040 /* Common Rcv and Trans. pins */
  305. #define SIMODE_STZA 0x00000020 /* Set L1TxDx to Zero TDM A */
  306. #define SIMODE_CEA_FALLING 0x00000000 /* Clock Edge - falling */
  307. #define SIMODE_CEA_RISING 0x00000010 /* Clock Edge - rising */
  308. #define SIMODE_FEA_FALLING 0x00000000 /* Frame Sync Edge - falling  */
  309. #define SIMODE_FEA_RISING 0x00000008 /* Frame Sync Edge - rising */
  310. #define SIMODE_GMA_GCI_SCIT 0x00000000 /* Grant Mode - GCI/SCIT */
  311. #define SIMODE_GMA_IDL 0x00000004 /* Grant Mode - idle */
  312. #define SIMODE_TFSDA_MSK 0x00000003 /* Transmit Frame Sync Delay */
  313. #define SIMODE_TFSDA_NO_DELAY 0x00000000 /* Transmit Delay - No Delay */
  314. #define SIMODE_TFSDA_1BIT 0x00000001 /* Transmit Delay - 1bit */
  315. #define SIMODE_TFSDA_2BIT 0x00000002 /* Transmit Delay - 2bit */
  316. #define SIMODE_TFSDA_3BIT 0x00000003 /* Transmit Delay - 3bit */
  317. /* SI Global Mode Register bit definition (SIGMR - 0xAE4) */
  318. #define SIGMR_ENB 0x08 /* Enable Channel B */
  319. #define SIGMR_ENA 0x04 /* Enable Channel A */
  320. #define SIGMR_RDM_MSK 0x03 /* Ram Division Mode mask */
  321. /* SI Status Register bit definition (SISTR - 0xAE6) */
  322. #define SISTR_CRORA 0x80 /* Current Route of TDM A Receiver */
  323. #define SISTR_CROTA 0x40 /* Current Route of TDM A Transmitter */
  324. #define SISTR_CRORB 0x20 /* Current Route of TDM B Receiver */
  325. #define SISTR_CROTB 0x10 /* Current Route of TDM B Transmitter */
  326. /* SI Command Register bit definition (SICMR - 0xAE7) */
  327. #define SICMR_CSRRA 0x80 /* Change Shadow RAM - TDM A Receiver */
  328. #define SICMR_CSRTA 0x40 /* Change Shadow RAM - TDM A Transmit */
  329. #define SICMR_CSRRB 0x20 /* Change Shadow RAM - TDM B Receiver */
  330. #define SICMR_CSRTB 0x10 /* Change Shadow RAM - TDM B Transmit */
  331. /* SI Clock Route Register bit definition (SICR - 0xAEC) */
  332. #define SICR_GR4 0x80000000 /* Grant Support of SCC4 */
  333. #define SICR_SC4_MUX 0x40000000 /* SCC4 Connection - mux SI */
  334. #define SICR_R4CS_MSK 0x38000000 /* SCC4 Receive Clock Source */
  335. #define SICR_R4CS_BRG1 0x00000000 /* BRG1 clock source */
  336. #define SICR_R4CS_BRG2 0x08000000 /* BRG2 clock source */
  337. #define SICR_R4CS_BRG3 0x10000000 /* BRG3 clock source */
  338. #define SICR_R4CS_BRG4 0x18000000 /* BRG4 clock source */
  339. #define SICR_R4CS_CLK5 0x20000000 /* CLK5 clock source */
  340. #define SICR_R4CS_CLK6 0x28000000 /* CLK6 clock source */
  341. #define SICR_R4CS_CLK7 0x30000000 /* CLK7 clock source */
  342. #define SICR_R4CS_CLK8 0x38000000 /* CLK8 clock source */
  343. #define SICR_T4CS_MSK 0x07000000 /* SCC4 Transmit Clock Source */
  344. #define SICR_T4CS_BRG1 0x00000000 /* BRG1 clock source */
  345. #define SICR_T4CS_BRG2 0x01000000 /* BRG2 clock source */
  346. #define SICR_T4CS_BRG3 0x02000000 /* BRG3 clock source */
  347. #define SICR_T4CS_BRG4 0x03000000 /* BRG4 clock source */
  348. #define SICR_T4CS_CLK5 0x04000000 /* CLK5 clock source */
  349. #define SICR_T4CS_CLK6 0x05000000 /* CLK6 clock source */
  350. #define SICR_T4CS_CLK7 0x06000000 /* CLK7 clock source */
  351. #define SICR_T4CS_CLK8 0x07000000 /* CLK8 clock source */
  352. #define SICR_GR3 0x00800000 /* Grant Support of SCC3 */
  353. #define SICR_SC3_MUX 0x00400000 /* SCC3 Connection - mux SI */
  354. #define SICR_R3CS_MSK 0x00380000 /* SCC3 Receive Clock Source */
  355. #define SICR_R3CS_BRG1 0x00000000 /* BRG1 clock source */
  356. #define SICR_R3CS_BRG2 0x00080000 /* BRG2 clock source */
  357. #define SICR_R3CS_BRG3 0x00100000 /* BRG3 clock source */
  358. #define SICR_R3CS_BRG4 0x00180000 /* BRG4 clock source */
  359. #define SICR_R3CS_CLK5 0x00200000 /* CLK5 clock source */
  360. #define SICR_R3CS_CLK6 0x00280000 /* CLK6 clock source */
  361. #define SICR_R3CS_CLK7 0x00300000 /* CLK7 clock source */
  362. #define SICR_R3CS_CLK8 0x00380000 /* CLK8 clock source */
  363. #define SICR_T3CS_MSK 0x00070000 /* SCC3 Transmit Clock Source */
  364. #define SICR_T3CS_BRG1 0x00000000 /* BRG1 clock source */
  365. #define SICR_T3CS_BRG2 0x00010000 /* BRG2 clock source */
  366. #define SICR_T3CS_BRG3 0x00020000 /* BRG3 clock source */
  367. #define SICR_T3CS_BRG4 0x00030000 /* BRG4 clock source */
  368. #define SICR_T3CS_CLK5 0x00040000 /* CLK5 clock source */
  369. #define SICR_T3CS_CLK6 0x00050000 /* CLK6 clock source */
  370. #define SICR_T3CS_CLK7 0x00060000 /* CLK7 clock source */
  371. #define SICR_T3CS_CLK8 0x00070000 /* CLK8 clock source */
  372. #define SICR_GR2 0x00008000 /* Grant Support of SCC2 */
  373. #define SICR_SC2_MUX 0x00004000 /* SCC2 Connection - mux SI */
  374. #define SICR_R2CS_MSK 0x00003800 /* SCC2 Receive Clock Source */
  375. #define SICR_R2CS_BRG1 0x00000000 /* BRG1 clock source */
  376. #define SICR_R2CS_BRG2 0x00000800 /* BRG2 clock source */
  377. #define SICR_R2CS_BRG3 0x00001000 /* BRG3 clock source */
  378. #define SICR_R2CS_BRG4 0x00001800 /* BRG4 clock source */
  379. #define SICR_R2CS_CLK1 0x00002000 /* CLK1 clock source */
  380. #define SICR_R2CS_CLK2 0x00002800 /* CLK2 clock source */
  381. #define SICR_R2CS_CLK3 0x00003000 /* CLK3 clock source */
  382. #define SICR_R2CS_CLK4 0x00003800 /* CLK4 clock source */
  383. #define SICR_T2CS_MSK 0x00000700 /* SCC2 Transmit Clock Source */
  384. #define SICR_T2CS_BRG1 0x00000000 /* BRG1 clock source */
  385. #define SICR_T2CS_BRG2 0x00000100 /* BRG2 clock source */
  386. #define SICR_T2CS_BRG3 0x00000200 /* BRG3 clock source */
  387. #define SICR_T2CS_BRG4 0x00000300 /* BRG4 clock source */
  388. #define SICR_T2CS_CLK1 0x00000400 /* CLK1 clock source */
  389. #define SICR_T2CS_CLK2 0x00000500 /* CLK2 clock source */
  390. #define SICR_T2CS_CLK3 0x00000600 /* CLK3 clock source */
  391. #define SICR_T2CS_CLK4 0x00000700 /* CLK4 clock source */
  392. #define SICR_GR1 0x00000080 /* Grant Support of SCC1 */
  393. #define SICR_SC1_MUX 0x00000040 /* SCC1 Connection - mux SI */
  394. #define SICR_R1CS_MSK 0x00000038 /* SCC1 Receive Clock Source */
  395. #define SICR_R1CS_BRG1 0x00000000 /* BRG1 clock source */
  396. #define SICR_R1CS_BRG2 0x00000008 /* BRG2 clock source */
  397. #define SICR_R1CS_BRG3 0x00000010 /* BRG3 clock source */
  398. #define SICR_R1CS_BRG4 0x00000018 /* BRG4 clock source */
  399. #define SICR_R1CS_CLK1 0x00000020 /* CLK1 clock source */
  400. #define SICR_R1CS_CLK2 0x00000028 /* CLK2 clock source */
  401. #define SICR_R1CS_CLK3 0x00000030 /* CLK3 clock source */
  402. #define SICR_R1CS_CLK4 0x00000038 /* CLK4 clock source */
  403. #define SICR_T1CS_MSK 0x00000007 /* SCC1 Transmit Clock Source */
  404. #define SICR_T1CS_BRG1 0x00000000 /* BRG1 clock source */
  405. #define SICR_T1CS_BRG2 0x00000001 /* BRG2 clock source */
  406. #define SICR_T1CS_BRG3 0x00000002 /* BRG3 clock source */
  407. #define SICR_T1CS_BRG4 0x00000003 /* BRG4 clock source */
  408. #define SICR_T1CS_CLK1 0x00000004 /* CLK1 clock source */
  409. #define SICR_T1CS_CLK2 0x00000005 /* CLK2 clock source */
  410. #define SICR_T1CS_CLK3 0x00000006 /* CLK3 clock source */
  411. #define SICR_T1CS_CLK4 0x00000007 /* CLK4 clock source */
  412. /* SI Ram Pointer bit definition (SIRP - 0xAF0) */
  413. #define SIRP_VTB_MSK 0x20000000 /* Transmitter B pointer Valid*/
  414. #define SIRP_TBPTR_MSK 0x1f000000 /* Transmitter B pointer */
  415. #define SIRP_VTA_MSK 0x00200000 /* Transmitter A pointer Valid*/
  416. #define SIRP_TAPTR_MSK 0x001f0000 /* Transmitter A pointer */
  417. #define SIRP_VRB_MSK 0x00002000 /* Receiver B pointer Valid */
  418. #define SIRP_RBPTR_MSK 0x00001f00 /* Receiver B pointer */
  419. #define SIRP_VRA_MSK 0x00000020 /* Receiver A pointer Valid */
  420. #define SIRP_RAPTR_MSK 0x0000001f /* Receiver A pointer */
  421. /* SMC UART Event Register bit definition (SMCE - 0x0A86) */ 
  422. #define SMCE_BRK 0x10 /* Break character received */
  423. #define SMCE_BSY 0x04 /* Busy Condition */
  424. #define SMCE_TX 0x02 /* Transmit Buffer */
  425. #define SMCE_RX 0x01 /* Receive Buffer */
  426. #define SMCE_ALL_EVENTS (SMCE_BRK | SMCE_BSY | SMCE_TX | SMCE_RX)
  427. /* SMC UART Mask Register bit definition (SMCM - 0x0A8A) */ 
  428. #define SMCM_BRK_MSK 0x10 /* Break character received Mask */
  429. #define SMCM_BSY_MSK 0x04 /* Busy Condition Mask */
  430. #define SMCM_TX_MSK 0x02 /* Transmit Buffer Mask */
  431. #define SMCM_RX_MSK 0x01 /* Receive Buffer Mask */
  432. /* equates for CICR register CP interrupt configuration register */
  433. #define CICR_IRL_LEVEL_0 0x00000000 /* highest interrupt level */
  434. #define CICR_IRL_LEVEL_1 0x00020000
  435. #define CICR_IRL_LEVEL_2 0x00040000
  436. #define CICR_IRL_LEVEL_3 0x00060000
  437. #define CICR_IRL_LEVEL_4 0x00080000 /* standard value */
  438. #define CICR_IRL_LEVEL_5 0x000A0000
  439. #define CICR_IRL_LEVEL_6 0x000C0000
  440. #define CICR_IRL_LEVEL_7 0x000E0000 /* lowest */
  441. #define CICR_HP_SRC_STD 0x0001F000 /* highest priority int */
  442. #define CICR_MASTER_IEN 0x00000080 /* master interrupt enable */
  443. /* SPI Mode Register bit definition (SPMODE - 0x0AA0) */
  444. #define SPMODE_LOOP 0x4000 /* Loop Mode */
  445. #define SPMODE_CI 0x2000 /* Clock Invert */
  446. #define SPMODE_CI_LOW 0x0000 /* Inactive state is low */
  447. #define SPMODE_CI_HIGH 0x2000 /* Inactive state is high */
  448. #define SPMODE_CP 0x1000 /* Clock Phase */
  449. #define SPMODE_CP_MIDDLE 0x0000 /* Clock Phase: middle of the data */
  450. #define SPMODE_CP_BEGIN 0x1000 /* Clock Phase: Beginning of the data */
  451. #define SPMODE_DIV16 0x0800 /* BRGCLK Divide by 16 */
  452. #define SPMODE_REV 0x0400 /* Reverse Data */
  453. #define SPMODE_MS 0x0200 /* SPI Master */
  454. #define SPMODE_EN 0x0100 /* Enable SPI */
  455. #define SPMODE_LEN_MSK 0x00f0 /* Character Length */
  456. #define SPMODE_LEN_1_BIT 0x0000 /* Character Length: 1 bit */
  457. #define SPMODE_LEN_2_BITS 0x0010 /* Character Length: 2 bits */
  458. #define SPMODE_LEN_3_BITS 0x0020 /* Character Length: 3 bits */
  459. #define SPMODE_LEN_4_BITS 0x0030 /* Character Length: 4 bits */
  460. #define SPMODE_LEN_5_BITS 0x0040 /* Character Length: 5 bits */
  461. #define SPMODE_LEN_6_BITS 0x0050 /* Character Length: 6 bits */
  462. #define SPMODE_LEN_7_BITS 0x0060 /* Character Length: 7 bits */
  463. #define SPMODE_LEN_8_BITS 0x0070 /* Character Length: 8 bits */
  464. #define SPMODE_LEN_9_BITS 0x0080 /* Character Length: 9 bits */
  465. #define SPMODE_LEN_10_BITS 0x0090 /* Character Length: 10 bits */
  466. #define SPMODE_LEN_11_BITS 0x00a0 /* Character Length: 11 bits */
  467. #define SPMODE_LEN_12_BITS 0x00b0 /* Character Length: 12 bits */
  468. #define SPMODE_LEN_13_BITS 0x00c0 /* Character Length: 13 bits */
  469. #define SPMODE_LEN_14_BITS 0x00d0 /* Character Length: 14 bits */
  470. #define SPMODE_LEN_15_BITS 0x00e0 /* Character Length: 15 bits */
  471. #define SPMODE_LEN_16_BITS 0x00f0 /* Character Length: 16 bits */
  472. #define SPMODE_PM_MSK 0x000f /* BRGCLK Prescale Modulus select mask*/
  473. #define SPMODE_PM_DIV4 0x0000 /* BRGCLK clock divided by 4 */
  474. #define SPMODE_PM_DIV8 0x0001 /* BRGCLK clock divided by 8 */
  475. #define SPMODE_PM_DIV12 0x0002 /* BRGCLK clock divided by 12 */
  476. #define SPMODE_PM_DIV16 0x0003 /* BRGCLK clock divided by 16 */
  477. #define SPMODE_PM_DIV20 0x0004 /* BRGCLK clock divided by 20 */
  478. #define SPMODE_PM_DIV24 0x0005 /* BRGCLK clock divided by 24 */
  479. #define SPMODE_PM_DIV28 0x0006 /* BRGCLK clock divided by 28 */
  480. #define SPMODE_PM_DIV32 0x0007 /* BRGCLK clock divided by 32 */
  481. #define SPMODE_PM_DIV36 0x0008 /* BRGCLK clock divided by 36 */
  482. #define SPMODE_PM_DIV40 0x0009 /* BRGCLK clock divided by 40 */
  483. #define SPMODE_PM_DIV44 0x000a /* BRGCLK clock divided by 44 */
  484. #define SPMODE_PM_DIV48 0x000b /* BRGCLK clock divided by 48 */
  485. #define SPMODE_PM_DIV52 0x000c /* BRGCLK clock divided by 52 */
  486. #define SPMODE_PM_DIV56 0x000d /* BRGCLK clock divided by 56 */
  487. #define SPMODE_PM_DIV60 0x000e /* BRGCLK clock divided by 60 */
  488. #define SPMODE_PM_DIV64 0x000f /* BRGCLK clock divided by 64 */
  489. /* SPI Command Register (SPCOM - 0x0AAD) */
  490. #define SPCOM_STR 0x80 /* Start Transmit */
  491. /* SCC Receive Function Code Register bit definition (RFCR) */
  492. #define RFCR_BO_MSK 0x18 /* Byte Order Mask */
  493. #define RFCR_BO_DEC_LE 0x00 /* Byte Order: DEC little endian mode */
  494. #define RFCR_BO_PPC_LE 0x08 /* Byte Order: PPC little endian mode */
  495. /* reverse transmission order of */
  496. /* bytes compared to DEC/Intel mode */
  497. #define RFCR_BO_MOT_BE 0x18 /* Motorola Big endian mode */
  498. #define RFCR_AT_MSK 0x07 /* Address Type Mask */
  499. /* SCC Transmit Function Code Register bit definition (TFCR) */ 
  500. #define TFCR_BO_MSK 0x18 /* Byte Order Mask */
  501. #define TFCR_BO_DEC_LE 0x00 /* Byte Order: DEC little endian mode */
  502. #define TFCR_BO_PPC_LE 0x08 /* Byte Order: PPC little endian mode */
  503. /* reverse transmission order of */
  504. /* bytes compared to DEC/Intel mode */
  505. #define TFCR_BO_MOT_BE 0x18 /* Motorola Big endian mode */
  506. #define TFCR_AT_MSK 0x07 /* Address Type Mask */
  507. /* SMC UART Mode Register bit definition (SMCMR - 0x0A82) */
  508. #define SMCMR_CLEN_MSK 0x7800 /* Character Length Mask */
  509. #define SMCMR_CLEN_0_BIT 0x0000 /* Character Length: 0 bit */
  510. #define SMCMR_CLEN_1_BIT 0x0800 /* Character Length: 1 bit */
  511. #define SMCMR_CLEN_2_BITS 0x1000 /* Character Length: 2 bits */
  512. #define SMCMR_CLEN_3_BITS 0x1800 /* Character Length: 3 bits */
  513. #define SMCMR_CLEN_4_BITS 0x2000 /* Character Length: 4 bits */
  514. #define SMCMR_CLEN_5_BITS 0x2800 /* Character Length: 5 bits */
  515. #define SMCMR_CLEN_6_BITS 0x3000 /* Character Length: 6 bits */
  516. #define SMCMR_CLEN_7_BITS 0x3800 /* Character Length: 7 bits */
  517. #define SMCMR_CLEN_8_BITS 0x4000 /* Character Length: 8 bits */
  518. #define SMCMR_CLEN_9_BITS 0x4800 /* Character Length: 9 bits */
  519. #define SMCMR_CLEN_10_BITS 0x5000 /* Character Length: 10 bits */
  520. #define SMCMR_CLEN_11_BITS 0x5800 /* Character Length: 11 bits */
  521. #define SMCMR_CLEN_12_BITS 0x6000 /* Character Length: 12 bits */
  522. #define SMCMR_CLEN_13_BITS 0x6800 /* Character Length: 13 bits */
  523. #define SMCMR_CLEN_14_BITS 0x7000 /* Character Length: 14 bits */
  524. #define SMCMR_CLEN_15_BITS 0x7800 /* Character Length: 15 bits */
  525. #define SMCMR_SL 0x0400 /* Stop Length */
  526. #define SMCMR_SL_1_BIT 0x0000 /* Stop Length: 1 bit */
  527. #define SMCMR_SL_2_BITS 0x0400 /* Stop Length: 2 bits */
  528. #define SMCMR_PEN 0x0200 /* Parity Enable */
  529. #define SMCMR_PM 0x0100 /* Parity Mode */
  530. #define SMCMR_PM_ODD 0x0000 /* Parity Mode: Odd parity */
  531. #define SMCMR_PM_EVEN 0x0100 /* Parity Mode: Even parity */
  532. #define SMCMR_SM_MSK 0x0030 /* SMC Mode Mask */
  533. #define SMCMR_SM_GCI_SCIT 0x0000 /* SMC Mode: GCI or SCIT support */
  534. #define SMCMR_SM_UART 0x0020 /* SMC Mode: GCI or SCIT support */
  535. #define SMCMR_SM_TRANSPARENT 0x0030 /* SMC Mode: Totally transparent */
  536. #define SMCMR_DM_MSK 0x000c /* Diagnostic Mode Mask */
  537. #define SMCMR_DM_NORMAL 0x0000 /* Diagnostic Mode: Normal */
  538. #define SMCMR_DM_LCLB 0x0004 /* Diagnostic Mode: Local Loopback */
  539. #define SMCMR_DM_ECHO 0x0008 /* Diagnostic Mode: Echo */
  540. #define SMCMR_TEN 0x0002 /* SMC Transmit Enable */
  541. #define SMCMR_REN 0x0001 /* SMC Receive Enable */
  542. #define SMCMR_STD_MODE   (SMCMR_CLEN_9_BITS | 
  543.  SMCMR_SL_1_BIT    | 
  544.  SMCMR_SM_UART    | 
  545.  SMCMR_DM_NORMAL)
  546. #define SCMCR_STD_MODE_ENABLED (SMCMR_STD_MODE | 
  547.  SMCMR_TEN | 
  548.  SMCMR_REN)
  549. /* CPM Interrupt Vector Register (CIVR - 0x930) */
  550. #define CIVR_IVN_MSK 0xf800 /* Interrupt Vector Number */
  551. #define CIVR_IACK 0x0001 /* Interrupt Acknowledge */
  552. /* CPM Interrupt configuration Register (CICR - 0x940) */
  553. #define CICR_SCCDP_MSK 0xc00000 /* SCCd Priority Order Mask */
  554. #define CICR_SCCDP_SCC1 0x000000 /* SCC1 asserts the SCCd */ 
  555. #define CICR_SCCDP_SCC2 0x400000 /* SCC2 asserts the SCCd */ 
  556. #define CICR_SCCDP_SCC3 0x800000 /* SCC3 asserts the SCCd */ 
  557. #define CICR_SCCDP_SCC4 0xc00000 /* SCC4 asserts the SCCd */ 
  558. #define CICR_SCCCP_MSK 0x300000 /* SCCc Priority Order Mask */
  559. #define CICR_SCCCP_SCC1 0x000000 /* SCC1 asserts the SCCc */ 
  560. #define CICR_SCCCP_SCC2 0x100000 /* SCC2 asserts the SCCc */ 
  561. #define CICR_SCCCP_SCC3 0x200000 /* SCC3 asserts the SCCc */ 
  562. #define CICR_SCCCP_SCC4 0x300000 /* SCC4 asserts the SCCc */ 
  563. #define CICR_SCCBP_MSK 0x0c0000 /* SCCb Priority Order Mask */
  564. #define CICR_SCCBP_SCC1 0x000000 /* SCC1 asserts the SCCb */ 
  565. #define CICR_SCCBP_SCC2 0x040000 /* SCC2 asserts the SCCb */ 
  566. #define CICR_SCCBP_SCC3 0x080000 /* SCC3 asserts the SCCb */ 
  567. #define CICR_SCCBP_SCC4 0x0c0000 /* SCC4 asserts the SCCb */ 
  568. #define CICR_SCCAP_MSK 0x030000 /* SCCa Priority Order Mask */
  569. #define CICR_SCCAP_SCC1 0x000000 /* SCC1 asserts the SCCa */ 
  570. #define CICR_SCCAP_SCC2 0x010000 /* SCC2 asserts the SCCa */ 
  571. #define CICR_SCCAP_SCC3 0x020000 /* SCC3 asserts the SCCa */ 
  572. #define CICR_SCCAP_SCC4 0x030000 /* SCC4 asserts the SCCa */ 
  573. #define CICR_IRL_MSK 0x00e000 /* Interrupt Request Level */
  574. #define CICR_IRL_LVL0 0x000000 /* Interrupt Request Level 0 */
  575. #define CICR_IRL_LVL1 0x002000 /* Interrupt Request Level 1 */
  576. #define CICR_IRL_LVL2 0x004000 /* Interrupt Request Level 2 */
  577. #define CICR_IRL_LVL3 0x006000 /* Interrupt Request Level 3 */
  578. #define CICR_IRL_LVL4 0x008000 /* Interrupt Request Level 4 */
  579. #define CICR_IRL_LVL5 0x00a000 /* Interrupt Request Level 5 */
  580. #define CICR_IRL_LVL6 0x00c000 /* Interrupt Request Level 6 */
  581. #define CICR_IRL_LVL7 0x00e000 /* Interrupt Request Level 7 */
  582. #define CICR_HP_MSK 0x001f00 /* Highest Priority */
  583. #define CICR_IEN 0x000080 /* Interrupt Enable */
  584. #define CICR_SPS 0x000001 /* Spread Priority Scheme */
  585. /* CPM Interrupt Pending Register (CIPR - 0x944) */
  586. #define CIPR_PC15 0x80000000 /* Parallel I/O Port C[15] */
  587. #define CIPR_SCC1 0x40000000 /* SCC 1 */
  588. #define CIPR_SCC2 0x20000000 /* SCC 2 */
  589. #define CIPR_SCC3 0x10000000 /* SCC 3 */
  590. #define CIPR_SCC4 0x08000000 /* SCC 4 */
  591. #define CIPR_PC14 0x04000000 /* Parallel I/O Port C[14] */
  592. #define CIPR_TIMER1 0x02000000 /* Timer 1 */
  593. #define CIPR_PC13 0x01000000 /* Parallel I/O Port C[13] */
  594. #define CIPR_PC12 0x00800000 /* Parallel I/O Port C[12] */
  595. #define CIPR_SDMA 0x00400000 /* SDMA bus error */
  596. #define CIPR_IDMA1 0x00200000 /* IDMA 1 */
  597. #define CIPR_IDMA2 0x00100000 /* IDMA 2 */
  598. #define CIPR_TIMER2 0x00040000 /* Timer 2 */
  599. #define CIPR_R_TT 0x00020000 /* Risc Timer Table */
  600. #define CIPR_I2C 0x00010000 /* I2C */
  601. #define CIPR_PC11 0x00008000 /* Parallel I/O Port C[11] */
  602. #define CIPR_PC10 0x00004000 /* Parallel I/O Port C[10] */
  603. #define CIPR_TIMER3 0x00001000 /* Timer 3 */
  604. #define CIPR_PC9 0x00000800 /* Parallel I/O Port C[9] */
  605. #define CIPR_PC8 0x00000400 /* Parallel I/O Port C[8] */
  606. #define CIPR_PC7 0x00000200 /* Parallel I/O Port C[7] */
  607. #define CIPR_TIMER4 0x00000080 /* Timer 4 */
  608. #define CIPR_PC6 0x00000040 /* Parallel I/O Port C[6] */
  609. #define CIPR_SPI 0x00000020 /* SPI */
  610. #define CIPR_SMC1 0x00000010 /* SMC 1 */
  611. #define CIPR_SMC2_PIP 0x00000008 /* SMC 1 */
  612. #define CIPR_PC5 0x00000004 /* Parallel I/O Port C[5] */
  613. #define CIPR_PC4 0x00000002 /* Parallel I/O Port C[4] */
  614. /* CPM Interrupt Mask Register (CIMR - 0x948) */
  615. #define CIMR_PC15 0x80000000 /* Parallel I/O Port C[15] */
  616. #define CIMR_SCC1 0x40000000 /* SCC 1 */
  617. #define CIMR_SCC2 0x20000000 /* SCC 2 */
  618. #define CIMR_SCC3 0x10000000 /* SCC 3 */
  619. #define CIMR_SCC4 0x08000000 /* SCC 4 */
  620. #define CIMR_PC14 0x04000000 /* Parallel I/O Port C[14] */
  621. #define CIMR_TIMER1 0x02000000 /* Timer 1 */
  622. #define CIMR_PC13 0x01000000 /* Parallel I/O Port C[13] */
  623. #define CIMR_PC12 0x00800000 /* Parallel I/O Port C[12] */
  624. #define CIMR_SDMA 0x00400000 /* SDMA bus error */
  625. #define CIMR_IDMA1 0x00200000 /* IDMA 1 */
  626. #define CIMR_IDMA2 0x00100000 /* IDMA 2 */
  627. #define CIMR_TIMER2 0x00040000 /* Timer 2 */
  628. #define CIMR_R_TT 0x00020000 /* Risc Timer Table */
  629. #define CIMR_I2C 0x00010000 /* I2C */
  630. #define CIMR_PC11 0x00008000 /* Parallel I/O Port C[11] */
  631. #define CIMR_PC10 0x00004000 /* Parallel I/O Port C[10] */
  632. #define CIMR_TIMER3 0x00001000 /* Timer 3 */
  633. #define CIMR_PC9 0x00000800 /* Parallel I/O Port C[9] */
  634. #define CIMR_PC8 0x00000400 /* Parallel I/O Port C[8] */
  635. #define CIMR_PC7 0x00000200 /* Parallel I/O Port C[7] */
  636. #define CIMR_TIMER4 0x00000080 /* Timer 4 */
  637. #define CIMR_PC6 0x00000040 /* Parallel I/O Port C[6] */
  638. #define CIMR_SPI 0x00000020 /* SPI */
  639. #define CIMR_SMC1 0x00000010 /* SMC 1 */
  640. #define CIMR_SMC2_PIP 0x00000008 /* SMC 1 */
  641. #define CIMR_PC5 0x00000004 /* Parallel I/O Port C[5] */
  642. #define CIMR_PC4 0x00000002 /* Parallel I/O Port C[4] */
  643. #define CIMR_ALL 0xfff7defe /* all interrupt masks */
  644. /* CPM Interrupt in Service Register (CISR - 0x94c) */
  645. #define CISR_PC15 0x80000000 /* Parallel I/O Port C[15] */
  646. #define CISR_SCC1 0x40000000 /* SCC 1 */
  647. #define CISR_SCC2 0x20000000 /* SCC 2 */
  648. #define CISR_SCC3 0x10000000 /* SCC 3 */
  649. #define CISR_SCC4 0x08000000 /* SCC 4 */
  650. #define CISR_PC14 0x04000000 /* Parallel I/O Port C[14] */
  651. #define CISR_TIMER1 0x02000000 /* Timer 1 */
  652. #define CISR_PC13 0x01000000 /* Parallel I/O Port C[13] */
  653. #define CISR_PC12 0x00800000 /* Parallel I/O Port C[12] */
  654. #define CISR_SDMA 0x00400000 /* SDMA bus error */
  655. #define CISR_IDMA1 0x00200000 /* IDMA 1 */
  656. #define CISR_IDMA2 0x00100000 /* IDMA 2 */
  657. #define CISR_TIMER2 0x00040000 /* Timer 2 */
  658. #define CISR_R_TT 0x00020000 /* Risc Timer Table */
  659. #define CISR_I2C 0x00010000 /* I2C */
  660. #define CISR_PC11 0x00008000 /* Parallel I/O Port C[11] */
  661. #define CISR_PC10 0x00004000 /* Parallel I/O Port C[10] */
  662. #define CISR_TIMER3 0x00001000 /* Timer 3 */
  663. #define CISR_PC9 0x00000800 /* Parallel I/O Port C[9] */
  664. #define CISR_PC8 0x00000400 /* Parallel I/O Port C[8] */
  665. #define CISR_PC7 0x00000200 /* Parallel I/O Port C[7] */
  666. #define CISR_TIMER4 0x00000080 /* Timer 4 */
  667. #define CISR_PC6 0x00000040 /* Parallel I/O Port C[6] */
  668. #define CISR_SPI 0x00000020 /* SPI */
  669. #define CISR_SMC1 0x00000010 /* SMC 1 */
  670. #define CISR_SMC2_PIP 0x00000008 /* SMC 1 */
  671. #define CISR_PC5 0x00000004 /* Parallel I/O Port C[5] */
  672. #define CISR_PC4 0x00000002 /* Parallel I/O Port C[4] */
  673. /* SCC - Serial Communication Controller */
  674. /* General SCC Mode Register definitions  */
  675. #define SCC_GSMRL_HDLC 0x00000000 /* HDLC mode */
  676. #define SCC_GSMRL_APPLETALK 0x00000002 /* AppleTalk mode (LocalTalk) */
  677. #define SCC_GSMRL_SS7 0x00000003 /* SS7 mode (microcode) */
  678. #define SCC_GSMRL_UART 0x00000004 /* UART mode */
  679. #define SCC_GSMRL_PROFI_BUS 0x00000005 /* Profi-Bus mode (microcode) */
  680. #define SCC_GSMRL_ASYNC_HDLC 0x00000006 /* async HDLC mode (microcode)*/
  681. #define SCC_GSMRL_V14 0x00000007 /* V.14 mode */
  682. #define SCC_GSMRL_BISYNC 0x00000008 /* BISYNC mode */
  683. #define SCC_GSMRL_DDCMP 0x00000009 /* DDCMP mode (microcode) */
  684. #define SCC_GSMRL_ETHERNET 0x0000000c /* ethernet mode (SCC1 only) */
  685. #define SCC_GSMRL_ENT 0x00000010 /* enable transmitter */
  686. #define SCC_GSMRL_ENR 0x00000020 /* enable receiver */
  687. #define SCC_GSMRL_LOOPBACK 0x00000040 /* local loopback mode */
  688. #define SCC_GSMRL_ECHO 0x00000080 /* automatic echo mode */
  689. #define SCC_GSMRL_TENC 0x00000700 /* transmitter encoding method*/
  690. #define SCC_GSMRL_RENC 0x00003800 /* receiver encoding method */
  691. #define SCC_GSMRL_RDCR_X8 0x00004000 /* receive DPLL clock x8 */
  692. #define SCC_GSMRL_RDCR_X16 0x00008000 /* receive DPLL clock x16 */
  693. #define SCC_GSMRL_RDCR_X32 0x0000c000 /* receive DPLL clock x32 */
  694. #define SCC_GSMRL_TDCR_X8 0x00010000 /* transmit DPLL clock x8 */
  695. #define SCC_GSMRL_TDCR_X16 0x00020000 /* transmit DPLL clock x16 */
  696. #define SCC_GSMRL_TDCR_X32 0x00030000 /* transmit DPLL clock x32 */
  697. #define SCC_GSMRL_TEND 0x00040000 /* transmitter frame ending */
  698. #define SCC_GSMRL_TPP_00 0x00180000 /* Tx preamble pattern = 00 */
  699. #define SCC_GSMRL_TPP_10 0x00080000 /* Tx preamble pattern = 10 */
  700. #define SCC_GSMRL_TPP_01 0x00100000 /* Tx preamble pattern = 01 */
  701. #define SCC_GSMRL_TPP_11 0x00180000 /* Tx preamble pattern = 11 */
  702. #define SCC_GSMRL_TPL_NONE 0x00000000 /* no Tx preamble (default) */
  703. #define SCC_GSMRL_TPL_8 0x00200000 /* Tx preamble = 1 byte */
  704. #define SCC_GSMRL_TPL_16 0x00400000 /* Tx preamble = 2 bytes */
  705. #define SCC_GSMRL_TPL_32 0x00600000 /* Tx preamble = 4 bytes */
  706. #define SCC_GSMRL_TPL_48 0x00800000 /* Tx preamble = 6 bytes */
  707. #define SCC_GSMRL_TPL_64 0x00a00000 /* Tx preamble = 8 bytes */
  708. #define SCC_GSMRL_TPL_128 0x00c00000 /* Tx preamble = 16 bytes */
  709. #define SCC_GSMRL_TINV 0x01000000 /* DPLL transmit input invert */
  710. #define SCC_GSMRL_RINV 0x02000000 /* DPLL receive input invert */
  711. #define SCC_GSMRL_TSNC 0x0c000000 /* transmit sense */
  712. #define SCC_GSMRL_TCI 0x10000000 /* transmit clock invert */
  713. #define SCC_GSMRL_EDGE 0x60000000 /* adjustment edge +/- */
  714. #define SCC_GSMRH_RSYN 0x00000001 /* receive sync timing*/
  715. #define SCC_GSMRH_RTSM 0x00000002 /* RTS* mode */
  716. #define SCC_GSMRH_SYNL 0x0000000c /* sync length */
  717. #define SCC_GSMRH_TXSY 0x00000010 /* transmitter/receiver sync */
  718. #define SCC_GSMRH_RFW 0x00000020 /* Rx FIFO width */
  719. #define SCC_GSMRH_TFL 0x00000040 /* transmit FIFO length */
  720. #define SCC_GSMRH_CTSS 0x00000080 /* CTS* sampling */
  721. #define SCC_GSMRH_CDS 0x00000100 /* CD* sampling */
  722. #define SCC_GSMRH_CTSP 0x00000200 /* CTS* pulse */
  723. #define SCC_GSMRH_CDP 0x00000400 /* CD* pulse */
  724. #define SCC_GSMRH_TTX 0x00000800 /* transparent transmitter */
  725. #define SCC_GSMRH_TRX 0x00001000 /* transparent receiver */
  726. #define SCC_GSMRH_REVD 0x00002000 /* reverse data */
  727. #define SCC_GSMRH_TCRC 0x0000c000 /* transparent CRC */
  728. #define SCC_GSMRH_GDE 0x00010000 /* glitch detect enable */
  729. /* SCC UART protocol specific parameters */
  730. typedef struct /* SCC_UART_PROTO */
  731.     {
  732.     UINT32 res1; /* reserved */
  733.     UINT32 res2; /* reserved */
  734.     UINT16 maxIdl; /* maximum idle characters */
  735.     UINT16 idlc; /* temporary idle counter */
  736.     UINT16 brkcr; /* break count register (transmit) */
  737.     UINT16 parec; /* receive parity error counter */
  738.     UINT16 frmer; /* receive framing error counter */
  739.     UINT16 nosec; /* receive noise counter */
  740.     UINT16 brkec; /* receive break condition counter */
  741.     UINT16 brkln; /* last received break length */
  742.     UINT16 uaddr1; /* uart address character 1 */
  743.     UINT16 uaddr2; /* uart address character 2 */
  744.     UINT16 rtemp; /* temp storage */
  745.     UINT16 toseq; /* transmit out-of-sequence character */
  746.     UINT16 character1; /* control character 1 */
  747.     UINT16 character2; /* control character 2 */
  748.     UINT16 character3; /* control character 3 */
  749.     UINT16 character4; /* control character 4 */
  750.     UINT16 character5; /* control character 5 */
  751.     UINT16 character6; /* control character 6 */
  752.     UINT16 character7; /* control character 7 */
  753.     UINT16 character8; /* control character 8 */
  754.     UINT16 rccm; /* receive control character mask */
  755.     UINT16 rccr; /* receive control character register */
  756.     UINT16 rlbc; /* receive last break character */
  757.     } SCC_UART_PROTO;
  758. /* SCC UART Protocol Specific Mode Register definitions */
  759. #define SCC_UART_PSMR_TPM_ODD 0x0000 /* odd parity mode (Tx) */
  760. #define SCC_UART_PSMR_TPM_LOW 0x0001 /* low parity mode (Tx) */
  761. #define SCC_UART_PSMR_TPM_EVEN 0x0002 /* even parity mode (Tx) */
  762. #define SCC_UART_PSMR_TPM_HIGH 0x0003 /* high parity mode (Tx) */
  763. #define SCC_UART_PSMR_RPM_ODD 0x0000 /* odd parity mode (Rx) */
  764. #define SCC_UART_PSMR_RPM_LOW 0x0004 /* low parity mode (Rx) */
  765. #define SCC_UART_PSMR_RPM_EVEN 0x0008 /* even parity mode (Rx) */
  766. #define SCC_UART_PSMR_RPM_HIGH 0x000c /* high parity mode (Rx) */
  767. #define SCC_UART_PSMR_PEN 0x0010 /* parity enable */
  768. #define SCC_UART_PSMR_DRT 0x0040 /* disable Rx while Tx */
  769. #define SCC_UART_PSMR_SYN 0x0080 /* synchronous mode */
  770. #define SCC_UART_PSMR_RZS 0x0100 /* receive zero stop bits */
  771. #define SCC_UART_PSMR_FRZ 0x0200 /* freeze transmission */
  772. #define SCC_UART_PSMR_UM_NML 0x0000 /* noraml UART operation */
  773. #define SCC_UART_PSMR_UM_MULT_M 0x0400 /* multidrop non-auto mode */
  774. #define SCC_UART_PSMR_UM_MULT_A 0x0c00 /* multidrop automatic mode */
  775. #define SCC_UART_PSMR_CL_5BIT 0x0000 /* 5 bit character length */
  776. #define SCC_UART_PSMR_CL_6BIT 0x1000 /* 6 bit character length */
  777. #define SCC_UART_PSMR_CL_7BIT 0x2000 /* 7 bit character length */
  778. #define SCC_UART_PSMR_CL_8BIT 0x3000 /* 8 bit character length */
  779. #define SCC_UART_PSMR_SL 0x4000 /* 1 or 2 bit stop length */
  780. #define SCC_UART_PSMR_FLC 0x8000 /* flow control */
  781. /* SCC UART Event and Mask Register definitions */
  782. #define SCC_UART_SCCX_RX  0x0001 /* buffer received */
  783. #define SCC_UART_SCCX_TX  0x0002 /* buffer transmitted */
  784. #define SCC_UART_SCCX_BSY  0x0004 /* busy condition */
  785. #define SCC_UART_SCCX_CCR  0x0008 /* control character received */
  786. #define SCC_UART_SCCX_BRK_S  0x0020   /* break start */
  787. #define SCC_UART_SCCX_BRK_E  0x0040 /* break end */
  788. #define SCC_UART_SCCX_GRA  0x0080 /* graceful stop complete */
  789. #define SCC_UART_SCCX_IDL 0x0100 /* idle sequence stat changed */
  790. #define SCC_UART_SCCX_AB   0x0200 /* autobaud lock */
  791. #define SCC_UART_SCCX_GL_T  0x0800 /* glitch on Tx */
  792. #define SCC_UART_SCCX_GL_R  0x1000 /* glitch on Rx */
  793. /* SCC UART Receive Buffer Descriptor definitions */
  794. #define SCC_UART_RX_BD_CD 0x0001 /* carrier detect loss */
  795. #define SCC_UART_RX_BD_OV 0x0002 /* receiver overrun */
  796. #define SCC_UART_RX_BD_PR 0x0008 /* parity error */
  797. #define SCC_UART_RX_BD_FR 0x0010 /* framing error */
  798. #define SCC_UART_RX_BD_BR 0x0020 /* break received */
  799. #define SCC_UART_RX_BD_AM 0x0080 /* address match */
  800. #define SCC_UART_RX_BD_ID 0x0100 /* buf closed on IDLES */
  801. #define SCC_UART_RX_BD_CM 0x0200 /* continous mode */
  802. #define SCC_UART_RX_BD_ADDR 0x0400 /* buffer contains address */
  803. #define SCC_UART_RX_BD_CNT 0x0800 /* control character */
  804. #define SCC_UART_RX_BD_INT 0x1000 /* interrupt generated */
  805. #define SCC_UART_RX_BD_WRAP 0x2000 /* wrap back to first BD */
  806. #define SCC_UART_RX_BD_EMPTY 0x8000 /* buffer is empty */
  807. /* SCC UART Transmit Buffer Descriptor definitions */
  808. #define SCC_UART_TX_BD_CT 0x0001 /* cts was lost during tx */
  809. #define SCC_UART_TX_BD_NS 0x0080 /* no stop bit transmitted */
  810. #define SCC_UART_TX_BD_PREAMBLE 0x0100 /* enable preamble */
  811. #define SCC_UART_TX_BD_CM 0x0200 /* continous mode */
  812. #define SCC_UART_TX_BD_ADDR 0x0400 /* buffer contains address */
  813. #define SCC_UART_TX_BD_CTSR 0x0800 /* normal cts error reporting */
  814. #define SCC_UART_TX_BD_INT 0x1000 /* interrupt generated */
  815. #define SCC_UART_TX_BD_WRAP 0x2000 /* wrap back to first BD */
  816. #define SCC_UART_TX_BD_READY 0x8000 /* buffer is being sent */
  817. /* SCC Buffer */
  818. typedef struct          /* SCC_BUF */
  819.     {
  820.     volatile UINT16 statusMode; /* status and control */
  821.     UINT16 dataLength; /* length of data buffer in bytes */
  822.     u_char * dataPointer; /* points to data buffer */
  823.     } SCC_BUF;
  824. /* SCC Parameters */
  825. typedef struct          /* SCC_PARAM */
  826.     {                 /* offset description*/
  827.     volatile INT16      rbase; /* 00 Rx buffer descriptor base address */
  828.     volatile INT16      tbase; /* 02 Tx buffer descriptor base address */
  829.     volatile INT8       rfcr; /* 04 Rx function code */
  830.     volatile INT8       tfcr; /* 05 Tx function code */
  831.     volatile INT16      mrblr; /* 06 maximum receive buffer length */
  832.     volatile INT32      rstate; /* 08 Rx internal state */
  833.     volatile INT32      res1; /* 0C Rx internal data pointer */
  834.     volatile INT16      rbptr; /* 10 Rx buffer descriptor pointer */
  835.     volatile INT16      res2; /* 12 reserved/internal */
  836.     volatile INT32      res3; /* 14 reserved/internal */
  837.     volatile INT32      tstate; /* 18 Tx internal state */
  838.     volatile INT32      res4; /* 1C reserved/internal */
  839.     volatile INT16      tbptr; /* 20 Tx buffer descriptor pointer */
  840.     volatile INT16      res5; /* 22 reserved/internal */
  841.     volatile INT32      res6; /* 24 reserved/internal */
  842.     volatile INT32 rcrc; /* 28 temp receive CRC */
  843.     volatile INT32 tcrc; /* 2C temp transmit CRC */
  844.     } SCC_PARAM;
  845.    
  846. typedef struct          /* SCC */
  847.     {
  848.     SCC_PARAM   param;                  /* SCC parameters */
  849.     char        prot[64];               /* protocol specific area */
  850.     } SCC;
  851. typedef struct          /* SCC_REG */
  852.     {
  853.     UINT32       gsmrl; /* SCC general mode register - low */
  854.     UINT32       gsmrh;   /* SCC eneral mode register - high */
  855.     UINT16       psmr;    /* SCC protocol mode register */
  856.     UINT16       res1;    /* reserved */
  857.     UINT16       todr;    /* SCC transmit on demand */
  858.     UINT16       dsr;     /* SCC data sync. register */
  859.     volatile UINT16     scce;    /* SCC event register */
  860.     UINT16       res2;    /* reserved */
  861.     UINT16       sccm;    /* SCC mask register */
  862.     UINT8        res3;    /* reserved */
  863.     volatile UINT8      sccs;    /* SCC status register */
  864.     } SCC_REG;
  865. /* PIP related definitions: */
  866. #define CPM_PIP_STB         0x00010000 /* printer data-strobe control */
  867. #define CPM_PIP_ACK         0x00020000 /* printer acknowledge status */
  868. #define CPM_PIP_BSY         0x00000001 /* printer busy status */
  869. #define CPM_PIP_SEL         0x00000002 /* printer select status */
  870. #define CPM_PIP_PE          0x00000004 /* printer paper error status */
  871. #define CPM_PIP_F           0x00000008 /* printer error/fault status */
  872. #define CPM_PIP_DATA        0x0000ff00 /* data mask */
  873. /* I2C related definitions */
  874. /* I2C receive buffer descriptor control/status */
  875. #define CPM_I2C_R_CS_E     0x8000   /* empty */
  876. #define CPM_I2C_R_CS_W     0x2000   /* wrap, final BD in table */
  877. #define CPM_I2C_R_CS_I     0x1000   /* interrupt */
  878. #define CPM_I2C_R_CS_L     0x0800   /* buffer closed on start/stop/error */
  879. #define CPM_I2C_R_CS_OV    0x0002   /* overrun */
  880. /* I2C mode register bit definitions */
  881. #define CPM_I2C_MODE_REVD            0x0020  /* reverse data */
  882. #define CPM_I2C_MODE_GCD             0x0010  /* general call disable */
  883. #define CPM_I2C_MODE_FLT             0x0008  /* clock filter */
  884. #define CPM_I2C_MODE_PDIV_MASK       0x0006  /* predivider mask */
  885. #define CPM_I2C_MODE_PDIV_BRGCLK32   0x0000  /* predivider - BRGCLK/32 */
  886. #define CPM_I2C_MODE_PDIV_BRGCLK16   0x0002  /* predivider - BRGCLK/16 */
  887. #define CPM_I2C_MODE_PDIV_BRGCLK8    0x0004  /* predivider - BRGCLK/8 */
  888. #define CPM_I2C_MODE_PDIV_BRGCLK4    0x0006  /* predivider - BRGCLK/4 */
  889. #define CPM_I2C_MODE_EN              0x0001  /* enable i2c */
  890. /* I2C event/mask register bit definitions */
  891. #define CPM_I2C_ER_TXE        0x0010  /* transmit error */
  892. #define CPM_I2C_ER_BSY        0x0004  /* busy condition */
  893. #define CPM_I2C_ER_TXB        0x0002  /* transmit buffer */
  894. #define CPM_I2C_ER_RXB        0x0001  /* receive buffer */
  895. /* I2C command register bit definitions */
  896. #define CPM_I2C_COMMAND_STR  0x0080  /* start transmit */
  897. #define CPM_I2C_COMMAND_MS   0x0001  /* master/slave mode */
  898. /* I2C transmit buffer descriptor control/status */
  899. #define CPM_I2C_T_CS_R       0x8000  /* ready */
  900. #define CPM_I2C_T_CS_W       0x2000  /* wrap, final BD in table */
  901. #define CPM_I2C_T_CS_I       0x1000  /* interrupt */
  902. #define CPM_I2C_T_CS_L       0x0800  /* last buffer of message */
  903. #define CPM_I2C_T_CS_S       0x0400  /* transmit start condition */
  904. #define CPM_I2C_T_CS_NAK     0x0004  /* no acknowledge */
  905. #define CPM_I2C_T_CS_UN      0x0002  /* underrun */
  906. #define CPM_I2C_T_CS_CL      0x0001  /* collision */
  907. #ifdef __cplusplus
  908. }
  909. #endif
  910. #endif /* __INCppc860Cpmh */