commproc.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  1. /*
  2. * MPC8xx Communication Processor Module.
  3. * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
  4. *
  5. * (C) Copyright 2000-2006
  6. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  7. *
  8. * This file contains structures and information for the communication
  9. * processor channels. Some CPM control and status is available
  10. * throught the MPC8xx internal memory map. See immap.h for details.
  11. * This file only contains what I need for the moment, not the total
  12. * CPM capabilities. I (or someone else) will add definitions as they
  13. * are needed. -- Dan
  14. *
  15. */
  16. #ifndef __CPM_8XX__
  17. #define __CPM_8XX__
  18. #include <asm/8xx_immap.h>
  19. /* CPM Command register.
  20. */
  21. #define CPM_CR_RST ((ushort)0x8000)
  22. #define CPM_CR_OPCODE ((ushort)0x0f00)
  23. #define CPM_CR_CHAN ((ushort)0x00f0)
  24. #define CPM_CR_FLG ((ushort)0x0001)
  25. /* Some commands (there are more...later)
  26. */
  27. #define CPM_CR_INIT_TRX ((ushort)0x0000)
  28. #define CPM_CR_INIT_RX ((ushort)0x0001)
  29. #define CPM_CR_INIT_TX ((ushort)0x0002)
  30. #define CPM_CR_HUNT_MODE ((ushort)0x0003)
  31. #define CPM_CR_STOP_TX ((ushort)0x0004)
  32. #define CPM_CR_RESTART_TX ((ushort)0x0006)
  33. #define CPM_CR_SET_GADDR ((ushort)0x0008)
  34. /* Channel numbers.
  35. */
  36. #define CPM_CR_CH_SCC1 ((ushort)0x0000)
  37. #define CPM_CR_CH_I2C ((ushort)0x0001) /* I2C and IDMA1 */
  38. #define CPM_CR_CH_SCC2 ((ushort)0x0004)
  39. #define CPM_CR_CH_SPI ((ushort)0x0005) /* SPI/IDMA2/Timers */
  40. #define CPM_CR_CH_SCC3 ((ushort)0x0008)
  41. #define CPM_CR_CH_SMC1 ((ushort)0x0009) /* SMC1 / DSP1 */
  42. #define CPM_CR_CH_SCC4 ((ushort)0x000c)
  43. #define CPM_CR_CH_SMC2 ((ushort)0x000d) /* SMC2 / DSP2 */
  44. #define mk_cr_cmd(CH, CMD) ((CMD << 8) | (CH << 4))
  45. /*
  46. * DPRAM defines and allocation functions
  47. */
  48. /* The dual ported RAM is multi-functional. Some areas can be (and are
  49. * being) used for microcode. There is an area that can only be used
  50. * as data ram for buffer descriptors, which is all we use right now.
  51. * Currently the first 512 and last 256 bytes are used for microcode.
  52. */
  53. #ifdef CONFIG_SYS_ALLOC_DPRAM
  54. #define CPM_DATAONLY_BASE ((uint)0x0800)
  55. #define CPM_DATAONLY_SIZE ((uint)0x0700)
  56. #define CPM_DP_NOSPACE ((uint)0x7fffffff)
  57. #else
  58. #define CPM_SERIAL_BASE 0x0800
  59. #define CPM_I2C_BASE 0x0820
  60. #define CPM_SPI_BASE 0x0840
  61. #define CPM_FEC_BASE 0x0860
  62. #define CPM_SERIAL2_BASE 0x08E0
  63. #define CPM_SCC_BASE 0x0900
  64. #define CPM_POST_BASE 0x0980
  65. #define CPM_WLKBD_BASE 0x0a00
  66. #endif
  67. #ifndef CONFIG_SYS_CPM_POST_WORD_ADDR
  68. #define CPM_POST_WORD_ADDR 0x07FC
  69. #else
  70. #define CPM_POST_WORD_ADDR CONFIG_SYS_CPM_POST_WORD_ADDR
  71. #endif
  72. #ifndef CONFIG_SYS_CPM_BOOTCOUNT_ADDR
  73. #define CPM_BOOTCOUNT_ADDR (CPM_POST_WORD_ADDR - 2*sizeof(ulong))
  74. #else
  75. #define CPM_BOOTCOUNT_ADDR CONFIG_SYS_CPM_BOOTCOUNT_ADDR
  76. #endif
  77. #define BD_IIC_START ((uint) 0x0400) /* <- please use CPM_I2C_BASE !! */
  78. /* Export the base address of the communication processor registers
  79. * and dual port ram.
  80. */
  81. extern cpm8xx_t *cpmp; /* Pointer to comm processor */
  82. /* Buffer descriptors used by many of the CPM protocols.
  83. */
  84. typedef struct cpm_buf_desc {
  85. ushort cbd_sc; /* Status and Control */
  86. ushort cbd_datlen; /* Data length in buffer */
  87. uint cbd_bufaddr; /* Buffer address in host memory */
  88. } cbd_t;
  89. #define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */
  90. #define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
  91. #define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */
  92. #define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
  93. #define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame */
  94. #define BD_SC_TC ((ushort)0x0400) /* Transmit CRC */
  95. #define BD_SC_CM ((ushort)0x0200) /* Continous mode */
  96. #define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */
  97. #define BD_SC_P ((ushort)0x0100) /* xmt preamble */
  98. #define BD_SC_BR ((ushort)0x0020) /* Break received */
  99. #define BD_SC_FR ((ushort)0x0010) /* Framing error */
  100. #define BD_SC_PR ((ushort)0x0008) /* Parity error */
  101. #define BD_SC_OV ((ushort)0x0002) /* Overrun */
  102. #define BD_SC_CD ((ushort)0x0001) /* Carrier Detect lost */
  103. /* Parameter RAM offsets.
  104. */
  105. #define PROFF_SCC1 ((uint)0x0000)
  106. #define PROFF_IIC ((uint)0x0080)
  107. #define PROFF_REVNUM ((uint)0x00b0)
  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. */
  116. typedef struct smc_uart {
  117. ushort smc_rbase; /* Rx Buffer descriptor base address */
  118. ushort smc_tbase; /* Tx Buffer descriptor base address */
  119. u_char smc_rfcr; /* Rx function code */
  120. u_char smc_tfcr; /* Tx function code */
  121. ushort smc_mrblr; /* Max receive buffer length */
  122. uint smc_rstate; /* Internal */
  123. uint smc_idp; /* Internal */
  124. ushort smc_rbptr; /* Internal */
  125. ushort smc_ibc; /* Internal */
  126. uint smc_rxtmp; /* Internal */
  127. uint smc_tstate; /* Internal */
  128. uint smc_tdp; /* Internal */
  129. ushort smc_tbptr; /* Internal */
  130. ushort smc_tbc; /* Internal */
  131. uint smc_txtmp; /* Internal */
  132. ushort smc_maxidl; /* Maximum idle characters */
  133. ushort smc_tmpidl; /* Temporary idle counter */
  134. ushort smc_brklen; /* Last received break length */
  135. ushort smc_brkec; /* rcv'd break condition counter */
  136. ushort smc_brkcr; /* xmt break count register */
  137. ushort smc_rmask; /* Temporary bit mask */
  138. u_char res1[8];
  139. ushort smc_rpbase; /* Relocation pointer */
  140. } smc_uart_t;
  141. /* Function code bits.
  142. */
  143. #define SMC_EB ((u_char)0x10) /* Set big endian byte order */
  144. /* SMC uart mode register.
  145. */
  146. #define SMCMR_REN ((ushort)0x0001)
  147. #define SMCMR_TEN ((ushort)0x0002)
  148. #define SMCMR_DM ((ushort)0x000c)
  149. #define SMCMR_SM_GCI ((ushort)0x0000)
  150. #define SMCMR_SM_UART ((ushort)0x0020)
  151. #define SMCMR_SM_TRANS ((ushort)0x0030)
  152. #define SMCMR_SM_MASK ((ushort)0x0030)
  153. #define SMCMR_PM_EVEN ((ushort)0x0100) /* Even parity, else odd */
  154. #define SMCMR_REVD SMCMR_PM_EVEN
  155. #define SMCMR_PEN ((ushort)0x0200) /* Parity enable */
  156. #define SMCMR_BS SMCMR_PEN
  157. #define SMCMR_SL ((ushort)0x0400) /* Two stops, else one */
  158. #define SMCR_CLEN_MASK ((ushort)0x7800) /* Character length */
  159. #define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
  160. /* SMC2 as Centronics parallel printer. It is half duplex, in that
  161. * it can only receive or transmit. The parameter ram values for
  162. * each direction are either unique or properly overlap, so we can
  163. * include them in one structure.
  164. */
  165. typedef struct smc_centronics {
  166. ushort scent_rbase;
  167. ushort scent_tbase;
  168. u_char scent_cfcr;
  169. u_char scent_smask;
  170. ushort scent_mrblr;
  171. uint scent_rstate;
  172. uint scent_r_ptr;
  173. ushort scent_rbptr;
  174. ushort scent_r_cnt;
  175. uint scent_rtemp;
  176. uint scent_tstate;
  177. uint scent_t_ptr;
  178. ushort scent_tbptr;
  179. ushort scent_t_cnt;
  180. uint scent_ttemp;
  181. ushort scent_max_sl;
  182. ushort scent_sl_cnt;
  183. ushort scent_character1;
  184. ushort scent_character2;
  185. ushort scent_character3;
  186. ushort scent_character4;
  187. ushort scent_character5;
  188. ushort scent_character6;
  189. ushort scent_character7;
  190. ushort scent_character8;
  191. ushort scent_rccm;
  192. ushort scent_rccr;
  193. } smc_cent_t;
  194. /* Centronics Status Mask Register.
  195. */
  196. #define SMC_CENT_F ((u_char)0x08)
  197. #define SMC_CENT_PE ((u_char)0x04)
  198. #define SMC_CENT_S ((u_char)0x02)
  199. /* SMC Event and Mask register.
  200. */
  201. #define SMCM_BRKE ((unsigned char)0x40) /* When in UART Mode */
  202. #define SMCM_BRK ((unsigned char)0x10) /* When in UART Mode */
  203. #define SMCM_TXE ((unsigned char)0x10) /* When in Transparent Mode */
  204. #define SMCM_BSY ((unsigned char)0x04)
  205. #define SMCM_TX ((unsigned char)0x02)
  206. #define SMCM_RX ((unsigned char)0x01)
  207. /* Baud rate generators.
  208. */
  209. #define CPM_BRG_RST ((uint)0x00020000)
  210. #define CPM_BRG_EN ((uint)0x00010000)
  211. #define CPM_BRG_EXTC_INT ((uint)0x00000000)
  212. #define CPM_BRG_EXTC_CLK2 ((uint)0x00004000)
  213. #define CPM_BRG_EXTC_CLK6 ((uint)0x00008000)
  214. #define CPM_BRG_ATB ((uint)0x00002000)
  215. #define CPM_BRG_CD_MASK ((uint)0x00001ffe)
  216. #define CPM_BRG_DIV16 ((uint)0x00000001)
  217. /* SI Clock Route Register
  218. */
  219. #define SICR_RCLK_SCC1_BRG1 ((uint)0x00000000)
  220. #define SICR_TCLK_SCC1_BRG1 ((uint)0x00000000)
  221. #define SICR_RCLK_SCC2_BRG2 ((uint)0x00000800)
  222. #define SICR_TCLK_SCC2_BRG2 ((uint)0x00000100)
  223. #define SICR_RCLK_SCC3_BRG3 ((uint)0x00100000)
  224. #define SICR_TCLK_SCC3_BRG3 ((uint)0x00020000)
  225. #define SICR_RCLK_SCC4_BRG4 ((uint)0x18000000)
  226. #define SICR_TCLK_SCC4_BRG4 ((uint)0x03000000)
  227. /* SCCs.
  228. */
  229. #define SCC_GSMRH_IRP ((uint)0x00040000)
  230. #define SCC_GSMRH_GDE ((uint)0x00010000)
  231. #define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
  232. #define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
  233. #define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
  234. #define SCC_GSMRH_REVD ((uint)0x00002000)
  235. #define SCC_GSMRH_TRX ((uint)0x00001000)
  236. #define SCC_GSMRH_TTX ((uint)0x00000800)
  237. #define SCC_GSMRH_CDP ((uint)0x00000400)
  238. #define SCC_GSMRH_CTSP ((uint)0x00000200)
  239. #define SCC_GSMRH_CDS ((uint)0x00000100)
  240. #define SCC_GSMRH_CTSS ((uint)0x00000080)
  241. #define SCC_GSMRH_TFL ((uint)0x00000040)
  242. #define SCC_GSMRH_RFW ((uint)0x00000020)
  243. #define SCC_GSMRH_TXSY ((uint)0x00000010)
  244. #define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
  245. #define SCC_GSMRH_SYNL8 ((uint)0x00000008)
  246. #define SCC_GSMRH_SYNL4 ((uint)0x00000004)
  247. #define SCC_GSMRH_RTSM ((uint)0x00000002)
  248. #define SCC_GSMRH_RSYN ((uint)0x00000001)
  249. #define SCC_GSMRL_SIR ((uint)0x80000000) /* SCC2 only */
  250. #define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
  251. #define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
  252. #define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
  253. #define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
  254. #define SCC_GSMRL_TCI ((uint)0x10000000)
  255. #define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
  256. #define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
  257. #define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
  258. #define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
  259. #define SCC_GSMRL_RINV ((uint)0x02000000)
  260. #define SCC_GSMRL_TINV ((uint)0x01000000)
  261. #define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
  262. #define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
  263. #define SCC_GSMRL_TPL_48 ((uint)0x00800000)
  264. #define SCC_GSMRL_TPL_32 ((uint)0x00600000)
  265. #define SCC_GSMRL_TPL_16 ((uint)0x00400000)
  266. #define SCC_GSMRL_TPL_8 ((uint)0x00200000)
  267. #define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
  268. #define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
  269. #define SCC_GSMRL_TPP_01 ((uint)0x00100000)
  270. #define SCC_GSMRL_TPP_10 ((uint)0x00080000)
  271. #define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
  272. #define SCC_GSMRL_TEND ((uint)0x00040000)
  273. #define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
  274. #define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
  275. #define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
  276. #define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
  277. #define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
  278. #define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
  279. #define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
  280. #define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
  281. #define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
  282. #define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
  283. #define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
  284. #define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
  285. #define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
  286. #define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
  287. #define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
  288. #define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
  289. #define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
  290. #define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
  291. #define SCC_GSMRL_DIAG_LE ((uint)0x000000c0) /* Loop and echo */
  292. #define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
  293. #define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
  294. #define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
  295. #define SCC_GSMRL_ENR ((uint)0x00000020)
  296. #define SCC_GSMRL_ENT ((uint)0x00000010)
  297. #define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
  298. #define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
  299. #define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
  300. #define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
  301. #define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
  302. #define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
  303. #define SCC_GSMRL_MODE_UART ((uint)0x00000004)
  304. #define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
  305. #define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
  306. #define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
  307. #define SCC_TODR_TOD ((ushort)0x8000)
  308. /* SCC Event and Mask register.
  309. */
  310. #define SCCM_TXE ((unsigned char)0x10)
  311. #define SCCM_BSY ((unsigned char)0x04)
  312. #define SCCM_TX ((unsigned char)0x02)
  313. #define SCCM_RX ((unsigned char)0x01)
  314. typedef struct scc_param {
  315. ushort scc_rbase; /* Rx Buffer descriptor base address */
  316. ushort scc_tbase; /* Tx Buffer descriptor base address */
  317. u_char scc_rfcr; /* Rx function code */
  318. u_char scc_tfcr; /* Tx function code */
  319. ushort scc_mrblr; /* Max receive buffer length */
  320. uint scc_rstate; /* Internal */
  321. uint scc_idp; /* Internal */
  322. ushort scc_rbptr; /* Internal */
  323. ushort scc_ibc; /* Internal */
  324. uint scc_rxtmp; /* Internal */
  325. uint scc_tstate; /* Internal */
  326. uint scc_tdp; /* Internal */
  327. ushort scc_tbptr; /* Internal */
  328. ushort scc_tbc; /* Internal */
  329. uint scc_txtmp; /* Internal */
  330. uint scc_rcrc; /* Internal */
  331. uint scc_tcrc; /* Internal */
  332. } sccp_t;
  333. /* Function code bits.
  334. */
  335. #define SCC_EB ((u_char)0x10) /* Set big endian byte order */
  336. /* CPM Ethernet through SCCx.
  337. */
  338. typedef struct scc_enet {
  339. sccp_t sen_genscc;
  340. uint sen_cpres; /* Preset CRC */
  341. uint sen_cmask; /* Constant mask for CRC */
  342. uint sen_crcec; /* CRC Error counter */
  343. uint sen_alec; /* alignment error counter */
  344. uint sen_disfc; /* discard frame counter */
  345. ushort sen_pads; /* Tx short frame pad character */
  346. ushort sen_retlim; /* Retry limit threshold */
  347. ushort sen_retcnt; /* Retry limit counter */
  348. ushort sen_maxflr; /* maximum frame length register */
  349. ushort sen_minflr; /* minimum frame length register */
  350. ushort sen_maxd1; /* maximum DMA1 length */
  351. ushort sen_maxd2; /* maximum DMA2 length */
  352. ushort sen_maxd; /* Rx max DMA */
  353. ushort sen_dmacnt; /* Rx DMA counter */
  354. ushort sen_maxb; /* Max BD byte count */
  355. ushort sen_gaddr1; /* Group address filter */
  356. ushort sen_gaddr2;
  357. ushort sen_gaddr3;
  358. ushort sen_gaddr4;
  359. uint sen_tbuf0data0; /* Save area 0 - current frame */
  360. uint sen_tbuf0data1; /* Save area 1 - current frame */
  361. uint sen_tbuf0rba; /* Internal */
  362. uint sen_tbuf0crc; /* Internal */
  363. ushort sen_tbuf0bcnt; /* Internal */
  364. ushort sen_paddrh; /* physical address (MSB) */
  365. ushort sen_paddrm;
  366. ushort sen_paddrl; /* physical address (LSB) */
  367. ushort sen_pper; /* persistence */
  368. ushort sen_rfbdptr; /* Rx first BD pointer */
  369. ushort sen_tfbdptr; /* Tx first BD pointer */
  370. ushort sen_tlbdptr; /* Tx last BD pointer */
  371. uint sen_tbuf1data0; /* Save area 0 - current frame */
  372. uint sen_tbuf1data1; /* Save area 1 - current frame */
  373. uint sen_tbuf1rba; /* Internal */
  374. uint sen_tbuf1crc; /* Internal */
  375. ushort sen_tbuf1bcnt; /* Internal */
  376. ushort sen_txlen; /* Tx Frame length counter */
  377. ushort sen_iaddr1; /* Individual address filter */
  378. ushort sen_iaddr2;
  379. ushort sen_iaddr3;
  380. ushort sen_iaddr4;
  381. ushort sen_boffcnt; /* Backoff counter */
  382. /* NOTE: Some versions of the manual have the following items
  383. * incorrectly documented. Below is the proper order.
  384. */
  385. ushort sen_taddrh; /* temp address (MSB) */
  386. ushort sen_taddrm;
  387. ushort sen_taddrl; /* temp address (LSB) */
  388. } scc_enet_t;
  389. /**********************************************************************
  390. *
  391. * Board specific configuration settings.
  392. *
  393. * Please note that we use the presence of a #define SCC_ENET and/or
  394. * #define FEC_ENET to enable the SCC resp. FEC ethernet drivers.
  395. **********************************************************************/
  396. /*** BSEIP **********************************************************/
  397. #ifdef CONFIG_BSEIP
  398. /* This ENET stuff is for the MPC823 with ethernet on SCC2.
  399. * This is unique to the BSE ip-Engine board.
  400. */
  401. #define PROFF_ENET PROFF_SCC2
  402. #define CPM_CR_ENET CPM_CR_CH_SCC2
  403. #define SCC_ENET 1
  404. #define PA_ENET_RXD ((ushort)0x0004)
  405. #define PA_ENET_TXD ((ushort)0x0008)
  406. #define PA_ENET_TCLK ((ushort)0x0100)
  407. #define PA_ENET_RCLK ((ushort)0x0200)
  408. #define PB_ENET_TENA ((uint)0x00002000)
  409. #define PC_ENET_CLSN ((ushort)0x0040)
  410. #define PC_ENET_RENA ((ushort)0x0080)
  411. /* BSE uses port B and C bits for PHY control also.
  412. */
  413. #define PB_BSE_POWERUP ((uint)0x00000004)
  414. #define PB_BSE_FDXDIS ((uint)0x00008000)
  415. #define PC_BSE_LOOPBACK ((ushort)0x0800)
  416. #define SICR_ENET_MASK ((uint)0x0000ff00)
  417. #define SICR_ENET_CLKRT ((uint)0x00002c00)
  418. #endif /* CONFIG_BSEIP */
  419. /*** KM8XX *********************************************************/
  420. /* The KM8XX Service Module uses SCC3 for Ethernet */
  421. #ifdef CONFIG_KM8XX
  422. #define PROFF_ENET PROFF_SCC3 /* Ethernet on SCC3 */
  423. #define CPM_CR_ENET CPM_CR_CH_SCC3
  424. #define SCC_ENET 2
  425. #define PA_ENET_RXD ((ushort)0x0010) /* PA 11 */
  426. #define PA_ENET_TXD ((ushort)0x0020) /* PA 10 */
  427. #define PA_ENET_RCLK ((ushort)0x1000) /* PA 3 CLK 5 */
  428. #define PA_ENET_TCLK ((ushort)0x2000) /* PA 2 CLK 6 */
  429. #define PC_ENET_TENA ((ushort)0x0004) /* PC 13 */
  430. #define PC_ENET_RENA ((ushort)0x0200) /* PC 6 */
  431. #define PC_ENET_CLSN ((ushort)0x0100) /* PC 7 */
  432. /* Control bits in the SICR to route TCLK (CLK6) and RCLK (CLK5) to
  433. * SCC3. Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero.
  434. */
  435. #define SICR_ENET_MASK ((uint)0x00FF0000)
  436. #define SICR_ENET_CLKRT ((uint)0x00250000)
  437. #endif /* CONFIG_KM8XX */
  438. /*** MVS1, TQM823L/M, TQM850L/M, TQM885D, R360MPI **********/
  439. #if (defined(CONFIG_MVS) && CONFIG_MVS < 2) || \
  440. defined(CONFIG_TQM823L) || \
  441. defined(CONFIG_TQM823M) || defined(CONFIG_TQM850L) || \
  442. defined(CONFIG_TQM850M) || defined(CONFIG_TQM885D)
  443. /* Bits in parallel I/O port registers that have to be set/cleared
  444. * to configure the pins for SCC2 use.
  445. */
  446. #define PROFF_ENET PROFF_SCC2
  447. #define CPM_CR_ENET CPM_CR_CH_SCC2
  448. #define SCC_ENET 1
  449. #define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
  450. #define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
  451. #define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
  452. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  453. #define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
  454. #define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
  455. #define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
  456. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  457. * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
  458. */
  459. #define SICR_ENET_MASK ((uint)0x0000ff00)
  460. #define SICR_ENET_CLKRT ((uint)0x00002600)
  461. # ifdef CONFIG_FEC_ENET /* Use FEC for Fast Ethernet */
  462. #define FEC_ENET
  463. # endif /* CONFIG_FEC_ENET */
  464. #endif /* CONFIG_MVS v1, CONFIG_TQM823L/M, CONFIG_TQM850L/M, etc. */
  465. /*** TQM855L/M, TQM860L/M, TQM862L/M, TQM866L/M *********************/
  466. #if defined(CONFIG_TQM855L) || defined(CONFIG_TQM855M) || \
  467. defined(CONFIG_TQM860L) || defined(CONFIG_TQM860M) || \
  468. defined(CONFIG_TQM862L) || defined(CONFIG_TQM862M) || \
  469. defined(CONFIG_TQM866L) || defined(CONFIG_TQM866M)
  470. # ifdef CONFIG_SCC1_ENET /* use SCC for 10Mbps Ethernet */
  471. /* Bits in parallel I/O port registers that have to be set/cleared
  472. * to configure the pins for SCC1 use.
  473. */
  474. #define PROFF_ENET PROFF_SCC1
  475. #define CPM_CR_ENET CPM_CR_CH_SCC1
  476. #define SCC_ENET 0
  477. #define PA_ENET_RXD ((ushort)0x0001) /* PA 15 */
  478. #define PA_ENET_TXD ((ushort)0x0002) /* PA 14 */
  479. #define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
  480. #define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
  481. #define PC_ENET_TENA ((ushort)0x0001) /* PC 15 */
  482. #define PC_ENET_CLSN ((ushort)0x0010) /* PC 11 */
  483. #define PC_ENET_RENA ((ushort)0x0020) /* PC 10 */
  484. /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
  485. * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
  486. */
  487. #define SICR_ENET_MASK ((uint)0x000000ff)
  488. #define SICR_ENET_CLKRT ((uint)0x00000026)
  489. # endif /* CONFIG_SCC1_ENET */
  490. # ifdef CONFIG_FEC_ENET /* Use FEC for Fast Ethernet */
  491. #define FEC_ENET
  492. #define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */
  493. #define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */
  494. #define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */
  495. #define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */
  496. #define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */
  497. #define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */
  498. #define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */
  499. #define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */
  500. #define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */
  501. #define PD_MII_MDC ((ushort)0x0008) /* PD 12 */
  502. #define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */
  503. #define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */
  504. #define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */
  505. #define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */
  506. # endif /* CONFIG_FEC_ENET */
  507. #endif /* CONFIG_TQM855L/M, TQM860L/M, TQM862L/M */
  508. /*********************************************************************/
  509. /* SCC Event register as used by Ethernet.
  510. */
  511. #define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
  512. #define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */
  513. #define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */
  514. #define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */
  515. #define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
  516. #define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
  517. /* SCC Mode Register (PSMR) as used by Ethernet.
  518. */
  519. #define SCC_PSMR_HBC ((ushort)0x8000) /* Enable heartbeat */
  520. #define SCC_PSMR_FC ((ushort)0x4000) /* Force collision */
  521. #define SCC_PSMR_RSH ((ushort)0x2000) /* Receive short frames */
  522. #define SCC_PSMR_IAM ((ushort)0x1000) /* Check individual hash */
  523. #define SCC_PSMR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
  524. #define SCC_PSMR_PRO ((ushort)0x0200) /* Promiscuous mode */
  525. #define SCC_PSMR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
  526. #define SCC_PSMR_SBT ((ushort)0x0080) /* Special backoff timer */
  527. #define SCC_PSMR_LPB ((ushort)0x0040) /* Set Loopback mode */
  528. #define SCC_PSMR_SIP ((ushort)0x0020) /* Sample Input Pins */
  529. #define SCC_PSMR_LCW ((ushort)0x0010) /* Late collision window */
  530. #define SCC_PSMR_NIB22 ((ushort)0x000a) /* Start frame search */
  531. #define SCC_PSMR_FDE ((ushort)0x0001) /* Full duplex enable */
  532. /* Buffer descriptor control/status used by Ethernet receive.
  533. */
  534. #define BD_ENET_RX_EMPTY ((ushort)0x8000)
  535. #define BD_ENET_RX_WRAP ((ushort)0x2000)
  536. #define BD_ENET_RX_INTR ((ushort)0x1000)
  537. #define BD_ENET_RX_LAST ((ushort)0x0800)
  538. #define BD_ENET_RX_FIRST ((ushort)0x0400)
  539. #define BD_ENET_RX_MISS ((ushort)0x0100)
  540. #define BD_ENET_RX_LG ((ushort)0x0020)
  541. #define BD_ENET_RX_NO ((ushort)0x0010)
  542. #define BD_ENET_RX_SH ((ushort)0x0008)
  543. #define BD_ENET_RX_CR ((ushort)0x0004)
  544. #define BD_ENET_RX_OV ((ushort)0x0002)
  545. #define BD_ENET_RX_CL ((ushort)0x0001)
  546. #define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */
  547. /* Buffer descriptor control/status used by Ethernet transmit.
  548. */
  549. #define BD_ENET_TX_READY ((ushort)0x8000)
  550. #define BD_ENET_TX_PAD ((ushort)0x4000)
  551. #define BD_ENET_TX_WRAP ((ushort)0x2000)
  552. #define BD_ENET_TX_INTR ((ushort)0x1000)
  553. #define BD_ENET_TX_LAST ((ushort)0x0800)
  554. #define BD_ENET_TX_TC ((ushort)0x0400)
  555. #define BD_ENET_TX_DEF ((ushort)0x0200)
  556. #define BD_ENET_TX_HB ((ushort)0x0100)
  557. #define BD_ENET_TX_LC ((ushort)0x0080)
  558. #define BD_ENET_TX_RL ((ushort)0x0040)
  559. #define BD_ENET_TX_RCMASK ((ushort)0x003c)
  560. #define BD_ENET_TX_UN ((ushort)0x0002)
  561. #define BD_ENET_TX_CSL ((ushort)0x0001)
  562. #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
  563. /* SCC as UART
  564. */
  565. typedef struct scc_uart {
  566. sccp_t scc_genscc;
  567. uint scc_res1; /* Reserved */
  568. uint scc_res2; /* Reserved */
  569. ushort scc_maxidl; /* Maximum idle chars */
  570. ushort scc_idlc; /* temp idle counter */
  571. ushort scc_brkcr; /* Break count register */
  572. ushort scc_parec; /* receive parity error counter */
  573. ushort scc_frmec; /* receive framing error counter */
  574. ushort scc_nosec; /* receive noise counter */
  575. ushort scc_brkec; /* receive break condition counter */
  576. ushort scc_brkln; /* last received break length */
  577. ushort scc_uaddr1; /* UART address character 1 */
  578. ushort scc_uaddr2; /* UART address character 2 */
  579. ushort scc_rtemp; /* Temp storage */
  580. ushort scc_toseq; /* Transmit out of sequence char */
  581. ushort scc_char1; /* control character 1 */
  582. ushort scc_char2; /* control character 2 */
  583. ushort scc_char3; /* control character 3 */
  584. ushort scc_char4; /* control character 4 */
  585. ushort scc_char5; /* control character 5 */
  586. ushort scc_char6; /* control character 6 */
  587. ushort scc_char7; /* control character 7 */
  588. ushort scc_char8; /* control character 8 */
  589. ushort scc_rccm; /* receive control character mask */
  590. ushort scc_rccr; /* receive control character register */
  591. ushort scc_rlbc; /* receive last break character */
  592. } scc_uart_t;
  593. /* SCC Event and Mask registers when it is used as a UART.
  594. */
  595. #define UART_SCCM_GLR ((ushort)0x1000)
  596. #define UART_SCCM_GLT ((ushort)0x0800)
  597. #define UART_SCCM_AB ((ushort)0x0200)
  598. #define UART_SCCM_IDL ((ushort)0x0100)
  599. #define UART_SCCM_GRA ((ushort)0x0080)
  600. #define UART_SCCM_BRKE ((ushort)0x0040)
  601. #define UART_SCCM_BRKS ((ushort)0x0020)
  602. #define UART_SCCM_CCR ((ushort)0x0008)
  603. #define UART_SCCM_BSY ((ushort)0x0004)
  604. #define UART_SCCM_TX ((ushort)0x0002)
  605. #define UART_SCCM_RX ((ushort)0x0001)
  606. /* The SCC PSMR when used as a UART.
  607. */
  608. #define SCU_PSMR_FLC ((ushort)0x8000)
  609. #define SCU_PSMR_SL ((ushort)0x4000)
  610. #define SCU_PSMR_CL ((ushort)0x3000)
  611. #define SCU_PSMR_UM ((ushort)0x0c00)
  612. #define SCU_PSMR_FRZ ((ushort)0x0200)
  613. #define SCU_PSMR_RZS ((ushort)0x0100)
  614. #define SCU_PSMR_SYN ((ushort)0x0080)
  615. #define SCU_PSMR_DRT ((ushort)0x0040)
  616. #define SCU_PSMR_PEN ((ushort)0x0010)
  617. #define SCU_PSMR_RPM ((ushort)0x000c)
  618. #define SCU_PSMR_REVP ((ushort)0x0008)
  619. #define SCU_PSMR_TPM ((ushort)0x0003)
  620. #define SCU_PSMR_TEVP ((ushort)0x0003)
  621. /* CPM Transparent mode SCC.
  622. */
  623. typedef struct scc_trans {
  624. sccp_t st_genscc;
  625. uint st_cpres; /* Preset CRC */
  626. uint st_cmask; /* Constant mask for CRC */
  627. } scc_trans_t;
  628. #define BD_SCC_TX_LAST ((ushort)0x0800)
  629. /* IIC parameter RAM.
  630. */
  631. typedef struct iic {
  632. ushort iic_rbase; /* Rx Buffer descriptor base address */
  633. ushort iic_tbase; /* Tx Buffer descriptor base address */
  634. u_char iic_rfcr; /* Rx function code */
  635. u_char iic_tfcr; /* Tx function code */
  636. ushort iic_mrblr; /* Max receive buffer length */
  637. uint iic_rstate; /* Internal */
  638. uint iic_rdp; /* Internal */
  639. ushort iic_rbptr; /* Internal */
  640. ushort iic_rbc; /* Internal */
  641. uint iic_rxtmp; /* Internal */
  642. uint iic_tstate; /* Internal */
  643. uint iic_tdp; /* Internal */
  644. ushort iic_tbptr; /* Internal */
  645. ushort iic_tbc; /* Internal */
  646. uint iic_txtmp; /* Internal */
  647. uint iic_res; /* reserved */
  648. ushort iic_rpbase; /* Relocation pointer */
  649. ushort iic_res2; /* reserved */
  650. } iic_t;
  651. /* SPI parameter RAM.
  652. */
  653. typedef struct spi {
  654. ushort spi_rbase; /* Rx Buffer descriptor base address */
  655. ushort spi_tbase; /* Tx Buffer descriptor base address */
  656. u_char spi_rfcr; /* Rx function code */
  657. u_char spi_tfcr; /* Tx function code */
  658. ushort spi_mrblr; /* Max receive buffer length */
  659. uint spi_rstate; /* Internal */
  660. uint spi_rdp; /* Internal */
  661. ushort spi_rbptr; /* Internal */
  662. ushort spi_rbc; /* Internal */
  663. uint spi_rxtmp; /* Internal */
  664. uint spi_tstate; /* Internal */
  665. uint spi_tdp; /* Internal */
  666. ushort spi_tbptr; /* Internal */
  667. ushort spi_tbc; /* Internal */
  668. uint spi_txtmp; /* Internal */
  669. uint spi_res;
  670. ushort spi_rpbase; /* Relocation pointer */
  671. ushort spi_res2;
  672. } spi_t;
  673. /* SPI Mode register.
  674. */
  675. #define SPMODE_LOOP ((ushort)0x4000) /* Loopback */
  676. #define SPMODE_CI ((ushort)0x2000) /* Clock Invert */
  677. #define SPMODE_CP ((ushort)0x1000) /* Clock Phase */
  678. #define SPMODE_DIV16 ((ushort)0x0800) /* BRG/16 mode */
  679. #define SPMODE_REV ((ushort)0x0400) /* Reversed Data */
  680. #define SPMODE_MSTR ((ushort)0x0200) /* SPI Master */
  681. #define SPMODE_EN ((ushort)0x0100) /* Enable */
  682. #define SPMODE_LENMSK ((ushort)0x00f0) /* character length */
  683. #define SPMODE_PMMSK ((ushort)0x000f) /* prescale modulus */
  684. #define SPMODE_LEN(x) ((((x)-1)&0xF)<<4)
  685. #define SPMODE_PM(x) ((x) &0xF)
  686. /* HDLC parameter RAM.
  687. */
  688. typedef struct hdlc_pram_s {
  689. /*
  690. * SCC parameter RAM
  691. */
  692. ushort rbase; /* Rx Buffer descriptor base address */
  693. ushort tbase; /* Tx Buffer descriptor base address */
  694. uchar rfcr; /* Rx function code */
  695. uchar tfcr; /* Tx function code */
  696. ushort mrblr; /* Rx buffer length */
  697. ulong rstate; /* Rx internal state */
  698. ulong rptr; /* Rx internal data pointer */
  699. ushort rbptr; /* rb BD Pointer */
  700. ushort rcount; /* Rx internal byte count */
  701. ulong rtemp; /* Rx temp */
  702. ulong tstate; /* Tx internal state */
  703. ulong tptr; /* Tx internal data pointer */
  704. ushort tbptr; /* Tx BD pointer */
  705. ushort tcount; /* Tx byte count */
  706. ulong ttemp; /* Tx temp */
  707. ulong rcrc; /* temp receive CRC */
  708. ulong tcrc; /* temp transmit CRC */
  709. /*
  710. * HDLC specific parameter RAM
  711. */
  712. uchar res[4]; /* reserved */
  713. ulong c_mask; /* CRC constant */
  714. ulong c_pres; /* CRC preset */
  715. ushort disfc; /* discarded frame counter */
  716. ushort crcec; /* CRC error counter */
  717. ushort abtsc; /* abort sequence counter */
  718. ushort nmarc; /* nonmatching address rx cnt */
  719. ushort retrc; /* frame retransmission cnt */
  720. ushort mflr; /* maximum frame length reg */
  721. ushort max_cnt; /* maximum length counter */
  722. ushort rfthr; /* received frames threshold */
  723. ushort rfcnt; /* received frames count */
  724. ushort hmask; /* user defined frm addr mask */
  725. ushort haddr1; /* user defined frm address 1 */
  726. ushort haddr2; /* user defined frm address 2 */
  727. ushort haddr3; /* user defined frm address 3 */
  728. ushort haddr4; /* user defined frm address 4 */
  729. ushort tmp; /* temp */
  730. ushort tmp_mb; /* temp */
  731. } hdlc_pram_t;
  732. /* CPM interrupts. There are nearly 32 interrupts generated by CPM
  733. * channels or devices. All of these are presented to the PPC core
  734. * as a single interrupt. The CPM interrupt handler dispatches its
  735. * own handlers, in a similar fashion to the PPC core handler. We
  736. * use the table as defined in the manuals (i.e. no special high
  737. * priority and SCC1 == SCCa, etc...).
  738. */
  739. #define CPMVEC_NR 32
  740. #define CPMVEC_OFFSET 0x00010000
  741. #define CPMVEC_PIO_PC15 ((ushort)0x1f | CPMVEC_OFFSET)
  742. #define CPMVEC_SCC1 ((ushort)0x1e | CPMVEC_OFFSET)
  743. #define CPMVEC_SCC2 ((ushort)0x1d | CPMVEC_OFFSET)
  744. #define CPMVEC_SCC3 ((ushort)0x1c | CPMVEC_OFFSET)
  745. #define CPMVEC_SCC4 ((ushort)0x1b | CPMVEC_OFFSET)
  746. #define CPMVEC_PIO_PC14 ((ushort)0x1a | CPMVEC_OFFSET)
  747. #define CPMVEC_TIMER1 ((ushort)0x19 | CPMVEC_OFFSET)
  748. #define CPMVEC_PIO_PC13 ((ushort)0x18 | CPMVEC_OFFSET)
  749. #define CPMVEC_PIO_PC12 ((ushort)0x17 | CPMVEC_OFFSET)
  750. #define CPMVEC_SDMA_CB_ERR ((ushort)0x16 | CPMVEC_OFFSET)
  751. #define CPMVEC_IDMA1 ((ushort)0x15 | CPMVEC_OFFSET)
  752. #define CPMVEC_IDMA2 ((ushort)0x14 | CPMVEC_OFFSET)
  753. #define CPMVEC_TIMER2 ((ushort)0x12 | CPMVEC_OFFSET)
  754. #define CPMVEC_RISCTIMER ((ushort)0x11 | CPMVEC_OFFSET)
  755. #define CPMVEC_I2C ((ushort)0x10 | CPMVEC_OFFSET)
  756. #define CPMVEC_PIO_PC11 ((ushort)0x0f | CPMVEC_OFFSET)
  757. #define CPMVEC_PIO_PC10 ((ushort)0x0e | CPMVEC_OFFSET)
  758. #define CPMVEC_TIMER3 ((ushort)0x0c | CPMVEC_OFFSET)
  759. #define CPMVEC_PIO_PC9 ((ushort)0x0b | CPMVEC_OFFSET)
  760. #define CPMVEC_PIO_PC8 ((ushort)0x0a | CPMVEC_OFFSET)
  761. #define CPMVEC_PIO_PC7 ((ushort)0x09 | CPMVEC_OFFSET)
  762. #define CPMVEC_TIMER4 ((ushort)0x07 | CPMVEC_OFFSET)
  763. #define CPMVEC_PIO_PC6 ((ushort)0x06 | CPMVEC_OFFSET)
  764. #define CPMVEC_SPI ((ushort)0x05 | CPMVEC_OFFSET)
  765. #define CPMVEC_SMC1 ((ushort)0x04 | CPMVEC_OFFSET)
  766. #define CPMVEC_SMC2 ((ushort)0x03 | CPMVEC_OFFSET)
  767. #define CPMVEC_PIO_PC5 ((ushort)0x02 | CPMVEC_OFFSET)
  768. #define CPMVEC_PIO_PC4 ((ushort)0x01 | CPMVEC_OFFSET)
  769. #define CPMVEC_ERROR ((ushort)0x00 | CPMVEC_OFFSET)
  770. extern void irq_install_handler(int vec, void (*handler)(void *), void *dev_id);
  771. /* CPM interrupt configuration vector.
  772. */
  773. #define CICR_SCD_SCC4 ((uint)0x00c00000) /* SCC4 @ SCCd */
  774. #define CICR_SCC_SCC3 ((uint)0x00200000) /* SCC3 @ SCCc */
  775. #define CICR_SCB_SCC2 ((uint)0x00040000) /* SCC2 @ SCCb */
  776. #define CICR_SCA_SCC1 ((uint)0x00000000) /* SCC1 @ SCCa */
  777. #define CICR_IRL_MASK ((uint)0x0000e000) /* Core interrrupt */
  778. #define CICR_HP_MASK ((uint)0x00001f00) /* Hi-pri int. */
  779. #define CICR_IEN ((uint)0x00000080) /* Int. enable */
  780. #define CICR_SPS ((uint)0x00000001) /* SCC Spread */
  781. #endif /* __CPM_8XX__ */