1
2
3
4
5
6
7
8
9
10
11#ifndef __CPM_82XX__
12#define __CPM_82XX__
13
14#include <asm/immap_8260.h>
15
16
17
18#define CPM_CR_RST ((uint)0x80000000)
19#define CPM_CR_PAGE ((uint)0x7c000000)
20#define CPM_CR_SBLOCK ((uint)0x03e00000)
21#define CPM_CR_FLG ((uint)0x00010000)
22#define CPM_CR_MCN ((uint)0x00003fc0)
23#define CPM_CR_OPCODE ((uint)0x0000000f)
24
25
26
27#define CPM_CR_SCC1_SBLOCK (0x04)
28#define CPM_CR_SCC2_SBLOCK (0x05)
29#define CPM_CR_SCC3_SBLOCK (0x06)
30#define CPM_CR_SCC4_SBLOCK (0x07)
31#define CPM_CR_SMC1_SBLOCK (0x08)
32#define CPM_CR_SMC2_SBLOCK (0x09)
33#define CPM_CR_SPI_SBLOCK (0x0a)
34#define CPM_CR_I2C_SBLOCK (0x0b)
35#define CPM_CR_TIMER_SBLOCK (0x0f)
36#define CPM_CR_RAND_SBLOCK (0x0e)
37#define CPM_CR_FCC1_SBLOCK (0x10)
38#define CPM_CR_FCC2_SBLOCK (0x11)
39#define CPM_CR_FCC3_SBLOCK (0x12)
40#define CPM_CR_IDMA1_SBLOCK (0x14)
41#define CPM_CR_IDMA2_SBLOCK (0x15)
42#define CPM_CR_IDMA3_SBLOCK (0x16)
43#define CPM_CR_IDMA4_SBLOCK (0x17)
44#define CPM_CR_MCC1_SBLOCK (0x1c)
45
46#define CPM_CR_SCC1_PAGE (0x00)
47#define CPM_CR_SCC2_PAGE (0x01)
48#define CPM_CR_SCC3_PAGE (0x02)
49#define CPM_CR_SCC4_PAGE (0x03)
50#define CPM_CR_SMC1_PAGE (0x07)
51#define CPM_CR_SMC2_PAGE (0x08)
52#define CPM_CR_SPI_PAGE (0x09)
53#define CPM_CR_I2C_PAGE (0x0a)
54#define CPM_CR_TIMER_PAGE (0x0a)
55#define CPM_CR_RAND_PAGE (0x0a)
56#define CPM_CR_FCC1_PAGE (0x04)
57#define CPM_CR_FCC2_PAGE (0x05)
58#define CPM_CR_FCC3_PAGE (0x06)
59#define CPM_CR_IDMA1_PAGE (0x07)
60#define CPM_CR_IDMA2_PAGE (0x08)
61#define CPM_CR_IDMA3_PAGE (0x09)
62#define CPM_CR_IDMA4_PAGE (0x0a)
63#define CPM_CR_MCC1_PAGE (0x07)
64#define CPM_CR_MCC2_PAGE (0x08)
65
66
67
68#define CPM_CR_INIT_TRX ((ushort)0x0000)
69#define CPM_CR_INIT_RX ((ushort)0x0001)
70#define CPM_CR_INIT_TX ((ushort)0x0002)
71#define CPM_CR_HUNT_MODE ((ushort)0x0003)
72#define CPM_CR_STOP_TX ((ushort)0x0004)
73#define CPM_CR_RESTART_TX ((ushort)0x0006)
74#define CPM_CR_SET_GADDR ((ushort)0x0008)
75
76#define mk_cr_cmd(PG, SBC, MCN, OP) \
77 ((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
78
79
80
81
82
83
84
85#define CPM_DATAONLY_BASE ((uint)128)
86#define CPM_DP_NOSPACE ((uint)0x7fffffff)
87#ifndef CONFIG_MPC8272_FAMILY
88#define CPM_DATAONLY_SIZE ((uint)(8 * 1024) - CPM_DATAONLY_BASE)
89#define CPM_FCC_SPECIAL_BASE ((uint)0x0000b000)
90#else
91#define CPM_DATAONLY_SIZE ((uint)(4 * 1024) - CPM_DATAONLY_BASE)
92#define CPM_FCC_SPECIAL_BASE ((uint)0x00009000)
93#endif
94
95
96
97
98
99#define NUM_CPM_HOST_PAGES 2
100
101
102
103
104
105extern cpm8260_t *cpmp;
106uint m8260_cpm_dpalloc(uint size, uint align);
107uint m8260_cpm_hostalloc(uint size, uint align);
108void m8260_cpm_setbrg(uint brg, uint rate);
109void m8260_cpm_fastbrg(uint brg, uint rate, int div16);
110void m8260_cpm_extcbrg(uint brg, uint rate, uint extclk, int pinsel);
111
112
113
114typedef struct cpm_buf_desc {
115 ushort cbd_sc;
116 ushort cbd_datlen;
117 uint cbd_bufaddr;
118} cbd_t;
119
120#define BD_SC_EMPTY ((ushort)0x8000)
121#define BD_SC_READY ((ushort)0x8000)
122#define BD_SC_WRAP ((ushort)0x2000)
123#define BD_SC_INTRPT ((ushort)0x1000)
124#define BD_SC_LAST ((ushort)0x0800)
125#define BD_SC_CM ((ushort)0x0200)
126#define BD_SC_ID ((ushort)0x0100)
127#define BD_SC_P ((ushort)0x0100)
128#define BD_SC_BR ((ushort)0x0020)
129#define BD_SC_FR ((ushort)0x0010)
130#define BD_SC_PR ((ushort)0x0008)
131#define BD_SC_OV ((ushort)0x0002)
132#define BD_SC_CD ((ushort)0x0001)
133
134
135
136#define CPMFCR_GBL ((u_char)0x20)
137#define CPMFCR_EB ((u_char)0x10)
138#define CPMFCR_TC2 ((u_char)0x04)
139#define CPMFCR_DTB ((u_char)0x02)
140#define CPMFCR_BDB ((u_char)0x01)
141
142
143
144#ifndef CONFIG_SYS_CPM_POST_WORD_ADDR
145#define CPM_POST_WORD_ADDR 0x80FC
146#else
147#define CPM_POST_WORD_ADDR CONFIG_SYS_CPM_POST_WORD_ADDR
148#endif
149
150#ifndef CONFIG_SYS_CPM_BOOTCOUNT_ADDR
151#define CPM_BOOTCOUNT_ADDR (CPM_POST_WORD_ADDR - 2*sizeof(ulong))
152#else
153#define CPM_BOOTCOUNT_ADDR CONFIG_SYS_CPM_BOOTCOUNT_ADDR
154#endif
155
156#define PROFF_SCC1 ((uint)0x8000)
157#define PROFF_SCC2 ((uint)0x8100)
158#define PROFF_SCC3 ((uint)0x8200)
159#define PROFF_SCC4 ((uint)0x8300)
160#define PROFF_FCC1 ((uint)0x8400)
161#define PROFF_FCC2 ((uint)0x8500)
162#define PROFF_FCC3 ((uint)0x8600)
163#define PROFF_MCC1 ((uint)0x8700)
164#define PROFF_SMC1_BASE ((uint)0x87fc)
165#define PROFF_IDMA1_BASE ((uint)0x87fe)
166#define PROFF_MCC2 ((uint)0x8800)
167#define PROFF_SMC2_BASE ((uint)0x88fc)
168#define PROFF_IDMA2_BASE ((uint)0x88fe)
169#define PROFF_SPI_BASE ((uint)0x89fc)
170#define PROFF_IDMA3_BASE ((uint)0x89fe)
171#define PROFF_TIMERS ((uint)0x8ae0)
172#define PROFF_REVNUM ((uint)0x8af0)
173#define PROFF_RAND ((uint)0x8af8)
174#define PROFF_I2C_BASE ((uint)0x8afc)
175#define PROFF_IDMA4_BASE ((uint)0x8afe)
176
177
178
179
180
181
182
183#define PROFF_SMC1 (0)
184#define PROFF_SMC2 (64)
185#define PROFF_SPI ((16*1024) - 128)
186
187
188
189typedef struct smc_uart {
190 ushort smc_rbase;
191 ushort smc_tbase;
192 u_char smc_rfcr;
193 u_char smc_tfcr;
194 ushort smc_mrblr;
195 uint smc_rstate;
196 uint smc_idp;
197 ushort smc_rbptr;
198 ushort smc_ibc;
199 uint smc_rxtmp;
200 uint smc_tstate;
201 uint smc_tdp;
202 ushort smc_tbptr;
203 ushort smc_tbc;
204 uint smc_txtmp;
205 ushort smc_maxidl;
206 ushort smc_tmpidl;
207 ushort smc_brklen;
208 ushort smc_brkec;
209 ushort smc_brkcr;
210 ushort smc_rmask;
211 uint smc_stmp;
212} smc_uart_t;
213
214
215
216#define SMCMR_REN ((ushort)0x0001)
217#define SMCMR_TEN ((ushort)0x0002)
218#define SMCMR_DM ((ushort)0x000c)
219#define SMCMR_SM_GCI ((ushort)0x0000)
220#define SMCMR_SM_UART ((ushort)0x0020)
221#define SMCMR_SM_TRANS ((ushort)0x0030)
222#define SMCMR_SM_MASK ((ushort)0x0030)
223#define SMCMR_PM_EVEN ((ushort)0x0100)
224#define SMCMR_REVD SMCMR_PM_EVEN
225#define SMCMR_PEN ((ushort)0x0200)
226#define SMCMR_BS SMCMR_PEN
227#define SMCMR_SL ((ushort)0x0400)
228#define SMCR_CLEN_MASK ((ushort)0x7800)
229#define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
230
231
232
233#define SMCM_TXE ((unsigned char)0x10)
234#define SMCM_BSY ((unsigned char)0x04)
235#define SMCM_TX ((unsigned char)0x02)
236#define SMCM_RX ((unsigned char)0x01)
237
238
239
240#define CPM_BRG_RST ((uint)0x00020000)
241#define CPM_BRG_EN ((uint)0x00010000)
242#define CPM_BRG_EXTC_INT ((uint)0x00000000)
243#define CPM_BRG_EXTC_CLK3_9 ((uint)0x00004000)
244#define CPM_BRG_EXTC_CLK5_15 ((uint)0x00008000)
245#define CPM_BRG_ATB ((uint)0x00002000)
246#define CPM_BRG_CD_MASK ((uint)0x00001ffe)
247#define CPM_BRG_DIV16 ((uint)0x00000001)
248
249
250
251#define SCC_GSMRH_IRP ((uint)0x00040000)
252#define SCC_GSMRH_GDE ((uint)0x00010000)
253#define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
254#define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
255#define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
256#define SCC_GSMRH_REVD ((uint)0x00002000)
257#define SCC_GSMRH_TRX ((uint)0x00001000)
258#define SCC_GSMRH_TTX ((uint)0x00000800)
259#define SCC_GSMRH_CDP ((uint)0x00000400)
260#define SCC_GSMRH_CTSP ((uint)0x00000200)
261#define SCC_GSMRH_CDS ((uint)0x00000100)
262#define SCC_GSMRH_CTSS ((uint)0x00000080)
263#define SCC_GSMRH_TFL ((uint)0x00000040)
264#define SCC_GSMRH_RFW ((uint)0x00000020)
265#define SCC_GSMRH_TXSY ((uint)0x00000010)
266#define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
267#define SCC_GSMRH_SYNL8 ((uint)0x00000008)
268#define SCC_GSMRH_SYNL4 ((uint)0x00000004)
269#define SCC_GSMRH_RTSM ((uint)0x00000002)
270#define SCC_GSMRH_RSYN ((uint)0x00000001)
271
272#define SCC_GSMRL_SIR ((uint)0x80000000)
273#define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
274#define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
275#define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
276#define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
277#define SCC_GSMRL_TCI ((uint)0x10000000)
278#define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
279#define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
280#define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
281#define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
282#define SCC_GSMRL_RINV ((uint)0x02000000)
283#define SCC_GSMRL_TINV ((uint)0x01000000)
284#define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
285#define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
286#define SCC_GSMRL_TPL_48 ((uint)0x00800000)
287#define SCC_GSMRL_TPL_32 ((uint)0x00600000)
288#define SCC_GSMRL_TPL_16 ((uint)0x00400000)
289#define SCC_GSMRL_TPL_8 ((uint)0x00200000)
290#define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
291#define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
292#define SCC_GSMRL_TPP_01 ((uint)0x00100000)
293#define SCC_GSMRL_TPP_10 ((uint)0x00080000)
294#define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
295#define SCC_GSMRL_TEND ((uint)0x00040000)
296#define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
297#define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
298#define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
299#define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
300#define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
301#define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
302#define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
303#define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
304#define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
305#define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
306#define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
307#define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
308#define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
309#define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
310#define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
311#define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
312#define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
313#define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
314#define SCC_GSMRL_DIAG_LE ((uint)0x000000c0)
315#define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
316#define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
317#define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
318#define SCC_GSMRL_ENR ((uint)0x00000020)
319#define SCC_GSMRL_ENT ((uint)0x00000010)
320#define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
321#define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
322#define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
323#define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
324#define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
325#define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
326#define SCC_GSMRL_MODE_UART ((uint)0x00000004)
327#define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
328#define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
329#define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
330
331#define SCC_TODR_TOD ((ushort)0x8000)
332
333
334
335#define SCCM_TXE ((unsigned char)0x10)
336#define SCCM_BSY ((unsigned char)0x04)
337#define SCCM_TX ((unsigned char)0x02)
338#define SCCM_RX ((unsigned char)0x01)
339
340typedef struct scc_param {
341 ushort scc_rbase;
342 ushort scc_tbase;
343 u_char scc_rfcr;
344 u_char scc_tfcr;
345 ushort scc_mrblr;
346 uint scc_rstate;
347 uint scc_idp;
348 ushort scc_rbptr;
349 ushort scc_ibc;
350 uint scc_rxtmp;
351 uint scc_tstate;
352 uint scc_tdp;
353 ushort scc_tbptr;
354 ushort scc_tbc;
355 uint scc_txtmp;
356 uint scc_rcrc;
357 uint scc_tcrc;
358} sccp_t;
359
360
361
362typedef struct scc_enet {
363 sccp_t sen_genscc;
364 uint sen_cpres;
365 uint sen_cmask;
366 uint sen_crcec;
367 uint sen_alec;
368 uint sen_disfc;
369 ushort sen_pads;
370 ushort sen_retlim;
371 ushort sen_retcnt;
372 ushort sen_maxflr;
373 ushort sen_minflr;
374 ushort sen_maxd1;
375 ushort sen_maxd2;
376 ushort sen_maxd;
377 ushort sen_dmacnt;
378 ushort sen_maxb;
379 ushort sen_gaddr1;
380 ushort sen_gaddr2;
381 ushort sen_gaddr3;
382 ushort sen_gaddr4;
383 uint sen_tbuf0data0;
384 uint sen_tbuf0data1;
385 uint sen_tbuf0rba;
386 uint sen_tbuf0crc;
387 ushort sen_tbuf0bcnt;
388 ushort sen_paddrh;
389 ushort sen_paddrm;
390 ushort sen_paddrl;
391 ushort sen_pper;
392 ushort sen_rfbdptr;
393 ushort sen_tfbdptr;
394 ushort sen_tlbdptr;
395 uint sen_tbuf1data0;
396 uint sen_tbuf1data1;
397 uint sen_tbuf1rba;
398 uint sen_tbuf1crc;
399 ushort sen_tbuf1bcnt;
400 ushort sen_txlen;
401 ushort sen_iaddr1;
402 ushort sen_iaddr2;
403 ushort sen_iaddr3;
404 ushort sen_iaddr4;
405 ushort sen_boffcnt;
406
407
408
409
410 ushort sen_taddrh;
411 ushort sen_taddrm;
412 ushort sen_taddrl;
413} scc_enet_t;
414
415
416
417
418#define SCCE_ENET_GRA ((ushort)0x0080)
419#define SCCE_ENET_TXE ((ushort)0x0010)
420#define SCCE_ENET_RXF ((ushort)0x0008)
421#define SCCE_ENET_BSY ((ushort)0x0004)
422#define SCCE_ENET_TXB ((ushort)0x0002)
423#define SCCE_ENET_RXB ((ushort)0x0001)
424
425
426
427#define SCC_PSMR_HBC ((ushort)0x8000)
428#define SCC_PSMR_FC ((ushort)0x4000)
429#define SCC_PSMR_RSH ((ushort)0x2000)
430#define SCC_PSMR_IAM ((ushort)0x1000)
431#define SCC_PSMR_ENCRC ((ushort)0x0800)
432#define SCC_PSMR_PRO ((ushort)0x0200)
433#define SCC_PSMR_BRO ((ushort)0x0100)
434#define SCC_PSMR_SBT ((ushort)0x0080)
435#define SCC_PSMR_LPB ((ushort)0x0040)
436#define SCC_PSMR_SIP ((ushort)0x0020)
437#define SCC_PSMR_LCW ((ushort)0x0010)
438#define SCC_PSMR_NIB22 ((ushort)0x000a)
439#define SCC_PSMR_FDE ((ushort)0x0001)
440
441
442
443
444#define BD_ENET_RX_EMPTY ((ushort)0x8000)
445#define BD_ENET_RX_WRAP ((ushort)0x2000)
446#define BD_ENET_RX_INTR ((ushort)0x1000)
447#define BD_ENET_RX_LAST ((ushort)0x0800)
448#define BD_ENET_RX_FIRST ((ushort)0x0400)
449#define BD_ENET_RX_MISS ((ushort)0x0100)
450#define BD_ENET_RX_BC ((ushort)0x0080)
451#define BD_ENET_RX_MC ((ushort)0x0040)
452#define BD_ENET_RX_LG ((ushort)0x0020)
453#define BD_ENET_RX_NO ((ushort)0x0010)
454#define BD_ENET_RX_SH ((ushort)0x0008)
455#define BD_ENET_RX_CR ((ushort)0x0004)
456#define BD_ENET_RX_OV ((ushort)0x0002)
457#define BD_ENET_RX_CL ((ushort)0x0001)
458#define BD_ENET_RX_STATS ((ushort)0x01ff)
459
460
461
462
463#define BD_ENET_TX_READY ((ushort)0x8000)
464#define BD_ENET_TX_PAD ((ushort)0x4000)
465#define BD_ENET_TX_WRAP ((ushort)0x2000)
466#define BD_ENET_TX_INTR ((ushort)0x1000)
467#define BD_ENET_TX_LAST ((ushort)0x0800)
468#define BD_ENET_TX_TC ((ushort)0x0400)
469#define BD_ENET_TX_DEF ((ushort)0x0200)
470#define BD_ENET_TX_HB ((ushort)0x0100)
471#define BD_ENET_TX_LC ((ushort)0x0080)
472#define BD_ENET_TX_RL ((ushort)0x0040)
473#define BD_ENET_TX_RCMASK ((ushort)0x003c)
474#define BD_ENET_TX_UN ((ushort)0x0002)
475#define BD_ENET_TX_CSL ((ushort)0x0001)
476#define BD_ENET_TX_STATS ((ushort)0x03ff)
477
478
479
480typedef struct scc_uart {
481 sccp_t scc_genscc;
482 uint scc_res1;
483 uint scc_res2;
484 ushort scc_maxidl;
485 ushort scc_idlc;
486 ushort scc_brkcr;
487 ushort scc_parec;
488 ushort scc_frmec;
489 ushort scc_nosec;
490 ushort scc_brkec;
491 ushort scc_brkln;
492 ushort scc_uaddr1;
493 ushort scc_uaddr2;
494 ushort scc_rtemp;
495 ushort scc_toseq;
496 ushort scc_char1;
497 ushort scc_char2;
498 ushort scc_char3;
499 ushort scc_char4;
500 ushort scc_char5;
501 ushort scc_char6;
502 ushort scc_char7;
503 ushort scc_char8;
504 ushort scc_rccm;
505 ushort scc_rccr;
506 ushort scc_rlbc;
507} scc_uart_t;
508
509
510
511#define UART_SCCM_GLR ((ushort)0x1000)
512#define UART_SCCM_GLT ((ushort)0x0800)
513#define UART_SCCM_AB ((ushort)0x0200)
514#define UART_SCCM_IDL ((ushort)0x0100)
515#define UART_SCCM_GRA ((ushort)0x0080)
516#define UART_SCCM_BRKE ((ushort)0x0040)
517#define UART_SCCM_BRKS ((ushort)0x0020)
518#define UART_SCCM_CCR ((ushort)0x0008)
519#define UART_SCCM_BSY ((ushort)0x0004)
520#define UART_SCCM_TX ((ushort)0x0002)
521#define UART_SCCM_RX ((ushort)0x0001)
522
523
524
525#define SCU_PSMR_FLC ((ushort)0x8000)
526#define SCU_PSMR_SL ((ushort)0x4000)
527#define SCU_PSMR_CL ((ushort)0x3000)
528#define SCU_PSMR_UM ((ushort)0x0c00)
529#define SCU_PSMR_FRZ ((ushort)0x0200)
530#define SCU_PSMR_RZS ((ushort)0x0100)
531#define SCU_PSMR_SYN ((ushort)0x0080)
532#define SCU_PSMR_DRT ((ushort)0x0040)
533#define SCU_PSMR_PEN ((ushort)0x0010)
534#define SCU_PSMR_RPM ((ushort)0x000c)
535#define SCU_PSMR_REVP ((ushort)0x0008)
536#define SCU_PSMR_TPM ((ushort)0x0003)
537#define SCU_PSMR_TEVP ((ushort)0x0003)
538
539
540
541typedef struct scc_trans {
542 sccp_t st_genscc;
543 uint st_cpres;
544 uint st_cmask;
545} scc_trans_t;
546
547#define BD_SCC_TX_LAST ((ushort)0x0800)
548
549
550
551typedef struct scc_hdlc {
552 sccp_t sh_genscc;
553
554
555
556 uchar res[4];
557 ulong sh_cmask;
558 ulong sh_cpres;
559 ushort sh_disfc;
560 ushort sh_crcec;
561 ushort sh_abtsc;
562 ushort sh_nmarc;
563 ushort sh_retrc;
564 ushort sh_mflr;
565 ushort sh_maxcnt;
566 ushort sh_rfthr;
567 ushort sh_rfcnt;
568 ushort sh_hmask;
569 ushort sh_haddr1;
570 ushort sh_haddr2;
571 ushort sh_haddr3;
572 ushort sh_haddr4;
573 ushort tmp;
574 ushort tmp_mb;
575} scc_hdlc_t;
576
577
578
579#define FCC_GFMR_DIAG_NORM ((uint)0x00000000)
580#define FCC_GFMR_DIAG_LE ((uint)0x40000000)
581#define FCC_GFMR_DIAG_AE ((uint)0x80000000)
582#define FCC_GFMR_DIAG_ALE ((uint)0xc0000000)
583#define FCC_GFMR_TCI ((uint)0x20000000)
584#define FCC_GFMR_TRX ((uint)0x10000000)
585#define FCC_GFMR_TTX ((uint)0x08000000)
586#define FCC_GFMR_TTX ((uint)0x08000000)
587#define FCC_GFMR_CDP ((uint)0x04000000)
588#define FCC_GFMR_CTSP ((uint)0x02000000)
589#define FCC_GFMR_CDS ((uint)0x01000000)
590#define FCC_GFMR_CTSS ((uint)0x00800000)
591#define FCC_GFMR_SYNL_NONE ((uint)0x00000000)
592#define FCC_GFMR_SYNL_AUTO ((uint)0x00004000)
593#define FCC_GFMR_SYNL_8 ((uint)0x00008000)
594#define FCC_GFMR_SYNL_16 ((uint)0x0000c000)
595#define FCC_GFMR_RTSM ((uint)0x00002000)
596#define FCC_GFMR_RENC_NRZ ((uint)0x00000000)
597#define FCC_GFMR_RENC_NRZI ((uint)0x00000800)
598#define FCC_GFMR_REVD ((uint)0x00000400)
599#define FCC_GFMR_TENC_NRZ ((uint)0x00000000)
600#define FCC_GFMR_TENC_NRZI ((uint)0x00000100)
601#define FCC_GFMR_TCRC_16 ((uint)0x00000000)
602#define FCC_GFMR_TCRC_32 ((uint)0x00000080)
603#define FCC_GFMR_ENR ((uint)0x00000020)
604#define FCC_GFMR_ENT ((uint)0x00000010)
605#define FCC_GFMR_MODE_ENET ((uint)0x0000000c)
606#define FCC_GFMR_MODE_ATM ((uint)0x0000000a)
607#define FCC_GFMR_MODE_HDLC ((uint)0x00000000)
608
609
610
611typedef struct fcc_param {
612 ushort fcc_riptr;
613 ushort fcc_tiptr;
614 ushort fcc_res1;
615 ushort fcc_mrblr;
616 uint fcc_rstate;
617 uint fcc_rbase;
618 ushort fcc_rbdstat;
619 ushort fcc_rbdlen;
620 uint fcc_rdptr;
621 uint fcc_tstate;
622 uint fcc_tbase;
623 ushort fcc_tbdstat;
624 ushort fcc_tbdlen;
625 uint fcc_tdptr;
626 uint fcc_rbptr;
627 uint fcc_tbptr;
628 uint fcc_rcrc;
629 uint fcc_res2;
630 uint fcc_tcrc;
631} fccp_t;
632
633
634
635
636typedef struct fcc_enet {
637 fccp_t fen_genfcc;
638 uint fen_statbuf;
639 uint fen_camptr;
640 uint fen_cmask;
641 uint fen_cpres;
642 uint fen_crcec;
643 uint fen_alec;
644 uint fen_disfc;
645 ushort fen_retlim;
646 ushort fen_retcnt;
647 ushort fen_pper;
648 ushort fen_boffcnt;
649 uint fen_gaddrh;
650 uint fen_gaddrl;
651 ushort fen_tfcstat;
652 ushort fen_tfclen;
653 uint fen_tfcptr;
654 ushort fen_mflr;
655 ushort fen_paddrh;
656 ushort fen_paddrm;
657 ushort fen_paddrl;
658 ushort fen_ibdcount;
659 ushort fen_idbstart;
660 ushort fen_ibdend;
661 ushort fen_txlen;
662 uint fen_ibdbase[8];
663 uint fen_iaddrh;
664 uint fen_iaddrl;
665 ushort fen_minflr;
666 ushort fen_taddrh;
667 ushort fen_taddrm;
668 ushort fen_taddrl;
669 ushort fen_padptr;
670 ushort fen_cftype;
671 ushort fen_cfrange;
672 ushort fen_maxb;
673 ushort fen_maxd1;
674 ushort fen_maxd2;
675 ushort fen_maxd;
676 ushort fen_dmacnt;
677 uint fen_octc;
678 uint fen_colc;
679 uint fen_broc;
680 uint fen_mulc;
681 uint fen_uspc;
682 uint fen_frgc;
683 uint fen_ospc;
684 uint fen_jbrc;
685 uint fen_p64c;
686 uint fen_p65c;
687 uint fen_p128c;
688 uint fen_p256c;
689 uint fen_p512c;
690 uint fen_p1024c;
691 uint fen_cambuf;
692 ushort fen_rfthr;
693 ushort fen_rfcnt;
694} fcc_enet_t;
695
696
697
698#define FCC_ENET_GRA ((ushort)0x0080)
699#define FCC_ENET_RXC ((ushort)0x0040)
700#define FCC_ENET_TXC ((ushort)0x0020)
701#define FCC_ENET_TXE ((ushort)0x0010)
702#define FCC_ENET_RXF ((ushort)0x0008)
703#define FCC_ENET_BSY ((ushort)0x0004)
704#define FCC_ENET_TXB ((ushort)0x0002)
705#define FCC_ENET_RXB ((ushort)0x0001)
706
707
708
709#define FCC_PSMR_HBC ((uint)0x80000000)
710#define FCC_PSMR_FC ((uint)0x40000000)
711#define FCC_PSMR_SBT ((uint)0x20000000)
712#define FCC_PSMR_LPB ((uint)0x10000000)
713#define FCC_PSMR_LCW ((uint)0x08000000)
714#define FCC_PSMR_FDE ((uint)0x04000000)
715#define FCC_PSMR_MON ((uint)0x02000000)
716#define FCC_PSMR_PRO ((uint)0x00400000)
717#define FCC_PSMR_FCE ((uint)0x00200000)
718#define FCC_PSMR_RSH ((uint)0x00100000)
719#define FCC_PSMR_RMII ((uint)0x00020000)
720#define FCC_PSMR_CAM ((uint)0x00000400)
721#define FCC_PSMR_BRO ((uint)0x00000200)
722#define FCC_PSMR_ENCRC ((uint)0x00000080)
723
724
725
726typedef struct iic {
727 ushort iic_rbase;
728 ushort iic_tbase;
729 u_char iic_rfcr;
730 u_char iic_tfcr;
731 ushort iic_mrblr;
732 uint iic_rstate;
733 uint iic_rdp;
734 ushort iic_rbptr;
735 ushort iic_rbc;
736 uint iic_rxtmp;
737 uint iic_tstate;
738 uint iic_tdp;
739 ushort iic_tbptr;
740 ushort iic_tbc;
741 uint iic_txtmp;
742} iic_t;
743
744
745
746typedef struct spi {
747 ushort spi_rbase;
748 ushort spi_tbase;
749 u_char spi_rfcr;
750 u_char spi_tfcr;
751 ushort spi_mrblr;
752 uint spi_rstate;
753 uint spi_rdp;
754 ushort spi_rbptr;
755 ushort spi_rbc;
756 uint spi_rxtmp;
757 uint spi_tstate;
758 uint spi_tdp;
759 ushort spi_tbptr;
760 ushort spi_tbc;
761 uint spi_txtmp;
762 uint spi_res;
763 uint spi_res1[4];
764} spi_t;
765
766
767
768#define SPMODE_LOOP ((ushort)0x4000)
769#define SPMODE_CI ((ushort)0x2000)
770#define SPMODE_CP ((ushort)0x1000)
771#define SPMODE_DIV16 ((ushort)0x0800)
772#define SPMODE_REV ((ushort)0x0400)
773#define SPMODE_MSTR ((ushort)0x0200)
774#define SPMODE_EN ((ushort)0x0100)
775#define SPMODE_LENMSK ((ushort)0x00f0)
776#define SPMODE_PMMSK ((ushort)0x000f)
777
778#define SPMODE_LEN(x) ((((x)-1)&0xF)<<4)
779#define SPMODE_PM(x) ((x) &0xF)
780
781
782
783#define SPI_EMASK 0x37
784#define SPI_MME 0x20
785#define SPI_TXE 0x10
786#define SPI_BSY 0x04
787#define SPI_TXB 0x02
788#define SPI_RXB 0x01
789
790#define SPI_STR 0x80
791
792#define SPI_EB ((u_char)0x10)
793
794#define BD_IIC_START ((ushort)0x0400)
795
796#endif
797