commproc.h 60 KB

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