ibm405.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. /*
  2. * Author: Armin Kuster <akuster@mvista.com>
  3. *
  4. * 2002 (c) MontaVista, Software, Inc. This file is licensed under
  5. * the terms of the GNU General Public License version 2. This program
  6. * is licensed "as is" without any warranty of any kind, whether express
  7. * or implied.
  8. */
  9. #ifdef __KERNEL__
  10. #ifndef __ASM_IBM405_H__
  11. #define __ASM_IBM405_H__
  12. #ifdef DCRN_BE_BASE
  13. #define DCRN_BEAR (DCRN_BE_BASE + 0x0) /* Bus Error Address Register */
  14. #define DCRN_BESR (DCRN_BE_BASE + 0x1) /* Bus Error Syndrome Register */
  15. #endif
  16. /* DCRN_BESR */
  17. #define BESR_DSES 0x80000000 /* Data-Side Error Status */
  18. #define BESR_DMES 0x40000000 /* DMA Error Status */
  19. #define BESR_RWS 0x20000000 /* Read/Write Status */
  20. #define BESR_ETMASK 0x1C000000 /* Error Type */
  21. #define ET_PROT 0
  22. #define ET_PARITY 1
  23. #define ET_NCFG 2
  24. #define ET_BUSERR 4
  25. #define ET_BUSTO 6
  26. /* Clock and power management shifts for emacs */
  27. #define IBM_CPM_EMMII 0 /* Shift value for MII */
  28. #define IBM_CPM_EMRX 1 /* Shift value for recv */
  29. #define IBM_CPM_EMTX 2 /* Shift value for MAC */
  30. #ifdef DCRN_CHCR_BASE
  31. #define DCRN_CHCR0 (DCRN_CHCR_BASE + 0x0) /* Chip Control Register 1 */
  32. #define DCRN_CHCR1 (DCRN_CHCR_BASE + 0x1) /* Chip Control Register 2 */
  33. #endif
  34. #define CHR1_PCIPW 0x00008000 /* PCI Int enable/Peripheral Write enable */
  35. #ifdef DCRN_CHPSR_BASE
  36. #define DCRN_CHPSR (DCRN_CHPSR_BASE + 0x0) /* Chip Pin Strapping */
  37. #endif
  38. #ifdef DCRN_CPMFR_BASE
  39. #define DCRN_CPMFR (DCRN_CPMFR_BASE + 0x0) /* CPM Force */
  40. #endif
  41. #ifdef DCRN_CPMSR_BASE
  42. #define DCRN_CPMSR (DCRN_CPMSR_BASE + 0x0) /* CPM Status */
  43. #define DCRN_CPMER (DCRN_CPMSR_BASE + 0x1) /* CPM Enable */
  44. #endif
  45. #ifdef DCRN_DCP0_BASE
  46. /* Decompression Controller Address */
  47. #define DCRN_DCP0_CFGADDR (DCRN_DCP0_BASE + 0x0)
  48. /* Decompression Controller Data */
  49. #define DCRN_DCP0_CFGDATA (DCRN_DCP0_BASE + 0x1)
  50. #else
  51. #define DCRN_DCP0_CFGADDR 0x0
  52. #define DCRN_DCP0_CFGDATA 0x0
  53. #endif
  54. #ifdef DCRN_DMA0_BASE
  55. /* DMA Channel Control Register 0 */
  56. #define DCRN_DMACR0 (DCRN_DMA0_BASE + 0x0)
  57. #define DCRN_DMACT0 (DCRN_DMA0_BASE + 0x1) /* DMA Count Register 0 */
  58. /* DMA Destination Address Register 0 */
  59. #define DCRN_DMADA0 (DCRN_DMA0_BASE + 0x2)
  60. /* DMA Source Address Register 0 */
  61. #define DCRN_DMASA0 (DCRN_DMA0_BASE + 0x3)
  62. #ifdef DCRNCAP_DMA_CC
  63. /* DMA Chained Count Register 0 */
  64. #define DCRN_DMACC0 (DCRN_DMA0_BASE + 0x4)
  65. #endif
  66. #ifdef DCRNCAP_DMA_SG
  67. /* DMA Scatter/Gather Descriptor Addr 0 */
  68. #define DCRN_ASG0 (DCRN_DMA0_BASE + 0x4)
  69. #endif
  70. #endif
  71. #ifdef DCRN_DMA1_BASE
  72. /* DMA Channel Control Register 1 */
  73. #define DCRN_DMACR1 (DCRN_DMA1_BASE + 0x0)
  74. #define DCRN_DMACT1 (DCRN_DMA1_BASE + 0x1) /* DMA Count Register 1 */
  75. /* DMA Destination Address Register 1 */
  76. #define DCRN_DMADA1 (DCRN_DMA1_BASE + 0x2)
  77. /* DMA Source Address Register 1 */
  78. #define DCRN_DMASA1 (DCRN_DMA1_BASE + 0x3) /* DMA Source Address Register 1 */
  79. #ifdef DCRNCAP_DMA_CC
  80. /* DMA Chained Count Register 1 */
  81. #define DCRN_DMACC1 (DCRN_DMA1_BASE + 0x4)
  82. #endif
  83. #ifdef DCRNCAP_DMA_SG
  84. /* DMA Scatter/Gather Descriptor Addr 1 */
  85. #define DCRN_ASG1 (DCRN_DMA1_BASE + 0x4)
  86. #endif
  87. #endif
  88. #ifdef DCRN_DMA2_BASE
  89. #define DCRN_DMACR2 (DCRN_DMA2_BASE + 0x0) /* DMA Channel Control Register 2 */
  90. #define DCRN_DMACT2 (DCRN_DMA2_BASE + 0x1) /* DMA Count Register 2 */
  91. #define DCRN_DMADA2 (DCRN_DMA2_BASE + 0x2) /* DMA Destination Address Register 2 */
  92. #define DCRN_DMASA2 (DCRN_DMA2_BASE + 0x3) /* DMA Source Address Register 2 */
  93. #ifdef DCRNCAP_DMA_CC
  94. #define DCRN_DMACC2 (DCRN_DMA2_BASE + 0x4) /* DMA Chained Count Register 2 */
  95. #endif
  96. #ifdef DCRNCAP_DMA_SG
  97. #define DCRN_ASG2 (DCRN_DMA2_BASE + 0x4) /* DMA Scatter/Gather Descriptor Addr 2 */
  98. #endif
  99. #endif
  100. #ifdef DCRN_DMA3_BASE
  101. #define DCRN_DMACR3 (DCRN_DMA3_BASE + 0x0) /* DMA Channel Control Register 3 */
  102. #define DCRN_DMACT3 (DCRN_DMA3_BASE + 0x1) /* DMA Count Register 3 */
  103. #define DCRN_DMADA3 (DCRN_DMA3_BASE + 0x2) /* DMA Destination Address Register 3 */
  104. #define DCRN_DMASA3 (DCRN_DMA3_BASE + 0x3) /* DMA Source Address Register 3 */
  105. #ifdef DCRNCAP_DMA_CC
  106. #define DCRN_DMACC3 (DCRN_DMA3_BASE + 0x4) /* DMA Chained Count Register 3 */
  107. #endif
  108. #ifdef DCRNCAP_DMA_SG
  109. #define DCRN_ASG3 (DCRN_DMA3_BASE + 0x4) /* DMA Scatter/Gather Descriptor Addr 3 */
  110. #endif
  111. #endif
  112. #ifdef DCRN_DMASR_BASE
  113. #define DCRN_DMASR (DCRN_DMASR_BASE + 0x0) /* DMA Status Register */
  114. #ifdef DCRNCAP_DMA_SG
  115. #define DCRN_ASGC (DCRN_DMASR_BASE + 0x3) /* DMA Scatter/Gather Command */
  116. /* don't know if these two registers always exist if scatter/gather exists */
  117. #define DCRN_POL (DCRN_DMASR_BASE + 0x6) /* DMA Polarity Register */
  118. #define DCRN_SLP (DCRN_DMASR_BASE + 0x5) /* DMA Sleep Register */
  119. #endif
  120. #endif
  121. #ifdef DCRN_EBC_BASE
  122. #define DCRN_EBCCFGADR (DCRN_EBC_BASE + 0x0) /* Peripheral Controller Address */
  123. #define DCRN_EBCCFGDATA (DCRN_EBC_BASE + 0x1) /* Peripheral Controller Data */
  124. #endif
  125. #ifdef DCRN_EXIER_BASE
  126. #define DCRN_EXIER (DCRN_EXIER_BASE + 0x0) /* External Interrupt Enable Register */
  127. #endif
  128. #ifdef DCRN_EXISR_BASE
  129. #define DCRN_EXISR (DCRN_EXISR_BASE + 0x0) /* External Interrupt Status Register */
  130. #endif
  131. #define EXIER_CIE 0x80000000 /* Critical Interrupt Enable */
  132. #define EXIER_SRIE 0x08000000 /* Serial Port Rx Int. Enable */
  133. #define EXIER_STIE 0x04000000 /* Serial Port Tx Int. Enable */
  134. #define EXIER_JRIE 0x02000000 /* JTAG Serial Port Rx Int. Enable */
  135. #define EXIER_JTIE 0x01000000 /* JTAG Serial Port Tx Int. Enable */
  136. #define EXIER_D0IE 0x00800000 /* DMA Channel 0 Interrupt Enable */
  137. #define EXIER_D1IE 0x00400000 /* DMA Channel 1 Interrupt Enable */
  138. #define EXIER_D2IE 0x00200000 /* DMA Channel 2 Interrupt Enable */
  139. #define EXIER_D3IE 0x00100000 /* DMA Channel 3 Interrupt Enable */
  140. #define EXIER_E0IE 0x00000010 /* External Interrupt 0 Enable */
  141. #define EXIER_E1IE 0x00000008 /* External Interrupt 1 Enable */
  142. #define EXIER_E2IE 0x00000004 /* External Interrupt 2 Enable */
  143. #define EXIER_E3IE 0x00000002 /* External Interrupt 3 Enable */
  144. #define EXIER_E4IE 0x00000001 /* External Interrupt 4 Enable */
  145. #ifdef DCRN_IOCR_BASE
  146. #define DCRN_IOCR (DCRN_IOCR_BASE + 0x0) /* Input/Output Configuration Register */
  147. #endif
  148. #define IOCR_E0TE 0x80000000
  149. #define IOCR_E0LP 0x40000000
  150. #define IOCR_E1TE 0x20000000
  151. #define IOCR_E1LP 0x10000000
  152. #define IOCR_E2TE 0x08000000
  153. #define IOCR_E2LP 0x04000000
  154. #define IOCR_E3TE 0x02000000
  155. #define IOCR_E3LP 0x01000000
  156. #define IOCR_E4TE 0x00800000
  157. #define IOCR_E4LP 0x00400000
  158. #define IOCR_EDT 0x00080000
  159. #define IOCR_SOR 0x00040000
  160. #define IOCR_EDO 0x00008000
  161. #define IOCR_2XC 0x00004000
  162. #define IOCR_ATC 0x00002000
  163. #define IOCR_SPD 0x00001000
  164. #define IOCR_BEM 0x00000800
  165. #define IOCR_PTD 0x00000400
  166. #define IOCR_ARE 0x00000080
  167. #define IOCR_DRC 0x00000020
  168. #define IOCR_RDM(x) (((x) & 0x3) << 3)
  169. #define IOCR_TCS 0x00000004
  170. #define IOCR_SCS 0x00000002
  171. #define IOCR_SPC 0x00000001
  172. #define DCRN_MALCR(base) (base + 0x0) /* MAL Configuration */
  173. #define DCRN_MALDBR(base) ((base) + 0x3) /* Debug Register */
  174. #define DCRN_MALESR(base) ((base) + 0x1) /* Error Status */
  175. #define DCRN_MALIER(base) ((base) + 0x2) /* Interrupt Enable */
  176. #define DCRN_MALTXCARR(base) ((base) + 0x5) /* TX Channed Active Reset Register */
  177. #define DCRN_MALTXCASR(base) ((base) + 0x4) /* TX Channel Active Set Register */
  178. #define DCRN_MALTXDEIR(base) ((base) + 0x7) /* Tx Descriptor Error Interrupt */
  179. #define DCRN_MALTXEOBISR(base) ((base) + 0x6) /* Tx End of Buffer Interrupt Status */
  180. #define DCRN_MALRXCARR(base) ((base) + 0x11) /* RX Channed Active Reset Register */
  181. #define DCRN_MALRXCASR(base) ((base) + 0x10) /* RX Channel Active Set Register */
  182. #define DCRN_MALRXDEIR(base) ((base) + 0x13) /* Rx Descriptor Error Interrupt */
  183. #define DCRN_MALRXEOBISR(base) ((base) + 0x12) /* Rx End of Buffer Interrupt Status */
  184. #define DCRN_MALRXCTP0R(base) ((base) + 0x40) /* Channel Rx 0 Channel Table Pointer */
  185. #define DCRN_MALRXCTP1R(base) ((base) + 0x41) /* Channel Rx 1 Channel Table Pointer */
  186. #define DCRN_MALTXCTP0R(base) ((base) + 0x20) /* Channel Tx 0 Channel Table Pointer */
  187. #define DCRN_MALTXCTP1R(base) ((base) + 0x21) /* Channel Tx 1 Channel Table Pointer */
  188. #define DCRN_MALTXCTP2R(base) ((base) + 0x22) /* Channel Tx 2 Channel Table Pointer */
  189. #define DCRN_MALTXCTP3R(base) ((base) + 0x23) /* Channel Tx 3 Channel Table Pointer */
  190. #define DCRN_MALRCBS0(base) ((base) + 0x60) /* Channel Rx 0 Channel Buffer Size */
  191. #define DCRN_MALRCBS1(base) ((base) + 0x61) /* Channel Rx 1 Channel Buffer Size */
  192. /* DCRN_MALCR */
  193. #define MALCR_MMSR 0x80000000 /* MAL Software reset */
  194. #define MALCR_PLBP_1 0x00400000 /* MAL reqest priority: */
  195. #define MALCR_PLBP_2 0x00800000 /* lowsest is 00 */
  196. #define MALCR_PLBP_3 0x00C00000 /* highest */
  197. #define MALCR_GA 0x00200000 /* Guarded Active Bit */
  198. #define MALCR_OA 0x00100000 /* Ordered Active Bit */
  199. #define MALCR_PLBLE 0x00080000 /* PLB Lock Error Bit */
  200. #define MALCR_PLBLT_1 0x00040000 /* PLB Latency Timer */
  201. #define MALCR_PLBLT_2 0x00020000
  202. #define MALCR_PLBLT_3 0x00010000
  203. #define MALCR_PLBLT_4 0x00008000
  204. #define MALCR_PLBLT_DEFAULT 0x00078000 /* JSP: Is this a valid default?? */
  205. #define MALCR_PLBB 0x00004000 /* PLB Burst Deactivation Bit */
  206. #define MALCR_OPBBL 0x00000080 /* OPB Lock Bit */
  207. #define MALCR_EOPIE 0x00000004 /* End Of Packet Interrupt Enable */
  208. #define MALCR_LEA 0x00000002 /* Locked Error Active */
  209. #define MALCR_MSD 0x00000001 /* MAL Scroll Descriptor Bit */
  210. /* DCRN_MALESR */
  211. #define MALESR_EVB 0x80000000 /* Error Valid Bit */
  212. #define MALESR_CIDRX 0x40000000 /* Channel ID Receive */
  213. #define MALESR_DE 0x00100000 /* Descriptor Error */
  214. #define MALESR_OEN 0x00080000 /* OPB Non-Fullword Error */
  215. #define MALESR_OTE 0x00040000 /* OPB Timeout Error */
  216. #define MALESR_OSE 0x00020000 /* OPB Slave Error */
  217. #define MALESR_PEIN 0x00010000 /* PLB Bus Error Indication */
  218. #define MALESR_DEI 0x00000010 /* Descriptor Error Interrupt */
  219. #define MALESR_ONEI 0x00000008 /* OPB Non-Fullword Error Interrupt */
  220. #define MALESR_OTEI 0x00000004 /* OPB Timeout Error Interrupt */
  221. #define MALESR_OSEI 0x00000002 /* OPB Slace Error Interrupt */
  222. #define MALESR_PBEI 0x00000001 /* PLB Bus Error Interrupt */
  223. /* DCRN_MALIER */
  224. #define MALIER_DE 0x00000010 /* Descriptor Error Interrupt Enable */
  225. #define MALIER_NE 0x00000008 /* OPB Non-word Transfer Int Enable */
  226. #define MALIER_TE 0x00000004 /* OPB Time Out Error Interrupt Enable */
  227. #define MALIER_OPBE 0x00000002 /* OPB Slave Error Interrupt Enable */
  228. #define MALIER_PLBE 0x00000001 /* PLB Error Interrupt Enable */
  229. /* DCRN_MALTXEOBISR */
  230. #define MALOBISR_CH0 0x80000000 /* EOB channel 1 bit */
  231. #define MALOBISR_CH2 0x40000000 /* EOB channel 2 bit */
  232. #ifdef DCRN_PLB0_BASE
  233. #define DCRN_PLB0_BESR (DCRN_PLB0_BASE + 0x0)
  234. #define DCRN_PLB0_BEAR (DCRN_PLB0_BASE + 0x2)
  235. /* doesn't exist on stb03xxx? */
  236. #define DCRN_PLB0_ACR (DCRN_PLB0_BASE + 0x3)
  237. #endif
  238. #ifdef DCRN_PLB1_BASE
  239. #define DCRN_PLB1_BESR (DCRN_PLB1_BASE + 0x0)
  240. #define DCRN_PLB1_BEAR (DCRN_PLB1_BASE + 0x1)
  241. /* doesn't exist on stb03xxx? */
  242. #define DCRN_PLB1_ACR (DCRN_PLB1_BASE + 0x2)
  243. #endif
  244. #ifdef DCRN_PLLMR_BASE
  245. #define DCRN_PLLMR (DCRN_PLLMR_BASE + 0x0) /* PL1 Mode */
  246. #endif
  247. #ifdef DCRN_POB0_BASE
  248. #define DCRN_POB0_BESR0 (DCRN_POB0_BASE + 0x0)
  249. #define DCRN_POB0_BEAR (DCRN_POB0_BASE + 0x2)
  250. #define DCRN_POB0_BESR1 (DCRN_POB0_BASE + 0x4)
  251. #endif
  252. #define DCRN_UIC_SR(base) (base + 0x0)
  253. #define DCRN_UIC_ER(base) (base + 0x2)
  254. #define DCRN_UIC_CR(base) (base + 0x3)
  255. #define DCRN_UIC_PR(base) (base + 0x4)
  256. #define DCRN_UIC_TR(base) (base + 0x5)
  257. #define DCRN_UIC_MSR(base) (base + 0x6)
  258. #define DCRN_UIC_VR(base) (base + 0x7)
  259. #define DCRN_UIC_VCR(base) (base + 0x8)
  260. #ifdef DCRN_SDRAM0_BASE
  261. #define DCRN_SDRAM0_CFGADDR (DCRN_SDRAM0_BASE + 0x0) /* Memory Controller Address */
  262. #define DCRN_SDRAM0_CFGDATA (DCRN_SDRAM0_BASE + 0x1) /* Memory Controller Data */
  263. #endif
  264. #ifdef DCRN_OCM0_BASE
  265. #define DCRN_OCMISARC (DCRN_OCM0_BASE + 0x0) /* OCM Instr Side Addr Range Compare */
  266. #define DCRN_OCMISCR (DCRN_OCM0_BASE + 0x1) /* OCM Instr Side Control */
  267. #define DCRN_OCMDSARC (DCRN_OCM0_BASE + 0x2) /* OCM Data Side Addr Range Compare */
  268. #define DCRN_OCMDSCR (DCRN_OCM0_BASE + 0x3) /* OCM Data Side Control */
  269. #endif
  270. #endif /* __ASM_IBM405_H__ */
  271. #endif /* __KERNEL__ */