commproc.h 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733
  1. /*
  2. * MPC8xx Communication Processor Module.
  3. * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
  4. *
  5. * This file contains structures and information for the communication
  6. * processor channels. Some CPM control and status is available
  7. * throught the MPC8xx internal memory map. See immap.h for details.
  8. * This file only contains what I need for the moment, not the total
  9. * CPM capabilities. I (or someone else) will add definitions as they
  10. * are needed. -- Dan
  11. *
  12. * On the MBX board, EPPC-Bug loads CPM microcode into the first 512
  13. * bytes of the DP RAM and relocates the I2C parameter area to the
  14. * IDMA1 space. The remaining DP RAM is available for buffer descriptors
  15. * or other use.
  16. */
  17. #ifndef __CPM_8XX__
  18. #define __CPM_8XX__
  19. #include <linux/config.h>
  20. #include <asm/8xx_immap.h>
  21. /* CPM Command register.
  22. */
  23. #define CPM_CR_RST ((ushort)0x8000)
  24. #define CPM_CR_OPCODE ((ushort)0x0f00)
  25. #define CPM_CR_CHAN ((ushort)0x00f0)
  26. #define CPM_CR_FLG ((ushort)0x0001)
  27. /* Some commands (there are more...later)
  28. */
  29. #define CPM_CR_INIT_TRX ((ushort)0x0000)
  30. #define CPM_CR_INIT_RX ((ushort)0x0001)
  31. #define CPM_CR_INIT_TX ((ushort)0x0002)
  32. #define CPM_CR_HUNT_MODE ((ushort)0x0003)
  33. #define CPM_CR_STOP_TX ((ushort)0x0004)
  34. #define CPM_CR_RESTART_TX ((ushort)0x0006)
  35. #define CPM_CR_SET_GADDR ((ushort)0x0008)
  36. /* Channel numbers.
  37. */
  38. #define CPM_CR_CH_SCC1 ((ushort)0x0000)
  39. #define CPM_CR_CH_I2C ((ushort)0x0001) /* I2C and IDMA1 */
  40. #define CPM_CR_CH_SCC2 ((ushort)0x0004)
  41. #define CPM_CR_CH_SPI ((ushort)0x0005) /* SPI/IDMA2/Timers */
  42. #define CPM_CR_CH_SCC3 ((ushort)0x0008)
  43. #define CPM_CR_CH_SMC1 ((ushort)0x0009) /* SMC1 / DSP1 */
  44. #define CPM_CR_CH_SCC4 ((ushort)0x000c)
  45. #define CPM_CR_CH_SMC2 ((ushort)0x000d) /* SMC2 / DSP2 */
  46. #define mk_cr_cmd(CH, CMD) ((CMD << 8) | (CH << 4))
  47. /*
  48. * DPRAM defines and allocation functions
  49. */
  50. /* The dual ported RAM is multi-functional. Some areas can be (and are
  51. * being) used for microcode. There is an area that can only be used
  52. * as data ram for buffer descriptors, which is all we use right now.
  53. * Currently the first 512 and last 256 bytes are used for microcode.
  54. */
  55. #ifdef CFG_ALLOC_DPRAM
  56. #define CPM_DATAONLY_BASE ((uint)0x0800)
  57. #define CPM_DATAONLY_SIZE ((uint)0x0700)
  58. #define CPM_DP_NOSPACE ((uint)0x7fffffff)
  59. #else
  60. #define CPM_SERIAL_BASE 0x0800
  61. #define CPM_I2C_BASE 0x0820
  62. #define CPM_SPI_BASE 0x0840
  63. #define CPM_FEC_BASE 0x0860
  64. #define CPM_WLKBD_BASE 0x0880
  65. #define CPM_SCC_BASE 0x0900
  66. #define CPM_POST_BASE 0x0980
  67. #endif
  68. #ifndef CFG_CPM_POST_WORD_ADDR
  69. #define CPM_POST_WORD_ADDR 0x07FC
  70. #else
  71. #define CPM_POST_WORD_ADDR CFG_CPM_POST_WORD_ADDR
  72. #endif
  73. #define BD_IIC_START ((uint) 0x0400) /* <- please use CPM_I2C_BASE !! */
  74. /* Export the base address of the communication processor registers
  75. * and dual port ram.
  76. */
  77. extern cpm8xx_t *cpmp; /* Pointer to comm processor */
  78. /* Buffer descriptors used by many of the CPM protocols.
  79. */
  80. typedef struct cpm_buf_desc {
  81. ushort cbd_sc; /* Status and Control */
  82. ushort cbd_datlen; /* Data length in buffer */
  83. uint cbd_bufaddr; /* Buffer address in host memory */
  84. } cbd_t;
  85. #define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */
  86. #define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
  87. #define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */
  88. #define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
  89. #define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame */
  90. #define BD_SC_TC ((ushort)0x0400) /* Transmit CRC */
  91. #define BD_SC_CM ((ushort)0x0200) /* Continous mode */
  92. #define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */
  93. #define BD_SC_P ((ushort)0x0100) /* xmt preamble */
  94. #define BD_SC_BR ((ushort)0x0020) /* Break received */
  95. #define BD_SC_FR ((ushort)0x0010) /* Framing error */
  96. #define BD_SC_PR ((ushort)0x0008) /* Parity error */
  97. #define BD_SC_OV ((ushort)0x0002) /* Overrun */
  98. #define BD_SC_CD ((ushort)0x0001) /* Carrier Detect lost */
  99. /* Parameter RAM offsets.
  100. */
  101. #define PROFF_SCC1 ((uint)0x0000)
  102. #define PROFF_IIC ((uint)0x0080)
  103. #define PROFF_SCC2 ((uint)0x0100)
  104. #define PROFF_SPI ((uint)0x0180)
  105. #define PROFF_SCC3 ((uint)0x0200)
  106. #define PROFF_SMC1 ((uint)0x0280)
  107. #define PROFF_SCC4 ((uint)0x0300)
  108. #define PROFF_SMC2 ((uint)0x0380)
  109. /* Define enough so I can at least use the serial port as a UART.
  110. * The MBX uses SMC1 as the host serial port.
  111. */
  112. typedef struct smc_uart {
  113. ushort smc_rbase; /* Rx Buffer descriptor base address */
  114. ushort smc_tbase; /* Tx Buffer descriptor base address */
  115. u_char smc_rfcr; /* Rx function code */
  116. u_char smc_tfcr; /* Tx function code */
  117. ushort smc_mrblr; /* Max receive buffer length */
  118. uint smc_rstate; /* Internal */
  119. uint smc_idp; /* Internal */
  120. ushort smc_rbptr; /* Internal */
  121. ushort smc_ibc; /* Internal */
  122. uint smc_rxtmp; /* Internal */
  123. uint smc_tstate; /* Internal */
  124. uint smc_tdp; /* Internal */
  125. ushort smc_tbptr; /* Internal */
  126. ushort smc_tbc; /* Internal */
  127. uint smc_txtmp; /* Internal */
  128. ushort smc_maxidl; /* Maximum idle characters */
  129. ushort smc_tmpidl; /* Temporary idle counter */
  130. ushort smc_brklen; /* Last received break length */
  131. ushort smc_brkec; /* rcv'd break condition counter */
  132. ushort smc_brkcr; /* xmt break count register */
  133. ushort smc_rmask; /* Temporary bit mask */
  134. } smc_uart_t;
  135. /* Function code bits.
  136. */
  137. #define SMC_EB ((u_char)0x10) /* Set big endian byte order */
  138. /* SMC uart mode register.
  139. */
  140. #define SMCMR_REN ((ushort)0x0001)
  141. #define SMCMR_TEN ((ushort)0x0002)
  142. #define SMCMR_DM ((ushort)0x000c)
  143. #define SMCMR_SM_GCI ((ushort)0x0000)
  144. #define SMCMR_SM_UART ((ushort)0x0020)
  145. #define SMCMR_SM_TRANS ((ushort)0x0030)
  146. #define SMCMR_SM_MASK ((ushort)0x0030)
  147. #define SMCMR_PM_EVEN ((ushort)0x0100) /* Even parity, else odd */
  148. #define SMCMR_REVD SMCMR_PM_EVEN
  149. #define SMCMR_PEN ((ushort)0x0200) /* Parity enable */
  150. #define SMCMR_BS SMCMR_PEN
  151. #define SMCMR_SL ((ushort)0x0400) /* Two stops, else one */
  152. #define SMCR_CLEN_MASK ((ushort)0x7800) /* Character length */
  153. #define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
  154. /* SMC2 as Centronics parallel printer. It is half duplex, in that
  155. * it can only receive or transmit. The parameter ram values for
  156. * each direction are either unique or properly overlap, so we can
  157. * include them in one structure.
  158. */
  159. typedef struct smc_centronics {
  160. ushort scent_rbase;
  161. ushort scent_tbase;
  162. u_char scent_cfcr;
  163. u_char scent_smask;
  164. ushort scent_mrblr;
  165. uint scent_rstate;
  166. uint scent_r_ptr;
  167. ushort scent_rbptr;
  168. ushort scent_r_cnt;
  169. uint scent_rtemp;
  170. uint scent_tstate;
  171. uint scent_t_ptr;
  172. ushort scent_tbptr;
  173. ushort scent_t_cnt;
  174. uint scent_ttemp;
  175. ushort scent_max_sl;
  176. ushort scent_sl_cnt;
  177. ushort scent_character1;
  178. ushort scent_character2;
  179. ushort scent_character3;
  180. ushort scent_character4;
  181. ushort scent_character5;
  182. ushort scent_character6;
  183. ushort scent_character7;
  184. ushort scent_character8;
  185. ushort scent_rccm;
  186. ushort scent_rccr;
  187. } smc_cent_t;
  188. /* Centronics Status Mask Register.
  189. */
  190. #define SMC_CENT_F ((u_char)0x08)
  191. #define SMC_CENT_PE ((u_char)0x04)
  192. #define SMC_CENT_S ((u_char)0x02)
  193. /* SMC Event and Mask register.
  194. */
  195. #define SMCM_BRKE ((unsigned char)0x40) /* When in UART Mode */
  196. #define SMCM_BRK ((unsigned char)0x10) /* When in UART Mode */
  197. #define SMCM_TXE ((unsigned char)0x10) /* When in Transparent Mode */
  198. #define SMCM_BSY ((unsigned char)0x04)
  199. #define SMCM_TX ((unsigned char)0x02)
  200. #define SMCM_RX ((unsigned char)0x01)
  201. /* Baud rate generators.
  202. */
  203. #define CPM_BRG_RST ((uint)0x00020000)
  204. #define CPM_BRG_EN ((uint)0x00010000)
  205. #define CPM_BRG_EXTC_INT ((uint)0x00000000)
  206. #define CPM_BRG_EXTC_CLK2 ((uint)0x00004000)
  207. #define CPM_BRG_EXTC_CLK6 ((uint)0x00008000)
  208. #define CPM_BRG_ATB ((uint)0x00002000)
  209. #define CPM_BRG_CD_MASK ((uint)0x00001ffe)
  210. #define CPM_BRG_DIV16 ((uint)0x00000001)
  211. /* SI Clock Route Register
  212. */
  213. #define SICR_RCLK_SCC1_BRG1 ((uint)0x00000000)
  214. #define SICR_TCLK_SCC1_BRG1 ((uint)0x00000000)
  215. #define SICR_RCLK_SCC2_BRG2 ((uint)0x00000800)
  216. #define SICR_TCLK_SCC2_BRG2 ((uint)0x00000100)
  217. #define SICR_RCLK_SCC3_BRG3 ((uint)0x00100000)
  218. #define SICR_TCLK_SCC3_BRG3 ((uint)0x00020000)
  219. #define SICR_RCLK_SCC4_BRG4 ((uint)0x18000000)
  220. #define SICR_TCLK_SCC4_BRG4 ((uint)0x03000000)
  221. /* SCCs.
  222. */
  223. #define SCC_GSMRH_IRP ((uint)0x00040000)
  224. #define SCC_GSMRH_GDE ((uint)0x00010000)
  225. #define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
  226. #define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
  227. #define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
  228. #define SCC_GSMRH_REVD ((uint)0x00002000)
  229. #define SCC_GSMRH_TRX ((uint)0x00001000)
  230. #define SCC_GSMRH_TTX ((uint)0x00000800)
  231. #define SCC_GSMRH_CDP ((uint)0x00000400)
  232. #define SCC_GSMRH_CTSP ((uint)0x00000200)
  233. #define SCC_GSMRH_CDS ((uint)0x00000100)
  234. #define SCC_GSMRH_CTSS ((uint)0x00000080)
  235. #define SCC_GSMRH_TFL ((uint)0x00000040)
  236. #define SCC_GSMRH_RFW ((uint)0x00000020)
  237. #define SCC_GSMRH_TXSY ((uint)0x00000010)
  238. #define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
  239. #define SCC_GSMRH_SYNL8 ((uint)0x00000008)
  240. #define SCC_GSMRH_SYNL4 ((uint)0x00000004)
  241. #define SCC_GSMRH_RTSM ((uint)0x00000002)
  242. #define SCC_GSMRH_RSYN ((uint)0x00000001)
  243. #define SCC_GSMRL_SIR ((uint)0x80000000) /* SCC2 only */
  244. #define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
  245. #define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
  246. #define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
  247. #define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
  248. #define SCC_GSMRL_TCI ((uint)0x10000000)
  249. #define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
  250. #define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
  251. #define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
  252. #define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
  253. #define SCC_GSMRL_RINV ((uint)0x02000000)
  254. #define SCC_GSMRL_TINV ((uint)0x01000000)
  255. #define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
  256. #define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
  257. #define SCC_GSMRL_TPL_48 ((uint)0x00800000)
  258. #define SCC_GSMRL_TPL_32 ((uint)0x00600000)
  259. #define SCC_GSMRL_TPL_16 ((uint)0x00400000)
  260. #define SCC_GSMRL_TPL_8 ((uint)0x00200000)
  261. #define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
  262. #define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
  263. #define SCC_GSMRL_TPP_01 ((uint)0x00100000)
  264. #define SCC_GSMRL_TPP_10 ((uint)0x00080000)
  265. #define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
  266. #define SCC_GSMRL_TEND ((uint)0x00040000)
  267. #define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
  268. #define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
  269. #define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
  270. #define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
  271. #define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
  272. #define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
  273. #define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
  274. #define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
  275. #define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
  276. #define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
  277. #define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
  278. #define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
  279. #define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
  280. #define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
  281. #define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
  282. #define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
  283. #define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
  284. #define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
  285. #define SCC_GSMRL_DIAG_LE ((uint)0x000000c0) /* Loop and echo */
  286. #define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
  287. #define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
  288. #define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
  289. #define SCC_GSMRL_ENR ((uint)0x00000020)
  290. #define SCC_GSMRL_ENT ((uint)0x00000010)
  291. #define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
  292. #define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
  293. #define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
  294. #define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
  295. #define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
  296. #define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
  297. #define SCC_GSMRL_MODE_UART ((uint)0x00000004)
  298. #define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
  299. #define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
  300. #define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
  301. #define SCC_TODR_TOD ((ushort)0x8000)
  302. /* SCC Event and Mask register.
  303. */
  304. #define SCCM_TXE ((unsigned char)0x10)
  305. #define SCCM_BSY ((unsigned char)0x04)
  306. #define SCCM_TX ((unsigned char)0x02)
  307. #define SCCM_RX ((unsigned char)0x01)
  308. typedef struct scc_param {
  309. ushort scc_rbase; /* Rx Buffer descriptor base address */
  310. ushort scc_tbase; /* Tx Buffer descriptor base address */
  311. u_char scc_rfcr; /* Rx function code */
  312. u_char scc_tfcr; /* Tx function code */
  313. ushort scc_mrblr; /* Max receive buffer length */
  314. uint scc_rstate; /* Internal */
  315. uint scc_idp; /* Internal */
  316. ushort scc_rbptr; /* Internal */
  317. ushort scc_ibc; /* Internal */
  318. uint scc_rxtmp; /* Internal */
  319. uint scc_tstate; /* Internal */
  320. uint scc_tdp; /* Internal */
  321. ushort scc_tbptr; /* Internal */
  322. ushort scc_tbc; /* Internal */
  323. uint scc_txtmp; /* Internal */
  324. uint scc_rcrc; /* Internal */
  325. uint scc_tcrc; /* Internal */
  326. } sccp_t;
  327. /* Function code bits.
  328. */
  329. #define SCC_EB ((u_char)0x10) /* Set big endian byte order */
  330. /* CPM Ethernet through SCCx.
  331. */
  332. typedef struct scc_enet {
  333. sccp_t sen_genscc;
  334. uint sen_cpres; /* Preset CRC */
  335. uint sen_cmask; /* Constant mask for CRC */
  336. uint sen_crcec; /* CRC Error counter */
  337. uint sen_alec; /* alignment error counter */
  338. uint sen_disfc; /* discard frame counter */
  339. ushort sen_pads; /* Tx short frame pad character */
  340. ushort sen_retlim; /* Retry limit threshold */
  341. ushort sen_retcnt; /* Retry limit counter */
  342. ushort sen_maxflr; /* maximum frame length register */
  343. ushort sen_minflr; /* minimum frame length register */
  344. ushort sen_maxd1; /* maximum DMA1 length */
  345. ushort sen_maxd2; /* maximum DMA2 length */
  346. ushort sen_maxd; /* Rx max DMA */
  347. ushort sen_dmacnt; /* Rx DMA counter */
  348. ushort sen_maxb; /* Max BD byte count */
  349. ushort sen_gaddr1; /* Group address filter */
  350. ushort sen_gaddr2;
  351. ushort sen_gaddr3;
  352. ushort sen_gaddr4;
  353. uint sen_tbuf0data0; /* Save area 0 - current frame */
  354. uint sen_tbuf0data1; /* Save area 1 - current frame */
  355. uint sen_tbuf0rba; /* Internal */
  356. uint sen_tbuf0crc; /* Internal */
  357. ushort sen_tbuf0bcnt; /* Internal */
  358. ushort sen_paddrh; /* physical address (MSB) */
  359. ushort sen_paddrm;
  360. ushort sen_paddrl; /* physical address (LSB) */
  361. ushort sen_pper; /* persistence */
  362. ushort sen_rfbdptr; /* Rx first BD pointer */
  363. ushort sen_tfbdptr; /* Tx first BD pointer */
  364. ushort sen_tlbdptr; /* Tx last BD pointer */
  365. uint sen_tbuf1data0; /* Save area 0 - current frame */
  366. uint sen_tbuf1data1; /* Save area 1 - current frame */
  367. uint sen_tbuf1rba; /* Internal */
  368. uint sen_tbuf1crc; /* Internal */
  369. ushort sen_tbuf1bcnt; /* Internal */
  370. ushort sen_txlen; /* Tx Frame length counter */
  371. ushort sen_iaddr1; /* Individual address filter */
  372. ushort sen_iaddr2;
  373. ushort sen_iaddr3;
  374. ushort sen_iaddr4;
  375. ushort sen_boffcnt; /* Backoff counter */
  376. /* NOTE: Some versions of the manual have the following items
  377. * incorrectly documented. Below is the proper order.
  378. */
  379. ushort sen_taddrh; /* temp address (MSB) */
  380. ushort sen_taddrm;
  381. ushort sen_taddrl; /* temp address (LSB) */
  382. } scc_enet_t;
  383. /**********************************************************************
  384. *
  385. * Board specific configuration settings.
  386. *
  387. * Please note that we use the presence of a #define SCC_ENET and/or
  388. * #define FEC_ENET to enable the SCC resp. FEC ethernet drivers.
  389. **********************************************************************/
  390. /*** ADS *************************************************************/
  391. #if defined(CONFIG_MPC860) && defined(CONFIG_ADS)
  392. /* This ENET stuff is for the MPC860ADS with ethernet on SCC1.
  393. */
  394. #define PROFF_ENET PROFF_SCC1
  395. #define CPM_CR_ENET CPM_CR_CH_SCC1
  396. #define SCC_ENET 0
  397. #define PA_ENET_RXD ((ushort)0x0001)
  398. #define PA_ENET_TXD ((ushort)0x0002)
  399. #define PA_ENET_TCLK ((ushort)0x0100)
  400. #define PA_ENET_RCLK ((ushort)0x0200)
  401. #define PB_ENET_TENA ((uint)0x00001000)
  402. #define PC_ENET_CLSN ((ushort)0x0010)
  403. #define PC_ENET_RENA ((ushort)0x0020)
  404. #define SICR_ENET_MASK ((uint)0x000000ff)
  405. #define SICR_ENET_CLKRT ((uint)0x0000002c)
  406. /* 68160 PHY control */
  407. #define PC_ENET_ETHLOOP ((ushort)0x0800)
  408. #define PC_ENET_TPFLDL ((ushort)0x0400)
  409. #define PC_ENET_TPSQEL ((ushort)0x0200)
  410. #endif /* MPC860ADS */
  411. /*** AMX860 **********************************************/
  412. #if defined(CONFIG_AMX860)
  413. /* This ENET stuff is for the AMX860 with ethernet on SCC1.
  414. */
  415. #define PROFF_ENET PROFF_SCC1
  416. #define CPM_CR_ENET CPM_CR_CH_SCC1
  417. #define SCC_ENET 0
  418. #define PA_ENET_RXD ((ushort)0x0001)
  419. #define PA_ENET_TXD ((ushort)0x0002)
  420. #define PA_ENET_TCLK ((ushort)0x0400)
  421. #define PA_ENET_RCLK ((ushort)0x0800)
  422. #define PB_ENET_TENA ((uint)0x00001000)
  423. #define PC_ENET_CLSN ((ushort)0x0010)
  424. #define PC_ENET_RENA ((ushort)0x0020)
  425. #define SICR_ENET_MASK ((uint)0x000000ff)
  426. #define SICR_ENET_CLKRT ((uint)0x0000003e)
  427. /* 68160 PHY control */
  428. #define PB_ENET_ETHLOOP ((uint)0x00020000)
  429. #define PB_ENET_TPFLDL ((uint)0x00010000)
  430. #define PB_ENET_TPSQEL ((uint)0x00008000)
  431. #define PD_ENET_ETH_EN ((ushort)0x0004)
  432. #endif /* CONFIG_AMX860 */
  433. /*** BSEIP **********************************************************/
  434. #ifdef CONFIG_BSEIP
  435. /* This ENET stuff is for the MPC823 with ethernet on SCC2.
  436. * This is unique to the BSE ip-Engine board.
  437. */
  438. #define PROFF_ENET PROFF_SCC2
  439. #define CPM_CR_ENET CPM_CR_CH_SCC2
  440. #define SCC_ENET 1
  441. #define PA_ENET_RXD ((ushort)0x0004)
  442. #define PA_ENET_TXD ((ushort)0x0008)
  443. #define PA_ENET_TCLK ((ushort)0x0100)
  444. #define PA_ENET_RCLK ((ushort)0x0200)
  445. #define PB_ENET_TENA ((uint)0x00002000)
  446. #define PC_ENET_CLSN ((ushort)0x0040)
  447. #define PC_ENET_RENA ((ushort)0x0080)
  448. /* BSE uses port B and C bits for PHY control also.
  449. */
  450. #define PB_BSE_POWERUP ((uint)0x00000004)
  451. #define PB_BSE_FDXDIS ((uint)0x00008000)
  452. #define PC_BSE_LOOPBACK ((ushort)0x0800)
  453. #define SICR_ENET_MASK ((uint)0x0000ff00)
  454. #define SICR_ENET_CLKRT ((uint)0x00002c00)
  455. #endif /* CONFIG_BSEIP */
  456. /*** BSEIP **********************************************************/
  457. #ifdef CONFIG_FLAGADM
  458. /* Enet configuration for the FLAGADM */
  459. /* Enet on SCC2 */
  460. #define PROFF_ENET PROFF_SCC2
  461. #define CPM_CR_ENET CPM_CR_CH_SCC2
  462. #define SCC_ENET 1
  463. #define PA_ENET_RXD ((ushort)0x0004)
  464. #define PA_ENET_TXD ((ushort)0x0008)
  465. #define PA_ENET_TCLK ((ushort)0x0100)
  466. #define PA_ENET_RCLK ((ushort)0x0400)
  467. #define PB_ENET_TENA ((uint)0x00002000)
  468. #define PC_ENET_CLSN ((ushort)0x0040)
  469. #define PC_ENET_RENA ((ushort)0x0080)
  470. #define SICR_ENET_MASK ((uint)0x0000ff00)
  471. #define SICR_ENET_CLKRT ((uint)0x00003400)
  472. #endif /* CONFIG_FLAGADM */
  473. /*** C2MON **********************************************************/
  474. #ifdef CONFIG_C2MON
  475. # ifndef CONFIG_FEC_ENET /* use SCC for 10Mbps Ethernet */
  476. # error "Ethernet on SCC not supported on C2MON Board!"
  477. # else /* Use FEC for Fast Ethernet */
  478. #undef SCC_ENET
  479. #define FEC_ENET
  480. #define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */
  481. #define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */
  482. #define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */
  483. #define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */
  484. #define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */
  485. #define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */
  486. #define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */
  487. #define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */
  488. #define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */
  489. #define PD_MII_MDC ((ushort)0x0008) /* PD 12 */
  490. #define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */
  491. #define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */
  492. #define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */
  493. #define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */
  494. # endif /* CONFIG_FEC_ENET */
  495. #endif /* CONFIG_C2MON */
  496. /*********************************************************************/
  497. /*** CCM and PCU E ***********************************************/
  498. /* The PCU E and CCM use the FEC on a MPC860T for Ethernet */
  499. #if defined (CONFIG_PCU_E) || defined(CONFIG_CCM)
  500. #define FEC_ENET /* use FEC for EThernet */
  501. #undef SCC_ENET
  502. #define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */
  503. #define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */
  504. #define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */
  505. #define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */
  506. #define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */
  507. #define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */
  508. #define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */
  509. #define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */
  510. #define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */
  511. #define PD_MII_MDC ((ushort)0x0008) /* PD 12 */
  512. #define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */
  513. #define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */
  514. #define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */
  515. #define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */
  516. #endif /* CONFIG_PCU_E, CONFIG_CCM */
  517. /*** ELPT860 *********************************************************/
  518. #ifdef CONFIG_ELPT860
  519. /* Bits in parallel I/O port registers that have to be set/cleared
  520. * to configure the pins for SCC1 use.
  521. */
  522. # define PROFF_ENET PROFF_SCC1
  523. # define CPM_CR_ENET CPM_CR_CH_SCC1
  524. # define SCC_ENET 0
  525. # define PA_ENET_RXD ((ushort)0x0001) /* PA 15 */
  526. # define PA_ENET_TXD ((ushort)0x0002) /* PA 14 */
  527. # define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
  528. # define PA_ENET_TCLK ((ushort)0x0200) /* PA 6 */
  529. # define PC_ENET_TENA ((ushort)0x0001) /* PC 15 */
  530. # define PC_ENET_CLSN ((ushort)0x0010) /* PC 11 */
  531. # define PC_ENET_RENA ((ushort)0x0020) /* PC 10 */
  532. /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK1) to
  533. * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
  534. */
  535. # define SICR_ENET_MASK ((uint)0x000000FF)
  536. # define SICR_ENET_CLKRT ((uint)0x00000025)
  537. #endif /* CONFIG_ELPT860 */
  538. /*** ESTEEM 192E **************************************************/
  539. #ifdef CONFIG_ESTEEM192E
  540. /* ESTEEM192E
  541. * This ENET stuff is for the MPC850 with ethernet on SCC2. This
  542. * is very similar to the RPX-Lite configuration.
  543. * Note TENA , LOOPBACK , FDPLEX_DIS on Port B.
  544. */
  545. #define PROFF_ENET PROFF_SCC2
  546. #define CPM_CR_ENET CPM_CR_CH_SCC2
  547. #define SCC_ENET 1
  548. #define PA_ENET_RXD ((ushort)0x0004)
  549. #define PA_ENET_TXD ((ushort)0x0008)
  550. #define PA_ENET_TCLK ((ushort)0x0200)
  551. #define PA_ENET_RCLK ((ushort)0x0800)
  552. #define PB_ENET_TENA ((uint)0x00002000)
  553. #define PC_ENET_CLSN ((ushort)0x0040)
  554. #define PC_ENET_RENA ((ushort)0x0080)
  555. #define SICR_ENET_MASK ((uint)0x0000ff00)
  556. #define SICR_ENET_CLKRT ((uint)0x00003d00)
  557. #define PB_ENET_LOOPBACK ((uint)0x00004000)
  558. #define PB_ENET_FDPLEX_DIS ((uint)0x00008000)
  559. #endif
  560. /*** FADS823 ********************************************************/
  561. #if defined(CONFIG_MPC823FADS) && defined(CONFIG_FADS)
  562. /* This ENET stuff is for the MPC823FADS with ethernet on SCC2.
  563. */
  564. #ifdef CONFIG_SCC2_ENET
  565. #define PROFF_ENET PROFF_SCC2
  566. #define CPM_CR_ENET CPM_CR_CH_SCC2
  567. #define SCC_ENET 1
  568. #define CPMVEC_ENET CPMVEC_SCC2
  569. #endif
  570. #ifdef CONFIG_SCC1_ENET
  571. #define PROFF_ENET PROFF_SCC1
  572. #define CPM_CR_ENET CPM_CR_CH_SCC1
  573. #define SCC_ENET 0
  574. #define CPMVEC_ENET CPMVEC_SCC1
  575. #endif
  576. #define PA_ENET_RXD ((ushort)0x0004)
  577. #define PA_ENET_TXD ((ushort)0x0008)
  578. #define PA_ENET_TCLK ((ushort)0x0400)
  579. #define PA_ENET_RCLK ((ushort)0x0200)
  580. #define PB_ENET_TENA ((uint)0x00002000)
  581. #define PC_ENET_CLSN ((ushort)0x0040)
  582. #define PC_ENET_RENA ((ushort)0x0080)
  583. #define SICR_ENET_MASK ((uint)0x0000ff00)
  584. #define SICR_ENET_CLKRT ((uint)0x00002e00)
  585. #endif /* CONFIG_FADS823FADS */
  586. /*** FADS850SAR ********************************************************/
  587. #if defined(CONFIG_MPC850SAR) && defined(CONFIG_FADS)
  588. /* This ENET stuff is for the MPC850SAR with ethernet on SCC2. Some of
  589. * this may be unique to the FADS850SAR configuration.
  590. * Note TENA is on Port B.
  591. */
  592. #define PROFF_ENET PROFF_SCC2
  593. #define CPM_CR_ENET CPM_CR_CH_SCC2
  594. #define SCC_ENET 1
  595. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  596. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  597. #define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */
  598. #define PA_ENET_TCLK ((ushort)0x0800) /* PA 4 */
  599. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  600. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  601. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  602. #define SICR_ENET_MASK ((uint)0x0000ff00)
  603. #define SICR_ENET_CLKRT ((uint)0x00002f00) /* RCLK-CLK2, TCLK-CLK4 */
  604. #endif /* CONFIG_FADS850SAR */
  605. /*** FADS860T********************************************************/
  606. #if defined(CONFIG_MPC860T) && defined(CONFIG_FADS)
  607. /* This ENET stuff is for the MPC860TFADS with ethernet on SCC1.
  608. */
  609. #ifdef CONFIG_SCC1_ENET
  610. #define SCC_ENET 0
  611. #endif /* CONFIG_SCC1_ETHERNET */
  612. #define PROFF_ENET PROFF_SCC1
  613. #define CPM_CR_ENET CPM_CR_CH_SCC1
  614. #define PA_ENET_RXD ((ushort)0x0001)
  615. #define PA_ENET_TXD ((ushort)0x0002)
  616. #define PA_ENET_TCLK ((ushort)0x0100)
  617. #define PA_ENET_RCLK ((ushort)0x0200)
  618. #define PB_ENET_TENA ((uint)0x00001000)
  619. #define PC_ENET_CLSN ((ushort)0x0010)
  620. #define PC_ENET_RENA ((ushort)0x0020)
  621. #define SICR_ENET_MASK ((uint)0x000000ff)
  622. #define SICR_ENET_CLKRT ((uint)0x0000002c)
  623. /* This ENET stuff is for the MPC860TFADS with ethernet on FEC.
  624. */
  625. #ifdef CONFIG_FEC_ENET
  626. #define FEC_ENET /* use FEC for EThernet */
  627. #endif /* CONFIG_FEC_ETHERNET */
  628. #endif /* CONFIG_FADS860T */
  629. /*** FPS850L, FPS860L ************************************************/
  630. #if defined(CONFIG_FPS850L) || defined(CONFIG_FPS860L)
  631. /* Bits in parallel I/O port registers that have to be set/cleared
  632. * to configure the pins for SCC2 use.
  633. */
  634. #define PROFF_ENET PROFF_SCC2
  635. #define CPM_CR_ENET CPM_CR_CH_SCC2
  636. #define SCC_ENET 1
  637. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  638. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  639. #define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
  640. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  641. #define PC_ENET_TENA ((ushort)0x0002) /* PC 14 */
  642. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  643. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  644. /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
  645. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  646. */
  647. #define SICR_ENET_MASK ((uint)0x0000ff00)
  648. #define SICR_ENET_CLKRT ((uint)0x00002600)
  649. #endif /* CONFIG_FPS850L, CONFIG_FPS860L */
  650. /*** GEN860T **********************************************************/
  651. #if defined(CONFIG_GEN860T)
  652. #undef SCC_ENET
  653. #define FEC_ENET
  654. #define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */
  655. #define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */
  656. #define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */
  657. #define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */
  658. #define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */
  659. #define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */
  660. #define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */
  661. #define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */
  662. #define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */
  663. #define PD_MII_MDC ((ushort)0x0008) /* PD 12 */
  664. #define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */
  665. #define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */
  666. #define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */
  667. #define PD_MII_MASK ((ushort)0x1FFF) /* PD 3-15 */
  668. #endif /* CONFIG_GEN860T */
  669. /*** GENIETV ********************************************************/
  670. #if defined(CONFIG_GENIETV)
  671. /* Ethernet is only on SCC2 */
  672. #define CONFIG_SCC2_ENET
  673. #define PROFF_ENET PROFF_SCC2
  674. #define CPM_CR_ENET CPM_CR_CH_SCC2
  675. #define SCC_ENET 1
  676. #define CPMVEC_ENET CPMVEC_SCC2
  677. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  678. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  679. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  680. #define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */
  681. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  682. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  683. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  684. #define SICR_ENET_MASK ((uint)0x0000ff00)
  685. #define SICR_ENET_CLKRT ((uint)0x00002e00)
  686. #endif /* CONFIG_GENIETV */
  687. /*** GTH ******************************************************/
  688. #ifdef CONFIG_GTH
  689. #ifdef CONFIG_FEC_ENET
  690. #define FEC_ENET /* use FEC for EThernet */
  691. #endif /* CONFIG_FEC_ETHERNET */
  692. /* This ENET stuff is for GTH 10 Mbit ( SCC ) */
  693. #define PROFF_ENET PROFF_SCC1
  694. #define CPM_CR_ENET CPM_CR_CH_SCC1
  695. #define SCC_ENET 0
  696. #define PA_ENET_RXD ((ushort)0x0001) /* PA15 */
  697. #define PA_ENET_TXD ((ushort)0x0002) /* PA14 */
  698. #define PA_ENET_TCLK ((ushort)0x0800) /* PA4 */
  699. #define PA_ENET_RCLK ((ushort)0x0400) /* PA5 */
  700. #define PB_ENET_TENA ((uint)0x00001000) /* PB19 */
  701. #define PC_ENET_CLSN ((ushort)0x0010) /* PC11 */
  702. #define PC_ENET_RENA ((ushort)0x0020) /* PC10 */
  703. /* NOTE. This is reset for 10Mbit port only */
  704. #define PC_ENET_RESET ((ushort)0x0100) /* PC 7 */
  705. #define SICR_ENET_MASK ((uint)0x000000ff)
  706. /* TCLK PA4 -->CLK4, RCLK PA5 -->CLK3 */
  707. #define SICR_ENET_CLKRT ((uint)0x00000037)
  708. #endif /* CONFIG_GTH */
  709. /*** HERMES-PRO ******************************************************/
  710. /* The HERMES-PRO uses the FEC on a MPC860T for Ethernet */
  711. #ifdef CONFIG_HERMES
  712. #define FEC_ENET /* use FEC for EThernet */
  713. #undef SCC_ENET
  714. #define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */
  715. #define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */
  716. #define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */
  717. #define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */
  718. #define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */
  719. #define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */
  720. #define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */
  721. #define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */
  722. #define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */
  723. #define PD_MII_MDC ((ushort)0x0008) /* PD 12 */
  724. #define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */
  725. #define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */
  726. #define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */
  727. #define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */
  728. #endif /* CONFIG_HERMES */
  729. /*** IAD210 **********************************************************/
  730. /* The IAD210 uses the FEC on a MPC860P for Ethernet */
  731. #if defined(CONFIG_IAD210)
  732. # define FEC_ENET /* use FEC for Ethernet */
  733. # undef SCC_ENET
  734. # define PD_MII_TXD1 ((ushort) 0x1000 ) /* PD 3 */
  735. # define PD_MII_TXD2 ((ushort) 0x0800 ) /* PD 4 */
  736. # define PD_MII_TXD3 ((ushort) 0x0400 ) /* PD 5 */
  737. # define PD_MII_RX_DV ((ushort) 0x0200 ) /* PD 6 */
  738. # define PD_MII_RX_ERR ((ushort) 0x0100 ) /* PD 7 */
  739. # define PD_MII_RX_CLK ((ushort) 0x0080 ) /* PD 8 */
  740. # define PD_MII_TXD0 ((ushort) 0x0040 ) /* PD 9 */
  741. # define PD_MII_RXD0 ((ushort) 0x0020 ) /* PD 10 */
  742. # define PD_MII_TX_ERR ((ushort) 0x0010 ) /* PD 11 */
  743. # define PD_MII_MDC ((ushort) 0x0008 ) /* PD 12 */
  744. # define PD_MII_RXD1 ((ushort) 0x0004 ) /* PD 13 */
  745. # define PD_MII_RXD2 ((ushort) 0x0002 ) /* PD 14 */
  746. # define PD_MII_RXD3 ((ushort) 0x0001 ) /* PD 15 */
  747. # define PD_MII_MASK ((ushort) 0x1FFF ) /* PD 3...15 */
  748. #endif /* CONFIG_IAD210 */
  749. /*** ICU862 **********************************************************/
  750. #if defined(CONFIG_ICU862)
  751. #ifdef CONFIG_FEC_ENET
  752. #define FEC_ENET /* use FEC for EThernet */
  753. #endif /* CONFIG_FEC_ETHERNET */
  754. #endif /* CONFIG_ICU862 */
  755. /*** IP860 **********************************************************/
  756. #if defined(CONFIG_IP860)
  757. /* Bits in parallel I/O port registers that have to be set/cleared
  758. * to configure the pins for SCC1 use.
  759. */
  760. #define PROFF_ENET PROFF_SCC1
  761. #define CPM_CR_ENET CPM_CR_CH_SCC1
  762. #define SCC_ENET 0
  763. #define PA_ENET_RXD ((ushort)0x0001) /* PA 15 */
  764. #define PA_ENET_TXD ((ushort)0x0002) /* PA 14 */
  765. #define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */
  766. #define PA_ENET_TCLK ((ushort)0x0100) /* PA 7 */
  767. #define PC_ENET_TENA ((ushort)0x0001) /* PC 15 */
  768. #define PC_ENET_CLSN ((ushort)0x0010) /* PC 11 */
  769. #define PC_ENET_RENA ((ushort)0x0020) /* PC 10 */
  770. #define PB_ENET_RESET (uint)0x00000008 /* PB 28 */
  771. #define PB_ENET_JABD (uint)0x00000004 /* PB 29 */
  772. /* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
  773. * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
  774. */
  775. #define SICR_ENET_MASK ((uint)0x000000ff)
  776. #define SICR_ENET_CLKRT ((uint)0x0000002C)
  777. #endif /* CONFIG_IP860 */
  778. /*** IVMS8 **********************************************************/
  779. /* The IVMS8 uses the FEC on a MPC860T for Ethernet */
  780. #if defined(CONFIG_IVMS8) || defined(CONFIG_IVML24)
  781. #define FEC_ENET /* use FEC for EThernet */
  782. #undef SCC_ENET
  783. #define PB_ENET_POWER ((uint)0x00010000) /* PB 15 */
  784. #define PC_ENET_RESET ((ushort)0x0010) /* PC 11 */
  785. #define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */
  786. #define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */
  787. #define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */
  788. #define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */
  789. #define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */
  790. #define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */
  791. #define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */
  792. #define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */
  793. #define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */
  794. #define PD_MII_MDC ((ushort)0x0008) /* PD 12 */
  795. #define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */
  796. #define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */
  797. #define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */
  798. #define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */
  799. #endif /* CONFIG_IVMS8, CONFIG_IVML24 */
  800. /*** KUP4K *********************************************************/
  801. /* The KUP4K uses the FEC on a MPC855T for Ethernet */
  802. #if defined(CONFIG_KUP4K)
  803. #define FEC_ENET /* use FEC for EThernet */
  804. #undef SCC_ENET
  805. #define PB_ENET_POWER ((uint)0x00010000) /* PB 15 */
  806. #define PC_ENET_RESET ((ushort)0x0010) /* PC 11 */
  807. #define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */
  808. #define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */
  809. #define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */
  810. #define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */
  811. #define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */
  812. #define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */
  813. #define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */
  814. #define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */
  815. #define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */
  816. #define PD_MII_MDC ((ushort)0x0008) /* PD 12 */
  817. #define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */
  818. #define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */
  819. #define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */
  820. #define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */
  821. #endif /* CONFIG_KUP4K */
  822. /*** LANTEC *********************************************************/
  823. #if defined(CONFIG_LANTEC) && CONFIG_LANTEC >= 2
  824. /* Bits in parallel I/O port registers that have to be set/cleared
  825. * to configure the pins for SCC2 use.
  826. */
  827. #define PROFF_ENET PROFF_SCC2
  828. #define CPM_CR_ENET CPM_CR_CH_SCC2
  829. #define SCC_ENET 1
  830. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  831. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  832. #define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */
  833. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  834. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  835. #define PC_ENET_LBK ((ushort)0x0010) /* PC 11 */
  836. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  837. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  838. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK2) to
  839. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  840. */
  841. #define SICR_ENET_MASK ((uint)0x0000FF00)
  842. #define SICR_ENET_CLKRT ((uint)0x00002E00)
  843. #endif /* CONFIG_LANTEC v2 */
  844. /*** LWMON **********************************************************/
  845. #if defined(CONFIG_LWMON) && !defined(CONFIG_8xx_CONS_SCC2)
  846. /* Bits in parallel I/O port registers that have to be set/cleared
  847. * to configure the pins for SCC2 use.
  848. */
  849. #define PROFF_ENET PROFF_SCC2
  850. #define CPM_CR_ENET CPM_CR_CH_SCC2
  851. #define SCC_ENET 1
  852. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  853. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  854. #define PA_ENET_RCLK ((ushort)0x0800) /* PA 4 */
  855. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  856. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  857. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  858. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  859. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK4) to
  860. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  861. */
  862. #define SICR_ENET_MASK ((uint)0x0000ff00)
  863. #define SICR_ENET_CLKRT ((uint)0x00003E00)
  864. #endif /* CONFIG_LWMON */
  865. /*** NX823 ***********************************************/
  866. #if defined(CONFIG_NX823)
  867. /* Bits in parallel I/O port registers that have to be set/cleared
  868. * to configure the pins for SCC1 use.
  869. */
  870. #define PROFF_ENET PROFF_SCC2
  871. #define CPM_CR_ENET CPM_CR_CH_SCC2
  872. #define SCC_ENET 1
  873. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  874. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  875. #define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */
  876. #define PA_ENET_TCLK ((ushort)0x0800) /* PA 4 */
  877. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  878. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  879. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  880. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  881. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  882. */
  883. #define SICR_ENET_MASK ((uint)0x0000ff00)
  884. #define SICR_ENET_CLKRT ((uint)0x00002f00)
  885. #endif /* CONFIG_NX823 */
  886. /*** MBX ************************************************************/
  887. #ifdef CONFIG_MBX
  888. /* Bits in parallel I/O port registers that have to be set/cleared
  889. * to configure the pins for SCC1 use. The TCLK and RCLK seem unique
  890. * to the MBX860 board. Any two of the four available clocks could be
  891. * used, and the MPC860 cookbook manual has an example using different
  892. * clock pins.
  893. */
  894. #define PROFF_ENET PROFF_SCC1
  895. #define CPM_CR_ENET CPM_CR_CH_SCC1
  896. #define SCC_ENET 0
  897. #define PA_ENET_RXD ((ushort)0x0001)
  898. #define PA_ENET_TXD ((ushort)0x0002)
  899. #define PA_ENET_TCLK ((ushort)0x0200)
  900. #define PA_ENET_RCLK ((ushort)0x0800)
  901. #define PC_ENET_TENA ((ushort)0x0001)
  902. #define PC_ENET_CLSN ((ushort)0x0010)
  903. #define PC_ENET_RENA ((ushort)0x0020)
  904. /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
  905. * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
  906. */
  907. #define SICR_ENET_MASK ((uint)0x000000ff)
  908. #define SICR_ENET_CLKRT ((uint)0x0000003d)
  909. #endif /* CONFIG_MBX */
  910. /*** MHPC ********************************************************/
  911. #if defined(CONFIG_MHPC)
  912. /* This ENET stuff is for the MHPC with ethernet on SCC2.
  913. * Note TENA is on Port B.
  914. */
  915. #define PROFF_ENET PROFF_SCC2
  916. #define CPM_CR_ENET CPM_CR_CH_SCC2
  917. #define SCC_ENET 1
  918. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  919. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  920. #define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */
  921. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  922. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  923. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  924. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  925. #define SICR_ENET_MASK ((uint)0x0000ff00)
  926. #define SICR_ENET_CLKRT ((uint)0x00002e00) /* RCLK-CLK2, TCLK-CLK3 */
  927. #endif /* CONFIG_MHPC */
  928. /*** NETVIA *******************************************************/
  929. /* SinoVee Microsystems SC8xx series FEL8xx-AT,SC823,SC850,SC855T,SC860T */
  930. #if ( defined CONFIG_SVM_SC8xx )
  931. # ifndef CONFIG_FEC_ENET
  932. #define PROFF_ENET PROFF_SCC2
  933. #define CPM_CR_ENET CPM_CR_CH_SCC2
  934. #define SCC_ENET 1
  935. /* Bits in parallel I/O port registers that have to be set/cleared
  936. * * * * to configure the pins for SCC2 use.
  937. * * * */
  938. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  939. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  940. #define PA_ENET_RCLK ((ushort)0x0400) /* PA 5 */
  941. #define PA_ENET_TCLK ((ushort)0x0800) /* PA 4 */
  942. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  943. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  944. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  945. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  946. * * * * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  947. * * * */
  948. #define SICR_ENET_MASK ((uint)0x0000ff00)
  949. #define SICR_ENET_CLKRT ((uint)0x00003700)
  950. # else /* Use FEC for Fast Ethernet */
  951. #undef SCC_ENET
  952. #define FEC_ENET
  953. #define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */
  954. #define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */
  955. #define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */
  956. #define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */
  957. #define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */
  958. #define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */
  959. #define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */
  960. #define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */
  961. #define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */
  962. #define PD_MII_MDC ((ushort)0x0008) /* PD 12 */
  963. #define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */
  964. #define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */
  965. #define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */
  966. #define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */
  967. # endif /* CONFIG_FEC_ENET */
  968. #endif /* CONFIG_SVM_SC8xx */
  969. #if defined(CONFIG_NETVIA)
  970. /* Bits in parallel I/O port registers that have to be set/cleared
  971. * to configure the pins for SCC2 use.
  972. */
  973. #define PROFF_ENET PROFF_SCC2
  974. #define CPM_CR_ENET CPM_CR_CH_SCC2
  975. #define SCC_ENET 1
  976. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  977. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  978. #define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */
  979. #define PA_ENET_TCLK ((ushort)0x0800) /* PA 4 */
  980. #define PB_ENET_PDN ((ushort)0x4000) /* PB 17 */
  981. #define PB_ENET_TENA ((ushort)0x2000) /* PB 18 */
  982. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  983. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  984. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  985. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  986. */
  987. #define SICR_ENET_MASK ((uint)0x0000ff00)
  988. #define SICR_ENET_CLKRT ((uint)0x00002f00)
  989. #endif /* CONFIG_NETVIA */
  990. /*** RPXCLASSIC *****************************************************/
  991. #ifdef CONFIG_RPXCLASSIC
  992. #ifdef CONFIG_FEC_ENET
  993. # define FEC_ENET /* use FEC for EThernet */
  994. # undef SCC_ENET
  995. #else /* ! CONFIG_FEC_ENET */
  996. /* Bits in parallel I/O port registers that have to be set/cleared
  997. * to configure the pins for SCC1 use.
  998. */
  999. #define PROFF_ENET PROFF_SCC1
  1000. #define CPM_CR_ENET CPM_CR_CH_SCC1
  1001. #define SCC_ENET 0
  1002. #define PA_ENET_RXD ((ushort)0x0001)
  1003. #define PA_ENET_TXD ((ushort)0x0002)
  1004. #define PA_ENET_TCLK ((ushort)0x0200)
  1005. #define PA_ENET_RCLK ((ushort)0x0800)
  1006. #define PB_ENET_TENA ((uint)0x00001000)
  1007. #define PC_ENET_CLSN ((ushort)0x0010)
  1008. #define PC_ENET_RENA ((ushort)0x0020)
  1009. /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
  1010. * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
  1011. */
  1012. #define SICR_ENET_MASK ((uint)0x000000ff)
  1013. #define SICR_ENET_CLKRT ((uint)0x0000003d)
  1014. #endif /* CONFIG_FEC_ENET */
  1015. #endif /* CONFIG_RPXCLASSIC */
  1016. /*** RPXLITE ********************************************************/
  1017. #ifdef CONFIG_RPXLITE
  1018. /* This ENET stuff is for the MPC850 with ethernet on SCC2. Some of
  1019. * this may be unique to the RPX-Lite configuration.
  1020. * Note TENA is on Port B.
  1021. */
  1022. #define PROFF_ENET PROFF_SCC2
  1023. #define CPM_CR_ENET CPM_CR_CH_SCC2
  1024. #define SCC_ENET 1
  1025. #define PA_ENET_RXD ((ushort)0x0004)
  1026. #define PA_ENET_TXD ((ushort)0x0008)
  1027. #define PA_ENET_TCLK ((ushort)0x0200)
  1028. #define PA_ENET_RCLK ((ushort)0x0800)
  1029. #define PB_ENET_TENA ((uint)0x00002000)
  1030. #define PC_ENET_CLSN ((ushort)0x0040)
  1031. #define PC_ENET_RENA ((ushort)0x0080)
  1032. #define SICR_ENET_MASK ((uint)0x0000ff00)
  1033. #define SICR_ENET_CLKRT ((uint)0x00003d00)
  1034. #endif /* CONFIG_RPXLITE */
  1035. /*** SM850 *********************************************************/
  1036. /* The SM850 Service Module uses SCC2 for IrDA and SCC3 for Ethernet */
  1037. #ifdef CONFIG_SM850
  1038. #define PROFF_ENET PROFF_SCC3 /* Ethernet on SCC3 */
  1039. #define CPM_CR_ENET CPM_CR_CH_SCC3
  1040. #define SCC_ENET 2
  1041. #define PB_ENET_RXD ((uint)0x00000004) /* PB 29 */
  1042. #define PB_ENET_TXD ((uint)0x00000002) /* PB 30 */
  1043. #define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
  1044. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  1045. #define PC_ENET_LBK ((ushort)0x0008) /* PC 12 */
  1046. #define PC_ENET_TENA ((ushort)0x0004) /* PC 13 */
  1047. #define PC_ENET_RENA ((ushort)0x0800) /* PC 4 */
  1048. #define PC_ENET_CLSN ((ushort)0x0400) /* PC 5 */
  1049. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  1050. * SCC3. Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero.
  1051. */
  1052. #define SICR_ENET_MASK ((uint)0x00FF0000)
  1053. #define SICR_ENET_CLKRT ((uint)0x00260000)
  1054. #endif /* CONFIG_SM850 */
  1055. /*** SPD823TS ******************************************************/
  1056. #ifdef CONFIG_SPD823TS
  1057. /* Bits in parallel I/O port registers that have to be set/cleared
  1058. * to configure the pins for SCC2 use.
  1059. */
  1060. #define PROFF_ENET PROFF_SCC2 /* Ethernet on SCC2 */
  1061. #define CPM_CR_ENET CPM_CR_CH_SCC2
  1062. #define SCC_ENET 1
  1063. #define PA_ENET_MDC ((ushort)0x0001) /* PA 15 !!! */
  1064. #define PA_ENET_MDIO ((ushort)0x0002) /* PA 14 !!! */
  1065. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  1066. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  1067. #define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */
  1068. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  1069. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  1070. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  1071. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  1072. #define PC_ENET_RESET ((ushort)0x0100) /* PC 7 !!! */
  1073. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK2) to
  1074. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  1075. */
  1076. #define SICR_ENET_MASK ((uint)0x0000ff00)
  1077. #define SICR_ENET_CLKRT ((uint)0x00002E00)
  1078. #endif /* CONFIG_SPD823TS */
  1079. /*** SXNI855T ******************************************************/
  1080. #if defined(CONFIG_SXNI855T)
  1081. #ifdef CONFIG_FEC_ENET
  1082. #define FEC_ENET /* use FEC for Ethernet */
  1083. #endif /* CONFIG_FEC_ETHERNET */
  1084. #endif /* CONFIG_SXNI855T */
  1085. /*** MVS1, TQM823L, TQM850L, ETX094, R360MPI ***********************/
  1086. #if (defined(CONFIG_MVS) && CONFIG_MVS < 2) || \
  1087. defined(CONFIG_R360MPI) || \
  1088. defined(CONFIG_RBC823) || \
  1089. defined(CONFIG_TQM823L) || \
  1090. defined(CONFIG_TQM850L) || \
  1091. defined(CONFIG_ETX094) || \
  1092. defined(CONFIG_RRVISION)|| \
  1093. (defined(CONFIG_LANTEC) && CONFIG_LANTEC < 2)
  1094. /* Bits in parallel I/O port registers that have to be set/cleared
  1095. * to configure the pins for SCC2 use.
  1096. */
  1097. #define PROFF_ENET PROFF_SCC2
  1098. #define CPM_CR_ENET CPM_CR_CH_SCC2
  1099. #define SCC_ENET 1
  1100. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  1101. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  1102. #define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
  1103. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  1104. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  1105. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  1106. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  1107. #if defined(CONFIG_R360MPI)
  1108. #define PC_ENET_LBK ((ushort)0x0008) /* PC 12 */
  1109. #endif /* CONFIG_R360MPI */
  1110. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  1111. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  1112. */
  1113. #define SICR_ENET_MASK ((uint)0x0000ff00)
  1114. #define SICR_ENET_CLKRT ((uint)0x00002600)
  1115. #endif /* CONFIG_MVS v1, CONFIG_TQM823L, CONFIG_TQM850L, etc. */
  1116. /*** TQM855L, TQM860L, TQM862L **************************************/
  1117. #if defined(CONFIG_TQM855L) || \
  1118. defined(CONFIG_TQM860L) || \
  1119. defined(CONFIG_TQM862L)
  1120. # ifdef CONFIG_SCC1_ENET /* use SCC for 10Mbps Ethernet */
  1121. /* Bits in parallel I/O port registers that have to be set/cleared
  1122. * to configure the pins for SCC1 use.
  1123. */
  1124. #define PROFF_ENET PROFF_SCC1
  1125. #define CPM_CR_ENET CPM_CR_CH_SCC1
  1126. #define SCC_ENET 0
  1127. #define PA_ENET_RXD ((ushort)0x0001) /* PA 15 */
  1128. #define PA_ENET_TXD ((ushort)0x0002) /* PA 14 */
  1129. #define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
  1130. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  1131. #define PC_ENET_TENA ((ushort)0x0001) /* PC 15 */
  1132. #define PC_ENET_CLSN ((ushort)0x0010) /* PC 11 */
  1133. #define PC_ENET_RENA ((ushort)0x0020) /* PC 10 */
  1134. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  1135. * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
  1136. */
  1137. #define SICR_ENET_MASK ((uint)0x000000ff)
  1138. #define SICR_ENET_CLKRT ((uint)0x00000026)
  1139. # endif /* CONFIG_SCC1_ENET */
  1140. # ifdef CONFIG_FEC_ENET /* Use FEC for Fast Ethernet */
  1141. #define FEC_ENET
  1142. #define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */
  1143. #define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */
  1144. #define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */
  1145. #define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */
  1146. #define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */
  1147. #define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */
  1148. #define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */
  1149. #define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */
  1150. #define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */
  1151. #define PD_MII_MDC ((ushort)0x0008) /* PD 12 */
  1152. #define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */
  1153. #define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */
  1154. #define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */
  1155. #define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */
  1156. # endif /* CONFIG_FEC_ENET */
  1157. #endif /* CONFIG_TQM855L, TQM860L, TQM862L */
  1158. /*** V37 **********************************************************/
  1159. #ifdef CONFIG_V37
  1160. /* This ENET stuff is for the MPC823 with ethernet on SCC2. Some of
  1161. * this may be unique to the Marel V37 configuration.
  1162. * Note TENA is on Port B.
  1163. */
  1164. #define PROFF_ENET PROFF_SCC2
  1165. #define CPM_CR_ENET CPM_CR_CH_SCC2
  1166. #define SCC_ENET 1
  1167. #define PA_ENET_RXD ((ushort)0x0004)
  1168. #define PA_ENET_TXD ((ushort)0x0008)
  1169. #define PA_ENET_TCLK ((ushort)0x0400)
  1170. #define PA_ENET_RCLK ((ushort)0x0200)
  1171. #define PB_ENET_TENA ((uint)0x00002000)
  1172. #define PC_ENET_CLSN ((ushort)0x0040)
  1173. #define PC_ENET_RENA ((ushort)0x0080)
  1174. #define SICR_ENET_MASK ((uint)0x0000ff00)
  1175. #define SICR_ENET_CLKRT ((uint)0x00002e00)
  1176. #endif /* CONFIG_V37 */
  1177. /*********************************************************************/
  1178. /* SCC Event register as used by Ethernet.
  1179. */
  1180. #define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
  1181. #define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */
  1182. #define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */
  1183. #define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */
  1184. #define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
  1185. #define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
  1186. /* SCC Mode Register (PSMR) as used by Ethernet.
  1187. */
  1188. #define SCC_PSMR_HBC ((ushort)0x8000) /* Enable heartbeat */
  1189. #define SCC_PSMR_FC ((ushort)0x4000) /* Force collision */
  1190. #define SCC_PSMR_RSH ((ushort)0x2000) /* Receive short frames */
  1191. #define SCC_PSMR_IAM ((ushort)0x1000) /* Check individual hash */
  1192. #define SCC_PSMR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
  1193. #define SCC_PSMR_PRO ((ushort)0x0200) /* Promiscuous mode */
  1194. #define SCC_PSMR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
  1195. #define SCC_PSMR_SBT ((ushort)0x0080) /* Special backoff timer */
  1196. #define SCC_PSMR_LPB ((ushort)0x0040) /* Set Loopback mode */
  1197. #define SCC_PSMR_SIP ((ushort)0x0020) /* Sample Input Pins */
  1198. #define SCC_PSMR_LCW ((ushort)0x0010) /* Late collision window */
  1199. #define SCC_PSMR_NIB22 ((ushort)0x000a) /* Start frame search */
  1200. #define SCC_PSMR_FDE ((ushort)0x0001) /* Full duplex enable */
  1201. /* Buffer descriptor control/status used by Ethernet receive.
  1202. */
  1203. #define BD_ENET_RX_EMPTY ((ushort)0x8000)
  1204. #define BD_ENET_RX_WRAP ((ushort)0x2000)
  1205. #define BD_ENET_RX_INTR ((ushort)0x1000)
  1206. #define BD_ENET_RX_LAST ((ushort)0x0800)
  1207. #define BD_ENET_RX_FIRST ((ushort)0x0400)
  1208. #define BD_ENET_RX_MISS ((ushort)0x0100)
  1209. #define BD_ENET_RX_LG ((ushort)0x0020)
  1210. #define BD_ENET_RX_NO ((ushort)0x0010)
  1211. #define BD_ENET_RX_SH ((ushort)0x0008)
  1212. #define BD_ENET_RX_CR ((ushort)0x0004)
  1213. #define BD_ENET_RX_OV ((ushort)0x0002)
  1214. #define BD_ENET_RX_CL ((ushort)0x0001)
  1215. #define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */
  1216. /* Buffer descriptor control/status used by Ethernet transmit.
  1217. */
  1218. #define BD_ENET_TX_READY ((ushort)0x8000)
  1219. #define BD_ENET_TX_PAD ((ushort)0x4000)
  1220. #define BD_ENET_TX_WRAP ((ushort)0x2000)
  1221. #define BD_ENET_TX_INTR ((ushort)0x1000)
  1222. #define BD_ENET_TX_LAST ((ushort)0x0800)
  1223. #define BD_ENET_TX_TC ((ushort)0x0400)
  1224. #define BD_ENET_TX_DEF ((ushort)0x0200)
  1225. #define BD_ENET_TX_HB ((ushort)0x0100)
  1226. #define BD_ENET_TX_LC ((ushort)0x0080)
  1227. #define BD_ENET_TX_RL ((ushort)0x0040)
  1228. #define BD_ENET_TX_RCMASK ((ushort)0x003c)
  1229. #define BD_ENET_TX_UN ((ushort)0x0002)
  1230. #define BD_ENET_TX_CSL ((ushort)0x0001)
  1231. #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
  1232. /* SCC as UART
  1233. */
  1234. typedef struct scc_uart {
  1235. sccp_t scc_genscc;
  1236. uint scc_res1; /* Reserved */
  1237. uint scc_res2; /* Reserved */
  1238. ushort scc_maxidl; /* Maximum idle chars */
  1239. ushort scc_idlc; /* temp idle counter */
  1240. ushort scc_brkcr; /* Break count register */
  1241. ushort scc_parec; /* receive parity error counter */
  1242. ushort scc_frmec; /* receive framing error counter */
  1243. ushort scc_nosec; /* receive noise counter */
  1244. ushort scc_brkec; /* receive break condition counter */
  1245. ushort scc_brkln; /* last received break length */
  1246. ushort scc_uaddr1; /* UART address character 1 */
  1247. ushort scc_uaddr2; /* UART address character 2 */
  1248. ushort scc_rtemp; /* Temp storage */
  1249. ushort scc_toseq; /* Transmit out of sequence char */
  1250. ushort scc_char1; /* control character 1 */
  1251. ushort scc_char2; /* control character 2 */
  1252. ushort scc_char3; /* control character 3 */
  1253. ushort scc_char4; /* control character 4 */
  1254. ushort scc_char5; /* control character 5 */
  1255. ushort scc_char6; /* control character 6 */
  1256. ushort scc_char7; /* control character 7 */
  1257. ushort scc_char8; /* control character 8 */
  1258. ushort scc_rccm; /* receive control character mask */
  1259. ushort scc_rccr; /* receive control character register */
  1260. ushort scc_rlbc; /* receive last break character */
  1261. } scc_uart_t;
  1262. /* SCC Event and Mask registers when it is used as a UART.
  1263. */
  1264. #define UART_SCCM_GLR ((ushort)0x1000)
  1265. #define UART_SCCM_GLT ((ushort)0x0800)
  1266. #define UART_SCCM_AB ((ushort)0x0200)
  1267. #define UART_SCCM_IDL ((ushort)0x0100)
  1268. #define UART_SCCM_GRA ((ushort)0x0080)
  1269. #define UART_SCCM_BRKE ((ushort)0x0040)
  1270. #define UART_SCCM_BRKS ((ushort)0x0020)
  1271. #define UART_SCCM_CCR ((ushort)0x0008)
  1272. #define UART_SCCM_BSY ((ushort)0x0004)
  1273. #define UART_SCCM_TX ((ushort)0x0002)
  1274. #define UART_SCCM_RX ((ushort)0x0001)
  1275. /* The SCC PSMR when used as a UART.
  1276. */
  1277. #define SCU_PSMR_FLC ((ushort)0x8000)
  1278. #define SCU_PSMR_SL ((ushort)0x4000)
  1279. #define SCU_PSMR_CL ((ushort)0x3000)
  1280. #define SCU_PSMR_UM ((ushort)0x0c00)
  1281. #define SCU_PSMR_FRZ ((ushort)0x0200)
  1282. #define SCU_PSMR_RZS ((ushort)0x0100)
  1283. #define SCU_PSMR_SYN ((ushort)0x0080)
  1284. #define SCU_PSMR_DRT ((ushort)0x0040)
  1285. #define SCU_PSMR_PEN ((ushort)0x0010)
  1286. #define SCU_PSMR_RPM ((ushort)0x000c)
  1287. #define SCU_PSMR_REVP ((ushort)0x0008)
  1288. #define SCU_PSMR_TPM ((ushort)0x0003)
  1289. #define SCU_PSMR_TEVP ((ushort)0x0003)
  1290. /* CPM Transparent mode SCC.
  1291. */
  1292. typedef struct scc_trans {
  1293. sccp_t st_genscc;
  1294. uint st_cpres; /* Preset CRC */
  1295. uint st_cmask; /* Constant mask for CRC */
  1296. } scc_trans_t;
  1297. #define BD_SCC_TX_LAST ((ushort)0x0800)
  1298. /* IIC parameter RAM.
  1299. */
  1300. typedef struct iic {
  1301. ushort iic_rbase; /* Rx Buffer descriptor base address */
  1302. ushort iic_tbase; /* Tx Buffer descriptor base address */
  1303. u_char iic_rfcr; /* Rx function code */
  1304. u_char iic_tfcr; /* Tx function code */
  1305. ushort iic_mrblr; /* Max receive buffer length */
  1306. uint iic_rstate; /* Internal */
  1307. uint iic_rdp; /* Internal */
  1308. ushort iic_rbptr; /* Internal */
  1309. ushort iic_rbc; /* Internal */
  1310. uint iic_rxtmp; /* Internal */
  1311. uint iic_tstate; /* Internal */
  1312. uint iic_tdp; /* Internal */
  1313. ushort iic_tbptr; /* Internal */
  1314. ushort iic_tbc; /* Internal */
  1315. uint iic_txtmp; /* Internal */
  1316. uint iic_res; /* reserved */
  1317. ushort iic_rpbase; /* Relocation pointer */
  1318. ushort iic_res2; /* reserved */
  1319. } iic_t;
  1320. /* SPI parameter RAM.
  1321. */
  1322. typedef struct spi {
  1323. ushort spi_rbase; /* Rx Buffer descriptor base address */
  1324. ushort spi_tbase; /* Tx Buffer descriptor base address */
  1325. u_char spi_rfcr; /* Rx function code */
  1326. u_char spi_tfcr; /* Tx function code */
  1327. ushort spi_mrblr; /* Max receive buffer length */
  1328. uint spi_rstate; /* Internal */
  1329. uint spi_rdp; /* Internal */
  1330. ushort spi_rbptr; /* Internal */
  1331. ushort spi_rbc; /* Internal */
  1332. uint spi_rxtmp; /* Internal */
  1333. uint spi_tstate; /* Internal */
  1334. uint spi_tdp; /* Internal */
  1335. ushort spi_tbptr; /* Internal */
  1336. ushort spi_tbc; /* Internal */
  1337. uint spi_txtmp; /* Internal */
  1338. uint spi_res;
  1339. ushort spi_rpbase; /* Relocation pointer */
  1340. ushort spi_res2;
  1341. } spi_t;
  1342. /* SPI Mode register.
  1343. */
  1344. #define SPMODE_LOOP ((ushort)0x4000) /* Loopback */
  1345. #define SPMODE_CI ((ushort)0x2000) /* Clock Invert */
  1346. #define SPMODE_CP ((ushort)0x1000) /* Clock Phase */
  1347. #define SPMODE_DIV16 ((ushort)0x0800) /* BRG/16 mode */
  1348. #define SPMODE_REV ((ushort)0x0400) /* Reversed Data */
  1349. #define SPMODE_MSTR ((ushort)0x0200) /* SPI Master */
  1350. #define SPMODE_EN ((ushort)0x0100) /* Enable */
  1351. #define SPMODE_LENMSK ((ushort)0x00f0) /* character length */
  1352. #define SPMODE_PMMSK ((ushort)0x000f) /* prescale modulus */
  1353. #define SPMODE_LEN(x) ((((x)-1)&0xF)<<4)
  1354. #define SPMODE_PM(x) ((x) &0xF)
  1355. /* HDLC parameter RAM.
  1356. */
  1357. typedef struct hdlc_pram_s {
  1358. /*
  1359. * SCC parameter RAM
  1360. */
  1361. ushort rbase; /* Rx Buffer descriptor base address */
  1362. ushort tbase; /* Tx Buffer descriptor base address */
  1363. uchar rfcr; /* Rx function code */
  1364. uchar tfcr; /* Tx function code */
  1365. ushort mrblr; /* Rx buffer length */
  1366. ulong rstate; /* Rx internal state */
  1367. ulong rptr; /* Rx internal data pointer */
  1368. ushort rbptr; /* rb BD Pointer */
  1369. ushort rcount; /* Rx internal byte count */
  1370. ulong rtemp; /* Rx temp */
  1371. ulong tstate; /* Tx internal state */
  1372. ulong tptr; /* Tx internal data pointer */
  1373. ushort tbptr; /* Tx BD pointer */
  1374. ushort tcount; /* Tx byte count */
  1375. ulong ttemp; /* Tx temp */
  1376. ulong rcrc; /* temp receive CRC */
  1377. ulong tcrc; /* temp transmit CRC */
  1378. /*
  1379. * HDLC specific parameter RAM
  1380. */
  1381. uchar res[4]; /* reserved */
  1382. ulong c_mask; /* CRC constant */
  1383. ulong c_pres; /* CRC preset */
  1384. ushort disfc; /* discarded frame counter */
  1385. ushort crcec; /* CRC error counter */
  1386. ushort abtsc; /* abort sequence counter */
  1387. ushort nmarc; /* nonmatching address rx cnt */
  1388. ushort retrc; /* frame retransmission cnt */
  1389. ushort mflr; /* maximum frame length reg */
  1390. ushort max_cnt; /* maximum length counter */
  1391. ushort rfthr; /* received frames threshold */
  1392. ushort rfcnt; /* received frames count */
  1393. ushort hmask; /* user defined frm addr mask */
  1394. ushort haddr1; /* user defined frm address 1 */
  1395. ushort haddr2; /* user defined frm address 2 */
  1396. ushort haddr3; /* user defined frm address 3 */
  1397. ushort haddr4; /* user defined frm address 4 */
  1398. ushort tmp; /* temp */
  1399. ushort tmp_mb; /* temp */
  1400. } hdlc_pram_t;
  1401. /* CPM interrupts. There are nearly 32 interrupts generated by CPM
  1402. * channels or devices. All of these are presented to the PPC core
  1403. * as a single interrupt. The CPM interrupt handler dispatches its
  1404. * own handlers, in a similar fashion to the PPC core handler. We
  1405. * use the table as defined in the manuals (i.e. no special high
  1406. * priority and SCC1 == SCCa, etc...).
  1407. */
  1408. #define CPMVEC_NR 32
  1409. #define CPMVEC_OFFSET 0x00010000
  1410. #define CPMVEC_PIO_PC15 ((ushort)0x1f | CPMVEC_OFFSET)
  1411. #define CPMVEC_SCC1 ((ushort)0x1e | CPMVEC_OFFSET)
  1412. #define CPMVEC_SCC2 ((ushort)0x1d | CPMVEC_OFFSET)
  1413. #define CPMVEC_SCC3 ((ushort)0x1c | CPMVEC_OFFSET)
  1414. #define CPMVEC_SCC4 ((ushort)0x1b | CPMVEC_OFFSET)
  1415. #define CPMVEC_PIO_PC14 ((ushort)0x1a | CPMVEC_OFFSET)
  1416. #define CPMVEC_TIMER1 ((ushort)0x19 | CPMVEC_OFFSET)
  1417. #define CPMVEC_PIO_PC13 ((ushort)0x18 | CPMVEC_OFFSET)
  1418. #define CPMVEC_PIO_PC12 ((ushort)0x17 | CPMVEC_OFFSET)
  1419. #define CPMVEC_SDMA_CB_ERR ((ushort)0x16 | CPMVEC_OFFSET)
  1420. #define CPMVEC_IDMA1 ((ushort)0x15 | CPMVEC_OFFSET)
  1421. #define CPMVEC_IDMA2 ((ushort)0x14 | CPMVEC_OFFSET)
  1422. #define CPMVEC_TIMER2 ((ushort)0x12 | CPMVEC_OFFSET)
  1423. #define CPMVEC_RISCTIMER ((ushort)0x11 | CPMVEC_OFFSET)
  1424. #define CPMVEC_I2C ((ushort)0x10 | CPMVEC_OFFSET)
  1425. #define CPMVEC_PIO_PC11 ((ushort)0x0f | CPMVEC_OFFSET)
  1426. #define CPMVEC_PIO_PC10 ((ushort)0x0e | CPMVEC_OFFSET)
  1427. #define CPMVEC_TIMER3 ((ushort)0x0c | CPMVEC_OFFSET)
  1428. #define CPMVEC_PIO_PC9 ((ushort)0x0b | CPMVEC_OFFSET)
  1429. #define CPMVEC_PIO_PC8 ((ushort)0x0a | CPMVEC_OFFSET)
  1430. #define CPMVEC_PIO_PC7 ((ushort)0x09 | CPMVEC_OFFSET)
  1431. #define CPMVEC_TIMER4 ((ushort)0x07 | CPMVEC_OFFSET)
  1432. #define CPMVEC_PIO_PC6 ((ushort)0x06 | CPMVEC_OFFSET)
  1433. #define CPMVEC_SPI ((ushort)0x05 | CPMVEC_OFFSET)
  1434. #define CPMVEC_SMC1 ((ushort)0x04 | CPMVEC_OFFSET)
  1435. #define CPMVEC_SMC2 ((ushort)0x03 | CPMVEC_OFFSET)
  1436. #define CPMVEC_PIO_PC5 ((ushort)0x02 | CPMVEC_OFFSET)
  1437. #define CPMVEC_PIO_PC4 ((ushort)0x01 | CPMVEC_OFFSET)
  1438. #define CPMVEC_ERROR ((ushort)0x00 | CPMVEC_OFFSET)
  1439. extern void irq_install_handler(int vec, void (*handler)(void *), void *dev_id);
  1440. /* CPM interrupt configuration vector.
  1441. */
  1442. #define CICR_SCD_SCC4 ((uint)0x00c00000) /* SCC4 @ SCCd */
  1443. #define CICR_SCC_SCC3 ((uint)0x00200000) /* SCC3 @ SCCc */
  1444. #define CICR_SCB_SCC2 ((uint)0x00040000) /* SCC2 @ SCCb */
  1445. #define CICR_SCA_SCC1 ((uint)0x00000000) /* SCC1 @ SCCa */
  1446. #define CICR_IRL_MASK ((uint)0x0000e000) /* Core interrrupt */
  1447. #define CICR_HP_MASK ((uint)0x00001f00) /* Hi-pri int. */
  1448. #define CICR_IEN ((uint)0x00000080) /* Int. enable */
  1449. #define CICR_SPS ((uint)0x00000001) /* SCC Spread */
  1450. #endif /* __CPM_8XX__ */