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

VxWorks

开发平台:

C/C++

  1. /* m8260Cp.h - Motorola MPC8260 Communications Processor header file */
  2. /* Copyright 1984-1999 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01a,12sep99,ms_  created from m8260Cpm.h, 01d.
  7. */
  8. /*
  9.  * This file contains constants for the Communication Processor in
  10.  * the Motorola MPC8260 PowerQUICC II integrated Communications Processor
  11.  */
  12. #ifndef __INCm8260Cph
  13. #define __INCm8260Cph
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #ifndef M8260ABBREVIATIONS
  18. #define M8260ABBREVIATIONS
  19.     
  20. #ifdef  _ASMLANGUAGE
  21. #define CAST(x)
  22. #else /* _ASMLANGUAGE */
  23. typedef volatile UCHAR VCHAR;   /* shorthand for volatile UCHAR */
  24. typedef volatile INT32 VINT32; /* volatile unsigned word */
  25. typedef volatile INT16 VINT16; /* volatile unsigned halfword */
  26. typedef volatile INT8 VINT8;   /* volatile unsigned byte */
  27. typedef volatile UINT32 VUINT32; /* volatile unsigned word */
  28. typedef volatile UINT16 VUINT16; /* volatile unsigned halfword */
  29. typedef volatile UINT8 VUINT8;   /* volatile unsigned byte */
  30. #define CAST(x) (x)
  31. #endif  /* _ASMLANGUAGE */
  32. #endif /* M8260ABBREVIATIONS */
  33. /*
  34.  * MPC8260 internal register/memory map (section 17 of prelim. spec)
  35.  * note that these are offsets from the value stored in the IMMR
  36.  * register. Also note that in the MPC8260, the IMMR is not a special
  37.  * purpose register, but it is memory mapped.
  38.  */
  39.  
  40. /* Command Register definitions (CPCR - 0x119C0) */    
  41.  
  42. #define M8260_CPCR(base)   (CAST(VUINT32 *)((base) + 0x119C0)) /* CPCR */
  43. #define M8260_CPCR_LATENCY (65536 * 400) /* worst case exec latency */
  44. #define M8260_CPCR_RESET 0x80000000 /* software reset command */
  45. #define M8260_CPCR_PAGE_MSK 0x7c000000 /* RAM page number */
  46. #define M8260_CPCR_SBC_MSK      0x03e00000 /* sub-block code */
  47. #define M8260_CPCR_RES1      0x001e0000 /* reserved */
  48. #define M8260_CPCR_FLG 0x00010000 /* flag - command executing */ 
  49. #define M8260_CPCR_RES2      0x0000c000 /* reserved */
  50. #define M8260_CPCR_MCN_MSK      0x00003fc0 /* MCC channel number */
  51. #define M8260_CPCR_RES3      0x00000030 /* reserved */
  52. #define M8260_CPCR_OP_MSK      0x0000000f /* command opcode */
  53. #define M8260_CPCR_PAGE_SHIFT   0x1a /* get to the page field */
  54. #define M8260_CPCR_SBC_SHIFT    0x15 /* get to the SBC field */
  55. #define M8260_CPCR_MCN_SHIFT    0x6 /* get to the MCC field */
  56. #define M8260_CPCR_OP_SHIFT  0x0 /* get to the opcode field */
  57. #define M8260_CPCR_MCN_HDLC    0x0 /* protocol code: HDLC */
  58. #define M8260_CPCR_MCN_ATM    0xa /* protocol code: ATM */
  59. #define M8260_CPCR_MCN_ETH    0xc /* protocol code: ETH */
  60. #define M8260_CPCR_MCN_TRANS    0xf /* protocol code: TRANS */
  61. #define M8260_CPCR_OP(x)
  62.     (((x) << M8260_CPCR_OP_SHIFT) & M8260_CPCR_OP_MSK)
  63.     
  64. #define M8260_CPCR_SBC(x)
  65.     (((x) << M8260_CPCR_SBC_SHIFT) & M8260_CPCR_SBC_MSK)
  66. #define M8260_CPCR_PAGE(x)
  67.     (((x) << M8260_CPCR_PAGE_SHIFT) & M8260_CPCR_PAGE_MSK)
  68. #define M8260_CPCR_MCN(x)
  69.     (((x) << M8260_CPCR_MCN_SHIFT) & M8260_CPCR_MCN_MSK)
  70. /* CPCR - Sub-block code */
  71. #define M8260_CPCR_SBC_FCC1     0x10 /* FCC1 channel */ 
  72. #define M8260_CPCR_SBC_ATM_FCC1 0x0e /* ATM on FCC1 */ 
  73. #define M8260_CPCR_SBC_FCC2     0x11 /* FCC2 channel */ 
  74. #define M8260_CPCR_SBC_ATM_FCC2 0x0e /* ATM on FCC2 */ 
  75. #define M8260_CPCR_SBC_FCC3     0x12 /* FCC3 channel */ 
  76. #define M8260_CPCR_SBC_SCC1     0x04 /* SCC1 channel */ 
  77. #define M8260_CPCR_SBC_SCC2     0x05 /* SCC2 channel */ 
  78. #define M8260_CPCR_SBC_SCC3     0x06 /* SCC3 channel */ 
  79. #define M8260_CPCR_SBC_SCC4     0x07 /* SCC4 channel */ 
  80. #define M8260_CPCR_SBC_SMC1     0x08 /* SMC1 channel */ 
  81. #define M8260_CPCR_SBC_SMC2     0x09 /* SMC2 channel */ 
  82. #define M8260_CPCR_SBC_RAND     0x0e /* RAND channel */ 
  83. #define M8260_CPCR_SBC_SPI      0x0a /* SPI */ 
  84. #define M8260_CPCR_SBC_I2C      0x0b /* I2C */ 
  85. #define M8260_CPCR_SBC_TIMER    0x0f /* TIMER */ 
  86. #define M8260_CPCR_SBC_MCC1     0x1c /* MCC1 channel */ 
  87. #define M8260_CPCR_SBC_MCC2     0x1d /* MCC2 channel */ 
  88. #define M8260_CPCR_SBC_IDMA1    0x14 /* IDMA1 channel */ 
  89. #define M8260_CPCR_SBC_IDMA2    0x15 /* IDMA2 channel */ 
  90. #define M8260_CPCR_SBC_IDMA3    0x16 /* IDMA3 channel */ 
  91. #define M8260_CPCR_SBC_IDMA4    0x17 /* IDMA4 channel */ 
  92. /* CPCR - Page code */
  93. #define M8260_CPCR_PAGE_FCC1    0x04 /* FCC1 channel */ 
  94. #define M8260_CPCR_PAGE_FCC2    0x05 /* FCC2 channel */ 
  95. #define M8260_CPCR_PAGE_FCC3    0x06 /* FCC3 channel */ 
  96. #define M8260_CPCR_PAGE_SCC1    0x00 /* SCC1 channel */ 
  97. #define M8260_CPCR_PAGE_SCC2    0x01 /* SCC2 channel */ 
  98. #define M8260_CPCR_PAGE_SCC3    0x02 /* SCC3 channel */ 
  99. #define M8260_CPCR_PAGE_SCC4    0x03 /* SCC4 channel */ 
  100. #define M8260_CPCR_PAGE_SMC1    0x07 /* SMC1 channel */ 
  101. #define M8260_CPCR_PAGE_SMC2    0x08 /* SMC2 channel */ 
  102. #define M8260_CPCR_PAGE_RAND    0x0a /* RAND channel */ 
  103. #define M8260_CPCR_PAGE_SPI     0x09 /* SPI */ 
  104. #define M8260_CPCR_PAGE_I2C     0x0a /* I2C */ 
  105. #define M8260_CPCR_PAGE_TIMER   0x0a /* TIMER */ 
  106. #define M8260_CPCR_PAGE_MCC1    0x07 /* MCC1 channel */ 
  107. #define M8260_CPCR_PAGE_MCC2    0x08 /* MCC2 channel */ 
  108. #define M8260_CPCR_PAGE_IDMA1   0x07 /* IDMA1 channel */ 
  109. #define M8260_CPCR_PAGE_IDMA2   0x08 /* IDMA2 channel */ 
  110. #define M8260_CPCR_PAGE_IDMA3   0x09 /* IDMA3 channel */ 
  111. #define M8260_CPCR_PAGE_IDMA4   0x0a /* IDMA4 channel */ 
  112. /* CPCR - opcodes */
  113.  
  114. #define M8260_CPCR_RT_INIT 0x0 /* Init rx and tx */
  115. #define M8260_CPCR_RX_INIT    0x1 /* init rx only */
  116. #define M8260_CPCR_TX_INIT    0x2 /* init tx only */
  117. #define M8260_CPCR_HUNT       0x3 /* rx frame hunt mode */
  118. #define M8260_CPCR_TX_STOP      0x4 /* stop tx */
  119. #define M8260_CPCR_TX_GRSTOP    0x5 /* gracefully stop tx */
  120. #define M8260_CPCR_TX_RESTART   0x6 /* restart tx */
  121. #define M8260_CPCR_RX_CLOSE     0x7 /* close rx buffer */
  122. #define M8260_CPCR_SET_GROUP  0x8 /* set group address */
  123. #define M8260_CPCR_SET_TMR 0x8 /* set timer */
  124. #define M8260_CPCR_GCI_TMO 0x9 /* gci timeout */
  125. #define M8260_CPCR_IDMA_START 0x9 /* start idma */
  126. #define M8260_CPCR_MCC_RX_STOP 0x9 /* stop rx on MCC */
  127. #define M8260_CPCR_ATM_TX 0xa /* ATM transmit */
  128. #define M8260_CPCR_BCS_RESET  0xa /* blk chk seq reset */
  129. #define M8260_CPCR_GCI_ABRT 0xa /* gci abort request */
  130. #define M8260_CPCR_IDMA_STOP 0xb /* stop idma */
  131. #define M8260_CPCR_RANDOM 0xc /* random number */
  132. #ifdef __cplusplus
  133. }
  134. #endif
  135. #endif /* __INCm8260Cph */