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