cpm2.h 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097
  1. /*
  2. * Communication Processor Module v2.
  3. *
  4. * This file contains structures and information for the communication
  5. * processor channels found in the dual port RAM or parameter RAM.
  6. * All CPM control and status is available through the CPM2 internal
  7. * memory map. See immap_cpm2.h for details.
  8. */
  9. #ifdef __KERNEL__
  10. #ifndef __CPM2__
  11. #define __CPM2__
  12. #include <asm/immap_cpm2.h>
  13. /* CPM Command register.
  14. */
  15. #define CPM_CR_RST ((uint)0x80000000)
  16. #define CPM_CR_PAGE ((uint)0x7c000000)
  17. #define CPM_CR_SBLOCK ((uint)0x03e00000)
  18. #define CPM_CR_FLG ((uint)0x00010000)
  19. #define CPM_CR_MCN ((uint)0x00003fc0)
  20. #define CPM_CR_OPCODE ((uint)0x0000000f)
  21. /* Device sub-block and page codes.
  22. */
  23. #define CPM_CR_SCC1_SBLOCK (0x04)
  24. #define CPM_CR_SCC2_SBLOCK (0x05)
  25. #define CPM_CR_SCC3_SBLOCK (0x06)
  26. #define CPM_CR_SCC4_SBLOCK (0x07)
  27. #define CPM_CR_SMC1_SBLOCK (0x08)
  28. #define CPM_CR_SMC2_SBLOCK (0x09)
  29. #define CPM_CR_SPI_SBLOCK (0x0a)
  30. #define CPM_CR_I2C_SBLOCK (0x0b)
  31. #define CPM_CR_TIMER_SBLOCK (0x0f)
  32. #define CPM_CR_RAND_SBLOCK (0x0e)
  33. #define CPM_CR_FCC1_SBLOCK (0x10)
  34. #define CPM_CR_FCC2_SBLOCK (0x11)
  35. #define CPM_CR_FCC3_SBLOCK (0x12)
  36. #define CPM_CR_IDMA1_SBLOCK (0x14)
  37. #define CPM_CR_IDMA2_SBLOCK (0x15)
  38. #define CPM_CR_IDMA3_SBLOCK (0x16)
  39. #define CPM_CR_IDMA4_SBLOCK (0x17)
  40. #define CPM_CR_MCC1_SBLOCK (0x1c)
  41. #define CPM_CR_SCC1_PAGE (0x00)
  42. #define CPM_CR_SCC2_PAGE (0x01)
  43. #define CPM_CR_SCC3_PAGE (0x02)
  44. #define CPM_CR_SCC4_PAGE (0x03)
  45. #define CPM_CR_SMC1_PAGE (0x07)
  46. #define CPM_CR_SMC2_PAGE (0x08)
  47. #define CPM_CR_SPI_PAGE (0x09)
  48. #define CPM_CR_I2C_PAGE (0x0a)
  49. #define CPM_CR_TIMER_PAGE (0x0a)
  50. #define CPM_CR_RAND_PAGE (0x0a)
  51. #define CPM_CR_FCC1_PAGE (0x04)
  52. #define CPM_CR_FCC2_PAGE (0x05)
  53. #define CPM_CR_FCC3_PAGE (0x06)
  54. #define CPM_CR_IDMA1_PAGE (0x07)
  55. #define CPM_CR_IDMA2_PAGE (0x08)
  56. #define CPM_CR_IDMA3_PAGE (0x09)
  57. #define CPM_CR_IDMA4_PAGE (0x0a)
  58. #define CPM_CR_MCC1_PAGE (0x07)
  59. #define CPM_CR_MCC2_PAGE (0x08)
  60. /* Some opcodes (there are more...later)
  61. */
  62. #define CPM_CR_INIT_TRX ((ushort)0x0000)
  63. #define CPM_CR_INIT_RX ((ushort)0x0001)
  64. #define CPM_CR_INIT_TX ((ushort)0x0002)
  65. #define CPM_CR_HUNT_MODE ((ushort)0x0003)
  66. #define CPM_CR_STOP_TX ((ushort)0x0004)
  67. #define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
  68. #define CPM_CR_RESTART_TX ((ushort)0x0006)
  69. #define CPM_CR_SET_GADDR ((ushort)0x0008)
  70. #define CPM_CR_START_IDMA ((ushort)0x0009)
  71. #define CPM_CR_STOP_IDMA ((ushort)0x000b)
  72. #define mk_cr_cmd(PG, SBC, MCN, OP) \
  73. ((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
  74. /* Dual Port RAM addresses. The first 16K is available for almost
  75. * any CPM use, so we put the BDs there. The first 128 bytes are
  76. * used for SMC1 and SMC2 parameter RAM, so we start allocating
  77. * BDs above that. All of this must change when we start
  78. * downloading RAM microcode.
  79. */
  80. #define CPM_DATAONLY_BASE ((uint)128)
  81. #define CPM_DP_NOSPACE ((uint)0x7fffffff)
  82. #if defined(CONFIG_8272) || defined(CONFIG_MPC8555)
  83. #define CPM_DATAONLY_SIZE ((uint)(8 * 1024) - CPM_DATAONLY_BASE)
  84. #define CPM_FCC_SPECIAL_BASE ((uint)0x00009000)
  85. #else
  86. #define CPM_DATAONLY_SIZE ((uint)(16 * 1024) - CPM_DATAONLY_BASE)
  87. #define CPM_FCC_SPECIAL_BASE ((uint)0x0000b000)
  88. #endif
  89. /* The number of pages of host memory we allocate for CPM. This is
  90. * done early in kernel initialization to get physically contiguous
  91. * pages.
  92. */
  93. #define NUM_CPM_HOST_PAGES 2
  94. static inline long IS_DPERR(const uint offset)
  95. {
  96. return (uint)offset > (uint)-1000L;
  97. }
  98. /* Export the base address of the communication processor registers
  99. * and dual port ram.
  100. */
  101. extern cpm_cpm2_t *cpmp; /* Pointer to comm processor */
  102. extern uint cpm_dpalloc(uint size, uint align);
  103. extern int cpm_dpfree(uint offset);
  104. extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
  105. extern void cpm_dpdump(void);
  106. extern void *cpm_dpram_addr(uint offset);
  107. extern void cpm_setbrg(uint brg, uint rate);
  108. extern void cpm2_fastbrg(uint brg, uint rate, int div16);
  109. extern void cpm2_reset(void);
  110. /* Buffer descriptors used by many of the CPM protocols.
  111. */
  112. typedef struct cpm_buf_desc {
  113. ushort cbd_sc; /* Status and Control */
  114. ushort cbd_datlen; /* Data length in buffer */
  115. uint cbd_bufaddr; /* Buffer address in host memory */
  116. } cbd_t;
  117. #define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */
  118. #define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
  119. #define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */
  120. #define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
  121. #define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame */
  122. #define BD_SC_CM ((ushort)0x0200) /* Continous mode */
  123. #define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */
  124. #define BD_SC_P ((ushort)0x0100) /* xmt preamble */
  125. #define BD_SC_BR ((ushort)0x0020) /* Break received */
  126. #define BD_SC_FR ((ushort)0x0010) /* Framing error */
  127. #define BD_SC_PR ((ushort)0x0008) /* Parity error */
  128. #define BD_SC_OV ((ushort)0x0002) /* Overrun */
  129. #define BD_SC_CD ((ushort)0x0001) /* ?? */
  130. /* Function code bits, usually generic to devices.
  131. */
  132. #define CPMFCR_GBL ((u_char)0x20) /* Set memory snooping */
  133. #define CPMFCR_EB ((u_char)0x10) /* Set big endian byte order */
  134. #define CPMFCR_TC2 ((u_char)0x04) /* Transfer code 2 value */
  135. #define CPMFCR_DTB ((u_char)0x02) /* Use local bus for data when set */
  136. #define CPMFCR_BDB ((u_char)0x01) /* Use local bus for BD when set */
  137. /* Parameter RAM offsets from the base.
  138. */
  139. #define PROFF_SCC1 ((uint)0x8000)
  140. #define PROFF_SCC2 ((uint)0x8100)
  141. #define PROFF_SCC3 ((uint)0x8200)
  142. #define PROFF_SCC4 ((uint)0x8300)
  143. #define PROFF_FCC1 ((uint)0x8400)
  144. #define PROFF_FCC2 ((uint)0x8500)
  145. #define PROFF_FCC3 ((uint)0x8600)
  146. #define PROFF_MCC1 ((uint)0x8700)
  147. #define PROFF_SMC1_BASE ((uint)0x87fc)
  148. #define PROFF_IDMA1_BASE ((uint)0x87fe)
  149. #define PROFF_MCC2 ((uint)0x8800)
  150. #define PROFF_SMC2_BASE ((uint)0x88fc)
  151. #define PROFF_IDMA2_BASE ((uint)0x88fe)
  152. #define PROFF_SPI_BASE ((uint)0x89fc)
  153. #define PROFF_IDMA3_BASE ((uint)0x89fe)
  154. #define PROFF_TIMERS ((uint)0x8ae0)
  155. #define PROFF_REVNUM ((uint)0x8af0)
  156. #define PROFF_RAND ((uint)0x8af8)
  157. #define PROFF_I2C_BASE ((uint)0x8afc)
  158. #define PROFF_IDMA4_BASE ((uint)0x8afe)
  159. /* The SMCs are relocated to any of the first eight DPRAM pages.
  160. * We will fix these at the first locations of DPRAM, until we
  161. * get some microcode patches :-).
  162. * The parameter ram space for the SMCs is fifty-some bytes, and
  163. * they are required to start on a 64 byte boundary.
  164. */
  165. #define PROFF_SMC1 (0)
  166. #define PROFF_SMC2 (64)
  167. /* Define enough so I can at least use the serial port as a UART.
  168. */
  169. typedef struct smc_uart {
  170. ushort smc_rbase; /* Rx Buffer descriptor base address */
  171. ushort smc_tbase; /* Tx Buffer descriptor base address */
  172. u_char smc_rfcr; /* Rx function code */
  173. u_char smc_tfcr; /* Tx function code */
  174. ushort smc_mrblr; /* Max receive buffer length */
  175. uint smc_rstate; /* Internal */
  176. uint smc_idp; /* Internal */
  177. ushort smc_rbptr; /* Internal */
  178. ushort smc_ibc; /* Internal */
  179. uint smc_rxtmp; /* Internal */
  180. uint smc_tstate; /* Internal */
  181. uint smc_tdp; /* Internal */
  182. ushort smc_tbptr; /* Internal */
  183. ushort smc_tbc; /* Internal */
  184. uint smc_txtmp; /* Internal */
  185. ushort smc_maxidl; /* Maximum idle characters */
  186. ushort smc_tmpidl; /* Temporary idle counter */
  187. ushort smc_brklen; /* Last received break length */
  188. ushort smc_brkec; /* rcv'd break condition counter */
  189. ushort smc_brkcr; /* xmt break count register */
  190. ushort smc_rmask; /* Temporary bit mask */
  191. uint smc_stmp; /* SDMA Temp */
  192. } smc_uart_t;
  193. /* SMC uart mode register (Internal memory map).
  194. */
  195. #define SMCMR_REN ((ushort)0x0001)
  196. #define SMCMR_TEN ((ushort)0x0002)
  197. #define SMCMR_DM ((ushort)0x000c)
  198. #define SMCMR_SM_GCI ((ushort)0x0000)
  199. #define SMCMR_SM_UART ((ushort)0x0020)
  200. #define SMCMR_SM_TRANS ((ushort)0x0030)
  201. #define SMCMR_SM_MASK ((ushort)0x0030)
  202. #define SMCMR_PM_EVEN ((ushort)0x0100) /* Even parity, else odd */
  203. #define SMCMR_REVD SMCMR_PM_EVEN
  204. #define SMCMR_PEN ((ushort)0x0200) /* Parity enable */
  205. #define SMCMR_BS SMCMR_PEN
  206. #define SMCMR_SL ((ushort)0x0400) /* Two stops, else one */
  207. #define SMCR_CLEN_MASK ((ushort)0x7800) /* Character length */
  208. #define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
  209. /* SMC Event and Mask register.
  210. */
  211. #define SMCM_BRKE ((unsigned char)0x40) /* When in UART Mode */
  212. #define SMCM_BRK ((unsigned char)0x10) /* When in UART Mode */
  213. #define SMCM_TXE ((unsigned char)0x10)
  214. #define SMCM_BSY ((unsigned char)0x04)
  215. #define SMCM_TX ((unsigned char)0x02)
  216. #define SMCM_RX ((unsigned char)0x01)
  217. /* Baud rate generators.
  218. */
  219. #define CPM_BRG_RST ((uint)0x00020000)
  220. #define CPM_BRG_EN ((uint)0x00010000)
  221. #define CPM_BRG_EXTC_INT ((uint)0x00000000)
  222. #define CPM_BRG_EXTC_CLK3_9 ((uint)0x00004000)
  223. #define CPM_BRG_EXTC_CLK5_15 ((uint)0x00008000)
  224. #define CPM_BRG_ATB ((uint)0x00002000)
  225. #define CPM_BRG_CD_MASK ((uint)0x00001ffe)
  226. #define CPM_BRG_DIV16 ((uint)0x00000001)
  227. /* SCCs.
  228. */
  229. #define SCC_GSMRH_IRP ((uint)0x00040000)
  230. #define SCC_GSMRH_GDE ((uint)0x00010000)
  231. #define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
  232. #define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
  233. #define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
  234. #define SCC_GSMRH_REVD ((uint)0x00002000)
  235. #define SCC_GSMRH_TRX ((uint)0x00001000)
  236. #define SCC_GSMRH_TTX ((uint)0x00000800)
  237. #define SCC_GSMRH_CDP ((uint)0x00000400)
  238. #define SCC_GSMRH_CTSP ((uint)0x00000200)
  239. #define SCC_GSMRH_CDS ((uint)0x00000100)
  240. #define SCC_GSMRH_CTSS ((uint)0x00000080)
  241. #define SCC_GSMRH_TFL ((uint)0x00000040)
  242. #define SCC_GSMRH_RFW ((uint)0x00000020)
  243. #define SCC_GSMRH_TXSY ((uint)0x00000010)
  244. #define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
  245. #define SCC_GSMRH_SYNL8 ((uint)0x00000008)
  246. #define SCC_GSMRH_SYNL4 ((uint)0x00000004)
  247. #define SCC_GSMRH_RTSM ((uint)0x00000002)
  248. #define SCC_GSMRH_RSYN ((uint)0x00000001)
  249. #define SCC_GSMRL_SIR ((uint)0x80000000) /* SCC2 only */
  250. #define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
  251. #define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
  252. #define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
  253. #define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
  254. #define SCC_GSMRL_TCI ((uint)0x10000000)
  255. #define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
  256. #define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
  257. #define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
  258. #define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
  259. #define SCC_GSMRL_RINV ((uint)0x02000000)
  260. #define SCC_GSMRL_TINV ((uint)0x01000000)
  261. #define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
  262. #define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
  263. #define SCC_GSMRL_TPL_48 ((uint)0x00800000)
  264. #define SCC_GSMRL_TPL_32 ((uint)0x00600000)
  265. #define SCC_GSMRL_TPL_16 ((uint)0x00400000)
  266. #define SCC_GSMRL_TPL_8 ((uint)0x00200000)
  267. #define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
  268. #define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
  269. #define SCC_GSMRL_TPP_01 ((uint)0x00100000)
  270. #define SCC_GSMRL_TPP_10 ((uint)0x00080000)
  271. #define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
  272. #define SCC_GSMRL_TEND ((uint)0x00040000)
  273. #define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
  274. #define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
  275. #define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
  276. #define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
  277. #define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
  278. #define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
  279. #define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
  280. #define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
  281. #define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
  282. #define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
  283. #define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
  284. #define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
  285. #define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
  286. #define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
  287. #define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
  288. #define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
  289. #define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
  290. #define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
  291. #define SCC_GSMRL_DIAG_LE ((uint)0x000000c0) /* Loop and echo */
  292. #define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
  293. #define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
  294. #define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
  295. #define SCC_GSMRL_ENR ((uint)0x00000020)
  296. #define SCC_GSMRL_ENT ((uint)0x00000010)
  297. #define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
  298. #define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
  299. #define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
  300. #define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
  301. #define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
  302. #define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
  303. #define SCC_GSMRL_MODE_UART ((uint)0x00000004)
  304. #define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
  305. #define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
  306. #define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
  307. #define SCC_TODR_TOD ((ushort)0x8000)
  308. /* SCC Event and Mask register.
  309. */
  310. #define SCCM_TXE ((unsigned char)0x10)
  311. #define SCCM_BSY ((unsigned char)0x04)
  312. #define SCCM_TX ((unsigned char)0x02)
  313. #define SCCM_RX ((unsigned char)0x01)
  314. typedef struct scc_param {
  315. ushort scc_rbase; /* Rx Buffer descriptor base address */
  316. ushort scc_tbase; /* Tx Buffer descriptor base address */
  317. u_char scc_rfcr; /* Rx function code */
  318. u_char scc_tfcr; /* Tx function code */
  319. ushort scc_mrblr; /* Max receive buffer length */
  320. uint scc_rstate; /* Internal */
  321. uint scc_idp; /* Internal */
  322. ushort scc_rbptr; /* Internal */
  323. ushort scc_ibc; /* Internal */
  324. uint scc_rxtmp; /* Internal */
  325. uint scc_tstate; /* Internal */
  326. uint scc_tdp; /* Internal */
  327. ushort scc_tbptr; /* Internal */
  328. ushort scc_tbc; /* Internal */
  329. uint scc_txtmp; /* Internal */
  330. uint scc_rcrc; /* Internal */
  331. uint scc_tcrc; /* Internal */
  332. } sccp_t;
  333. /* CPM Ethernet through SCC1.
  334. */
  335. typedef struct scc_enet {
  336. sccp_t sen_genscc;
  337. uint sen_cpres; /* Preset CRC */
  338. uint sen_cmask; /* Constant mask for CRC */
  339. uint sen_crcec; /* CRC Error counter */
  340. uint sen_alec; /* alignment error counter */
  341. uint sen_disfc; /* discard frame counter */
  342. ushort sen_pads; /* Tx short frame pad character */
  343. ushort sen_retlim; /* Retry limit threshold */
  344. ushort sen_retcnt; /* Retry limit counter */
  345. ushort sen_maxflr; /* maximum frame length register */
  346. ushort sen_minflr; /* minimum frame length register */
  347. ushort sen_maxd1; /* maximum DMA1 length */
  348. ushort sen_maxd2; /* maximum DMA2 length */
  349. ushort sen_maxd; /* Rx max DMA */
  350. ushort sen_dmacnt; /* Rx DMA counter */
  351. ushort sen_maxb; /* Max BD byte count */
  352. ushort sen_gaddr1; /* Group address filter */
  353. ushort sen_gaddr2;
  354. ushort sen_gaddr3;
  355. ushort sen_gaddr4;
  356. uint sen_tbuf0data0; /* Save area 0 - current frame */
  357. uint sen_tbuf0data1; /* Save area 1 - current frame */
  358. uint sen_tbuf0rba; /* Internal */
  359. uint sen_tbuf0crc; /* Internal */
  360. ushort sen_tbuf0bcnt; /* Internal */
  361. ushort sen_paddrh; /* physical address (MSB) */
  362. ushort sen_paddrm;
  363. ushort sen_paddrl; /* physical address (LSB) */
  364. ushort sen_pper; /* persistence */
  365. ushort sen_rfbdptr; /* Rx first BD pointer */
  366. ushort sen_tfbdptr; /* Tx first BD pointer */
  367. ushort sen_tlbdptr; /* Tx last BD pointer */
  368. uint sen_tbuf1data0; /* Save area 0 - current frame */
  369. uint sen_tbuf1data1; /* Save area 1 - current frame */
  370. uint sen_tbuf1rba; /* Internal */
  371. uint sen_tbuf1crc; /* Internal */
  372. ushort sen_tbuf1bcnt; /* Internal */
  373. ushort sen_txlen; /* Tx Frame length counter */
  374. ushort sen_iaddr1; /* Individual address filter */
  375. ushort sen_iaddr2;
  376. ushort sen_iaddr3;
  377. ushort sen_iaddr4;
  378. ushort sen_boffcnt; /* Backoff counter */
  379. /* NOTE: Some versions of the manual have the following items
  380. * incorrectly documented. Below is the proper order.
  381. */
  382. ushort sen_taddrh; /* temp address (MSB) */
  383. ushort sen_taddrm;
  384. ushort sen_taddrl; /* temp address (LSB) */
  385. } scc_enet_t;
  386. /* SCC Event register as used by Ethernet.
  387. */
  388. #define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
  389. #define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */
  390. #define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */
  391. #define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */
  392. #define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
  393. #define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
  394. /* SCC Mode Register (PSMR) as used by Ethernet.
  395. */
  396. #define SCC_PSMR_HBC ((ushort)0x8000) /* Enable heartbeat */
  397. #define SCC_PSMR_FC ((ushort)0x4000) /* Force collision */
  398. #define SCC_PSMR_RSH ((ushort)0x2000) /* Receive short frames */
  399. #define SCC_PSMR_IAM ((ushort)0x1000) /* Check individual hash */
  400. #define SCC_PSMR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
  401. #define SCC_PSMR_PRO ((ushort)0x0200) /* Promiscuous mode */
  402. #define SCC_PSMR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
  403. #define SCC_PSMR_SBT ((ushort)0x0080) /* Special backoff timer */
  404. #define SCC_PSMR_LPB ((ushort)0x0040) /* Set Loopback mode */
  405. #define SCC_PSMR_SIP ((ushort)0x0020) /* Sample Input Pins */
  406. #define SCC_PSMR_LCW ((ushort)0x0010) /* Late collision window */
  407. #define SCC_PSMR_NIB22 ((ushort)0x000a) /* Start frame search */
  408. #define SCC_PSMR_FDE ((ushort)0x0001) /* Full duplex enable */
  409. /* Buffer descriptor control/status used by Ethernet receive.
  410. * Common to SCC and FCC.
  411. */
  412. #define BD_ENET_RX_EMPTY ((ushort)0x8000)
  413. #define BD_ENET_RX_WRAP ((ushort)0x2000)
  414. #define BD_ENET_RX_INTR ((ushort)0x1000)
  415. #define BD_ENET_RX_LAST ((ushort)0x0800)
  416. #define BD_ENET_RX_FIRST ((ushort)0x0400)
  417. #define BD_ENET_RX_MISS ((ushort)0x0100)
  418. #define BD_ENET_RX_BC ((ushort)0x0080) /* FCC Only */
  419. #define BD_ENET_RX_MC ((ushort)0x0040) /* FCC Only */
  420. #define BD_ENET_RX_LG ((ushort)0x0020)
  421. #define BD_ENET_RX_NO ((ushort)0x0010)
  422. #define BD_ENET_RX_SH ((ushort)0x0008)
  423. #define BD_ENET_RX_CR ((ushort)0x0004)
  424. #define BD_ENET_RX_OV ((ushort)0x0002)
  425. #define BD_ENET_RX_CL ((ushort)0x0001)
  426. #define BD_ENET_RX_STATS ((ushort)0x01ff) /* All status bits */
  427. /* Buffer descriptor control/status used by Ethernet transmit.
  428. * Common to SCC and FCC.
  429. */
  430. #define BD_ENET_TX_READY ((ushort)0x8000)
  431. #define BD_ENET_TX_PAD ((ushort)0x4000)
  432. #define BD_ENET_TX_WRAP ((ushort)0x2000)
  433. #define BD_ENET_TX_INTR ((ushort)0x1000)
  434. #define BD_ENET_TX_LAST ((ushort)0x0800)
  435. #define BD_ENET_TX_TC ((ushort)0x0400)
  436. #define BD_ENET_TX_DEF ((ushort)0x0200)
  437. #define BD_ENET_TX_HB ((ushort)0x0100)
  438. #define BD_ENET_TX_LC ((ushort)0x0080)
  439. #define BD_ENET_TX_RL ((ushort)0x0040)
  440. #define BD_ENET_TX_RCMASK ((ushort)0x003c)
  441. #define BD_ENET_TX_UN ((ushort)0x0002)
  442. #define BD_ENET_TX_CSL ((ushort)0x0001)
  443. #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
  444. /* SCC as UART
  445. */
  446. typedef struct scc_uart {
  447. sccp_t scc_genscc;
  448. uint scc_res1; /* Reserved */
  449. uint scc_res2; /* Reserved */
  450. ushort scc_maxidl; /* Maximum idle chars */
  451. ushort scc_idlc; /* temp idle counter */
  452. ushort scc_brkcr; /* Break count register */
  453. ushort scc_parec; /* receive parity error counter */
  454. ushort scc_frmec; /* receive framing error counter */
  455. ushort scc_nosec; /* receive noise counter */
  456. ushort scc_brkec; /* receive break condition counter */
  457. ushort scc_brkln; /* last received break length */
  458. ushort scc_uaddr1; /* UART address character 1 */
  459. ushort scc_uaddr2; /* UART address character 2 */
  460. ushort scc_rtemp; /* Temp storage */
  461. ushort scc_toseq; /* Transmit out of sequence char */
  462. ushort scc_char1; /* control character 1 */
  463. ushort scc_char2; /* control character 2 */
  464. ushort scc_char3; /* control character 3 */
  465. ushort scc_char4; /* control character 4 */
  466. ushort scc_char5; /* control character 5 */
  467. ushort scc_char6; /* control character 6 */
  468. ushort scc_char7; /* control character 7 */
  469. ushort scc_char8; /* control character 8 */
  470. ushort scc_rccm; /* receive control character mask */
  471. ushort scc_rccr; /* receive control character register */
  472. ushort scc_rlbc; /* receive last break character */
  473. } scc_uart_t;
  474. /* SCC Event and Mask registers when it is used as a UART.
  475. */
  476. #define UART_SCCM_GLR ((ushort)0x1000)
  477. #define UART_SCCM_GLT ((ushort)0x0800)
  478. #define UART_SCCM_AB ((ushort)0x0200)
  479. #define UART_SCCM_IDL ((ushort)0x0100)
  480. #define UART_SCCM_GRA ((ushort)0x0080)
  481. #define UART_SCCM_BRKE ((ushort)0x0040)
  482. #define UART_SCCM_BRKS ((ushort)0x0020)
  483. #define UART_SCCM_CCR ((ushort)0x0008)
  484. #define UART_SCCM_BSY ((ushort)0x0004)
  485. #define UART_SCCM_TX ((ushort)0x0002)
  486. #define UART_SCCM_RX ((ushort)0x0001)
  487. /* The SCC PSMR when used as a UART.
  488. */
  489. #define SCU_PSMR_FLC ((ushort)0x8000)
  490. #define SCU_PSMR_SL ((ushort)0x4000)
  491. #define SCU_PSMR_CL ((ushort)0x3000)
  492. #define SCU_PSMR_UM ((ushort)0x0c00)
  493. #define SCU_PSMR_FRZ ((ushort)0x0200)
  494. #define SCU_PSMR_RZS ((ushort)0x0100)
  495. #define SCU_PSMR_SYN ((ushort)0x0080)
  496. #define SCU_PSMR_DRT ((ushort)0x0040)
  497. #define SCU_PSMR_PEN ((ushort)0x0010)
  498. #define SCU_PSMR_RPM ((ushort)0x000c)
  499. #define SCU_PSMR_REVP ((ushort)0x0008)
  500. #define SCU_PSMR_TPM ((ushort)0x0003)
  501. #define SCU_PSMR_TEVP ((ushort)0x0002)
  502. /* CPM Transparent mode SCC.
  503. */
  504. typedef struct scc_trans {
  505. sccp_t st_genscc;
  506. uint st_cpres; /* Preset CRC */
  507. uint st_cmask; /* Constant mask for CRC */
  508. } scc_trans_t;
  509. #define BD_SCC_TX_LAST ((ushort)0x0800)
  510. /* How about some FCCs.....
  511. */
  512. #define FCC_GFMR_DIAG_NORM ((uint)0x00000000)
  513. #define FCC_GFMR_DIAG_LE ((uint)0x40000000)
  514. #define FCC_GFMR_DIAG_AE ((uint)0x80000000)
  515. #define FCC_GFMR_DIAG_ALE ((uint)0xc0000000)
  516. #define FCC_GFMR_TCI ((uint)0x20000000)
  517. #define FCC_GFMR_TRX ((uint)0x10000000)
  518. #define FCC_GFMR_TTX ((uint)0x08000000)
  519. #define FCC_GFMR_TTX ((uint)0x08000000)
  520. #define FCC_GFMR_CDP ((uint)0x04000000)
  521. #define FCC_GFMR_CTSP ((uint)0x02000000)
  522. #define FCC_GFMR_CDS ((uint)0x01000000)
  523. #define FCC_GFMR_CTSS ((uint)0x00800000)
  524. #define FCC_GFMR_SYNL_NONE ((uint)0x00000000)
  525. #define FCC_GFMR_SYNL_AUTO ((uint)0x00004000)
  526. #define FCC_GFMR_SYNL_8 ((uint)0x00008000)
  527. #define FCC_GFMR_SYNL_16 ((uint)0x0000c000)
  528. #define FCC_GFMR_RTSM ((uint)0x00002000)
  529. #define FCC_GFMR_RENC_NRZ ((uint)0x00000000)
  530. #define FCC_GFMR_RENC_NRZI ((uint)0x00000800)
  531. #define FCC_GFMR_REVD ((uint)0x00000400)
  532. #define FCC_GFMR_TENC_NRZ ((uint)0x00000000)
  533. #define FCC_GFMR_TENC_NRZI ((uint)0x00000100)
  534. #define FCC_GFMR_TCRC_16 ((uint)0x00000000)
  535. #define FCC_GFMR_TCRC_32 ((uint)0x00000080)
  536. #define FCC_GFMR_ENR ((uint)0x00000020)
  537. #define FCC_GFMR_ENT ((uint)0x00000010)
  538. #define FCC_GFMR_MODE_ENET ((uint)0x0000000c)
  539. #define FCC_GFMR_MODE_ATM ((uint)0x0000000a)
  540. #define FCC_GFMR_MODE_HDLC ((uint)0x00000000)
  541. /* Generic FCC parameter ram.
  542. */
  543. typedef struct fcc_param {
  544. ushort fcc_riptr; /* Rx Internal temp pointer */
  545. ushort fcc_tiptr; /* Tx Internal temp pointer */
  546. ushort fcc_res1;
  547. ushort fcc_mrblr; /* Max receive buffer length, mod 32 bytes */
  548. uint fcc_rstate; /* Upper byte is Func code, must be set */
  549. uint fcc_rbase; /* Receive BD base */
  550. ushort fcc_rbdstat; /* RxBD status */
  551. ushort fcc_rbdlen; /* RxBD down counter */
  552. uint fcc_rdptr; /* RxBD internal data pointer */
  553. uint fcc_tstate; /* Upper byte is Func code, must be set */
  554. uint fcc_tbase; /* Transmit BD base */
  555. ushort fcc_tbdstat; /* TxBD status */
  556. ushort fcc_tbdlen; /* TxBD down counter */
  557. uint fcc_tdptr; /* TxBD internal data pointer */
  558. uint fcc_rbptr; /* Rx BD Internal buf pointer */
  559. uint fcc_tbptr; /* Tx BD Internal buf pointer */
  560. uint fcc_rcrc; /* Rx temp CRC */
  561. uint fcc_res2;
  562. uint fcc_tcrc; /* Tx temp CRC */
  563. } fccp_t;
  564. /* Ethernet controller through FCC.
  565. */
  566. typedef struct fcc_enet {
  567. fccp_t fen_genfcc;
  568. uint fen_statbuf; /* Internal status buffer */
  569. uint fen_camptr; /* CAM address */
  570. uint fen_cmask; /* Constant mask for CRC */
  571. uint fen_cpres; /* Preset CRC */
  572. uint fen_crcec; /* CRC Error counter */
  573. uint fen_alec; /* alignment error counter */
  574. uint fen_disfc; /* discard frame counter */
  575. ushort fen_retlim; /* Retry limit */
  576. ushort fen_retcnt; /* Retry counter */
  577. ushort fen_pper; /* Persistence */
  578. ushort fen_boffcnt; /* backoff counter */
  579. uint fen_gaddrh; /* Group address filter, high 32-bits */
  580. uint fen_gaddrl; /* Group address filter, low 32-bits */
  581. ushort fen_tfcstat; /* out of sequence TxBD */
  582. ushort fen_tfclen;
  583. uint fen_tfcptr;
  584. ushort fen_mflr; /* Maximum frame length (1518) */
  585. ushort fen_paddrh; /* MAC address */
  586. ushort fen_paddrm;
  587. ushort fen_paddrl;
  588. ushort fen_ibdcount; /* Internal BD counter */
  589. ushort fen_ibdstart; /* Internal BD start pointer */
  590. ushort fen_ibdend; /* Internal BD end pointer */
  591. ushort fen_txlen; /* Internal Tx frame length counter */
  592. uint fen_ibdbase[8]; /* Internal use */
  593. uint fen_iaddrh; /* Individual address filter */
  594. uint fen_iaddrl;
  595. ushort fen_minflr; /* Minimum frame length (64) */
  596. ushort fen_taddrh; /* Filter transfer MAC address */
  597. ushort fen_taddrm;
  598. ushort fen_taddrl;
  599. ushort fen_padptr; /* Pointer to pad byte buffer */
  600. ushort fen_cftype; /* control frame type */
  601. ushort fen_cfrange; /* control frame range */
  602. ushort fen_maxb; /* maximum BD count */
  603. ushort fen_maxd1; /* Max DMA1 length (1520) */
  604. ushort fen_maxd2; /* Max DMA2 length (1520) */
  605. ushort fen_maxd; /* internal max DMA count */
  606. ushort fen_dmacnt; /* internal DMA counter */
  607. uint fen_octc; /* Total octect counter */
  608. uint fen_colc; /* Total collision counter */
  609. uint fen_broc; /* Total broadcast packet counter */
  610. uint fen_mulc; /* Total multicast packet count */
  611. uint fen_uspc; /* Total packets < 64 bytes */
  612. uint fen_frgc; /* Total packets < 64 bytes with errors */
  613. uint fen_ospc; /* Total packets > 1518 */
  614. uint fen_jbrc; /* Total packets > 1518 with errors */
  615. uint fen_p64c; /* Total packets == 64 bytes */
  616. uint fen_p65c; /* Total packets 64 < bytes <= 127 */
  617. uint fen_p128c; /* Total packets 127 < bytes <= 255 */
  618. uint fen_p256c; /* Total packets 256 < bytes <= 511 */
  619. uint fen_p512c; /* Total packets 512 < bytes <= 1023 */
  620. uint fen_p1024c; /* Total packets 1024 < bytes <= 1518 */
  621. uint fen_cambuf; /* Internal CAM buffer poiner */
  622. ushort fen_rfthr; /* Received frames threshold */
  623. ushort fen_rfcnt; /* Received frames count */
  624. } fcc_enet_t;
  625. /* FCC Event/Mask register as used by Ethernet.
  626. */
  627. #define FCC_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
  628. #define FCC_ENET_RXC ((ushort)0x0040) /* Control Frame Received */
  629. #define FCC_ENET_TXC ((ushort)0x0020) /* Out of seq. Tx sent */
  630. #define FCC_ENET_TXE ((ushort)0x0010) /* Transmit Error */
  631. #define FCC_ENET_RXF ((ushort)0x0008) /* Full frame received */
  632. #define FCC_ENET_BSY ((ushort)0x0004) /* Busy. Rx Frame dropped */
  633. #define FCC_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
  634. #define FCC_ENET_RXB ((ushort)0x0001) /* A buffer was received */
  635. /* FCC Mode Register (FPSMR) as used by Ethernet.
  636. */
  637. #define FCC_PSMR_HBC ((uint)0x80000000) /* Enable heartbeat */
  638. #define FCC_PSMR_FC ((uint)0x40000000) /* Force Collision */
  639. #define FCC_PSMR_SBT ((uint)0x20000000) /* Stop backoff timer */
  640. #define FCC_PSMR_LPB ((uint)0x10000000) /* Local protect. 1 = FDX */
  641. #define FCC_PSMR_LCW ((uint)0x08000000) /* Late collision select */
  642. #define FCC_PSMR_FDE ((uint)0x04000000) /* Full Duplex Enable */
  643. #define FCC_PSMR_MON ((uint)0x02000000) /* RMON Enable */
  644. #define FCC_PSMR_PRO ((uint)0x00400000) /* Promiscuous Enable */
  645. #define FCC_PSMR_FCE ((uint)0x00200000) /* Flow Control Enable */
  646. #define FCC_PSMR_RSH ((uint)0x00100000) /* Receive Short Frames */
  647. #define FCC_PSMR_CAM ((uint)0x00000400) /* CAM enable */
  648. #define FCC_PSMR_BRO ((uint)0x00000200) /* Broadcast pkt discard */
  649. #define FCC_PSMR_ENCRC ((uint)0x00000080) /* Use 32-bit CRC */
  650. /* IIC parameter RAM.
  651. */
  652. typedef struct iic {
  653. ushort iic_rbase; /* Rx Buffer descriptor base address */
  654. ushort iic_tbase; /* Tx Buffer descriptor base address */
  655. u_char iic_rfcr; /* Rx function code */
  656. u_char iic_tfcr; /* Tx function code */
  657. ushort iic_mrblr; /* Max receive buffer length */
  658. uint iic_rstate; /* Internal */
  659. uint iic_rdp; /* Internal */
  660. ushort iic_rbptr; /* Internal */
  661. ushort iic_rbc; /* Internal */
  662. uint iic_rxtmp; /* Internal */
  663. uint iic_tstate; /* Internal */
  664. uint iic_tdp; /* Internal */
  665. ushort iic_tbptr; /* Internal */
  666. ushort iic_tbc; /* Internal */
  667. uint iic_txtmp; /* Internal */
  668. } iic_t;
  669. /* SPI parameter RAM.
  670. */
  671. typedef struct spi {
  672. ushort spi_rbase; /* Rx Buffer descriptor base address */
  673. ushort spi_tbase; /* Tx Buffer descriptor base address */
  674. u_char spi_rfcr; /* Rx function code */
  675. u_char spi_tfcr; /* Tx function code */
  676. ushort spi_mrblr; /* Max receive buffer length */
  677. uint spi_rstate; /* Internal */
  678. uint spi_rdp; /* Internal */
  679. ushort spi_rbptr; /* Internal */
  680. ushort spi_rbc; /* Internal */
  681. uint spi_rxtmp; /* Internal */
  682. uint spi_tstate; /* Internal */
  683. uint spi_tdp; /* Internal */
  684. ushort spi_tbptr; /* Internal */
  685. ushort spi_tbc; /* Internal */
  686. uint spi_txtmp; /* Internal */
  687. uint spi_res; /* Tx temp. */
  688. uint spi_res1[4]; /* SDMA temp. */
  689. } spi_t;
  690. /* SPI Mode register.
  691. */
  692. #define SPMODE_LOOP ((ushort)0x4000) /* Loopback */
  693. #define SPMODE_CI ((ushort)0x2000) /* Clock Invert */
  694. #define SPMODE_CP ((ushort)0x1000) /* Clock Phase */
  695. #define SPMODE_DIV16 ((ushort)0x0800) /* BRG/16 mode */
  696. #define SPMODE_REV ((ushort)0x0400) /* Reversed Data */
  697. #define SPMODE_MSTR ((ushort)0x0200) /* SPI Master */
  698. #define SPMODE_EN ((ushort)0x0100) /* Enable */
  699. #define SPMODE_LENMSK ((ushort)0x00f0) /* character length */
  700. #define SPMODE_PMMSK ((ushort)0x000f) /* prescale modulus */
  701. #define SPMODE_LEN(x) ((((x)-1)&0xF)<<4)
  702. #define SPMODE_PM(x) ((x) &0xF)
  703. #define SPI_EB ((u_char)0x10) /* big endian byte order */
  704. #define BD_IIC_START ((ushort)0x0400)
  705. /* IDMA parameter RAM
  706. */
  707. typedef struct idma {
  708. ushort ibase; /* IDMA buffer descriptor table base address */
  709. ushort dcm; /* DMA channel mode */
  710. ushort ibdptr; /* IDMA current buffer descriptor pointer */
  711. ushort dpr_buf; /* IDMA transfer buffer base address */
  712. ushort buf_inv; /* internal buffer inventory */
  713. ushort ss_max; /* steady-state maximum transfer size */
  714. ushort dpr_in_ptr; /* write pointer inside the internal buffer */
  715. ushort sts; /* source transfer size */
  716. ushort dpr_out_ptr; /* read pointer inside the internal buffer */
  717. ushort seob; /* source end of burst */
  718. ushort deob; /* destination end of burst */
  719. ushort dts; /* destination transfer size */
  720. ushort ret_add; /* return address when working in ERM=1 mode */
  721. ushort res0; /* reserved */
  722. uint bd_cnt; /* internal byte count */
  723. uint s_ptr; /* source internal data pointer */
  724. uint d_ptr; /* destination internal data pointer */
  725. uint istate; /* internal state */
  726. u_char res1[20]; /* pad to 64-byte length */
  727. } idma_t;
  728. /* DMA channel mode bit fields
  729. */
  730. #define IDMA_DCM_FB ((ushort)0x8000) /* fly-by mode */
  731. #define IDMA_DCM_LP ((ushort)0x4000) /* low priority */
  732. #define IDMA_DCM_TC2 ((ushort)0x0400) /* value driven on TC[2] */
  733. #define IDMA_DCM_DMA_WRAP_MASK ((ushort)0x01c0) /* mask for DMA wrap */
  734. #define IDMA_DCM_DMA_WRAP_64 ((ushort)0x0000) /* 64-byte DMA xfer buffer */
  735. #define IDMA_DCM_DMA_WRAP_128 ((ushort)0x0040) /* 128-byte DMA xfer buffer */
  736. #define IDMA_DCM_DMA_WRAP_256 ((ushort)0x0080) /* 256-byte DMA xfer buffer */
  737. #define IDMA_DCM_DMA_WRAP_512 ((ushort)0x00c0) /* 512-byte DMA xfer buffer */
  738. #define IDMA_DCM_DMA_WRAP_1024 ((ushort)0x0100) /* 1024-byte DMA xfer buffer */
  739. #define IDMA_DCM_DMA_WRAP_2048 ((ushort)0x0140) /* 2048-byte DMA xfer buffer */
  740. #define IDMA_DCM_SINC ((ushort)0x0020) /* source inc addr */
  741. #define IDMA_DCM_DINC ((ushort)0x0010) /* destination inc addr */
  742. #define IDMA_DCM_ERM ((ushort)0x0008) /* external request mode */
  743. #define IDMA_DCM_DT ((ushort)0x0004) /* DONE treatment */
  744. #define IDMA_DCM_SD_MASK ((ushort)0x0003) /* mask for SD bit field */
  745. #define IDMA_DCM_SD_MEM2MEM ((ushort)0x0000) /* memory-to-memory xfer */
  746. #define IDMA_DCM_SD_PER2MEM ((ushort)0x0002) /* peripheral-to-memory xfer */
  747. #define IDMA_DCM_SD_MEM2PER ((ushort)0x0001) /* memory-to-peripheral xfer */
  748. /* IDMA Buffer Descriptors
  749. */
  750. typedef struct idma_bd {
  751. uint flags;
  752. uint len; /* data length */
  753. uint src; /* source data buffer pointer */
  754. uint dst; /* destination data buffer pointer */
  755. } idma_bd_t;
  756. /* IDMA buffer descriptor flag bit fields
  757. */
  758. #define IDMA_BD_V ((uint)0x80000000) /* valid */
  759. #define IDMA_BD_W ((uint)0x20000000) /* wrap */
  760. #define IDMA_BD_I ((uint)0x10000000) /* interrupt */
  761. #define IDMA_BD_L ((uint)0x08000000) /* last */
  762. #define IDMA_BD_CM ((uint)0x02000000) /* continuous mode */
  763. #define IDMA_BD_SDN ((uint)0x00400000) /* source done */
  764. #define IDMA_BD_DDN ((uint)0x00200000) /* destination done */
  765. #define IDMA_BD_DGBL ((uint)0x00100000) /* destination global */
  766. #define IDMA_BD_DBO_LE ((uint)0x00040000) /* little-end dest byte order */
  767. #define IDMA_BD_DBO_BE ((uint)0x00080000) /* big-end dest byte order */
  768. #define IDMA_BD_DDTB ((uint)0x00010000) /* destination data bus */
  769. #define IDMA_BD_SGBL ((uint)0x00002000) /* source global */
  770. #define IDMA_BD_SBO_LE ((uint)0x00000800) /* little-end src byte order */
  771. #define IDMA_BD_SBO_BE ((uint)0x00001000) /* big-end src byte order */
  772. #define IDMA_BD_SDTB ((uint)0x00000200) /* source data bus */
  773. /* per-channel IDMA registers
  774. */
  775. typedef struct im_idma {
  776. u_char idsr; /* IDMAn event status register */
  777. u_char res0[3];
  778. u_char idmr; /* IDMAn event mask register */
  779. u_char res1[3];
  780. } im_idma_t;
  781. /* IDMA event register bit fields
  782. */
  783. #define IDMA_EVENT_SC ((unsigned char)0x08) /* stop completed */
  784. #define IDMA_EVENT_OB ((unsigned char)0x04) /* out of buffers */
  785. #define IDMA_EVENT_EDN ((unsigned char)0x02) /* external DONE asserted */
  786. #define IDMA_EVENT_BC ((unsigned char)0x01) /* buffer descriptor complete */
  787. /* RISC Controller Configuration Register (RCCR) bit fields
  788. */
  789. #define RCCR_TIME ((uint)0x80000000) /* timer enable */
  790. #define RCCR_TIMEP_MASK ((uint)0x3f000000) /* mask for timer period bit field */
  791. #define RCCR_DR0M ((uint)0x00800000) /* IDMA0 request mode */
  792. #define RCCR_DR1M ((uint)0x00400000) /* IDMA1 request mode */
  793. #define RCCR_DR2M ((uint)0x00000080) /* IDMA2 request mode */
  794. #define RCCR_DR3M ((uint)0x00000040) /* IDMA3 request mode */
  795. #define RCCR_DR0QP_MASK ((uint)0x00300000) /* mask for IDMA0 req priority */
  796. #define RCCR_DR0QP_HIGH ((uint)0x00000000) /* IDMA0 has high req priority */
  797. #define RCCR_DR0QP_MED ((uint)0x00100000) /* IDMA0 has medium req priority */
  798. #define RCCR_DR0QP_LOW ((uint)0x00200000) /* IDMA0 has low req priority */
  799. #define RCCR_DR1QP_MASK ((uint)0x00030000) /* mask for IDMA1 req priority */
  800. #define RCCR_DR1QP_HIGH ((uint)0x00000000) /* IDMA1 has high req priority */
  801. #define RCCR_DR1QP_MED ((uint)0x00010000) /* IDMA1 has medium req priority */
  802. #define RCCR_DR1QP_LOW ((uint)0x00020000) /* IDMA1 has low req priority */
  803. #define RCCR_DR2QP_MASK ((uint)0x00000030) /* mask for IDMA2 req priority */
  804. #define RCCR_DR2QP_HIGH ((uint)0x00000000) /* IDMA2 has high req priority */
  805. #define RCCR_DR2QP_MED ((uint)0x00000010) /* IDMA2 has medium req priority */
  806. #define RCCR_DR2QP_LOW ((uint)0x00000020) /* IDMA2 has low req priority */
  807. #define RCCR_DR3QP_MASK ((uint)0x00000003) /* mask for IDMA3 req priority */
  808. #define RCCR_DR3QP_HIGH ((uint)0x00000000) /* IDMA3 has high req priority */
  809. #define RCCR_DR3QP_MED ((uint)0x00000001) /* IDMA3 has medium req priority */
  810. #define RCCR_DR3QP_LOW ((uint)0x00000002) /* IDMA3 has low req priority */
  811. #define RCCR_EIE ((uint)0x00080000) /* external interrupt enable */
  812. #define RCCR_SCD ((uint)0x00040000) /* scheduler configuration */
  813. #define RCCR_ERAM_MASK ((uint)0x0000e000) /* mask for enable RAM microcode */
  814. #define RCCR_ERAM_0KB ((uint)0x00000000) /* use 0KB of dpram for microcode */
  815. #define RCCR_ERAM_2KB ((uint)0x00002000) /* use 2KB of dpram for microcode */
  816. #define RCCR_ERAM_4KB ((uint)0x00004000) /* use 4KB of dpram for microcode */
  817. #define RCCR_ERAM_6KB ((uint)0x00006000) /* use 6KB of dpram for microcode */
  818. #define RCCR_ERAM_8KB ((uint)0x00008000) /* use 8KB of dpram for microcode */
  819. #define RCCR_ERAM_10KB ((uint)0x0000a000) /* use 10KB of dpram for microcode */
  820. #define RCCR_ERAM_12KB ((uint)0x0000c000) /* use 12KB of dpram for microcode */
  821. #define RCCR_EDM0 ((uint)0x00000800) /* DREQ0 edge detect mode */
  822. #define RCCR_EDM1 ((uint)0x00000400) /* DREQ1 edge detect mode */
  823. #define RCCR_EDM2 ((uint)0x00000200) /* DREQ2 edge detect mode */
  824. #define RCCR_EDM3 ((uint)0x00000100) /* DREQ3 edge detect mode */
  825. #define RCCR_DEM01 ((uint)0x00000008) /* DONE0/DONE1 edge detect mode */
  826. #define RCCR_DEM23 ((uint)0x00000004) /* DONE2/DONE3 edge detect mode */
  827. /*-----------------------------------------------------------------------
  828. * CMXFCR - CMX FCC Clock Route Register
  829. */
  830. #define CMXFCR_FC1 0x40000000 /* FCC1 connection */
  831. #define CMXFCR_RF1CS_MSK 0x38000000 /* Receive FCC1 Clock Source Mask */
  832. #define CMXFCR_TF1CS_MSK 0x07000000 /* Transmit FCC1 Clock Source Mask */
  833. #define CMXFCR_FC2 0x00400000 /* FCC2 connection */
  834. #define CMXFCR_RF2CS_MSK 0x00380000 /* Receive FCC2 Clock Source Mask */
  835. #define CMXFCR_TF2CS_MSK 0x00070000 /* Transmit FCC2 Clock Source Mask */
  836. #define CMXFCR_FC3 0x00004000 /* FCC3 connection */
  837. #define CMXFCR_RF3CS_MSK 0x00003800 /* Receive FCC3 Clock Source Mask */
  838. #define CMXFCR_TF3CS_MSK 0x00000700 /* Transmit FCC3 Clock Source Mask */
  839. #define CMXFCR_RF1CS_BRG5 0x00000000 /* Receive FCC1 Clock Source is BRG5 */
  840. #define CMXFCR_RF1CS_BRG6 0x08000000 /* Receive FCC1 Clock Source is BRG6 */
  841. #define CMXFCR_RF1CS_BRG7 0x10000000 /* Receive FCC1 Clock Source is BRG7 */
  842. #define CMXFCR_RF1CS_BRG8 0x18000000 /* Receive FCC1 Clock Source is BRG8 */
  843. #define CMXFCR_RF1CS_CLK9 0x20000000 /* Receive FCC1 Clock Source is CLK9 */
  844. #define CMXFCR_RF1CS_CLK10 0x28000000 /* Receive FCC1 Clock Source is CLK10 */
  845. #define CMXFCR_RF1CS_CLK11 0x30000000 /* Receive FCC1 Clock Source is CLK11 */
  846. #define CMXFCR_RF1CS_CLK12 0x38000000 /* Receive FCC1 Clock Source is CLK12 */
  847. #define CMXFCR_TF1CS_BRG5 0x00000000 /* Transmit FCC1 Clock Source is BRG5 */
  848. #define CMXFCR_TF1CS_BRG6 0x01000000 /* Transmit FCC1 Clock Source is BRG6 */
  849. #define CMXFCR_TF1CS_BRG7 0x02000000 /* Transmit FCC1 Clock Source is BRG7 */
  850. #define CMXFCR_TF1CS_BRG8 0x03000000 /* Transmit FCC1 Clock Source is BRG8 */
  851. #define CMXFCR_TF1CS_CLK9 0x04000000 /* Transmit FCC1 Clock Source is CLK9 */
  852. #define CMXFCR_TF1CS_CLK10 0x05000000 /* Transmit FCC1 Clock Source is CLK10 */
  853. #define CMXFCR_TF1CS_CLK11 0x06000000 /* Transmit FCC1 Clock Source is CLK11 */
  854. #define CMXFCR_TF1CS_CLK12 0x07000000 /* Transmit FCC1 Clock Source is CLK12 */
  855. #define CMXFCR_RF2CS_BRG5 0x00000000 /* Receive FCC2 Clock Source is BRG5 */
  856. #define CMXFCR_RF2CS_BRG6 0x00080000 /* Receive FCC2 Clock Source is BRG6 */
  857. #define CMXFCR_RF2CS_BRG7 0x00100000 /* Receive FCC2 Clock Source is BRG7 */
  858. #define CMXFCR_RF2CS_BRG8 0x00180000 /* Receive FCC2 Clock Source is BRG8 */
  859. #define CMXFCR_RF2CS_CLK13 0x00200000 /* Receive FCC2 Clock Source is CLK13 */
  860. #define CMXFCR_RF2CS_CLK14 0x00280000 /* Receive FCC2 Clock Source is CLK14 */
  861. #define CMXFCR_RF2CS_CLK15 0x00300000 /* Receive FCC2 Clock Source is CLK15 */
  862. #define CMXFCR_RF2CS_CLK16 0x00380000 /* Receive FCC2 Clock Source is CLK16 */
  863. #define CMXFCR_TF2CS_BRG5 0x00000000 /* Transmit FCC2 Clock Source is BRG5 */
  864. #define CMXFCR_TF2CS_BRG6 0x00010000 /* Transmit FCC2 Clock Source is BRG6 */
  865. #define CMXFCR_TF2CS_BRG7 0x00020000 /* Transmit FCC2 Clock Source is BRG7 */
  866. #define CMXFCR_TF2CS_BRG8 0x00030000 /* Transmit FCC2 Clock Source is BRG8 */
  867. #define CMXFCR_TF2CS_CLK13 0x00040000 /* Transmit FCC2 Clock Source is CLK13 */
  868. #define CMXFCR_TF2CS_CLK14 0x00050000 /* Transmit FCC2 Clock Source is CLK14 */
  869. #define CMXFCR_TF2CS_CLK15 0x00060000 /* Transmit FCC2 Clock Source is CLK15 */
  870. #define CMXFCR_TF2CS_CLK16 0x00070000 /* Transmit FCC2 Clock Source is CLK16 */
  871. #define CMXFCR_RF3CS_BRG5 0x00000000 /* Receive FCC3 Clock Source is BRG5 */
  872. #define CMXFCR_RF3CS_BRG6 0x00000800 /* Receive FCC3 Clock Source is BRG6 */
  873. #define CMXFCR_RF3CS_BRG7 0x00001000 /* Receive FCC3 Clock Source is BRG7 */
  874. #define CMXFCR_RF3CS_BRG8 0x00001800 /* Receive FCC3 Clock Source is BRG8 */
  875. #define CMXFCR_RF3CS_CLK13 0x00002000 /* Receive FCC3 Clock Source is CLK13 */
  876. #define CMXFCR_RF3CS_CLK14 0x00002800 /* Receive FCC3 Clock Source is CLK14 */
  877. #define CMXFCR_RF3CS_CLK15 0x00003000 /* Receive FCC3 Clock Source is CLK15 */
  878. #define CMXFCR_RF3CS_CLK16 0x00003800 /* Receive FCC3 Clock Source is CLK16 */
  879. #define CMXFCR_TF3CS_BRG5 0x00000000 /* Transmit FCC3 Clock Source is BRG5 */
  880. #define CMXFCR_TF3CS_BRG6 0x00000100 /* Transmit FCC3 Clock Source is BRG6 */
  881. #define CMXFCR_TF3CS_BRG7 0x00000200 /* Transmit FCC3 Clock Source is BRG7 */
  882. #define CMXFCR_TF3CS_BRG8 0x00000300 /* Transmit FCC3 Clock Source is BRG8 */
  883. #define CMXFCR_TF3CS_CLK13 0x00000400 /* Transmit FCC3 Clock Source is CLK13 */
  884. #define CMXFCR_TF3CS_CLK14 0x00000500 /* Transmit FCC3 Clock Source is CLK14 */
  885. #define CMXFCR_TF3CS_CLK15 0x00000600 /* Transmit FCC3 Clock Source is CLK15 */
  886. #define CMXFCR_TF3CS_CLK16 0x00000700 /* Transmit FCC3 Clock Source is CLK16 */
  887. /*-----------------------------------------------------------------------
  888. * CMXSCR - CMX SCC Clock Route Register
  889. */
  890. #define CMXSCR_GR1 0x80000000 /* Grant Support of SCC1 */
  891. #define CMXSCR_SC1 0x40000000 /* SCC1 connection */
  892. #define CMXSCR_RS1CS_MSK 0x38000000 /* Receive SCC1 Clock Source Mask */
  893. #define CMXSCR_TS1CS_MSK 0x07000000 /* Transmit SCC1 Clock Source Mask */
  894. #define CMXSCR_GR2 0x00800000 /* Grant Support of SCC2 */
  895. #define CMXSCR_SC2 0x00400000 /* SCC2 connection */
  896. #define CMXSCR_RS2CS_MSK 0x00380000 /* Receive SCC2 Clock Source Mask */
  897. #define CMXSCR_TS2CS_MSK 0x00070000 /* Transmit SCC2 Clock Source Mask */
  898. #define CMXSCR_GR3 0x00008000 /* Grant Support of SCC3 */
  899. #define CMXSCR_SC3 0x00004000 /* SCC3 connection */
  900. #define CMXSCR_RS3CS_MSK 0x00003800 /* Receive SCC3 Clock Source Mask */
  901. #define CMXSCR_TS3CS_MSK 0x00000700 /* Transmit SCC3 Clock Source Mask */
  902. #define CMXSCR_GR4 0x00000080 /* Grant Support of SCC4 */
  903. #define CMXSCR_SC4 0x00000040 /* SCC4 connection */
  904. #define CMXSCR_RS4CS_MSK 0x00000038 /* Receive SCC4 Clock Source Mask */
  905. #define CMXSCR_TS4CS_MSK 0x00000007 /* Transmit SCC4 Clock Source Mask */
  906. #define CMXSCR_RS1CS_BRG1 0x00000000 /* SCC1 Rx Clock Source is BRG1 */
  907. #define CMXSCR_RS1CS_BRG2 0x08000000 /* SCC1 Rx Clock Source is BRG2 */
  908. #define CMXSCR_RS1CS_BRG3 0x10000000 /* SCC1 Rx Clock Source is BRG3 */
  909. #define CMXSCR_RS1CS_BRG4 0x18000000 /* SCC1 Rx Clock Source is BRG4 */
  910. #define CMXSCR_RS1CS_CLK11 0x20000000 /* SCC1 Rx Clock Source is CLK11 */
  911. #define CMXSCR_RS1CS_CLK12 0x28000000 /* SCC1 Rx Clock Source is CLK12 */
  912. #define CMXSCR_RS1CS_CLK3 0x30000000 /* SCC1 Rx Clock Source is CLK3 */
  913. #define CMXSCR_RS1CS_CLK4 0x38000000 /* SCC1 Rx Clock Source is CLK4 */
  914. #define CMXSCR_TS1CS_BRG1 0x00000000 /* SCC1 Tx Clock Source is BRG1 */
  915. #define CMXSCR_TS1CS_BRG2 0x01000000 /* SCC1 Tx Clock Source is BRG2 */
  916. #define CMXSCR_TS1CS_BRG3 0x02000000 /* SCC1 Tx Clock Source is BRG3 */
  917. #define CMXSCR_TS1CS_BRG4 0x03000000 /* SCC1 Tx Clock Source is BRG4 */
  918. #define CMXSCR_TS1CS_CLK11 0x04000000 /* SCC1 Tx Clock Source is CLK11 */
  919. #define CMXSCR_TS1CS_CLK12 0x05000000 /* SCC1 Tx Clock Source is CLK12 */
  920. #define CMXSCR_TS1CS_CLK3 0x06000000 /* SCC1 Tx Clock Source is CLK3 */
  921. #define CMXSCR_TS1CS_CLK4 0x07000000 /* SCC1 Tx Clock Source is CLK4 */
  922. #define CMXSCR_RS2CS_BRG1 0x00000000 /* SCC2 Rx Clock Source is BRG1 */
  923. #define CMXSCR_RS2CS_BRG2 0x00080000 /* SCC2 Rx Clock Source is BRG2 */
  924. #define CMXSCR_RS2CS_BRG3 0x00100000 /* SCC2 Rx Clock Source is BRG3 */
  925. #define CMXSCR_RS2CS_BRG4 0x00180000 /* SCC2 Rx Clock Source is BRG4 */
  926. #define CMXSCR_RS2CS_CLK11 0x00200000 /* SCC2 Rx Clock Source is CLK11 */
  927. #define CMXSCR_RS2CS_CLK12 0x00280000 /* SCC2 Rx Clock Source is CLK12 */
  928. #define CMXSCR_RS2CS_CLK3 0x00300000 /* SCC2 Rx Clock Source is CLK3 */
  929. #define CMXSCR_RS2CS_CLK4 0x00380000 /* SCC2 Rx Clock Source is CLK4 */
  930. #define CMXSCR_TS2CS_BRG1 0x00000000 /* SCC2 Tx Clock Source is BRG1 */
  931. #define CMXSCR_TS2CS_BRG2 0x00010000 /* SCC2 Tx Clock Source is BRG2 */
  932. #define CMXSCR_TS2CS_BRG3 0x00020000 /* SCC2 Tx Clock Source is BRG3 */
  933. #define CMXSCR_TS2CS_BRG4 0x00030000 /* SCC2 Tx Clock Source is BRG4 */
  934. #define CMXSCR_TS2CS_CLK11 0x00040000 /* SCC2 Tx Clock Source is CLK11 */
  935. #define CMXSCR_TS2CS_CLK12 0x00050000 /* SCC2 Tx Clock Source is CLK12 */
  936. #define CMXSCR_TS2CS_CLK3 0x00060000 /* SCC2 Tx Clock Source is CLK3 */
  937. #define CMXSCR_TS2CS_CLK4 0x00070000 /* SCC2 Tx Clock Source is CLK4 */
  938. #define CMXSCR_RS3CS_BRG1 0x00000000 /* SCC3 Rx Clock Source is BRG1 */
  939. #define CMXSCR_RS3CS_BRG2 0x00000800 /* SCC3 Rx Clock Source is BRG2 */
  940. #define CMXSCR_RS3CS_BRG3 0x00001000 /* SCC3 Rx Clock Source is BRG3 */
  941. #define CMXSCR_RS3CS_BRG4 0x00001800 /* SCC3 Rx Clock Source is BRG4 */
  942. #define CMXSCR_RS3CS_CLK5 0x00002000 /* SCC3 Rx Clock Source is CLK5 */
  943. #define CMXSCR_RS3CS_CLK6 0x00002800 /* SCC3 Rx Clock Source is CLK6 */
  944. #define CMXSCR_RS3CS_CLK7 0x00003000 /* SCC3 Rx Clock Source is CLK7 */
  945. #define CMXSCR_RS3CS_CLK8 0x00003800 /* SCC3 Rx Clock Source is CLK8 */
  946. #define CMXSCR_TS3CS_BRG1 0x00000000 /* SCC3 Tx Clock Source is BRG1 */
  947. #define CMXSCR_TS3CS_BRG2 0x00000100 /* SCC3 Tx Clock Source is BRG2 */
  948. #define CMXSCR_TS3CS_BRG3 0x00000200 /* SCC3 Tx Clock Source is BRG3 */
  949. #define CMXSCR_TS3CS_BRG4 0x00000300 /* SCC3 Tx Clock Source is BRG4 */
  950. #define CMXSCR_TS3CS_CLK5 0x00000400 /* SCC3 Tx Clock Source is CLK5 */
  951. #define CMXSCR_TS3CS_CLK6 0x00000500 /* SCC3 Tx Clock Source is CLK6 */
  952. #define CMXSCR_TS3CS_CLK7 0x00000600 /* SCC3 Tx Clock Source is CLK7 */
  953. #define CMXSCR_TS3CS_CLK8 0x00000700 /* SCC3 Tx Clock Source is CLK8 */
  954. #define CMXSCR_RS4CS_BRG1 0x00000000 /* SCC4 Rx Clock Source is BRG1 */
  955. #define CMXSCR_RS4CS_BRG2 0x00000008 /* SCC4 Rx Clock Source is BRG2 */
  956. #define CMXSCR_RS4CS_BRG3 0x00000010 /* SCC4 Rx Clock Source is BRG3 */
  957. #define CMXSCR_RS4CS_BRG4 0x00000018 /* SCC4 Rx Clock Source is BRG4 */
  958. #define CMXSCR_RS4CS_CLK5 0x00000020 /* SCC4 Rx Clock Source is CLK5 */
  959. #define CMXSCR_RS4CS_CLK6 0x00000028 /* SCC4 Rx Clock Source is CLK6 */
  960. #define CMXSCR_RS4CS_CLK7 0x00000030 /* SCC4 Rx Clock Source is CLK7 */
  961. #define CMXSCR_RS4CS_CLK8 0x00000038 /* SCC4 Rx Clock Source is CLK8 */
  962. #define CMXSCR_TS4CS_BRG1 0x00000000 /* SCC4 Tx Clock Source is BRG1 */
  963. #define CMXSCR_TS4CS_BRG2 0x00000001 /* SCC4 Tx Clock Source is BRG2 */
  964. #define CMXSCR_TS4CS_BRG3 0x00000002 /* SCC4 Tx Clock Source is BRG3 */
  965. #define CMXSCR_TS4CS_BRG4 0x00000003 /* SCC4 Tx Clock Source is BRG4 */
  966. #define CMXSCR_TS4CS_CLK5 0x00000004 /* SCC4 Tx Clock Source is CLK5 */
  967. #define CMXSCR_TS4CS_CLK6 0x00000005 /* SCC4 Tx Clock Source is CLK6 */
  968. #define CMXSCR_TS4CS_CLK7 0x00000006 /* SCC4 Tx Clock Source is CLK7 */
  969. #define CMXSCR_TS4CS_CLK8 0x00000007 /* SCC4 Tx Clock Source is CLK8 */
  970. /*-----------------------------------------------------------------------
  971. * SIUMCR - SIU Module Configuration Register 4-31
  972. */
  973. #define SIUMCR_BBD 0x80000000 /* Bus Busy Disable */
  974. #define SIUMCR_ESE 0x40000000 /* External Snoop Enable */
  975. #define SIUMCR_PBSE 0x20000000 /* Parity Byte Select Enable */
  976. #define SIUMCR_CDIS 0x10000000 /* Core Disable */
  977. #define SIUMCR_DPPC00 0x00000000 /* Data Parity Pins Configuration*/
  978. #define SIUMCR_DPPC01 0x04000000 /* - " - */
  979. #define SIUMCR_DPPC10 0x08000000 /* - " - */
  980. #define SIUMCR_DPPC11 0x0c000000 /* - " - */
  981. #define SIUMCR_L2CPC00 0x00000000 /* L2 Cache Pins Configuration */
  982. #define SIUMCR_L2CPC01 0x01000000 /* - " - */
  983. #define SIUMCR_L2CPC10 0x02000000 /* - " - */
  984. #define SIUMCR_L2CPC11 0x03000000 /* - " - */
  985. #define SIUMCR_LBPC00 0x00000000 /* Local Bus Pins Configuration */
  986. #define SIUMCR_LBPC01 0x00400000 /* - " - */
  987. #define SIUMCR_LBPC10 0x00800000 /* - " - */
  988. #define SIUMCR_LBPC11 0x00c00000 /* - " - */
  989. #define SIUMCR_APPC00 0x00000000 /* Address Parity Pins Configuration*/
  990. #define SIUMCR_APPC01 0x00100000 /* - " - */
  991. #define SIUMCR_APPC10 0x00200000 /* - " - */
  992. #define SIUMCR_APPC11 0x00300000 /* - " - */
  993. #define SIUMCR_CS10PC00 0x00000000 /* CS10 Pin Configuration */
  994. #define SIUMCR_CS10PC01 0x00040000 /* - " - */
  995. #define SIUMCR_CS10PC10 0x00080000 /* - " - */
  996. #define SIUMCR_CS10PC11 0x000c0000 /* - " - */
  997. #define SIUMCR_BCTLC00 0x00000000 /* Buffer Control Configuration */
  998. #define SIUMCR_BCTLC01 0x00010000 /* - " - */
  999. #define SIUMCR_BCTLC10 0x00020000 /* - " - */
  1000. #define SIUMCR_BCTLC11 0x00030000 /* - " - */
  1001. #define SIUMCR_MMR00 0x00000000 /* Mask Masters Requests */
  1002. #define SIUMCR_MMR01 0x00004000 /* - " - */
  1003. #define SIUMCR_MMR10 0x00008000 /* - " - */
  1004. #define SIUMCR_MMR11 0x0000c000 /* - " - */
  1005. #define SIUMCR_LPBSE 0x00002000 /* LocalBus Parity Byte Select Enable*/
  1006. /*-----------------------------------------------------------------------
  1007. * SCCR - System Clock Control Register 9-8
  1008. */
  1009. #define SCCR_PCI_MODE 0x00000100 /* PCI Mode */
  1010. #define SCCR_PCI_MODCK 0x00000080 /* Value of PCI_MODCK pin */
  1011. #define SCCR_PCIDF_MSK 0x00000078 /* PCI division factor */
  1012. #define SCCR_PCIDF_SHIFT 3
  1013. #ifndef CPM_IMMR_OFFSET
  1014. #define CPM_IMMR_OFFSET 0x101a8
  1015. #endif
  1016. #define FCC_PSMR_RMII ((uint)0x00020000) /* Use RMII interface */
  1017. #endif /* __CPM2__ */
  1018. #endif /* __KERNEL__ */