commproc.h 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740
  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. #if !defined(CONFIG_NETVIA_VERSION) || CONFIG_NETVIA_VERSION == 1
  981. # define PB_ENET_PDN ((ushort)0x4000) /* PB 17 */
  982. #elif CONFIG_NETVIA_VERSION >= 2
  983. # define PC_ENET_PDN ((ushort)0x0008) /* PC 12 */
  984. #endif
  985. #define PB_ENET_TENA ((ushort)0x2000) /* PB 18 */
  986. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  987. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  988. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  989. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  990. */
  991. #define SICR_ENET_MASK ((uint)0x0000ff00)
  992. #define SICR_ENET_CLKRT ((uint)0x00002f00)
  993. #endif /* CONFIG_NETVIA */
  994. /*** RPXCLASSIC *****************************************************/
  995. #ifdef CONFIG_RPXCLASSIC
  996. #ifdef CONFIG_FEC_ENET
  997. # define FEC_ENET /* use FEC for EThernet */
  998. # undef SCC_ENET
  999. #else /* ! CONFIG_FEC_ENET */
  1000. /* Bits in parallel I/O port registers that have to be set/cleared
  1001. * to configure the pins for SCC1 use.
  1002. */
  1003. #define PROFF_ENET PROFF_SCC1
  1004. #define CPM_CR_ENET CPM_CR_CH_SCC1
  1005. #define SCC_ENET 0
  1006. #define PA_ENET_RXD ((ushort)0x0001)
  1007. #define PA_ENET_TXD ((ushort)0x0002)
  1008. #define PA_ENET_TCLK ((ushort)0x0200)
  1009. #define PA_ENET_RCLK ((ushort)0x0800)
  1010. #define PB_ENET_TENA ((uint)0x00001000)
  1011. #define PC_ENET_CLSN ((ushort)0x0010)
  1012. #define PC_ENET_RENA ((ushort)0x0020)
  1013. /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
  1014. * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
  1015. */
  1016. #define SICR_ENET_MASK ((uint)0x000000ff)
  1017. #define SICR_ENET_CLKRT ((uint)0x0000003d)
  1018. #endif /* CONFIG_FEC_ENET */
  1019. #endif /* CONFIG_RPXCLASSIC */
  1020. /*** RPXLITE ********************************************************/
  1021. #ifdef CONFIG_RPXLITE
  1022. /* This ENET stuff is for the MPC850 with ethernet on SCC2. Some of
  1023. * this may be unique to the RPX-Lite configuration.
  1024. * Note TENA is on Port B.
  1025. */
  1026. #define PROFF_ENET PROFF_SCC2
  1027. #define CPM_CR_ENET CPM_CR_CH_SCC2
  1028. #define SCC_ENET 1
  1029. #define PA_ENET_RXD ((ushort)0x0004)
  1030. #define PA_ENET_TXD ((ushort)0x0008)
  1031. #define PA_ENET_TCLK ((ushort)0x0200)
  1032. #define PA_ENET_RCLK ((ushort)0x0800)
  1033. #if defined(CONFIG_RMU)
  1034. #define PC_ENET_TENA ((uint)0x00000002) /* PC14 */
  1035. #else
  1036. #define PB_ENET_TENA ((uint)0x00002000)
  1037. #endif
  1038. #define PC_ENET_CLSN ((ushort)0x0040)
  1039. #define PC_ENET_RENA ((ushort)0x0080)
  1040. #define SICR_ENET_MASK ((uint)0x0000ff00)
  1041. #define SICR_ENET_CLKRT ((uint)0x00003d00)
  1042. #endif /* CONFIG_RPXLITE */
  1043. /*** SM850 *********************************************************/
  1044. /* The SM850 Service Module uses SCC2 for IrDA and SCC3 for Ethernet */
  1045. #ifdef CONFIG_SM850
  1046. #define PROFF_ENET PROFF_SCC3 /* Ethernet on SCC3 */
  1047. #define CPM_CR_ENET CPM_CR_CH_SCC3
  1048. #define SCC_ENET 2
  1049. #define PB_ENET_RXD ((uint)0x00000004) /* PB 29 */
  1050. #define PB_ENET_TXD ((uint)0x00000002) /* PB 30 */
  1051. #define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
  1052. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  1053. #define PC_ENET_LBK ((ushort)0x0008) /* PC 12 */
  1054. #define PC_ENET_TENA ((ushort)0x0004) /* PC 13 */
  1055. #define PC_ENET_RENA ((ushort)0x0800) /* PC 4 */
  1056. #define PC_ENET_CLSN ((ushort)0x0400) /* PC 5 */
  1057. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  1058. * SCC3. Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero.
  1059. */
  1060. #define SICR_ENET_MASK ((uint)0x00FF0000)
  1061. #define SICR_ENET_CLKRT ((uint)0x00260000)
  1062. #endif /* CONFIG_SM850 */
  1063. /*** SPD823TS ******************************************************/
  1064. #ifdef CONFIG_SPD823TS
  1065. /* Bits in parallel I/O port registers that have to be set/cleared
  1066. * to configure the pins for SCC2 use.
  1067. */
  1068. #define PROFF_ENET PROFF_SCC2 /* Ethernet on SCC2 */
  1069. #define CPM_CR_ENET CPM_CR_CH_SCC2
  1070. #define SCC_ENET 1
  1071. #define PA_ENET_MDC ((ushort)0x0001) /* PA 15 !!! */
  1072. #define PA_ENET_MDIO ((ushort)0x0002) /* PA 14 !!! */
  1073. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  1074. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  1075. #define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */
  1076. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  1077. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  1078. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  1079. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  1080. #define PC_ENET_RESET ((ushort)0x0100) /* PC 7 !!! */
  1081. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK2) to
  1082. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  1083. */
  1084. #define SICR_ENET_MASK ((uint)0x0000ff00)
  1085. #define SICR_ENET_CLKRT ((uint)0x00002E00)
  1086. #endif /* CONFIG_SPD823TS */
  1087. /*** SXNI855T ******************************************************/
  1088. #if defined(CONFIG_SXNI855T)
  1089. #ifdef CONFIG_FEC_ENET
  1090. #define FEC_ENET /* use FEC for Ethernet */
  1091. #endif /* CONFIG_FEC_ETHERNET */
  1092. #endif /* CONFIG_SXNI855T */
  1093. /*** MVS1, TQM823L/M, TQM850L/M, ETX094, R360MPI *******************/
  1094. #if (defined(CONFIG_MVS) && CONFIG_MVS < 2) || \
  1095. defined(CONFIG_R360MPI) || defined(CONFIG_RBC823) || \
  1096. defined(CONFIG_TQM823L) || defined(CONFIG_TQM823M) || \
  1097. defined(CONFIG_TQM850L) || defined(CONFIG_TQM850M) || \
  1098. defined(CONFIG_ETX094) || defined(CONFIG_RRVISION)|| \
  1099. (defined(CONFIG_LANTEC) && CONFIG_LANTEC < 2)
  1100. /* Bits in parallel I/O port registers that have to be set/cleared
  1101. * to configure the pins for SCC2 use.
  1102. */
  1103. #define PROFF_ENET PROFF_SCC2
  1104. #define CPM_CR_ENET CPM_CR_CH_SCC2
  1105. #define SCC_ENET 1
  1106. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  1107. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  1108. #define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
  1109. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  1110. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  1111. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  1112. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  1113. #if defined(CONFIG_R360MPI)
  1114. #define PC_ENET_LBK ((ushort)0x0008) /* PC 12 */
  1115. #endif /* CONFIG_R360MPI */
  1116. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  1117. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  1118. */
  1119. #define SICR_ENET_MASK ((uint)0x0000ff00)
  1120. #define SICR_ENET_CLKRT ((uint)0x00002600)
  1121. #endif /* CONFIG_MVS v1, CONFIG_TQM823L/M, CONFIG_TQM850L/M, etc. */
  1122. /*** TQM855L/M, TQM860L/M, TQM862L/M ********************************/
  1123. #if defined(CONFIG_TQM855L) || defined(CONFIG_TQM855M) || \
  1124. defined(CONFIG_TQM860L) || defined(CONFIG_TQM860M) || \
  1125. defined(CONFIG_TQM862L) || defined(CONFIG_TQM862M)
  1126. # ifdef CONFIG_SCC1_ENET /* use SCC for 10Mbps Ethernet */
  1127. /* Bits in parallel I/O port registers that have to be set/cleared
  1128. * to configure the pins for SCC1 use.
  1129. */
  1130. #define PROFF_ENET PROFF_SCC1
  1131. #define CPM_CR_ENET CPM_CR_CH_SCC1
  1132. #define SCC_ENET 0
  1133. #define PA_ENET_RXD ((ushort)0x0001) /* PA 15 */
  1134. #define PA_ENET_TXD ((ushort)0x0002) /* PA 14 */
  1135. #define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
  1136. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  1137. #define PC_ENET_TENA ((ushort)0x0001) /* PC 15 */
  1138. #define PC_ENET_CLSN ((ushort)0x0010) /* PC 11 */
  1139. #define PC_ENET_RENA ((ushort)0x0020) /* PC 10 */
  1140. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  1141. * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
  1142. */
  1143. #define SICR_ENET_MASK ((uint)0x000000ff)
  1144. #define SICR_ENET_CLKRT ((uint)0x00000026)
  1145. # endif /* CONFIG_SCC1_ENET */
  1146. # ifdef CONFIG_FEC_ENET /* Use FEC for Fast Ethernet */
  1147. #define FEC_ENET
  1148. #define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */
  1149. #define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */
  1150. #define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */
  1151. #define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */
  1152. #define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */
  1153. #define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */
  1154. #define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */
  1155. #define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */
  1156. #define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */
  1157. #define PD_MII_MDC ((ushort)0x0008) /* PD 12 */
  1158. #define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */
  1159. #define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */
  1160. #define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */
  1161. #define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */
  1162. # endif /* CONFIG_FEC_ENET */
  1163. #endif /* CONFIG_TQM855L/M, TQM860L/M, TQM862L/M */
  1164. /*** V37 **********************************************************/
  1165. #ifdef CONFIG_V37
  1166. /* This ENET stuff is for the MPC823 with ethernet on SCC2. Some of
  1167. * this may be unique to the Marel V37 configuration.
  1168. * Note TENA is on Port B.
  1169. */
  1170. #define PROFF_ENET PROFF_SCC2
  1171. #define CPM_CR_ENET CPM_CR_CH_SCC2
  1172. #define SCC_ENET 1
  1173. #define PA_ENET_RXD ((ushort)0x0004)
  1174. #define PA_ENET_TXD ((ushort)0x0008)
  1175. #define PA_ENET_TCLK ((ushort)0x0400)
  1176. #define PA_ENET_RCLK ((ushort)0x0200)
  1177. #define PB_ENET_TENA ((uint)0x00002000)
  1178. #define PC_ENET_CLSN ((ushort)0x0040)
  1179. #define PC_ENET_RENA ((ushort)0x0080)
  1180. #define SICR_ENET_MASK ((uint)0x0000ff00)
  1181. #define SICR_ENET_CLKRT ((uint)0x00002e00)
  1182. #endif /* CONFIG_V37 */
  1183. /*********************************************************************/
  1184. /* SCC Event register as used by Ethernet.
  1185. */
  1186. #define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
  1187. #define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */
  1188. #define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */
  1189. #define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */
  1190. #define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
  1191. #define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
  1192. /* SCC Mode Register (PSMR) as used by Ethernet.
  1193. */
  1194. #define SCC_PSMR_HBC ((ushort)0x8000) /* Enable heartbeat */
  1195. #define SCC_PSMR_FC ((ushort)0x4000) /* Force collision */
  1196. #define SCC_PSMR_RSH ((ushort)0x2000) /* Receive short frames */
  1197. #define SCC_PSMR_IAM ((ushort)0x1000) /* Check individual hash */
  1198. #define SCC_PSMR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
  1199. #define SCC_PSMR_PRO ((ushort)0x0200) /* Promiscuous mode */
  1200. #define SCC_PSMR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
  1201. #define SCC_PSMR_SBT ((ushort)0x0080) /* Special backoff timer */
  1202. #define SCC_PSMR_LPB ((ushort)0x0040) /* Set Loopback mode */
  1203. #define SCC_PSMR_SIP ((ushort)0x0020) /* Sample Input Pins */
  1204. #define SCC_PSMR_LCW ((ushort)0x0010) /* Late collision window */
  1205. #define SCC_PSMR_NIB22 ((ushort)0x000a) /* Start frame search */
  1206. #define SCC_PSMR_FDE ((ushort)0x0001) /* Full duplex enable */
  1207. /* Buffer descriptor control/status used by Ethernet receive.
  1208. */
  1209. #define BD_ENET_RX_EMPTY ((ushort)0x8000)
  1210. #define BD_ENET_RX_WRAP ((ushort)0x2000)
  1211. #define BD_ENET_RX_INTR ((ushort)0x1000)
  1212. #define BD_ENET_RX_LAST ((ushort)0x0800)
  1213. #define BD_ENET_RX_FIRST ((ushort)0x0400)
  1214. #define BD_ENET_RX_MISS ((ushort)0x0100)
  1215. #define BD_ENET_RX_LG ((ushort)0x0020)
  1216. #define BD_ENET_RX_NO ((ushort)0x0010)
  1217. #define BD_ENET_RX_SH ((ushort)0x0008)
  1218. #define BD_ENET_RX_CR ((ushort)0x0004)
  1219. #define BD_ENET_RX_OV ((ushort)0x0002)
  1220. #define BD_ENET_RX_CL ((ushort)0x0001)
  1221. #define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */
  1222. /* Buffer descriptor control/status used by Ethernet transmit.
  1223. */
  1224. #define BD_ENET_TX_READY ((ushort)0x8000)
  1225. #define BD_ENET_TX_PAD ((ushort)0x4000)
  1226. #define BD_ENET_TX_WRAP ((ushort)0x2000)
  1227. #define BD_ENET_TX_INTR ((ushort)0x1000)
  1228. #define BD_ENET_TX_LAST ((ushort)0x0800)
  1229. #define BD_ENET_TX_TC ((ushort)0x0400)
  1230. #define BD_ENET_TX_DEF ((ushort)0x0200)
  1231. #define BD_ENET_TX_HB ((ushort)0x0100)
  1232. #define BD_ENET_TX_LC ((ushort)0x0080)
  1233. #define BD_ENET_TX_RL ((ushort)0x0040)
  1234. #define BD_ENET_TX_RCMASK ((ushort)0x003c)
  1235. #define BD_ENET_TX_UN ((ushort)0x0002)
  1236. #define BD_ENET_TX_CSL ((ushort)0x0001)
  1237. #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
  1238. /* SCC as UART
  1239. */
  1240. typedef struct scc_uart {
  1241. sccp_t scc_genscc;
  1242. uint scc_res1; /* Reserved */
  1243. uint scc_res2; /* Reserved */
  1244. ushort scc_maxidl; /* Maximum idle chars */
  1245. ushort scc_idlc; /* temp idle counter */
  1246. ushort scc_brkcr; /* Break count register */
  1247. ushort scc_parec; /* receive parity error counter */
  1248. ushort scc_frmec; /* receive framing error counter */
  1249. ushort scc_nosec; /* receive noise counter */
  1250. ushort scc_brkec; /* receive break condition counter */
  1251. ushort scc_brkln; /* last received break length */
  1252. ushort scc_uaddr1; /* UART address character 1 */
  1253. ushort scc_uaddr2; /* UART address character 2 */
  1254. ushort scc_rtemp; /* Temp storage */
  1255. ushort scc_toseq; /* Transmit out of sequence char */
  1256. ushort scc_char1; /* control character 1 */
  1257. ushort scc_char2; /* control character 2 */
  1258. ushort scc_char3; /* control character 3 */
  1259. ushort scc_char4; /* control character 4 */
  1260. ushort scc_char5; /* control character 5 */
  1261. ushort scc_char6; /* control character 6 */
  1262. ushort scc_char7; /* control character 7 */
  1263. ushort scc_char8; /* control character 8 */
  1264. ushort scc_rccm; /* receive control character mask */
  1265. ushort scc_rccr; /* receive control character register */
  1266. ushort scc_rlbc; /* receive last break character */
  1267. } scc_uart_t;
  1268. /* SCC Event and Mask registers when it is used as a UART.
  1269. */
  1270. #define UART_SCCM_GLR ((ushort)0x1000)
  1271. #define UART_SCCM_GLT ((ushort)0x0800)
  1272. #define UART_SCCM_AB ((ushort)0x0200)
  1273. #define UART_SCCM_IDL ((ushort)0x0100)
  1274. #define UART_SCCM_GRA ((ushort)0x0080)
  1275. #define UART_SCCM_BRKE ((ushort)0x0040)
  1276. #define UART_SCCM_BRKS ((ushort)0x0020)
  1277. #define UART_SCCM_CCR ((ushort)0x0008)
  1278. #define UART_SCCM_BSY ((ushort)0x0004)
  1279. #define UART_SCCM_TX ((ushort)0x0002)
  1280. #define UART_SCCM_RX ((ushort)0x0001)
  1281. /* The SCC PSMR when used as a UART.
  1282. */
  1283. #define SCU_PSMR_FLC ((ushort)0x8000)
  1284. #define SCU_PSMR_SL ((ushort)0x4000)
  1285. #define SCU_PSMR_CL ((ushort)0x3000)
  1286. #define SCU_PSMR_UM ((ushort)0x0c00)
  1287. #define SCU_PSMR_FRZ ((ushort)0x0200)
  1288. #define SCU_PSMR_RZS ((ushort)0x0100)
  1289. #define SCU_PSMR_SYN ((ushort)0x0080)
  1290. #define SCU_PSMR_DRT ((ushort)0x0040)
  1291. #define SCU_PSMR_PEN ((ushort)0x0010)
  1292. #define SCU_PSMR_RPM ((ushort)0x000c)
  1293. #define SCU_PSMR_REVP ((ushort)0x0008)
  1294. #define SCU_PSMR_TPM ((ushort)0x0003)
  1295. #define SCU_PSMR_TEVP ((ushort)0x0003)
  1296. /* CPM Transparent mode SCC.
  1297. */
  1298. typedef struct scc_trans {
  1299. sccp_t st_genscc;
  1300. uint st_cpres; /* Preset CRC */
  1301. uint st_cmask; /* Constant mask for CRC */
  1302. } scc_trans_t;
  1303. #define BD_SCC_TX_LAST ((ushort)0x0800)
  1304. /* IIC parameter RAM.
  1305. */
  1306. typedef struct iic {
  1307. ushort iic_rbase; /* Rx Buffer descriptor base address */
  1308. ushort iic_tbase; /* Tx Buffer descriptor base address */
  1309. u_char iic_rfcr; /* Rx function code */
  1310. u_char iic_tfcr; /* Tx function code */
  1311. ushort iic_mrblr; /* Max receive buffer length */
  1312. uint iic_rstate; /* Internal */
  1313. uint iic_rdp; /* Internal */
  1314. ushort iic_rbptr; /* Internal */
  1315. ushort iic_rbc; /* Internal */
  1316. uint iic_rxtmp; /* Internal */
  1317. uint iic_tstate; /* Internal */
  1318. uint iic_tdp; /* Internal */
  1319. ushort iic_tbptr; /* Internal */
  1320. ushort iic_tbc; /* Internal */
  1321. uint iic_txtmp; /* Internal */
  1322. uint iic_res; /* reserved */
  1323. ushort iic_rpbase; /* Relocation pointer */
  1324. ushort iic_res2; /* reserved */
  1325. } iic_t;
  1326. /* SPI parameter RAM.
  1327. */
  1328. typedef struct spi {
  1329. ushort spi_rbase; /* Rx Buffer descriptor base address */
  1330. ushort spi_tbase; /* Tx Buffer descriptor base address */
  1331. u_char spi_rfcr; /* Rx function code */
  1332. u_char spi_tfcr; /* Tx function code */
  1333. ushort spi_mrblr; /* Max receive buffer length */
  1334. uint spi_rstate; /* Internal */
  1335. uint spi_rdp; /* Internal */
  1336. ushort spi_rbptr; /* Internal */
  1337. ushort spi_rbc; /* Internal */
  1338. uint spi_rxtmp; /* Internal */
  1339. uint spi_tstate; /* Internal */
  1340. uint spi_tdp; /* Internal */
  1341. ushort spi_tbptr; /* Internal */
  1342. ushort spi_tbc; /* Internal */
  1343. uint spi_txtmp; /* Internal */
  1344. uint spi_res;
  1345. ushort spi_rpbase; /* Relocation pointer */
  1346. ushort spi_res2;
  1347. } spi_t;
  1348. /* SPI Mode register.
  1349. */
  1350. #define SPMODE_LOOP ((ushort)0x4000) /* Loopback */
  1351. #define SPMODE_CI ((ushort)0x2000) /* Clock Invert */
  1352. #define SPMODE_CP ((ushort)0x1000) /* Clock Phase */
  1353. #define SPMODE_DIV16 ((ushort)0x0800) /* BRG/16 mode */
  1354. #define SPMODE_REV ((ushort)0x0400) /* Reversed Data */
  1355. #define SPMODE_MSTR ((ushort)0x0200) /* SPI Master */
  1356. #define SPMODE_EN ((ushort)0x0100) /* Enable */
  1357. #define SPMODE_LENMSK ((ushort)0x00f0) /* character length */
  1358. #define SPMODE_PMMSK ((ushort)0x000f) /* prescale modulus */
  1359. #define SPMODE_LEN(x) ((((x)-1)&0xF)<<4)
  1360. #define SPMODE_PM(x) ((x) &0xF)
  1361. /* HDLC parameter RAM.
  1362. */
  1363. typedef struct hdlc_pram_s {
  1364. /*
  1365. * SCC parameter RAM
  1366. */
  1367. ushort rbase; /* Rx Buffer descriptor base address */
  1368. ushort tbase; /* Tx Buffer descriptor base address */
  1369. uchar rfcr; /* Rx function code */
  1370. uchar tfcr; /* Tx function code */
  1371. ushort mrblr; /* Rx buffer length */
  1372. ulong rstate; /* Rx internal state */
  1373. ulong rptr; /* Rx internal data pointer */
  1374. ushort rbptr; /* rb BD Pointer */
  1375. ushort rcount; /* Rx internal byte count */
  1376. ulong rtemp; /* Rx temp */
  1377. ulong tstate; /* Tx internal state */
  1378. ulong tptr; /* Tx internal data pointer */
  1379. ushort tbptr; /* Tx BD pointer */
  1380. ushort tcount; /* Tx byte count */
  1381. ulong ttemp; /* Tx temp */
  1382. ulong rcrc; /* temp receive CRC */
  1383. ulong tcrc; /* temp transmit CRC */
  1384. /*
  1385. * HDLC specific parameter RAM
  1386. */
  1387. uchar res[4]; /* reserved */
  1388. ulong c_mask; /* CRC constant */
  1389. ulong c_pres; /* CRC preset */
  1390. ushort disfc; /* discarded frame counter */
  1391. ushort crcec; /* CRC error counter */
  1392. ushort abtsc; /* abort sequence counter */
  1393. ushort nmarc; /* nonmatching address rx cnt */
  1394. ushort retrc; /* frame retransmission cnt */
  1395. ushort mflr; /* maximum frame length reg */
  1396. ushort max_cnt; /* maximum length counter */
  1397. ushort rfthr; /* received frames threshold */
  1398. ushort rfcnt; /* received frames count */
  1399. ushort hmask; /* user defined frm addr mask */
  1400. ushort haddr1; /* user defined frm address 1 */
  1401. ushort haddr2; /* user defined frm address 2 */
  1402. ushort haddr3; /* user defined frm address 3 */
  1403. ushort haddr4; /* user defined frm address 4 */
  1404. ushort tmp; /* temp */
  1405. ushort tmp_mb; /* temp */
  1406. } hdlc_pram_t;
  1407. /* CPM interrupts. There are nearly 32 interrupts generated by CPM
  1408. * channels or devices. All of these are presented to the PPC core
  1409. * as a single interrupt. The CPM interrupt handler dispatches its
  1410. * own handlers, in a similar fashion to the PPC core handler. We
  1411. * use the table as defined in the manuals (i.e. no special high
  1412. * priority and SCC1 == SCCa, etc...).
  1413. */
  1414. #define CPMVEC_NR 32
  1415. #define CPMVEC_OFFSET 0x00010000
  1416. #define CPMVEC_PIO_PC15 ((ushort)0x1f | CPMVEC_OFFSET)
  1417. #define CPMVEC_SCC1 ((ushort)0x1e | CPMVEC_OFFSET)
  1418. #define CPMVEC_SCC2 ((ushort)0x1d | CPMVEC_OFFSET)
  1419. #define CPMVEC_SCC3 ((ushort)0x1c | CPMVEC_OFFSET)
  1420. #define CPMVEC_SCC4 ((ushort)0x1b | CPMVEC_OFFSET)
  1421. #define CPMVEC_PIO_PC14 ((ushort)0x1a | CPMVEC_OFFSET)
  1422. #define CPMVEC_TIMER1 ((ushort)0x19 | CPMVEC_OFFSET)
  1423. #define CPMVEC_PIO_PC13 ((ushort)0x18 | CPMVEC_OFFSET)
  1424. #define CPMVEC_PIO_PC12 ((ushort)0x17 | CPMVEC_OFFSET)
  1425. #define CPMVEC_SDMA_CB_ERR ((ushort)0x16 | CPMVEC_OFFSET)
  1426. #define CPMVEC_IDMA1 ((ushort)0x15 | CPMVEC_OFFSET)
  1427. #define CPMVEC_IDMA2 ((ushort)0x14 | CPMVEC_OFFSET)
  1428. #define CPMVEC_TIMER2 ((ushort)0x12 | CPMVEC_OFFSET)
  1429. #define CPMVEC_RISCTIMER ((ushort)0x11 | CPMVEC_OFFSET)
  1430. #define CPMVEC_I2C ((ushort)0x10 | CPMVEC_OFFSET)
  1431. #define CPMVEC_PIO_PC11 ((ushort)0x0f | CPMVEC_OFFSET)
  1432. #define CPMVEC_PIO_PC10 ((ushort)0x0e | CPMVEC_OFFSET)
  1433. #define CPMVEC_TIMER3 ((ushort)0x0c | CPMVEC_OFFSET)
  1434. #define CPMVEC_PIO_PC9 ((ushort)0x0b | CPMVEC_OFFSET)
  1435. #define CPMVEC_PIO_PC8 ((ushort)0x0a | CPMVEC_OFFSET)
  1436. #define CPMVEC_PIO_PC7 ((ushort)0x09 | CPMVEC_OFFSET)
  1437. #define CPMVEC_TIMER4 ((ushort)0x07 | CPMVEC_OFFSET)
  1438. #define CPMVEC_PIO_PC6 ((ushort)0x06 | CPMVEC_OFFSET)
  1439. #define CPMVEC_SPI ((ushort)0x05 | CPMVEC_OFFSET)
  1440. #define CPMVEC_SMC1 ((ushort)0x04 | CPMVEC_OFFSET)
  1441. #define CPMVEC_SMC2 ((ushort)0x03 | CPMVEC_OFFSET)
  1442. #define CPMVEC_PIO_PC5 ((ushort)0x02 | CPMVEC_OFFSET)
  1443. #define CPMVEC_PIO_PC4 ((ushort)0x01 | CPMVEC_OFFSET)
  1444. #define CPMVEC_ERROR ((ushort)0x00 | CPMVEC_OFFSET)
  1445. extern void irq_install_handler(int vec, void (*handler)(void *), void *dev_id);
  1446. /* CPM interrupt configuration vector.
  1447. */
  1448. #define CICR_SCD_SCC4 ((uint)0x00c00000) /* SCC4 @ SCCd */
  1449. #define CICR_SCC_SCC3 ((uint)0x00200000) /* SCC3 @ SCCc */
  1450. #define CICR_SCB_SCC2 ((uint)0x00040000) /* SCC2 @ SCCb */
  1451. #define CICR_SCA_SCC1 ((uint)0x00000000) /* SCC1 @ SCCa */
  1452. #define CICR_IRL_MASK ((uint)0x0000e000) /* Core interrrupt */
  1453. #define CICR_HP_MASK ((uint)0x00001f00) /* Hi-pri int. */
  1454. #define CICR_IEN ((uint)0x00000080) /* Int. enable */
  1455. #define CICR_SPS ((uint)0x00000001) /* SCC Spread */
  1456. #endif /* __CPM_8XX__ */