19 #define CPM_CR_RST ((uint)0x80000000)
20 #define CPM_CR_PAGE ((uint)0x7c000000)
21 #define CPM_CR_SBLOCK ((uint)0x03e00000)
22 #define CPM_CR_FLG ((uint)0x00010000)
23 #define CPM_CR_MCN ((uint)0x00003fc0)
24 #define CPM_CR_OPCODE ((uint)0x0000000f)
28 #define CPM_CR_SCC1_SBLOCK (0x04)
29 #define CPM_CR_SCC2_SBLOCK (0x05)
30 #define CPM_CR_SCC3_SBLOCK (0x06)
31 #define CPM_CR_SCC4_SBLOCK (0x07)
32 #define CPM_CR_SMC1_SBLOCK (0x08)
33 #define CPM_CR_SMC2_SBLOCK (0x09)
34 #define CPM_CR_SPI_SBLOCK (0x0a)
35 #define CPM_CR_I2C_SBLOCK (0x0b)
36 #define CPM_CR_TIMER_SBLOCK (0x0f)
37 #define CPM_CR_RAND_SBLOCK (0x0e)
38 #define CPM_CR_FCC1_SBLOCK (0x10)
39 #define CPM_CR_FCC2_SBLOCK (0x11)
40 #define CPM_CR_FCC3_SBLOCK (0x12)
41 #define CPM_CR_IDMA1_SBLOCK (0x14)
42 #define CPM_CR_IDMA2_SBLOCK (0x15)
43 #define CPM_CR_IDMA3_SBLOCK (0x16)
44 #define CPM_CR_IDMA4_SBLOCK (0x17)
45 #define CPM_CR_MCC1_SBLOCK (0x1c)
47 #define CPM_CR_FCC_SBLOCK(x) (x + 0x10)
49 #define CPM_CR_SCC1_PAGE (0x00)
50 #define CPM_CR_SCC2_PAGE (0x01)
51 #define CPM_CR_SCC3_PAGE (0x02)
52 #define CPM_CR_SCC4_PAGE (0x03)
53 #define CPM_CR_SMC1_PAGE (0x07)
54 #define CPM_CR_SMC2_PAGE (0x08)
55 #define CPM_CR_SPI_PAGE (0x09)
56 #define CPM_CR_I2C_PAGE (0x0a)
57 #define CPM_CR_TIMER_PAGE (0x0a)
58 #define CPM_CR_RAND_PAGE (0x0a)
59 #define CPM_CR_FCC1_PAGE (0x04)
60 #define CPM_CR_FCC2_PAGE (0x05)
61 #define CPM_CR_FCC3_PAGE (0x06)
62 #define CPM_CR_IDMA1_PAGE (0x07)
63 #define CPM_CR_IDMA2_PAGE (0x08)
64 #define CPM_CR_IDMA3_PAGE (0x09)
65 #define CPM_CR_IDMA4_PAGE (0x0a)
66 #define CPM_CR_MCC1_PAGE (0x07)
67 #define CPM_CR_MCC2_PAGE (0x08)
69 #define CPM_CR_FCC_PAGE(x) (x + 0x04)
73 #define CPM_CR_START_IDMA ((ushort)0x0009)
75 #define mk_cr_cmd(PG, SBC, MCN, OP) \
76 ((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
82 #define NUM_CPM_HOST_PAGES 2
89 #define cpm_dpalloc cpm_muram_alloc
90 #define cpm_dpfree cpm_muram_free
91 #define cpm_dpram_addr cpm_muram_addr
97 #define CPM_BRG_RST ((uint)0x00020000)
98 #define CPM_BRG_EN ((uint)0x00010000)
99 #define CPM_BRG_EXTC_INT ((uint)0x00000000)
100 #define CPM_BRG_EXTC_CLK3_9 ((uint)0x00004000)
101 #define CPM_BRG_EXTC_CLK5_15 ((uint)0x00008000)
102 #define CPM_BRG_ATB ((uint)0x00002000)
103 #define CPM_BRG_CD_MASK ((uint)0x00001ffe)
104 #define CPM_BRG_DIV16 ((uint)0x00000001)
106 #define CPM2_BRG_INT_CLK (get_brgfreq())
107 #define CPM2_BRG_UART_CLK (CPM2_BRG_INT_CLK/16)
129 #define PROFF_SCC1 ((uint)0x8000)
130 #define PROFF_SCC2 ((uint)0x8100)
131 #define PROFF_SCC3 ((uint)0x8200)
132 #define PROFF_SCC4 ((uint)0x8300)
133 #define PROFF_FCC1 ((uint)0x8400)
134 #define PROFF_FCC2 ((uint)0x8500)
135 #define PROFF_FCC3 ((uint)0x8600)
136 #define PROFF_MCC1 ((uint)0x8700)
137 #define PROFF_SMC1_BASE ((uint)0x87fc)
138 #define PROFF_IDMA1_BASE ((uint)0x87fe)
139 #define PROFF_MCC2 ((uint)0x8800)
140 #define PROFF_SMC2_BASE ((uint)0x88fc)
141 #define PROFF_IDMA2_BASE ((uint)0x88fe)
142 #define PROFF_SPI_BASE ((uint)0x89fc)
143 #define PROFF_IDMA3_BASE ((uint)0x89fe)
144 #define PROFF_TIMERS ((uint)0x8ae0)
145 #define PROFF_REVNUM ((uint)0x8af0)
146 #define PROFF_RAND ((uint)0x8af8)
147 #define PROFF_I2C_BASE ((uint)0x8afc)
148 #define PROFF_IDMA4_BASE ((uint)0x8afe)
150 #define PROFF_SCC_SIZE ((uint)0x100)
151 #define PROFF_FCC_SIZE ((uint)0x100)
152 #define PROFF_SMC_SIZE ((uint)64)
160 #define PROFF_SMC1 (0)
161 #define PROFF_SMC2 (64)
193 #define SMCMR_REN ((ushort)0x0001)
194 #define SMCMR_TEN ((ushort)0x0002)
195 #define SMCMR_DM ((ushort)0x000c)
196 #define SMCMR_SM_GCI ((ushort)0x0000)
197 #define SMCMR_SM_UART ((ushort)0x0020)
198 #define SMCMR_SM_TRANS ((ushort)0x0030)
199 #define SMCMR_SM_MASK ((ushort)0x0030)
200 #define SMCMR_PM_EVEN ((ushort)0x0100)
201 #define SMCMR_REVD SMCMR_PM_EVEN
202 #define SMCMR_PEN ((ushort)0x0200)
203 #define SMCMR_BS SMCMR_PEN
204 #define SMCMR_SL ((ushort)0x0400)
205 #define SMCR_CLEN_MASK ((ushort)0x7800)
206 #define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
210 #define SMCM_BRKE ((unsigned char)0x40)
211 #define SMCM_BRK ((unsigned char)0x10)
212 #define SMCM_TXE ((unsigned char)0x10)
213 #define SMCM_BSY ((unsigned char)0x04)
214 #define SMCM_TX ((unsigned char)0x02)
215 #define SMCM_RX ((unsigned char)0x01)
219 #define SCC_GSMRH_IRP ((uint)0x00040000)
220 #define SCC_GSMRH_GDE ((uint)0x00010000)
221 #define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
222 #define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
223 #define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
224 #define SCC_GSMRH_REVD ((uint)0x00002000)
225 #define SCC_GSMRH_TRX ((uint)0x00001000)
226 #define SCC_GSMRH_TTX ((uint)0x00000800)
227 #define SCC_GSMRH_CDP ((uint)0x00000400)
228 #define SCC_GSMRH_CTSP ((uint)0x00000200)
229 #define SCC_GSMRH_CDS ((uint)0x00000100)
230 #define SCC_GSMRH_CTSS ((uint)0x00000080)
231 #define SCC_GSMRH_TFL ((uint)0x00000040)
232 #define SCC_GSMRH_RFW ((uint)0x00000020)
233 #define SCC_GSMRH_TXSY ((uint)0x00000010)
234 #define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
235 #define SCC_GSMRH_SYNL8 ((uint)0x00000008)
236 #define SCC_GSMRH_SYNL4 ((uint)0x00000004)
237 #define SCC_GSMRH_RTSM ((uint)0x00000002)
238 #define SCC_GSMRH_RSYN ((uint)0x00000001)
240 #define SCC_GSMRL_SIR ((uint)0x80000000)
241 #define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
242 #define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
243 #define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
244 #define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
245 #define SCC_GSMRL_TCI ((uint)0x10000000)
246 #define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
247 #define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
248 #define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
249 #define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
250 #define SCC_GSMRL_RINV ((uint)0x02000000)
251 #define SCC_GSMRL_TINV ((uint)0x01000000)
252 #define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
253 #define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
254 #define SCC_GSMRL_TPL_48 ((uint)0x00800000)
255 #define SCC_GSMRL_TPL_32 ((uint)0x00600000)
256 #define SCC_GSMRL_TPL_16 ((uint)0x00400000)
257 #define SCC_GSMRL_TPL_8 ((uint)0x00200000)
258 #define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
259 #define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
260 #define SCC_GSMRL_TPP_01 ((uint)0x00100000)
261 #define SCC_GSMRL_TPP_10 ((uint)0x00080000)
262 #define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
263 #define SCC_GSMRL_TEND ((uint)0x00040000)
264 #define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
265 #define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
266 #define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
267 #define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
268 #define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
269 #define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
270 #define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
271 #define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
272 #define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
273 #define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
274 #define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
275 #define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
276 #define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
277 #define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
278 #define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
279 #define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
280 #define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
281 #define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
282 #define SCC_GSMRL_DIAG_LE ((uint)0x000000c0)
283 #define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
284 #define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
285 #define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
286 #define SCC_GSMRL_ENR ((uint)0x00000020)
287 #define SCC_GSMRL_ENT ((uint)0x00000010)
288 #define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
289 #define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
290 #define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
291 #define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
292 #define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
293 #define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
294 #define SCC_GSMRL_MODE_UART ((uint)0x00000004)
295 #define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
296 #define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
297 #define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
299 #define SCC_TODR_TOD ((ushort)0x8000)
303 #define SCCM_TXE ((unsigned char)0x10)
304 #define SCCM_BSY ((unsigned char)0x04)
305 #define SCCM_TX ((unsigned char)0x02)
306 #define SCCM_RX ((unsigned char)0x01)
330 #define SCC_EB ((u_char) 0x10)
331 #define SCC_GBL ((u_char) 0x20)
391 #define SCCE_ENET_GRA ((ushort)0x0080)
392 #define SCCE_ENET_TXE ((ushort)0x0010)
393 #define SCCE_ENET_RXF ((ushort)0x0008)
394 #define SCCE_ENET_BSY ((ushort)0x0004)
395 #define SCCE_ENET_TXB ((ushort)0x0002)
396 #define SCCE_ENET_RXB ((ushort)0x0001)
400 #define SCC_PSMR_HBC ((ushort)0x8000)
401 #define SCC_PSMR_FC ((ushort)0x4000)
402 #define SCC_PSMR_RSH ((ushort)0x2000)
403 #define SCC_PSMR_IAM ((ushort)0x1000)
404 #define SCC_PSMR_ENCRC ((ushort)0x0800)
405 #define SCC_PSMR_PRO ((ushort)0x0200)
406 #define SCC_PSMR_BRO ((ushort)0x0100)
407 #define SCC_PSMR_SBT ((ushort)0x0080)
408 #define SCC_PSMR_LPB ((ushort)0x0040)
409 #define SCC_PSMR_SIP ((ushort)0x0020)
410 #define SCC_PSMR_LCW ((ushort)0x0010)
411 #define SCC_PSMR_NIB22 ((ushort)0x000a)
412 #define SCC_PSMR_FDE ((ushort)0x0001)
447 #define UART_SCCM_GLR ((ushort)0x1000)
448 #define UART_SCCM_GLT ((ushort)0x0800)
449 #define UART_SCCM_AB ((ushort)0x0200)
450 #define UART_SCCM_IDL ((ushort)0x0100)
451 #define UART_SCCM_GRA ((ushort)0x0080)
452 #define UART_SCCM_BRKE ((ushort)0x0040)
453 #define UART_SCCM_BRKS ((ushort)0x0020)
454 #define UART_SCCM_CCR ((ushort)0x0008)
455 #define UART_SCCM_BSY ((ushort)0x0004)
456 #define UART_SCCM_TX ((ushort)0x0002)
457 #define UART_SCCM_RX ((ushort)0x0001)
461 #define SCU_PSMR_FLC ((ushort)0x8000)
462 #define SCU_PSMR_SL ((ushort)0x4000)
463 #define SCU_PSMR_CL ((ushort)0x3000)
464 #define SCU_PSMR_UM ((ushort)0x0c00)
465 #define SCU_PSMR_FRZ ((ushort)0x0200)
466 #define SCU_PSMR_RZS ((ushort)0x0100)
467 #define SCU_PSMR_SYN ((ushort)0x0080)
468 #define SCU_PSMR_DRT ((ushort)0x0040)
469 #define SCU_PSMR_PEN ((ushort)0x0010)
470 #define SCU_PSMR_RPM ((ushort)0x000c)
471 #define SCU_PSMR_REVP ((ushort)0x0008)
472 #define SCU_PSMR_TPM ((ushort)0x0003)
473 #define SCU_PSMR_TEVP ((ushort)0x0002)
485 #define FCC_GFMR_DIAG_NORM ((uint)0x00000000)
486 #define FCC_GFMR_DIAG_LE ((uint)0x40000000)
487 #define FCC_GFMR_DIAG_AE ((uint)0x80000000)
488 #define FCC_GFMR_DIAG_ALE ((uint)0xc0000000)
489 #define FCC_GFMR_TCI ((uint)0x20000000)
490 #define FCC_GFMR_TRX ((uint)0x10000000)
491 #define FCC_GFMR_TTX ((uint)0x08000000)
492 #define FCC_GFMR_TTX ((uint)0x08000000)
493 #define FCC_GFMR_CDP ((uint)0x04000000)
494 #define FCC_GFMR_CTSP ((uint)0x02000000)
495 #define FCC_GFMR_CDS ((uint)0x01000000)
496 #define FCC_GFMR_CTSS ((uint)0x00800000)
497 #define FCC_GFMR_SYNL_NONE ((uint)0x00000000)
498 #define FCC_GFMR_SYNL_AUTO ((uint)0x00004000)
499 #define FCC_GFMR_SYNL_8 ((uint)0x00008000)
500 #define FCC_GFMR_SYNL_16 ((uint)0x0000c000)
501 #define FCC_GFMR_RTSM ((uint)0x00002000)
502 #define FCC_GFMR_RENC_NRZ ((uint)0x00000000)
503 #define FCC_GFMR_RENC_NRZI ((uint)0x00000800)
504 #define FCC_GFMR_REVD ((uint)0x00000400)
505 #define FCC_GFMR_TENC_NRZ ((uint)0x00000000)
506 #define FCC_GFMR_TENC_NRZI ((uint)0x00000100)
507 #define FCC_GFMR_TCRC_16 ((uint)0x00000000)
508 #define FCC_GFMR_TCRC_32 ((uint)0x00000080)
509 #define FCC_GFMR_ENR ((uint)0x00000020)
510 #define FCC_GFMR_ENT ((uint)0x00000010)
511 #define FCC_GFMR_MODE_ENET ((uint)0x0000000c)
512 #define FCC_GFMR_MODE_ATM ((uint)0x0000000a)
513 #define FCC_GFMR_MODE_HDLC ((uint)0x00000000)
517 typedef struct fcc_param {
542 typedef struct fcc_enet {
604 #define FCC_ENET_GRA ((ushort)0x0080)
605 #define FCC_ENET_RXC ((ushort)0x0040)
606 #define FCC_ENET_TXC ((ushort)0x0020)
607 #define FCC_ENET_TXE ((ushort)0x0010)
608 #define FCC_ENET_RXF ((ushort)0x0008)
609 #define FCC_ENET_BSY ((ushort)0x0004)
610 #define FCC_ENET_TXB ((ushort)0x0002)
611 #define FCC_ENET_RXB ((ushort)0x0001)
615 #define FCC_PSMR_HBC ((uint)0x80000000)
616 #define FCC_PSMR_FC ((uint)0x40000000)
617 #define FCC_PSMR_SBT ((uint)0x20000000)
618 #define FCC_PSMR_LPB ((uint)0x10000000)
619 #define FCC_PSMR_LCW ((uint)0x08000000)
620 #define FCC_PSMR_FDE ((uint)0x04000000)
621 #define FCC_PSMR_MON ((uint)0x02000000)
622 #define FCC_PSMR_PRO ((uint)0x00400000)
623 #define FCC_PSMR_FCE ((uint)0x00200000)
624 #define FCC_PSMR_RSH ((uint)0x00100000)
625 #define FCC_PSMR_CAM ((uint)0x00000400)
626 #define FCC_PSMR_BRO ((uint)0x00000200)
627 #define FCC_PSMR_ENCRC ((uint)0x00000080)
651 typedef struct idma {
675 #define IDMA_DCM_FB ((ushort)0x8000)
676 #define IDMA_DCM_LP ((ushort)0x4000)
677 #define IDMA_DCM_TC2 ((ushort)0x0400)
678 #define IDMA_DCM_DMA_WRAP_MASK ((ushort)0x01c0)
679 #define IDMA_DCM_DMA_WRAP_64 ((ushort)0x0000)
680 #define IDMA_DCM_DMA_WRAP_128 ((ushort)0x0040)
681 #define IDMA_DCM_DMA_WRAP_256 ((ushort)0x0080)
682 #define IDMA_DCM_DMA_WRAP_512 ((ushort)0x00c0)
683 #define IDMA_DCM_DMA_WRAP_1024 ((ushort)0x0100)
684 #define IDMA_DCM_DMA_WRAP_2048 ((ushort)0x0140)
685 #define IDMA_DCM_SINC ((ushort)0x0020)
686 #define IDMA_DCM_DINC ((ushort)0x0010)
687 #define IDMA_DCM_ERM ((ushort)0x0008)
688 #define IDMA_DCM_DT ((ushort)0x0004)
689 #define IDMA_DCM_SD_MASK ((ushort)0x0003)
690 #define IDMA_DCM_SD_MEM2MEM ((ushort)0x0000)
691 #define IDMA_DCM_SD_PER2MEM ((ushort)0x0002)
692 #define IDMA_DCM_SD_MEM2PER ((ushort)0x0001)
696 typedef struct idma_bd {
705 #define IDMA_BD_V ((uint)0x80000000)
706 #define IDMA_BD_W ((uint)0x20000000)
707 #define IDMA_BD_I ((uint)0x10000000)
708 #define IDMA_BD_L ((uint)0x08000000)
709 #define IDMA_BD_CM ((uint)0x02000000)
710 #define IDMA_BD_SDN ((uint)0x00400000)
711 #define IDMA_BD_DDN ((uint)0x00200000)
712 #define IDMA_BD_DGBL ((uint)0x00100000)
713 #define IDMA_BD_DBO_LE ((uint)0x00040000)
714 #define IDMA_BD_DBO_BE ((uint)0x00080000)
715 #define IDMA_BD_DDTB ((uint)0x00010000)
716 #define IDMA_BD_SGBL ((uint)0x00002000)
717 #define IDMA_BD_SBO_LE ((uint)0x00000800)
718 #define IDMA_BD_SBO_BE ((uint)0x00001000)
719 #define IDMA_BD_SDTB ((uint)0x00000200)
723 typedef struct im_idma {
732 #define IDMA_EVENT_SC ((unsigned char)0x08)
733 #define IDMA_EVENT_OB ((unsigned char)0x04)
734 #define IDMA_EVENT_EDN ((unsigned char)0x02)
735 #define IDMA_EVENT_BC ((unsigned char)0x01)
739 #define RCCR_TIME ((uint)0x80000000)
740 #define RCCR_TIMEP_MASK ((uint)0x3f000000)
741 #define RCCR_DR0M ((uint)0x00800000)
742 #define RCCR_DR1M ((uint)0x00400000)
743 #define RCCR_DR2M ((uint)0x00000080)
744 #define RCCR_DR3M ((uint)0x00000040)
745 #define RCCR_DR0QP_MASK ((uint)0x00300000)
746 #define RCCR_DR0QP_HIGH ((uint)0x00000000)
747 #define RCCR_DR0QP_MED ((uint)0x00100000)
748 #define RCCR_DR0QP_LOW ((uint)0x00200000)
749 #define RCCR_DR1QP_MASK ((uint)0x00030000)
750 #define RCCR_DR1QP_HIGH ((uint)0x00000000)
751 #define RCCR_DR1QP_MED ((uint)0x00010000)
752 #define RCCR_DR1QP_LOW ((uint)0x00020000)
753 #define RCCR_DR2QP_MASK ((uint)0x00000030)
754 #define RCCR_DR2QP_HIGH ((uint)0x00000000)
755 #define RCCR_DR2QP_MED ((uint)0x00000010)
756 #define RCCR_DR2QP_LOW ((uint)0x00000020)
757 #define RCCR_DR3QP_MASK ((uint)0x00000003)
758 #define RCCR_DR3QP_HIGH ((uint)0x00000000)
759 #define RCCR_DR3QP_MED ((uint)0x00000001)
760 #define RCCR_DR3QP_LOW ((uint)0x00000002)
761 #define RCCR_EIE ((uint)0x00080000)
762 #define RCCR_SCD ((uint)0x00040000)
763 #define RCCR_ERAM_MASK ((uint)0x0000e000)
764 #define RCCR_ERAM_0KB ((uint)0x00000000)
765 #define RCCR_ERAM_2KB ((uint)0x00002000)
766 #define RCCR_ERAM_4KB ((uint)0x00004000)
767 #define RCCR_ERAM_6KB ((uint)0x00006000)
768 #define RCCR_ERAM_8KB ((uint)0x00008000)
769 #define RCCR_ERAM_10KB ((uint)0x0000a000)
770 #define RCCR_ERAM_12KB ((uint)0x0000c000)
771 #define RCCR_EDM0 ((uint)0x00000800)
772 #define RCCR_EDM1 ((uint)0x00000400)
773 #define RCCR_EDM2 ((uint)0x00000200)
774 #define RCCR_EDM3 ((uint)0x00000100)
775 #define RCCR_DEM01 ((uint)0x00000008)
776 #define RCCR_DEM23 ((uint)0x00000004)
781 #define CMXFCR_FC1 0x40000000
782 #define CMXFCR_RF1CS_MSK 0x38000000
783 #define CMXFCR_TF1CS_MSK 0x07000000
784 #define CMXFCR_FC2 0x00400000
785 #define CMXFCR_RF2CS_MSK 0x00380000
786 #define CMXFCR_TF2CS_MSK 0x00070000
787 #define CMXFCR_FC3 0x00004000
788 #define CMXFCR_RF3CS_MSK 0x00003800
789 #define CMXFCR_TF3CS_MSK 0x00000700
791 #define CMXFCR_RF1CS_BRG5 0x00000000
792 #define CMXFCR_RF1CS_BRG6 0x08000000
793 #define CMXFCR_RF1CS_BRG7 0x10000000
794 #define CMXFCR_RF1CS_BRG8 0x18000000
795 #define CMXFCR_RF1CS_CLK9 0x20000000
796 #define CMXFCR_RF1CS_CLK10 0x28000000
797 #define CMXFCR_RF1CS_CLK11 0x30000000
798 #define CMXFCR_RF1CS_CLK12 0x38000000
800 #define CMXFCR_TF1CS_BRG5 0x00000000
801 #define CMXFCR_TF1CS_BRG6 0x01000000
802 #define CMXFCR_TF1CS_BRG7 0x02000000
803 #define CMXFCR_TF1CS_BRG8 0x03000000
804 #define CMXFCR_TF1CS_CLK9 0x04000000
805 #define CMXFCR_TF1CS_CLK10 0x05000000
806 #define CMXFCR_TF1CS_CLK11 0x06000000
807 #define CMXFCR_TF1CS_CLK12 0x07000000
809 #define CMXFCR_RF2CS_BRG5 0x00000000
810 #define CMXFCR_RF2CS_BRG6 0x00080000
811 #define CMXFCR_RF2CS_BRG7 0x00100000
812 #define CMXFCR_RF2CS_BRG8 0x00180000
813 #define CMXFCR_RF2CS_CLK13 0x00200000
814 #define CMXFCR_RF2CS_CLK14 0x00280000
815 #define CMXFCR_RF2CS_CLK15 0x00300000
816 #define CMXFCR_RF2CS_CLK16 0x00380000
818 #define CMXFCR_TF2CS_BRG5 0x00000000
819 #define CMXFCR_TF2CS_BRG6 0x00010000
820 #define CMXFCR_TF2CS_BRG7 0x00020000
821 #define CMXFCR_TF2CS_BRG8 0x00030000
822 #define CMXFCR_TF2CS_CLK13 0x00040000
823 #define CMXFCR_TF2CS_CLK14 0x00050000
824 #define CMXFCR_TF2CS_CLK15 0x00060000
825 #define CMXFCR_TF2CS_CLK16 0x00070000
827 #define CMXFCR_RF3CS_BRG5 0x00000000
828 #define CMXFCR_RF3CS_BRG6 0x00000800
829 #define CMXFCR_RF3CS_BRG7 0x00001000
830 #define CMXFCR_RF3CS_BRG8 0x00001800
831 #define CMXFCR_RF3CS_CLK13 0x00002000
832 #define CMXFCR_RF3CS_CLK14 0x00002800
833 #define CMXFCR_RF3CS_CLK15 0x00003000
834 #define CMXFCR_RF3CS_CLK16 0x00003800
836 #define CMXFCR_TF3CS_BRG5 0x00000000
837 #define CMXFCR_TF3CS_BRG6 0x00000100
838 #define CMXFCR_TF3CS_BRG7 0x00000200
839 #define CMXFCR_TF3CS_BRG8 0x00000300
840 #define CMXFCR_TF3CS_CLK13 0x00000400
841 #define CMXFCR_TF3CS_CLK14 0x00000500
842 #define CMXFCR_TF3CS_CLK15 0x00000600
843 #define CMXFCR_TF3CS_CLK16 0x00000700
848 #define CMXSCR_GR1 0x80000000
849 #define CMXSCR_SC1 0x40000000
850 #define CMXSCR_RS1CS_MSK 0x38000000
851 #define CMXSCR_TS1CS_MSK 0x07000000
852 #define CMXSCR_GR2 0x00800000
853 #define CMXSCR_SC2 0x00400000
854 #define CMXSCR_RS2CS_MSK 0x00380000
855 #define CMXSCR_TS2CS_MSK 0x00070000
856 #define CMXSCR_GR3 0x00008000
857 #define CMXSCR_SC3 0x00004000
858 #define CMXSCR_RS3CS_MSK 0x00003800
859 #define CMXSCR_TS3CS_MSK 0x00000700
860 #define CMXSCR_GR4 0x00000080
861 #define CMXSCR_SC4 0x00000040
862 #define CMXSCR_RS4CS_MSK 0x00000038
863 #define CMXSCR_TS4CS_MSK 0x00000007
865 #define CMXSCR_RS1CS_BRG1 0x00000000
866 #define CMXSCR_RS1CS_BRG2 0x08000000
867 #define CMXSCR_RS1CS_BRG3 0x10000000
868 #define CMXSCR_RS1CS_BRG4 0x18000000
869 #define CMXSCR_RS1CS_CLK11 0x20000000
870 #define CMXSCR_RS1CS_CLK12 0x28000000
871 #define CMXSCR_RS1CS_CLK3 0x30000000
872 #define CMXSCR_RS1CS_CLK4 0x38000000
874 #define CMXSCR_TS1CS_BRG1 0x00000000
875 #define CMXSCR_TS1CS_BRG2 0x01000000
876 #define CMXSCR_TS1CS_BRG3 0x02000000
877 #define CMXSCR_TS1CS_BRG4 0x03000000
878 #define CMXSCR_TS1CS_CLK11 0x04000000
879 #define CMXSCR_TS1CS_CLK12 0x05000000
880 #define CMXSCR_TS1CS_CLK3 0x06000000
881 #define CMXSCR_TS1CS_CLK4 0x07000000
883 #define CMXSCR_RS2CS_BRG1 0x00000000
884 #define CMXSCR_RS2CS_BRG2 0x00080000
885 #define CMXSCR_RS2CS_BRG3 0x00100000
886 #define CMXSCR_RS2CS_BRG4 0x00180000
887 #define CMXSCR_RS2CS_CLK11 0x00200000
888 #define CMXSCR_RS2CS_CLK12 0x00280000
889 #define CMXSCR_RS2CS_CLK3 0x00300000
890 #define CMXSCR_RS2CS_CLK4 0x00380000
892 #define CMXSCR_TS2CS_BRG1 0x00000000
893 #define CMXSCR_TS2CS_BRG2 0x00010000
894 #define CMXSCR_TS2CS_BRG3 0x00020000
895 #define CMXSCR_TS2CS_BRG4 0x00030000
896 #define CMXSCR_TS2CS_CLK11 0x00040000
897 #define CMXSCR_TS2CS_CLK12 0x00050000
898 #define CMXSCR_TS2CS_CLK3 0x00060000
899 #define CMXSCR_TS2CS_CLK4 0x00070000
901 #define CMXSCR_RS3CS_BRG1 0x00000000
902 #define CMXSCR_RS3CS_BRG2 0x00000800
903 #define CMXSCR_RS3CS_BRG3 0x00001000
904 #define CMXSCR_RS3CS_BRG4 0x00001800
905 #define CMXSCR_RS3CS_CLK5 0x00002000
906 #define CMXSCR_RS3CS_CLK6 0x00002800
907 #define CMXSCR_RS3CS_CLK7 0x00003000
908 #define CMXSCR_RS3CS_CLK8 0x00003800
910 #define CMXSCR_TS3CS_BRG1 0x00000000
911 #define CMXSCR_TS3CS_BRG2 0x00000100
912 #define CMXSCR_TS3CS_BRG3 0x00000200
913 #define CMXSCR_TS3CS_BRG4 0x00000300
914 #define CMXSCR_TS3CS_CLK5 0x00000400
915 #define CMXSCR_TS3CS_CLK6 0x00000500
916 #define CMXSCR_TS3CS_CLK7 0x00000600
917 #define CMXSCR_TS3CS_CLK8 0x00000700
919 #define CMXSCR_RS4CS_BRG1 0x00000000
920 #define CMXSCR_RS4CS_BRG2 0x00000008
921 #define CMXSCR_RS4CS_BRG3 0x00000010
922 #define CMXSCR_RS4CS_BRG4 0x00000018
923 #define CMXSCR_RS4CS_CLK5 0x00000020
924 #define CMXSCR_RS4CS_CLK6 0x00000028
925 #define CMXSCR_RS4CS_CLK7 0x00000030
926 #define CMXSCR_RS4CS_CLK8 0x00000038
928 #define CMXSCR_TS4CS_BRG1 0x00000000
929 #define CMXSCR_TS4CS_BRG2 0x00000001
930 #define CMXSCR_TS4CS_BRG3 0x00000002
931 #define CMXSCR_TS4CS_BRG4 0x00000003
932 #define CMXSCR_TS4CS_CLK5 0x00000004
933 #define CMXSCR_TS4CS_CLK6 0x00000005
934 #define CMXSCR_TS4CS_CLK7 0x00000006
935 #define CMXSCR_TS4CS_CLK8 0x00000007
940 #define SIUMCR_BBD 0x80000000
941 #define SIUMCR_ESE 0x40000000
942 #define SIUMCR_PBSE 0x20000000
943 #define SIUMCR_CDIS 0x10000000
944 #define SIUMCR_DPPC00 0x00000000
945 #define SIUMCR_DPPC01 0x04000000
946 #define SIUMCR_DPPC10 0x08000000
947 #define SIUMCR_DPPC11 0x0c000000
948 #define SIUMCR_L2CPC00 0x00000000
949 #define SIUMCR_L2CPC01 0x01000000
950 #define SIUMCR_L2CPC10 0x02000000
951 #define SIUMCR_L2CPC11 0x03000000
952 #define SIUMCR_LBPC00 0x00000000
953 #define SIUMCR_LBPC01 0x00400000
954 #define SIUMCR_LBPC10 0x00800000
955 #define SIUMCR_LBPC11 0x00c00000
956 #define SIUMCR_APPC00 0x00000000
957 #define SIUMCR_APPC01 0x00100000
958 #define SIUMCR_APPC10 0x00200000
959 #define SIUMCR_APPC11 0x00300000
960 #define SIUMCR_CS10PC00 0x00000000
961 #define SIUMCR_CS10PC01 0x00040000
962 #define SIUMCR_CS10PC10 0x00080000
963 #define SIUMCR_CS10PC11 0x000c0000
964 #define SIUMCR_BCTLC00 0x00000000
965 #define SIUMCR_BCTLC01 0x00010000
966 #define SIUMCR_BCTLC10 0x00020000
967 #define SIUMCR_BCTLC11 0x00030000
968 #define SIUMCR_MMR00 0x00000000
969 #define SIUMCR_MMR01 0x00004000
970 #define SIUMCR_MMR10 0x00008000
971 #define SIUMCR_MMR11 0x0000c000
972 #define SIUMCR_LPBSE 0x00002000
977 #define SCCR_PCI_MODE 0x00000100
978 #define SCCR_PCI_MODCK 0x00000080
979 #define SCCR_PCIDF_MSK 0x00000078
980 #define SCCR_PCIDF_SHIFT 3
982 #ifndef CPM_IMMR_OFFSET
983 #define CPM_IMMR_OFFSET 0x101a8
986 #define FCC_PSMR_RMII ((uint)0x00020000)
993 #define PC_CLK(x) ((uint)(1<<(x-1)))
995 #define CMXFCR_RF1CS(x) ((uint)((x-5)<<27))
996 #define CMXFCR_TF1CS(x) ((uint)((x-5)<<24))
997 #define CMXFCR_RF2CS(x) ((uint)((x-9)<<19))
998 #define CMXFCR_TF2CS(x) ((uint)((x-9)<<16))
999 #define CMXFCR_RF3CS(x) ((uint)((x-9)<<11))
1000 #define CMXFCR_TF3CS(x) ((uint)((x-9)<<8))
1002 #define PC_F1RXCLK PC_CLK(F1_RXCLK)
1003 #define PC_F1TXCLK PC_CLK(F1_TXCLK)
1004 #define CMX1_CLK_ROUTE (CMXFCR_RF1CS(F1_RXCLK) | CMXFCR_TF1CS(F1_TXCLK))
1005 #define CMX1_CLK_MASK ((uint)0xff000000)
1007 #define PC_F2RXCLK PC_CLK(F2_RXCLK)
1008 #define PC_F2TXCLK PC_CLK(F2_TXCLK)
1009 #define CMX2_CLK_ROUTE (CMXFCR_RF2CS(F2_RXCLK) | CMXFCR_TF2CS(F2_TXCLK))
1010 #define CMX2_CLK_MASK ((uint)0x00ff0000)
1012 #define PC_F3RXCLK PC_CLK(F3_RXCLK)
1013 #define PC_F3TXCLK PC_CLK(F3_TXCLK)
1014 #define CMX3_CLK_ROUTE (CMXFCR_RF3CS(F3_RXCLK) | CMXFCR_TF3CS(F3_TXCLK))
1015 #define CMX3_CLK_MASK ((uint)0x0000ff00)
1017 #define CPMUX_CLK_MASK (CMX3_CLK_MASK | CMX2_CLK_MASK)
1018 #define CPMUX_CLK_ROUTE (CMX3_CLK_ROUTE | CMX2_CLK_ROUTE)
1020 #define CLK_TRX (PC_F3TXCLK | PC_F3RXCLK | PC_F2TXCLK | PC_F2RXCLK)
1025 #define PA1_COL 0x00000001U
1026 #define PA1_CRS 0x00000002U
1027 #define PA1_TXER 0x00000004U
1028 #define PA1_TXEN 0x00000008U
1029 #define PA1_RXDV 0x00000010U
1030 #define PA1_RXER 0x00000020U
1031 #define PA1_TXDAT 0x00003c00U
1032 #define PA1_RXDAT 0x0003c000U
1033 #define PA1_PSORA0 (PA1_RXDAT | PA1_TXDAT)
1034 #define PA1_PSORA1 (PA1_COL | PA1_CRS | PA1_TXER | PA1_TXEN | \
1035 PA1_RXDV | PA1_RXER)
1036 #define PA1_DIRA0 (PA1_RXDAT | PA1_CRS | PA1_COL | PA1_RXER | PA1_RXDV)
1037 #define PA1_DIRA1 (PA1_TXDAT | PA1_TXEN | PA1_TXER)
1043 #define PB2_TXER 0x00000001U
1044 #define PB2_RXDV 0x00000002U
1045 #define PB2_TXEN 0x00000004U
1046 #define PB2_RXER 0x00000008U
1047 #define PB2_COL 0x00000010U
1048 #define PB2_CRS 0x00000020U
1049 #define PB2_TXDAT 0x000003c0U
1050 #define PB2_RXDAT 0x00003c00U
1051 #define PB2_PSORB0 (PB2_RXDAT | PB2_TXDAT | PB2_CRS | PB2_COL | \
1052 PB2_RXER | PB2_RXDV | PB2_TXER)
1053 #define PB2_PSORB1 (PB2_TXEN)
1054 #define PB2_DIRB0 (PB2_RXDAT | PB2_CRS | PB2_COL | PB2_RXER | PB2_RXDV)
1055 #define PB2_DIRB1 (PB2_TXDAT | PB2_TXEN | PB2_TXER)
1061 #define PB3_RXDV 0x00004000U
1062 #define PB3_RXER 0x00008000U
1063 #define PB3_TXER 0x00010000U
1064 #define PB3_TXEN 0x00020000U
1065 #define PB3_COL 0x00040000U
1066 #define PB3_CRS 0x00080000U
1067 #define PB3_TXDAT 0x0f000000U
1068 #define PC3_TXDAT 0x00000010U
1069 #define PB3_RXDAT 0x00f00000U
1070 #define PB3_PSORB0 (PB3_RXDAT | PB3_TXDAT | PB3_CRS | PB3_COL | \
1071 PB3_RXER | PB3_RXDV | PB3_TXER | PB3_TXEN)
1072 #define PB3_PSORB1 0
1073 #define PB3_DIRB0 (PB3_RXDAT | PB3_CRS | PB3_COL | PB3_RXER | PB3_RXDV)
1074 #define PB3_DIRB1 (PB3_TXDAT | PB3_TXEN | PB3_TXER)
1075 #define PC3_DIRC1 (PC3_TXDAT)
1078 #define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128))
1079 #define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0)
1080 #define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1)
1081 #define FCC3_MEM_OFFSET FCC_MEM_OFFSET(2)
1139 #define CPM_PIN_INPUT 0
1140 #define CPM_PIN_OUTPUT 1
1141 #define CPM_PIN_PRIMARY 0
1142 #define CPM_PIN_SECONDARY 2
1143 #define CPM_PIN_GPIO 4
1144 #define CPM_PIN_OPENDRAIN 8