Staging: et131x: GLOBAL_t is now sane so kill the GLOBAL_t itself
[safe/jmp/linux-2.6] / drivers / staging / et131x / et1310_address_map.h
1 /*
2  * Agere Systems Inc.
3  * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs
4  *
5  * Copyright © 2005 Agere Systems Inc.
6  * All rights reserved.
7  *   http://www.agere.com
8  *
9  *------------------------------------------------------------------------------
10  *
11  * et1310_address_map.h - Contains the register mapping for the ET1310
12  *
13  *------------------------------------------------------------------------------
14  *
15  * SOFTWARE LICENSE
16  *
17  * This software is provided subject to the following terms and conditions,
18  * which you should read carefully before using the software.  Using this
19  * software indicates your acceptance of these terms and conditions.  If you do
20  * not agree with these terms and conditions, do not use the software.
21  *
22  * Copyright © 2005 Agere Systems Inc.
23  * All rights reserved.
24  *
25  * Redistribution and use in source or binary forms, with or without
26  * modifications, are permitted provided that the following conditions are met:
27  *
28  * . Redistributions of source code must retain the above copyright notice, this
29  *    list of conditions and the following Disclaimer as comments in the code as
30  *    well as in the documentation and/or other materials provided with the
31  *    distribution.
32  *
33  * . Redistributions in binary form must reproduce the above copyright notice,
34  *    this list of conditions and the following Disclaimer in the documentation
35  *    and/or other materials provided with the distribution.
36  *
37  * . Neither the name of Agere Systems Inc. nor the names of the contributors
38  *    may be used to endorse or promote products derived from this software
39  *    without specific prior written permission.
40  *
41  * Disclaimer
42  *
43  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
44  * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
45  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  ANY
46  * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
47  * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
48  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
49  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
50  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
51  * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
52  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
53  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
54  * DAMAGE.
55  *
56  */
57
58 #ifndef _ET1310_ADDRESS_MAP_H_
59 #define _ET1310_ADDRESS_MAP_H_
60
61
62 /* START OF GLOBAL REGISTER ADDRESS MAP */
63
64 /*
65  * 10bit registers
66  *
67  * Tx queue start address reg in global address map at address 0x0000
68  * tx queue end address reg in global address map at address 0x0004
69  * rx queue start address reg in global address map at address 0x0008
70  * rx queue end address reg in global address map at address 0x000C
71  */
72
73 /*
74  * structure for power management control status reg in global address map
75  * located at address 0x0010
76  *      jagcore_rx_rdy  bit 9
77  *      jagcore_tx_rdy  bit 8
78  *      phy_lped_en     bit 7
79  *      phy_sw_coma     bit 6
80  *      rxclk_gate      bit 5
81  *      txclk_gate      bit 4
82  *      sysclk_gate     bit 3
83  *      jagcore_rx_en   bit 2
84  *      jagcore_tx_en   bit 1
85  *      gigephy_en      bit 0
86  */
87
88 #define ET_PM_PHY_SW_COMA               0x40
89 #define ET_PMCSR_INIT                   0x38
90
91 /*
92  * Interrupt status reg at address 0x0018
93  */
94
95 #define ET_INTR_TXDMA_ISR       0x00000008
96 #define ET_INTR_TXDMA_ERR       0x00000010
97 #define ET_INTR_RXDMA_XFR_DONE  0x00000020
98 #define ET_INTR_RXDMA_FB_R0_LOW 0x00000040
99 #define ET_INTR_RXDMA_FB_R1_LOW 0x00000080
100 #define ET_INTR_RXDMA_STAT_LOW  0x00000100
101 #define ET_INTR_RXDMA_ERR       0x00000200
102 #define ET_INTR_WATCHDOG        0x00004000
103 #define ET_INTR_WOL             0x00008000
104 #define ET_INTR_PHY             0x00010000
105 #define ET_INTR_TXMAC           0x00020000
106 #define ET_INTR_RXMAC           0x00040000
107 #define ET_INTR_MAC_STAT        0x00080000
108 #define ET_INTR_SLV_TIMEOUT     0x00100000
109
110 /*
111  * Interrupt mask register at address 0x001C
112  * Interrupt alias clear mask reg at address 0x0020
113  * Interrupt status alias reg at address 0x0024
114  *
115  * Same masks as above
116  */
117
118 /*
119  * Software reset reg at address 0x0028
120  * 0:   txdma_sw_reset
121  * 1:   rxdma_sw_reset
122  * 2:   txmac_sw_reset
123  * 3:   rxmac_sw_reset
124  * 4:   mac_sw_reset
125  * 5:   mac_stat_sw_reset
126  * 6:   mmc_sw_reset
127  *31:   selfclr_disable
128  */
129
130 /*
131  * SLV Timer reg at address 0x002C (low 24 bits)
132  */
133
134 /*
135  * MSI Configuration reg at address 0x0030
136  */
137
138 #define ET_MSI_VECTOR   0x0000001F
139 #define ET_MSI_TC       0x00070000
140
141 /*
142  * Loopback reg located at address 0x0034
143  */
144
145 #define ET_LOOP_MAC     0x00000001
146 #define ET_LOOP_DMA     0x00000002
147
148 /*
149  * GLOBAL Module of JAGCore Address Mapping
150  * Located at address 0x0000
151  */
152 struct global_regs {                    /* Location: */
153         u32 txq_start_addr;                     /*  0x0000 */
154         u32 txq_end_addr;                       /*  0x0004 */
155         u32 rxq_start_addr;                     /*  0x0008 */
156         u32 rxq_end_addr;                       /*  0x000C */
157         u32 pm_csr;                             /*  0x0010 */
158         u32 unused;                             /*  0x0014 */
159         u32 int_status;                         /*  0x0018 */
160         u32 int_mask;                           /*  0x001C */
161         u32 int_alias_clr_en;                   /*  0x0020 */
162         u32 int_status_alias;                   /*  0x0024 */
163         u32 sw_reset;                           /*  0x0028 */
164         u32 slv_timer;                          /*  0x002C */
165         u32 msi_config;                         /*  0x0030 */
166         u32 loopback;                   /*  0x0034 */
167         u32 watchdog_timer;                     /*  0x0038 */
168 };
169
170
171 /* START OF TXDMA REGISTER ADDRESS MAP */
172
173 /*
174  * txdma control status reg at address 0x1000
175  */
176
177 #define ET_TXDMA_CSR_HALT       0x00000001
178 #define ET_TXDMA_DROP_TLP       0x00000002
179 #define ET_TXDMA_CACHE_THRS     0x000000F0
180 #define ET_TXDMA_CACHE_SHIFT    4
181 #define ET_TXDMA_SNGL_EPKT      0x00000100
182 #define ET_TXDMA_CLASS          0x00001E00
183
184 /*
185  * structure for txdma packet ring base address hi reg in txdma address map
186  * located at address 0x1004
187  * Defined earlier (u32)
188  */
189
190 /*
191  * structure for txdma packet ring base address low reg in txdma address map
192  * located at address 0x1008
193  * Defined earlier (u32)
194  */
195
196 /*
197  * structure for txdma packet ring number of descriptor reg in txdma address
198  * map.  Located at address 0x100C
199  *
200  * 31-10: unused
201  * 9-0: pr ndes
202  */
203
204 #define ET_DMA12_MASK           0x0FFF  /* 12 bit mask for DMA12W types */
205 #define ET_DMA12_WRAP           0x1000
206 #define ET_DMA10_MASK           0x03FF  /* 10 bit mask for DMA10W types */
207 #define ET_DMA10_WRAP           0x0400
208 #define ET_DMA4_MASK            0x000F  /* 4 bit mask for DMA4W types */
209 #define ET_DMA4_WRAP            0x0010
210
211 #define INDEX12(x)      ((x) & ET_DMA12_MASK)
212 #define INDEX10(x)      ((x) & ET_DMA10_MASK)
213 #define INDEX4(x)       ((x) & ET_DMA4_MASK)
214
215 extern inline void add_10bit(u32 *v, int n)
216 {
217         *v = INDEX10(*v + n) | (*v & ET_DMA10_WRAP);
218 }
219
220 extern inline void add_12bit(u32 *v, int n)
221 {
222         *v = INDEX12(*v + n) | (*v & ET_DMA12_WRAP);
223 }
224
225 /*
226  * 10bit DMA with wrap
227  * txdma tx queue write address reg in txdma address map at 0x1010
228  * txdma tx queue write address external reg in txdma address map at 0x1014
229  * txdma tx queue read address reg in txdma address map at 0x1018
230  *
231  * u32
232  * txdma status writeback address hi reg in txdma address map at0x101C
233  * txdma status writeback address lo reg in txdma address map at 0x1020
234  *
235  * 10bit DMA with wrap
236  * txdma service request reg in txdma address map at 0x1024
237  * structure for txdma service complete reg in txdma address map at 0x1028
238  *
239  * 4bit DMA with wrap
240  * txdma tx descriptor cache read index reg in txdma address map at 0x102C
241  * txdma tx descriptor cache write index reg in txdma address map at 0x1030
242  *
243  * txdma error reg in txdma address map at address 0x1034
244  * 0: PyldResend
245  * 1: PyldRewind
246  * 4: DescrResend
247  * 5: DescrRewind
248  * 8: WrbkResend
249  * 9: WrbkRewind
250  */
251
252 /*
253  * Tx DMA Module of JAGCore Address Mapping
254  * Located at address 0x1000
255  */
256 typedef struct _TXDMA_t {               /* Location: */
257         u32 csr;                        /*  0x1000 */
258         u32 pr_base_hi;                 /*  0x1004 */
259         u32 pr_base_lo;                 /*  0x1008 */
260         u32 pr_num_des;                 /*  0x100C */
261         u32 txq_wr_addr;                /*  0x1010 */
262         u32 txq_wr_addr_ext;            /*  0x1014 */
263         u32 txq_rd_addr;                /*  0x1018 */
264         u32 dma_wb_base_hi;             /*  0x101C */
265         u32 dma_wb_base_lo;             /*  0x1020 */
266         u32 service_request;            /*  0x1024 */
267         u32 service_complete;           /*  0x1028 */
268         u32 cache_rd_index;             /*  0x102C */
269         u32 cache_wr_index;             /*  0x1030 */
270         u32 TxDmaError;                 /*  0x1034 */
271         u32 DescAbortCount;             /*  0x1038 */
272         u32 PayloadAbortCnt;            /*  0x103c */
273         u32 WriteBackAbortCnt;          /*  0x1040 */
274         u32 DescTimeoutCnt;             /*  0x1044 */
275         u32 PayloadTimeoutCnt;          /*  0x1048 */
276         u32 WriteBackTimeoutCnt;        /*  0x104c */
277         u32 DescErrorCount;             /*  0x1050 */
278         u32 PayloadErrorCnt;            /*  0x1054 */
279         u32 WriteBackErrorCnt;          /*  0x1058 */
280         u32 DroppedTLPCount;            /*  0x105c */
281         u32 NewServiceComplete;         /*  0x1060 */
282         u32 EthernetPacketCount;        /*  0x1064 */
283 } TXDMA_t, *PTXDMA_t;
284
285 /* END OF TXDMA REGISTER ADDRESS MAP */
286
287
288 /* START OF RXDMA REGISTER ADDRESS MAP */
289
290 /*
291  * structure for control status reg in rxdma address map
292  * Located at address 0x2000
293  *
294  * CSR
295  * 0: halt
296  * 1-3: tc
297  * 4: fbr_big_endian
298  * 5: psr_big_endian
299  * 6: pkt_big_endian
300  * 7: dma_big_endian
301  * 8-9: fbr0_size
302  * 10: fbr0_enable
303  * 11-12: fbr1_size
304  * 13: fbr1_enable
305  * 14: unused
306  * 15: pkt_drop_disable
307  * 16: pkt_done_flush
308  * 17: halt_status
309  * 18-31: unused
310  */
311
312
313 /*
314  * structure for dma writeback lo reg in rxdma address map
315  * located at address 0x2004
316  * Defined earlier (u32)
317  */
318
319 /*
320  * structure for dma writeback hi reg in rxdma address map
321  * located at address 0x2008
322  * Defined earlier (u32)
323  */
324
325 /*
326  * structure for number of packets done reg in rxdma address map
327  * located at address 0x200C
328  *
329  * 31-8: unused
330  * 7-0: num done
331  */
332
333 /*
334  * structure for max packet time reg in rxdma address map
335  * located at address 0x2010
336  *
337  * 31-18: unused
338  * 17-0: time done
339  */
340
341 /*
342  * structure for rx queue read address reg in rxdma address map
343  * located at address 0x2014
344  * Defined earlier (u32)
345  */
346
347 /*
348  * structure for rx queue read address external reg in rxdma address map
349  * located at address 0x2018
350  * Defined earlier (u32)
351  */
352
353 /*
354  * structure for rx queue write address reg in rxdma address map
355  * located at address 0x201C
356  * Defined earlier (u32)
357  */
358
359 /*
360  * structure for packet status ring base address lo reg in rxdma address map
361  * located at address 0x2020
362  * Defined earlier (u32)
363  */
364
365 /*
366  * structure for packet status ring base address hi reg in rxdma address map
367  * located at address 0x2024
368  * Defined earlier (u32)
369  */
370
371 /*
372  * structure for packet status ring number of descriptors reg in rxdma address
373  * map.  Located at address 0x2028
374  *
375  * 31-12: unused
376  * 11-0: psr ndes
377  */
378
379 /*
380  * structure for packet status ring available offset reg in rxdma address map
381  * located at address 0x202C
382  *
383  * 31-13: unused
384  * 12: psr avail wrap
385  * 11-0: psr avail
386  */
387
388 /*
389  * structure for packet status ring full offset reg in rxdma address map
390  * located at address 0x2030
391  *
392  * 31-13: unused
393  * 12: psr full wrap
394  * 11-0: psr full
395  */
396
397 /*
398  * structure for packet status ring access index reg in rxdma address map
399  * located at address 0x2034
400  *
401  * 31-5: unused
402  * 4-0: psr_ai
403  */
404
405 /*
406  * structure for packet status ring minimum descriptors reg in rxdma address
407  * map.  Located at address 0x2038
408  *
409  * 31-12: unused
410  * 11-0: psr_min
411  */
412
413 /*
414  * structure for free buffer ring base lo address reg in rxdma address map
415  * located at address 0x203C
416  * Defined earlier (u32)
417  */
418
419 /*
420  * structure for free buffer ring base hi address reg in rxdma address map
421  * located at address 0x2040
422  * Defined earlier (u32)
423  */
424
425 /*
426  * structure for free buffer ring number of descriptors reg in rxdma address
427  * map.  Located at address 0x2044
428  *
429  * 31-10: unused
430  * 9-0: fbr ndesc
431  */
432
433 /*
434  * structure for free buffer ring 0 available offset reg in rxdma address map
435  * located at address 0x2048
436  * Defined earlier (u32)
437  */
438
439 /*
440  * structure for free buffer ring 0 full offset reg in rxdma address map
441  * located at address 0x204C
442  * Defined earlier (u32)
443  */
444
445 /*
446  * structure for free buffer cache 0 full offset reg in rxdma address map
447  * located at address 0x2050
448  *
449  * 31-5: unused
450  * 4-0: fbc rdi
451  */
452
453 /*
454  * structure for free buffer ring 0 minimum descriptor reg in rxdma address map
455  * located at address 0x2054
456  *
457  * 31-10: unused
458  * 9-0: fbr min
459  */
460
461 /*
462  * structure for free buffer ring 1 base address lo reg in rxdma address map
463  * located at address 0x2058 - 0x205C
464  * Defined earlier (RXDMA_FBR_BASE_LO_t and RXDMA_FBR_BASE_HI_t)
465  */
466
467 /*
468  * structure for free buffer ring 1 number of descriptors reg in rxdma address
469  * map.  Located at address 0x2060
470  * Defined earlier (RXDMA_FBR_NUM_DES_t)
471  */
472
473 /*
474  * structure for free buffer ring 1 available offset reg in rxdma address map
475  * located at address 0x2064
476  * Defined Earlier (RXDMA_FBR_AVAIL_OFFSET_t)
477  */
478
479 /*
480  * structure for free buffer ring 1 full offset reg in rxdma address map
481  * located at address 0x2068
482  * Defined Earlier (RXDMA_FBR_FULL_OFFSET_t)
483  */
484
485 /*
486  * structure for free buffer cache 1 read index reg in rxdma address map
487  * located at address 0x206C
488  * Defined Earlier (RXDMA_FBC_RD_INDEX_t)
489  */
490
491 /*
492  * structure for free buffer ring 1 minimum descriptor reg in rxdma address map
493  * located at address 0x2070
494  * Defined Earlier (RXDMA_FBR_MIN_DES_t)
495  */
496
497 /*
498  * Rx DMA Module of JAGCore Address Mapping
499  * Located at address 0x2000
500  */
501 struct rxdma_regs {                                     /* Location: */
502         u32 csr;                                        /*  0x2000 */
503         u32 dma_wb_base_lo;                             /*  0x2004 */
504         u32 dma_wb_base_hi;                             /*  0x2008 */
505         u32 num_pkt_done;                               /*  0x200C */
506         u32 max_pkt_time;                               /*  0x2010 */
507         u32 rxq_rd_addr;                                /*  0x2014 */
508         u32 rxq_rd_addr_ext;                            /*  0x2018 */
509         u32 rxq_wr_addr;                                /*  0x201C */
510         u32 psr_base_lo;                                /*  0x2020 */
511         u32 psr_base_hi;                                /*  0x2024 */
512         u32 psr_num_des;                                /*  0x2028 */
513         u32 psr_avail_offset;                           /*  0x202C */
514         u32 psr_full_offset;                            /*  0x2030 */
515         u32 psr_access_index;                           /*  0x2034 */
516         u32 psr_min_des;                                /*  0x2038 */
517         u32 fbr0_base_lo;                               /*  0x203C */
518         u32 fbr0_base_hi;                               /*  0x2040 */
519         u32 fbr0_num_des;                               /*  0x2044 */
520         u32 fbr0_avail_offset;                          /*  0x2048 */
521         u32 fbr0_full_offset;                           /*  0x204C */
522         u32 fbr0_rd_index;                              /*  0x2050 */
523         u32 fbr0_min_des;                               /*  0x2054 */
524         u32 fbr1_base_lo;                               /*  0x2058 */
525         u32 fbr1_base_hi;                               /*  0x205C */
526         u32 fbr1_num_des;                               /*  0x2060 */
527         u32 fbr1_avail_offset;                          /*  0x2064 */
528         u32 fbr1_full_offset;                           /*  0x2068 */
529         u32 fbr1_rd_index;                              /*  0x206C */
530         u32 fbr1_min_des;                               /*  0x2070 */
531 };
532
533 /* END OF RXDMA REGISTER ADDRESS MAP */
534
535
536 /* START OF TXMAC REGISTER ADDRESS MAP */
537
538 /*
539  * structure for control reg in txmac address map
540  * located at address 0x3000
541  */
542 typedef union _TXMAC_CTL_t {
543         u32 value;
544         struct {
545 #ifdef _BIT_FIELDS_HTOL
546                 u32 unused:24;          /* bits 8-31 */
547                 u32 cklseg_diable:1;    /* bit 7 */
548                 u32 ckbcnt_disable:1;   /* bit 6 */
549                 u32 cksegnum:1;         /* bit 5 */
550                 u32 async_disable:1;    /* bit 4 */
551                 u32 fc_disable:1;       /* bit 3 */
552                 u32 mcif_disable:1;     /* bit 2 */
553                 u32 mif_disable:1;      /* bit 1 */
554                 u32 txmac_en:1;         /* bit 0 */
555 #else
556                 u32 txmac_en:1;         /* bit 0 */
557                 u32 mif_disable:1;      /* bit 1 mac interface */
558                 u32 mcif_disable:1;     /* bit 2 mem. contr. interface */
559                 u32 fc_disable:1;       /* bit 3 */
560                 u32 async_disable:1;    /* bit 4 */
561                 u32 cksegnum:1;         /* bit 5 */
562                 u32 ckbcnt_disable:1;   /* bit 6 */
563                 u32 cklseg_diable:1;    /* bit 7 */
564                 u32 unused:24;          /* bits 8-31 */
565 #endif
566         } bits;
567 } TXMAC_CTL_t, *PTXMAC_CTL_t;
568
569 /*
570  * structure for shadow pointer reg in txmac address map
571  * located at address 0x3004
572  * 31-27: reserved
573  * 26-16: txq rd ptr
574  * 15-11: reserved
575  * 10-0: txq wr ptr
576  */
577
578 /*
579  * structure for error count reg in txmac address map
580  * located at address 0x3008
581  */
582 typedef union _TXMAC_ERR_CNT_t {
583         u32 value;
584         struct {
585 #ifdef _BIT_FIELDS_HTOL
586                 u32 unused:20;          /* bits 12-31 */
587                 u32 reserved:4;         /* bits 8-11 */
588                 u32 txq_underrun:4;     /* bits 4-7 */
589                 u32 fifo_underrun:4;    /* bits 0-3 */
590 #else
591                 u32 fifo_underrun:4;    /* bits 0-3 */
592                 u32 txq_underrun:4;     /* bits 4-7 */
593                 u32 reserved:4;         /* bits 8-11 */
594                 u32 unused:20;          /* bits 12-31 */
595 #endif
596         } bits;
597 } TXMAC_ERR_CNT_t, *PTXMAC_ERR_CNT_t;
598
599 /*
600  * structure for max fill reg in txmac address map
601  * located at address 0x300C
602  * 31-12: unused
603  * 11-0: max fill
604  */
605
606 /*
607  * structure for cf parameter reg in txmac address map
608  * located at address 0x3010
609  * 31-16: cfep
610  * 15-0: cfpt
611  */
612
613 /*
614  * structure for tx test reg in txmac address map
615  * located at address 0x3014
616  * 31-17: unused
617  * 16: reserved1
618  * 15: txtest_en
619  * 14-11: unused
620  * 10-0: txq test pointer
621  */
622
623 /*
624  * structure for error reg in txmac address map
625  * located at address 0x3018
626  */
627 typedef union _TXMAC_ERR_t {
628         u32 value;
629         struct {
630 #ifdef _BIT_FIELDS_HTOL
631                 u32 unused2:23;         /* bits 9-31 */
632                 u32 fifo_underrun:1;    /* bit 8 */
633                 u32 unused1:2;          /* bits 6-7 */
634                 u32 ctrl2_err:1;        /* bit 5 */
635                 u32 txq_underrun:1;     /* bit 4 */
636                 u32 bcnt_err:1;         /* bit 3 */
637                 u32 lseg_err:1;         /* bit 2 */
638                 u32 segnum_err:1;       /* bit 1 */
639                 u32 seg0_err:1;         /* bit 0 */
640 #else
641                 u32 seg0_err:1;         /* bit 0 */
642                 u32 segnum_err:1;       /* bit 1 */
643                 u32 lseg_err:1;         /* bit 2 */
644                 u32 bcnt_err:1;         /* bit 3 */
645                 u32 txq_underrun:1;     /* bit 4 */
646                 u32 ctrl2_err:1;        /* bit 5 */
647                 u32 unused1:2;          /* bits 6-7 */
648                 u32 fifo_underrun:1;    /* bit 8 */
649                 u32 unused2:23;         /* bits 9-31 */
650 #endif
651         } bits;
652 } TXMAC_ERR_t, *PTXMAC_ERR_t;
653
654 /*
655  * structure for error interrupt reg in txmac address map
656  * located at address 0x301C
657  */
658 typedef union _TXMAC_ERR_INT_t {
659         u32 value;
660         struct {
661 #ifdef _BIT_FIELDS_HTOL
662                 u32 unused2:23;         /* bits 9-31 */
663                 u32 fifo_underrun:1;    /* bit 8 */
664                 u32 unused1:2;          /* bits 6-7 */
665                 u32 ctrl2_err:1;        /* bit 5 */
666                 u32 txq_underrun:1;     /* bit 4 */
667                 u32 bcnt_err:1;         /* bit 3 */
668                 u32 lseg_err:1;         /* bit 2 */
669                 u32 segnum_err:1;       /* bit 1 */
670                 u32 seg0_err:1;         /* bit 0 */
671 #else
672                 u32 seg0_err:1;         /* bit 0 */
673                 u32 segnum_err:1;       /* bit 1 */
674                 u32 lseg_err:1;         /* bit 2 */
675                 u32 bcnt_err:1;         /* bit 3 */
676                 u32 txq_underrun:1;     /* bit 4 */
677                 u32 ctrl2_err:1;        /* bit 5 */
678                 u32 unused1:2;          /* bits 6-7 */
679                 u32 fifo_underrun:1;    /* bit 8 */
680                 u32 unused2:23;         /* bits 9-31 */
681 #endif
682         } bits;
683 } TXMAC_ERR_INT_t, *PTXMAC_ERR_INT_t;
684
685 /*
686  * structure for error interrupt reg in txmac address map
687  * located at address 0x3020
688  *
689  * 31-2: unused
690  * 1: bp_req
691  * 0: bp_xonxoff
692  */
693
694 /*
695  * Tx MAC Module of JAGCore Address Mapping
696  */
697 typedef struct _TXMAC_t {               /* Location: */
698         TXMAC_CTL_t ctl;                /*  0x3000 */
699         u32 shadow_ptr;                 /*  0x3004 */
700         TXMAC_ERR_CNT_t err_cnt;        /*  0x3008 */
701         u32 max_fill;                   /*  0x300C */
702         u32 cf_param;                   /*  0x3010 */
703         u32 tx_test;                    /*  0x3014 */
704         TXMAC_ERR_t err;                /*  0x3018 */
705         TXMAC_ERR_INT_t err_int;        /*  0x301C */
706         u32 bp_ctrl;                    /*  0x3020 */
707 } TXMAC_t, *PTXMAC_t;
708
709 /* END OF TXMAC REGISTER ADDRESS MAP */
710
711 /* START OF RXMAC REGISTER ADDRESS MAP */
712
713 /*
714  * structure for rxmac control reg in rxmac address map
715  * located at address 0x4000
716  */
717 typedef union _RXMAC_CTRL_t {
718         u32 value;
719         struct {
720 #ifdef _BIT_FIELDS_HTOL
721                 u32 reserved:25;                /* bits 7-31 */
722                 u32 rxmac_int_disable:1;        /* bit 6 */
723                 u32 async_disable:1;            /* bit 5 */
724                 u32 mif_disable:1;              /* bit 4 */
725                 u32 wol_disable:1;              /* bit 3 */
726                 u32 pkt_filter_disable:1;       /* bit 2 */
727                 u32 mcif_disable:1;             /* bit 1 */
728                 u32 rxmac_en:1;                 /* bit 0 */
729 #else
730                 u32 rxmac_en:1;                 /* bit 0 */
731                 u32 mcif_disable:1;             /* bit 1 */
732                 u32 pkt_filter_disable:1;       /* bit 2 */
733                 u32 wol_disable:1;              /* bit 3 */
734                 u32 mif_disable:1;              /* bit 4 */
735                 u32 async_disable:1;            /* bit 5 */
736                 u32 rxmac_int_disable:1;        /* bit 6 */
737                 u32 reserved:25;                /* bits 7-31 */
738 #endif
739         } bits;
740 } RXMAC_CTRL_t, *PRXMAC_CTRL_t;
741
742 /*
743  * structure for Wake On Lan Control and CRC 0 reg in rxmac address map
744  * located at address 0x4004
745  */
746 typedef union _RXMAC_WOL_CTL_CRC0_t {
747         u32 value;
748         struct {
749 #ifdef _BIT_FIELDS_HTOL
750                 u32 crc0:16;            /* bits 16-31 */
751                 u32 reserve:4;          /* bits 12-15 */
752                 u32 ignore_pp:1;        /* bit 11 */
753                 u32 ignore_mp:1;        /* bit 10 */
754                 u32 clr_intr:1;         /* bit 9 */
755                 u32 ignore_link_chg:1;  /* bit 8 */
756                 u32 ignore_uni:1;       /* bit 7 */
757                 u32 ignore_multi:1;     /* bit 6 */
758                 u32 ignore_broad:1;     /* bit 5 */
759                 u32 valid_crc4:1;       /* bit 4 */
760                 u32 valid_crc3:1;       /* bit 3 */
761                 u32 valid_crc2:1;       /* bit 2 */
762                 u32 valid_crc1:1;       /* bit 1 */
763                 u32 valid_crc0:1;       /* bit 0 */
764 #else
765                 u32 valid_crc0:1;       /* bit 0 */
766                 u32 valid_crc1:1;       /* bit 1 */
767                 u32 valid_crc2:1;       /* bit 2 */
768                 u32 valid_crc3:1;       /* bit 3 */
769                 u32 valid_crc4:1;       /* bit 4 */
770                 u32 ignore_broad:1;     /* bit 5 */
771                 u32 ignore_multi:1;     /* bit 6 */
772                 u32 ignore_uni:1;       /* bit 7 */
773                 u32 ignore_link_chg:1;  /* bit 8 */
774                 u32 clr_intr:1;         /* bit 9 */
775                 u32 ignore_mp:1;        /* bit 10 */
776                 u32 ignore_pp:1;        /* bit 11 */
777                 u32 reserve:4;          /* bits 12-15 */
778                 u32 crc0:16;            /* bits 16-31 */
779 #endif
780         } bits;
781 } RXMAC_WOL_CTL_CRC0_t, *PRXMAC_WOL_CTL_CRC0_t;
782
783 /*
784  * structure for CRC 1 and CRC 2 reg in rxmac address map
785  * located at address 0x4008
786  */
787 typedef union _RXMAC_WOL_CRC12_t {
788         u32 value;
789         struct {
790 #ifdef _BIT_FIELDS_HTOL
791                 u32 crc2:16;    /* bits 16-31 */
792                 u32 crc1:16;    /* bits 0-15 */
793 #else
794                 u32 crc1:16;    /* bits 0-15 */
795                 u32 crc2:16;    /* bits 16-31 */
796 #endif
797         } bits;
798 } RXMAC_WOL_CRC12_t, *PRXMAC_WOL_CRC12_t;
799
800 /*
801  * structure for CRC 3 and CRC 4 reg in rxmac address map
802  * located at address 0x400C
803  */
804 typedef union _RXMAC_WOL_CRC34_t {
805         u32 value;
806         struct {
807 #ifdef _BIT_FIELDS_HTOL
808                 u32 crc4:16;    /* bits 16-31 */
809                 u32 crc3:16;    /* bits 0-15 */
810 #else
811                 u32 crc3:16;    /* bits 0-15 */
812                 u32 crc4:16;    /* bits 16-31 */
813 #endif
814         } bits;
815 } RXMAC_WOL_CRC34_t, *PRXMAC_WOL_CRC34_t;
816
817 /*
818  * structure for Wake On Lan Source Address Lo reg in rxmac address map
819  * located at address 0x4010
820  */
821 typedef union _RXMAC_WOL_SA_LO_t {
822         u32 value;
823         struct {
824 #ifdef _BIT_FIELDS_HTOL
825                 u32 sa3:8;      /* bits 24-31 */
826                 u32 sa4:8;      /* bits 16-23 */
827                 u32 sa5:8;      /* bits 8-15 */
828                 u32 sa6:8;      /* bits 0-7 */
829 #else
830                 u32 sa6:8;      /* bits 0-7 */
831                 u32 sa5:8;      /* bits 8-15 */
832                 u32 sa4:8;      /* bits 16-23 */
833                 u32 sa3:8;      /* bits 24-31 */
834 #endif
835         } bits;
836 } RXMAC_WOL_SA_LO_t, *PRXMAC_WOL_SA_LO_t;
837
838 /*
839  * structure for Wake On Lan Source Address Hi reg in rxmac address map
840  * located at address 0x4014
841  */
842 typedef union _RXMAC_WOL_SA_HI_t {
843         u32 value;
844         struct {
845 #ifdef _BIT_FIELDS_HTOL
846                 u32 reserved:16;        /* bits 16-31 */
847                 u32 sa1:8;              /* bits 8-15 */
848                 u32 sa2:8;              /* bits 0-7 */
849 #else
850                 u32 sa2:8;              /* bits 0-7 */
851                 u32 sa1:8;              /* bits 8-15 */
852                 u32 reserved:16;        /* bits 16-31 */
853 #endif
854         } bits;
855 } RXMAC_WOL_SA_HI_t, *PRXMAC_WOL_SA_HI_t;
856
857 /*
858  * structure for Wake On Lan mask reg in rxmac address map
859  * located at address 0x4018 - 0x4064
860  * Defined earlier (u32)
861  */
862
863 /*
864  * structure for Unicast Paket Filter Address 1 reg in rxmac address map
865  * located at address 0x4068
866  */
867 typedef union _RXMAC_UNI_PF_ADDR1_t {
868         u32 value;
869         struct {
870 #ifdef _BIT_FIELDS_HTOL
871                 u32 addr1_3:8;  /* bits 24-31 */
872                 u32 addr1_4:8;  /* bits 16-23 */
873                 u32 addr1_5:8;  /* bits 8-15 */
874                 u32 addr1_6:8;  /* bits 0-7 */
875 #else
876                 u32 addr1_6:8;  /* bits 0-7 */
877                 u32 addr1_5:8;  /* bits 8-15 */
878                 u32 addr1_4:8;  /* bits 16-23 */
879                 u32 addr1_3:8;  /* bits 24-31 */
880 #endif
881         } bits;
882 } RXMAC_UNI_PF_ADDR1_t, *PRXMAC_UNI_PF_ADDR1_t;
883
884 /*
885  * structure for Unicast Paket Filter Address 2 reg in rxmac address map
886  * located at address 0x406C
887  */
888 typedef union _RXMAC_UNI_PF_ADDR2_t {
889         u32 value;
890         struct {
891 #ifdef _BIT_FIELDS_HTOL
892                 u32 addr2_3:8;  /* bits 24-31 */
893                 u32 addr2_4:8;  /* bits 16-23 */
894                 u32 addr2_5:8;  /* bits 8-15 */
895                 u32 addr2_6:8;  /* bits 0-7 */
896 #else
897                 u32 addr2_6:8;  /* bits 0-7 */
898                 u32 addr2_5:8;  /* bits 8-15 */
899                 u32 addr2_4:8;  /* bits 16-23 */
900                 u32 addr2_3:8;  /* bits 24-31 */
901 #endif
902         } bits;
903 } RXMAC_UNI_PF_ADDR2_t, *PRXMAC_UNI_PF_ADDR2_t;
904
905 /*
906  * structure for Unicast Paket Filter Address 1 & 2 reg in rxmac address map
907  * located at address 0x4070
908  */
909 typedef union _RXMAC_UNI_PF_ADDR3_t {
910         u32 value;
911         struct {
912 #ifdef _BIT_FIELDS_HTOL
913                 u32 addr2_1:8;  /* bits 24-31 */
914                 u32 addr2_2:8;  /* bits 16-23 */
915                 u32 addr1_1:8;  /* bits 8-15 */
916                 u32 addr1_2:8;  /* bits 0-7 */
917 #else
918                 u32 addr1_2:8;  /* bits 0-7 */
919                 u32 addr1_1:8;  /* bits 8-15 */
920                 u32 addr2_2:8;  /* bits 16-23 */
921                 u32 addr2_1:8;  /* bits 24-31 */
922 #endif
923         } bits;
924 } RXMAC_UNI_PF_ADDR3_t, *PRXMAC_UNI_PF_ADDR3_t;
925
926 /*
927  * structure for Multicast Hash reg in rxmac address map
928  * located at address 0x4074 - 0x4080
929  * Defined earlier (u32)
930  */
931
932 /*
933  * structure for Packet Filter Control reg in rxmac address map
934  * located at address 0x4084
935  */
936 typedef union _RXMAC_PF_CTRL_t {
937         u32 value;
938         struct {
939 #ifdef _BIT_FIELDS_HTOL
940                 u32 unused2:9;          /* bits 23-31 */
941                 u32 min_pkt_size:7;     /* bits 16-22 */
942                 u32 unused1:12;         /* bits 4-15 */
943                 u32 filter_frag_en:1;   /* bit 3 */
944                 u32 filter_uni_en:1;    /* bit 2 */
945                 u32 filter_multi_en:1;  /* bit 1 */
946                 u32 filter_broad_en:1;  /* bit 0 */
947 #else
948                 u32 filter_broad_en:1;  /* bit 0 */
949                 u32 filter_multi_en:1;  /* bit 1 */
950                 u32 filter_uni_en:1;    /* bit 2 */
951                 u32 filter_frag_en:1;   /* bit 3 */
952                 u32 unused1:12;         /* bits 4-15 */
953                 u32 min_pkt_size:7;     /* bits 16-22 */
954                 u32 unused2:9;          /* bits 23-31 */
955 #endif
956         } bits;
957 } RXMAC_PF_CTRL_t, *PRXMAC_PF_CTRL_t;
958
959 /*
960  * structure for Memory Controller Interface Control Max Segment reg in rxmac
961  * address map.  Located at address 0x4088
962  */
963 typedef union _RXMAC_MCIF_CTRL_MAX_SEG_t {
964         u32 value;
965         struct {
966 #ifdef _BIT_FIELDS_HTOL
967                 u32 reserved:22;        /* bits 10-31 */
968                 u32 max_size:8; /* bits 2-9 */
969                 u32 fc_en:1;    /* bit 1 */
970                 u32 seg_en:1;   /* bit 0 */
971 #else
972                 u32 seg_en:1;   /* bit 0 */
973                 u32 fc_en:1;    /* bit 1 */
974                 u32 max_size:8; /* bits 2-9 */
975                 u32 reserved:22;        /* bits 10-31 */
976 #endif
977         } bits;
978 } RXMAC_MCIF_CTRL_MAX_SEG_t, *PRXMAC_MCIF_CTRL_MAX_SEG_t;
979
980 /*
981  * structure for Memory Controller Interface Water Mark reg in rxmac address
982  * map.  Located at address 0x408C
983  */
984 typedef union _RXMAC_MCIF_WATER_MARK_t {
985         u32 value;
986         struct {
987 #ifdef _BIT_FIELDS_HTOL
988                 u32 reserved2:6;        /* bits 26-31 */
989                 u32 mark_hi:10; /* bits 16-25 */
990                 u32 reserved1:6;        /* bits 10-15 */
991                 u32 mark_lo:10; /* bits 0-9 */
992 #else
993                 u32 mark_lo:10; /* bits 0-9 */
994                 u32 reserved1:6;        /* bits 10-15 */
995                 u32 mark_hi:10; /* bits 16-25 */
996                 u32 reserved2:6;        /* bits 26-31 */
997 #endif
998         } bits;
999 } RXMAC_MCIF_WATER_MARK_t, *PRXMAC_MCIF_WATER_MARK_t;
1000
1001 /*
1002  * structure for Rx Queue Dialog reg in rxmac address map.
1003  * located at address 0x4090
1004  */
1005 typedef union _RXMAC_RXQ_DIAG_t {
1006         u32 value;
1007         struct {
1008 #ifdef _BIT_FIELDS_HTOL
1009                 u32 reserved2:6;        /* bits 26-31 */
1010                 u32 rd_ptr:10;  /* bits 16-25 */
1011                 u32 reserved1:6;        /* bits 10-15 */
1012                 u32 wr_ptr:10;  /* bits 0-9 */
1013 #else
1014                 u32 wr_ptr:10;  /* bits 0-9 */
1015                 u32 reserved1:6;        /* bits 10-15 */
1016                 u32 rd_ptr:10;  /* bits 16-25 */
1017                 u32 reserved2:6;        /* bits 26-31 */
1018 #endif
1019         } bits;
1020 } RXMAC_RXQ_DIAG_t, *PRXMAC_RXQ_DIAG_t;
1021
1022 /*
1023  * structure for space availiable reg in rxmac address map.
1024  * located at address 0x4094
1025  */
1026 typedef union _RXMAC_SPACE_AVAIL_t {
1027         u32 value;
1028         struct {
1029 #ifdef _BIT_FIELDS_HTOL
1030                 u32 reserved2:15;               /* bits 17-31 */
1031                 u32 space_avail_en:1;   /* bit 16 */
1032                 u32 reserved1:6;                /* bits 10-15 */
1033                 u32 space_avail:10;     /* bits 0-9 */
1034 #else
1035                 u32 space_avail:10;     /* bits 0-9 */
1036                 u32 reserved1:6;                /* bits 10-15 */
1037                 u32 space_avail_en:1;   /* bit 16 */
1038                 u32 reserved2:15;               /* bits 17-31 */
1039 #endif
1040         } bits;
1041 } RXMAC_SPACE_AVAIL_t, *PRXMAC_SPACE_AVAIL_t;
1042
1043 /*
1044  * structure for management interface reg in rxmac address map.
1045  * located at address 0x4098
1046  */
1047 typedef union _RXMAC_MIF_CTL_t {
1048         u32 value;
1049         struct {
1050 #ifdef _BIT_FIELDS_HTOL
1051                 u32 reserve:14;         /* bits 18-31 */
1052                 u32 drop_pkt_en:1;              /* bit 17 */
1053                 u32 drop_pkt_mask:17;   /* bits 0-16 */
1054 #else
1055                 u32 drop_pkt_mask:17;   /* bits 0-16 */
1056                 u32 drop_pkt_en:1;              /* bit 17 */
1057                 u32 reserve:14;         /* bits 18-31 */
1058 #endif
1059         } bits;
1060 } RXMAC_MIF_CTL_t, *PRXMAC_MIF_CTL_t;
1061
1062 /*
1063  * structure for Error reg in rxmac address map.
1064  * located at address 0x409C
1065  */
1066 typedef union _RXMAC_ERROR_REG_t {
1067         u32 value;
1068         struct {
1069 #ifdef _BIT_FIELDS_HTOL
1070                 u32 reserve:28; /* bits 4-31 */
1071                 u32 mif:1;              /* bit 3 */
1072                 u32 async:1;    /* bit 2 */
1073                 u32 pkt_filter:1;       /* bit 1 */
1074                 u32 mcif:1;     /* bit 0 */
1075 #else
1076                 u32 mcif:1;     /* bit 0 */
1077                 u32 pkt_filter:1;       /* bit 1 */
1078                 u32 async:1;    /* bit 2 */
1079                 u32 mif:1;              /* bit 3 */
1080                 u32 reserve:28; /* bits 4-31 */
1081 #endif
1082         } bits;
1083 } RXMAC_ERROR_REG_t, *PRXMAC_ERROR_REG_t;
1084
1085 /*
1086  * Rx MAC Module of JAGCore Address Mapping
1087  */
1088 typedef struct _RXMAC_t {                               /* Location: */
1089         RXMAC_CTRL_t ctrl;                              /*  0x4000 */
1090         RXMAC_WOL_CTL_CRC0_t crc0;                      /*  0x4004 */
1091         RXMAC_WOL_CRC12_t crc12;                        /*  0x4008 */
1092         RXMAC_WOL_CRC34_t crc34;                        /*  0x400C */
1093         RXMAC_WOL_SA_LO_t sa_lo;                        /*  0x4010 */
1094         RXMAC_WOL_SA_HI_t sa_hi;                        /*  0x4014 */
1095         u32 mask0_word0;                                /*  0x4018 */
1096         u32 mask0_word1;                                /*  0x401C */
1097         u32 mask0_word2;                                /*  0x4020 */
1098         u32 mask0_word3;                                /*  0x4024 */
1099         u32 mask1_word0;                                /*  0x4028 */
1100         u32 mask1_word1;                                /*  0x402C */
1101         u32 mask1_word2;                                /*  0x4030 */
1102         u32 mask1_word3;                                /*  0x4034 */
1103         u32 mask2_word0;                                /*  0x4038 */
1104         u32 mask2_word1;                                /*  0x403C */
1105         u32 mask2_word2;                                /*  0x4040 */
1106         u32 mask2_word3;                                /*  0x4044 */
1107         u32 mask3_word0;                                /*  0x4048 */
1108         u32 mask3_word1;                                /*  0x404C */
1109         u32 mask3_word2;                                /*  0x4050 */
1110         u32 mask3_word3;                                /*  0x4054 */
1111         u32 mask4_word0;                                /*  0x4058 */
1112         u32 mask4_word1;                                /*  0x405C */
1113         u32 mask4_word2;                                /*  0x4060 */
1114         u32 mask4_word3;                                /*  0x4064 */
1115         RXMAC_UNI_PF_ADDR1_t uni_pf_addr1;              /*  0x4068 */
1116         RXMAC_UNI_PF_ADDR2_t uni_pf_addr2;              /*  0x406C */
1117         RXMAC_UNI_PF_ADDR3_t uni_pf_addr3;              /*  0x4070 */
1118         u32 multi_hash1;                                /*  0x4074 */
1119         u32 multi_hash2;                                /*  0x4078 */
1120         u32 multi_hash3;                                /*  0x407C */
1121         u32 multi_hash4;                                /*  0x4080 */
1122         RXMAC_PF_CTRL_t pf_ctrl;                        /*  0x4084 */
1123         RXMAC_MCIF_CTRL_MAX_SEG_t mcif_ctrl_max_seg;    /*  0x4088 */
1124         RXMAC_MCIF_WATER_MARK_t mcif_water_mark;        /*  0x408C */
1125         RXMAC_RXQ_DIAG_t rxq_diag;                      /*  0x4090 */
1126         RXMAC_SPACE_AVAIL_t space_avail;                /*  0x4094 */
1127
1128         RXMAC_MIF_CTL_t mif_ctrl;                       /*  0x4098 */
1129         RXMAC_ERROR_REG_t err_reg;                      /*  0x409C */
1130 } RXMAC_t, *PRXMAC_t;
1131
1132 /* END OF TXMAC REGISTER ADDRESS MAP */
1133
1134
1135 /* START OF MAC REGISTER ADDRESS MAP */
1136
1137 /*
1138  * structure for configuration #1 reg in mac address map.
1139  * located at address 0x5000
1140  *
1141  * 31: soft reset
1142  * 30: sim reset
1143  * 29-20: reserved
1144  * 19: reset rx mc
1145  * 18: reset tx mc
1146  * 17: reset rx func
1147  * 16: reset tx fnc
1148  * 15-9: reserved
1149  * 8: loopback
1150  * 7-6: reserved
1151  * 5: rx flow
1152  * 4: tx flow
1153  * 3: syncd rx en
1154  * 2: rx enable
1155  * 1: syncd tx en
1156  * 0: tx enable
1157  */
1158
1159 #define CFG1_LOOPBACK   0x00000100
1160 #define CFG1_RX_FLOW    0x00000020
1161 #define CFG1_TX_FLOW    0x00000010
1162 #define CFG1_RX_ENABLE  0x00000004
1163 #define CFG1_TX_ENABLE  0x00000001
1164 #define CFG1_WAIT       0x0000000A      /* RX & TX syncd */
1165
1166 /*
1167  * structure for configuration #2 reg in mac address map.
1168  * located at address 0x5004
1169  * 31-16: reserved
1170  * 15-12: preamble
1171  * 11-10: reserved
1172  * 9-8: if mode
1173  * 7-6: reserved
1174  * 5: huge frame
1175  * 4: length check
1176  * 3: undefined
1177  * 2: pad crc
1178  * 1: crc enable
1179  * 0: full duplex
1180  */
1181
1182
1183 /*
1184  * structure for Interpacket gap reg in mac address map.
1185  * located at address 0x5008
1186  *
1187  * 31: reserved
1188  * 30-24: non B2B ipg 1
1189  * 23: undefined
1190  * 22-16: non B2B ipg 2
1191  * 15-8: Min ifg enforce
1192  * 7-0: B2B ipg
1193  *
1194  * structure for half duplex reg in mac address map.
1195  * located at address 0x500C
1196  * 31-24: reserved
1197  * 23-20: Alt BEB trunc
1198  * 19: Alt BEB enable
1199  * 18: BP no backoff
1200  * 17: no backoff
1201  * 16: excess defer
1202  * 15-12: re-xmit max
1203  * 11-10: reserved
1204  * 9-0: collision window
1205  */
1206
1207 /*
1208  * structure for Maximum Frame Length reg in mac address map.
1209  * located at address 0x5010: bits 0-15 hold the length.
1210  */
1211
1212 /*
1213  * structure for Reserve 1 reg in mac address map.
1214  * located at address 0x5014 - 0x5018
1215  * Defined earlier (u32)
1216  */
1217
1218 /*
1219  * structure for Test reg in mac address map.
1220  * located at address 0x501C
1221  * test: bits 0-2, rest unused
1222  */
1223
1224 /*
1225  * structure for MII Management Configuration reg in mac address map.
1226  * located at address 0x5020
1227  *
1228  * 31: reset MII mgmt
1229  * 30-6: unused
1230  * 5: scan auto increment
1231  * 4: preamble supress
1232  * 3: undefined
1233  * 2-0: mgmt clock reset
1234  */
1235
1236 /*
1237  * structure for MII Management Command reg in mac address map.
1238  * located at address 0x5024
1239  * bit 1: scan cycle
1240  * bit 0: read cycle
1241  */
1242
1243 /*
1244  * structure for MII Management Address reg in mac address map.
1245  * located at address 0x5028
1246  * 31-13: reserved
1247  * 12-8: phy addr
1248  * 7-5: reserved
1249  * 4-0: register
1250  */
1251
1252 #define MII_ADDR(phy,reg)       ((phy) << 8 | (reg))
1253
1254 /*
1255  * structure for MII Management Control reg in mac address map.
1256  * located at address 0x502C
1257  * 31-16: reserved
1258  * 15-0: phy control
1259  */
1260
1261 /*
1262  * structure for MII Management Status reg in mac address map.
1263  * located at address 0x5030
1264  * 31-16: reserved
1265  * 15-0: phy control
1266  */
1267
1268 /*
1269  * structure for MII Management Indicators reg in mac address map.
1270  * located at address 0x5034
1271  * 31-3: reserved
1272  * 2: not valid
1273  * 1: scanning
1274  * 0: busy
1275  */
1276
1277 #define MGMT_BUSY       0x00000001      /* busy */
1278 #define MGMT_WAIT       0x00000005      /* busy | not valid */
1279
1280 /*
1281  * structure for Interface Control reg in mac address map.
1282  * located at address 0x5038
1283  *
1284  * 31: reset if module
1285  * 30-28: reserved
1286  * 27: tbi mode
1287  * 26: ghd mode
1288  * 25: lhd mode
1289  * 24: phy mode
1290  * 23: reset per mii
1291  * 22-17: reserved
1292  * 16: speed
1293  * 15: reset pe100x
1294  * 14-11: reserved
1295  * 10: force quiet
1296  * 9: no cipher
1297  * 8: disable link fail
1298  * 7: reset gpsi
1299  * 6-1: reserved
1300  * 0: enable jabber protection
1301  */
1302
1303 /*
1304  * structure for Interface Status reg in mac address map.
1305  * located at address 0x503C
1306  */
1307 typedef union _MAC_IF_STAT_t {
1308         u32 value;
1309         struct {
1310 #ifdef _BIT_FIELDS_HTOL
1311                 u32 reserved:22;                /* bits 10-31 */
1312                 u32 excess_defer:1;     /* bit 9 */
1313                 u32 clash:1;            /* bit 8 */
1314                 u32 phy_jabber:1;               /* bit 7 */
1315                 u32 phy_link_ok:1;              /* bit 6 */
1316                 u32 phy_full_duplex:1;  /* bit 5 */
1317                 u32 phy_speed:1;                /* bit 4 */
1318                 u32 pe100x_link_fail:1; /* bit 3 */
1319                 u32 pe10t_loss_carrie:1;        /* bit 2 */
1320                 u32 pe10t_sqe_error:1;  /* bit 1 */
1321                 u32 pe10t_jabber:1;     /* bit 0 */
1322 #else
1323                 u32 pe10t_jabber:1;     /* bit 0 */
1324                 u32 pe10t_sqe_error:1;  /* bit 1 */
1325                 u32 pe10t_loss_carrie:1;        /* bit 2 */
1326                 u32 pe100x_link_fail:1; /* bit 3 */
1327                 u32 phy_speed:1;                /* bit 4 */
1328                 u32 phy_full_duplex:1;  /* bit 5 */
1329                 u32 phy_link_ok:1;              /* bit 6 */
1330                 u32 phy_jabber:1;               /* bit 7 */
1331                 u32 clash:1;            /* bit 8 */
1332                 u32 excess_defer:1;     /* bit 9 */
1333                 u32 reserved:22;                /* bits 10-31 */
1334 #endif
1335         } bits;
1336 } MAC_IF_STAT_t, *PMAC_IF_STAT_t;
1337
1338 /*
1339  * structure for Mac Station Address, Part 1 reg in mac address map.
1340  * located at address 0x5040
1341  */
1342 typedef union _MAC_STATION_ADDR1_t {
1343         u32 value;
1344         struct {
1345 #ifdef _BIT_FIELDS_HTOL
1346                 u32 Octet6:8;   /* bits 24-31 */
1347                 u32 Octet5:8;   /* bits 16-23 */
1348                 u32 Octet4:8;   /* bits 8-15 */
1349                 u32 Octet3:8;   /* bits 0-7 */
1350 #else
1351                 u32 Octet3:8;   /* bits 0-7 */
1352                 u32 Octet4:8;   /* bits 8-15 */
1353                 u32 Octet5:8;   /* bits 16-23 */
1354                 u32 Octet6:8;   /* bits 24-31 */
1355 #endif
1356         } bits;
1357 } MAC_STATION_ADDR1_t, *PMAC_STATION_ADDR1_t;
1358
1359 /*
1360  * structure for Mac Station Address, Part 2 reg in mac address map.
1361  * located at address 0x5044
1362  */
1363 typedef union _MAC_STATION_ADDR2_t {
1364         u32 value;
1365         struct {
1366 #ifdef _BIT_FIELDS_HTOL
1367                 u32 Octet2:8;   /* bits 24-31 */
1368                 u32 Octet1:8;   /* bits 16-23 */
1369                 u32 reserved:16;        /* bits 0-15 */
1370 #else
1371                 u32 reserved:16;        /* bit 0-15 */
1372                 u32 Octet1:8;   /* bits 16-23 */
1373                 u32 Octet2:8;   /* bits 24-31 */
1374 #endif
1375         } bits;
1376 } MAC_STATION_ADDR2_t, *PMAC_STATION_ADDR2_t;
1377
1378 /*
1379  * MAC Module of JAGCore Address Mapping
1380  */
1381 typedef struct _MAC_t {                                 /* Location: */
1382         u32 cfg1;                                       /*  0x5000 */
1383         u32 cfg2;                                       /*  0x5004 */
1384         u32 ipg;                                        /*  0x5008 */
1385         u32 hfdp;                                       /*  0x500C */
1386         u32 max_fm_len;                                 /*  0x5010 */
1387         u32 rsv1;                                       /*  0x5014 */
1388         u32 rsv2;                                       /*  0x5018 */
1389         u32 mac_test;                                   /*  0x501C */
1390         u32 mii_mgmt_cfg;                               /*  0x5020 */
1391         u32 mii_mgmt_cmd;                               /*  0x5024 */
1392         u32 mii_mgmt_addr;                              /*  0x5028 */
1393         u32 mii_mgmt_ctrl;                              /*  0x502C */
1394         u32 mii_mgmt_stat;                              /*  0x5030 */
1395         u32 mii_mgmt_indicator;                         /*  0x5034 */
1396         u32 if_ctrl;                                    /*  0x5038 */
1397         MAC_IF_STAT_t if_stat;                          /*  0x503C */
1398         MAC_STATION_ADDR1_t station_addr_1;             /*  0x5040 */
1399         MAC_STATION_ADDR2_t station_addr_2;             /*  0x5044 */
1400 } MAC_t, *PMAC_t;
1401
1402 /* END OF MAC REGISTER ADDRESS MAP */
1403
1404 /* START OF MAC STAT REGISTER ADDRESS MAP */
1405
1406 /*
1407  * structure for Carry Register One and it's Mask Register reg located in mac
1408  * stat address map address 0x6130 and 0x6138.
1409  *
1410  * 31: tr64
1411  * 30: tr127
1412  * 29: tr255
1413  * 28: tr511
1414  * 27: tr1k
1415  * 26: trmax
1416  * 25: trmgv
1417  * 24-17: unused
1418  * 16: rbyt
1419  * 15: rpkt
1420  * 14: rfcs
1421  * 13: rmca
1422  * 12: rbca
1423  * 11: rxcf
1424  * 10: rxpf
1425  * 9: rxuo
1426  * 8: raln
1427  * 7: rflr
1428  * 6: rcde
1429  * 5: rcse
1430  * 4: rund
1431  * 3: rovr
1432  * 2: rfrg
1433  * 1: rjbr
1434  * 0: rdrp
1435  */
1436
1437 /*
1438  * structure for Carry Register Two Mask Register reg in mac stat address map.
1439  * located at address 0x613C
1440  *
1441  * 31-20: unused
1442  * 19: tjbr
1443  * 18: tfcs
1444  * 17: txcf
1445  * 16: tovr
1446  * 15: tund
1447  * 14: trfg
1448  * 13: tbyt
1449  * 12: tpkt
1450  * 11: tmca
1451  * 10: tbca
1452  * 9: txpf
1453  * 8: tdfr
1454  * 7: tedf
1455  * 6: tscl
1456  * 5: tmcl
1457  * 4: tlcl
1458  * 3: txcl
1459  * 2: tncl
1460  * 1: tpfh
1461  * 0: tdrp
1462  */
1463
1464 /*
1465  * MAC STATS Module of JAGCore Address Mapping
1466  */
1467 typedef struct _MAC_STAT_t {            /* Location: */
1468         u32 pad[32];            /*  0x6000 - 607C */
1469
1470         /* Tx/Rx 0-64 Byte Frame Counter */
1471         u32 TR64;                       /*  0x6080 */
1472
1473         /* Tx/Rx 65-127 Byte Frame Counter */
1474         u32 TR127;                      /*  0x6084 */
1475
1476         /* Tx/Rx 128-255 Byte Frame Counter */
1477         u32 TR255;                      /*  0x6088 */
1478
1479         /* Tx/Rx 256-511 Byte Frame Counter */
1480         u32 TR511;                      /*  0x608C */
1481
1482         /* Tx/Rx 512-1023 Byte Frame Counter */
1483         u32 TR1K;                       /*  0x6090 */
1484
1485         /* Tx/Rx 1024-1518 Byte Frame Counter */
1486         u32 TRMax;                      /*  0x6094 */
1487
1488         /* Tx/Rx 1519-1522 Byte Good VLAN Frame Count */
1489         u32 TRMgv;                      /*  0x6098 */
1490
1491         /* Rx Byte Counter */
1492         u32 RByt;                       /*  0x609C */
1493
1494         /* Rx Packet Counter */
1495         u32 RPkt;                       /*  0x60A0 */
1496
1497         /* Rx FCS Error Counter */
1498         u32 RFcs;                       /*  0x60A4 */
1499
1500         /* Rx Multicast Packet Counter */
1501         u32 RMca;                       /*  0x60A8 */
1502
1503         /* Rx Broadcast Packet Counter */
1504         u32 RBca;                       /*  0x60AC */
1505
1506         /* Rx Control Frame Packet Counter */
1507         u32 RxCf;                       /*  0x60B0 */
1508
1509         /* Rx Pause Frame Packet Counter */
1510         u32 RxPf;                       /*  0x60B4 */
1511
1512         /* Rx Unknown OP Code Counter */
1513         u32 RxUo;                       /*  0x60B8 */
1514
1515         /* Rx Alignment Error Counter */
1516         u32 RAln;                       /*  0x60BC */
1517
1518         /* Rx Frame Length Error Counter */
1519         u32 RFlr;                       /*  0x60C0 */
1520
1521         /* Rx Code Error Counter */
1522         u32 RCde;                       /*  0x60C4 */
1523
1524         /* Rx Carrier Sense Error Counter */
1525         u32 RCse;                       /*  0x60C8 */
1526
1527         /* Rx Undersize Packet Counter */
1528         u32 RUnd;                       /*  0x60CC */
1529
1530         /* Rx Oversize Packet Counter */
1531         u32 ROvr;                       /*  0x60D0 */
1532
1533         /* Rx Fragment Counter */
1534         u32 RFrg;                       /*  0x60D4 */
1535
1536         /* Rx Jabber Counter */
1537         u32 RJbr;                       /*  0x60D8 */
1538
1539         /* Rx Drop */
1540         u32 RDrp;                       /*  0x60DC */
1541
1542         /* Tx Byte Counter */
1543         u32 TByt;                       /*  0x60E0 */
1544
1545         /* Tx Packet Counter */
1546         u32 TPkt;                       /*  0x60E4 */
1547
1548         /* Tx Multicast Packet Counter */
1549         u32 TMca;                       /*  0x60E8 */
1550
1551         /* Tx Broadcast Packet Counter */
1552         u32 TBca;                       /*  0x60EC */
1553
1554         /* Tx Pause Control Frame Counter */
1555         u32 TxPf;                       /*  0x60F0 */
1556
1557         /* Tx Deferral Packet Counter */
1558         u32 TDfr;                       /*  0x60F4 */
1559
1560         /* Tx Excessive Deferral Packet Counter */
1561         u32 TEdf;                       /*  0x60F8 */
1562
1563         /* Tx Single Collision Packet Counter */
1564         u32 TScl;                       /*  0x60FC */
1565
1566         /* Tx Multiple Collision Packet Counter */
1567         u32 TMcl;                       /*  0x6100 */
1568
1569         /* Tx Late Collision Packet Counter */
1570         u32 TLcl;                       /*  0x6104 */
1571
1572         /* Tx Excessive Collision Packet Counter */
1573         u32 TXcl;                       /*  0x6108 */
1574
1575         /* Tx Total Collision Packet Counter */
1576         u32 TNcl;                       /*  0x610C */
1577
1578         /* Tx Pause Frame Honored Counter */
1579         u32 TPfh;                       /*  0x6110 */
1580
1581         /* Tx Drop Frame Counter */
1582         u32 TDrp;                       /*  0x6114 */
1583
1584         /* Tx Jabber Frame Counter */
1585         u32 TJbr;                       /*  0x6118 */
1586
1587         /* Tx FCS Error Counter */
1588         u32 TFcs;                       /*  0x611C */
1589
1590         /* Tx Control Frame Counter */
1591         u32 TxCf;                       /*  0x6120 */
1592
1593         /* Tx Oversize Frame Counter */
1594         u32 TOvr;                       /*  0x6124 */
1595
1596         /* Tx Undersize Frame Counter */
1597         u32 TUnd;                       /*  0x6128 */
1598
1599         /* Tx Fragments Frame Counter */
1600         u32 TFrg;                       /*  0x612C */
1601
1602         /* Carry Register One Register */
1603         u32 Carry1;                     /*  0x6130 */
1604
1605         /* Carry Register Two Register */
1606         u32 Carry2;                     /*  0x6134 */
1607
1608         /* Carry Register One Mask Register */
1609         u32 Carry1M;                    /*  0x6138 */
1610
1611         /* Carry Register Two Mask Register */
1612         u32 Carry2M;                    /*  0x613C */
1613 } MAC_STAT_t, *PMAC_STAT_t;
1614
1615 /* END OF MAC STAT REGISTER ADDRESS MAP */
1616
1617
1618 /* START OF MMC REGISTER ADDRESS MAP */
1619
1620 /*
1621  * Main Memory Controller Control reg in mmc address map.
1622  * located at address 0x7000
1623  */
1624
1625 #define ET_MMC_ENABLE           1
1626 #define ET_MMC_ARB_DISABLE      2
1627 #define ET_MMC_RXMAC_DISABLE    4
1628 #define ET_MMC_TXMAC_DISABLE    8
1629 #define ET_MMC_TXDMA_DISABLE    16
1630 #define ET_MMC_RXDMA_DISABLE    32
1631 #define ET_MMC_FORCE_CE         64
1632
1633 /*
1634  * Main Memory Controller Host Memory Access Address reg in mmc
1635  * address map.  Located at address 0x7004. Top 16 bits hold the address bits
1636  */
1637
1638 #define ET_SRAM_REQ_ACCESS      1
1639 #define ET_SRAM_WR_ACCESS       2
1640 #define ET_SRAM_IS_CTRL         4
1641
1642 /*
1643  * structure for Main Memory Controller Host Memory Access Data reg in mmc
1644  * address map.  Located at address 0x7008 - 0x7014
1645  * Defined earlier (u32)
1646  */
1647
1648 /*
1649  * Memory Control Module of JAGCore Address Mapping
1650  */
1651 typedef struct _MMC_t {                 /* Location: */
1652         u32 mmc_ctrl;           /*  0x7000 */
1653         u32 sram_access;        /*  0x7004 */
1654         u32 sram_word1;         /*  0x7008 */
1655         u32 sram_word2;         /*  0x700C */
1656         u32 sram_word3;         /*  0x7010 */
1657         u32 sram_word4;         /*  0x7014 */
1658 } MMC_t, *PMMC_t;
1659
1660 /* END OF MMC REGISTER ADDRESS MAP */
1661
1662
1663 /*
1664  * JAGCore Address Mapping
1665  */
1666 typedef struct _ADDRESS_MAP_t {
1667         struct global_regs global;
1668         /* unused section of global address map */
1669         u8 unused_global[4096 - sizeof(struct global_regs)];
1670         TXDMA_t txdma;
1671         /* unused section of txdma address map */
1672         u8 unused_txdma[4096 - sizeof(TXDMA_t)];
1673         struct rxdma_regs rxdma;
1674         /* unused section of rxdma address map */
1675         u8 unused_rxdma[4096 - sizeof(struct rxdma_regs)];
1676         TXMAC_t txmac;
1677         /* unused section of txmac address map */
1678         u8 unused_txmac[4096 - sizeof(TXMAC_t)];
1679         RXMAC_t rxmac;
1680         /* unused section of rxmac address map */
1681         u8 unused_rxmac[4096 - sizeof(RXMAC_t)];
1682         MAC_t mac;
1683         /* unused section of mac address map */
1684         u8 unused_mac[4096 - sizeof(MAC_t)];
1685         MAC_STAT_t macStat;
1686         /* unused section of mac stat address map */
1687         u8 unused_mac_stat[4096 - sizeof(MAC_STAT_t)];
1688         MMC_t mmc;
1689         /* unused section of mmc address map */
1690         u8 unused_mmc[4096 - sizeof(MMC_t)];
1691         /* unused section of address map */
1692         u8 unused_[1015808];
1693
1694         u8 unused_exp_rom[4096];        /* MGS-size TBD */
1695         u8 unused__[524288];    /* unused section of address map */
1696 } ADDRESS_MAP_t, *PADDRESS_MAP_t;
1697
1698 #endif /* _ET1310_ADDRESS_MAP_H_ */