1a2c73acdec6ee5231f650c2c98f81133c52f27f
[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  * structure for Loopback reg in global address map
143  * located at address 0x0034
144  */
145 typedef union _LOOPBACK_t {
146         u32 value;
147         struct {
148 #ifdef _BIT_FIELDS_HTOL
149                 u32 unused:30;          /* bits 2-31 */
150                 u32 dma_loopback:1;     /* bit 1 */
151                 u32 mac_loopback:1;     /* bit 0 */
152 #else
153                 u32 mac_loopback:1;     /* bit 0 */
154                 u32 dma_loopback:1;     /* bit 1 */
155                 u32 unused:30;          /* bits 2-31 */
156 #endif
157         } bits;
158 } LOOPBACK_t, *PLOOPBACK_t;
159
160 /*
161  * GLOBAL Module of JAGCore Address Mapping
162  * Located at address 0x0000
163  */
164 typedef struct _GLOBAL_t {                      /* Location: */
165         u32 txq_start_addr;                     /*  0x0000 */
166         u32 txq_end_addr;                       /*  0x0004 */
167         u32 rxq_start_addr;                     /*  0x0008 */
168         u32 rxq_end_addr;                       /*  0x000C */
169         u32 pm_csr;                             /*  0x0010 */
170         u32 unused;                             /*  0x0014 */
171         u32 int_status;                         /*  0x0018 */
172         u32 int_mask;                           /*  0x001C */
173         u32 int_alias_clr_en;                   /*  0x0020 */
174         u32 int_status_alias;                   /*  0x0024 */
175         u32 sw_reset;                           /*  0x0028 */
176         u32 slv_timer;                          /*  0x002C */
177         u32 msi_config;                         /*  0x0030 */
178         LOOPBACK_t loopback;                    /*  0x0034 */
179         u32 watchdog_timer;                     /*  0x0038 */
180 } GLOBAL_t, *PGLOBAL_t;
181
182 /* END OF GLOBAL REGISTER ADDRESS MAP */
183
184
185 /* START OF TXDMA REGISTER ADDRESS MAP */
186
187 /*
188  * structure for txdma control status reg in txdma address map
189  * located at address 0x1000
190  */
191 typedef union _TXDMA_CSR_t {
192         u32 value;
193         struct {
194 #ifdef _BIT_FIELDS_HTOL
195                 u32 unused2:19;         /* bits 13-31 */
196                 u32 traffic_class:4;    /* bits 9-12 */
197                 u32 sngl_epkt_mode:1;   /* bit 8 */
198                 u32 cache_thrshld:4;    /* bits 4-7 */
199                 u32 unused1:2;          /* bits 2-3 */
200                 u32 drop_TLP_disable:1; /* bit 1 */
201                 u32 halt:1;             /* bit 0 */
202 #else
203                 u32 halt:1;             /* bit 0 */
204                 u32 drop_TLP_disable:1; /* bit 1 */
205                 u32 unused1:2;          /* bits 2-3 */
206                 u32 cache_thrshld:4;    /* bits 4-7 */
207                 u32 sngl_epkt_mode:1;   /* bit 8 */
208                 u32 traffic_class:4;    /* bits 9-12 */
209                 u32 unused2:19;         /* bits 13-31 */
210 #endif
211         } bits;
212 } TXDMA_CSR_t, *PTXDMA_CSR_t;
213
214 /*
215  * structure for txdma packet ring base address hi reg in txdma address map
216  * located at address 0x1004
217  * Defined earlier (u32)
218  */
219
220 /*
221  * structure for txdma packet ring base address low reg in txdma address map
222  * located at address 0x1008
223  * Defined earlier (u32)
224  */
225
226 /*
227  * structure for txdma packet ring number of descriptor reg in txdma address
228  * map.  Located at address 0x100C
229  */
230 typedef union _TXDMA_PR_NUM_DES_t {
231         u32 value;
232         struct {
233 #ifdef _BIT_FIELDS_HTOL
234                 u32 unused:22;  /* bits 10-31 */
235                 u32 pr_ndes:10; /* bits 0-9 */
236 #else
237                 u32 pr_ndes:10; /* bits 0-9 */
238                 u32 unused:22;  /* bits 10-31 */
239 #endif
240         } bits;
241 } TXDMA_PR_NUM_DES_t, *PTXDMA_PR_NUM_DES_t;
242
243
244 #define ET_DMA10_MASK           0x3FF   /* 10 bit mask for DMA10W types */
245 #define ET_DMA10_WRAP           0x400
246 #define ET_DMA4_MASK            0x00F   /* 4 bit mask for DMA4W types */
247 #define ET_DMA4_WRAP            0x010
248
249 #define INDEX10(x)      ((x) & ET_DMA10_MASK)
250 #define INDEX4(x)       ((x) & ET_DMA4_MASK)
251
252 extern inline void add_10bit(u32 *v, int n)
253 {
254         *v = INDEX10(*v + n);
255 }
256
257 /*
258  * 10bit DMA with wrap
259  * txdma tx queue write address reg in txdma address map at 0x1010
260  * txdma tx queue write address external reg in txdma address map at 0x1014
261  * txdma tx queue read address reg in txdma address map at 0x1018
262  *
263  * u32
264  * txdma status writeback address hi reg in txdma address map at0x101C
265  * txdma status writeback address lo reg in txdma address map at 0x1020
266  *
267  * 10bit DMA with wrap
268  * txdma service request reg in txdma address map at 0x1024
269  * structure for txdma service complete reg in txdma address map at 0x1028
270  *
271  * 4bit DMA with wrap
272  * txdma tx descriptor cache read index reg in txdma address map at 0x102C
273  * txdma tx descriptor cache write index reg in txdma address map at 0x1030
274  *
275  * txdma error reg in txdma address map at address 0x1034
276  */
277
278 typedef union _TXDMA_ERROR_t {
279         u32 value;
280         struct {
281 #ifdef _BIT_FIELDS_HTOL
282                 u32 unused3:22;         /* bits 10-31 */
283                 u32 WrbkRewind:1;       /* bit 9 */
284                 u32 WrbkResend:1;       /* bit 8 */
285                 u32 unused2:2;          /* bits 6-7 */
286                 u32 DescrRewind:1;      /* bit 5 */
287                 u32 DescrResend:1;      /* bit 4 */
288                 u32 unused1:2;          /* bits 2-3 */
289                 u32 PyldRewind:1;       /* bit 1 */
290                 u32 PyldResend:1;       /* bit 0 */
291 #else
292                 u32 PyldResend:1;       /* bit 0 */
293                 u32 PyldRewind:1;       /* bit 1 */
294                 u32 unused1:2;          /* bits 2-3 */
295                 u32 DescrResend:1;      /* bit 4 */
296                 u32 DescrRewind:1;      /* bit 5 */
297                 u32 unused2:2;          /* bits 6-7 */
298                 u32 WrbkResend:1;       /* bit 8 */
299                 u32 WrbkRewind:1;       /* bit 9 */
300                 u32 unused3:22;         /* bits 10-31 */
301 #endif
302         } bits;
303 } TXDMA_ERROR_t, *PTXDMA_ERROR_t;
304
305 /*
306  * Tx DMA Module of JAGCore Address Mapping
307  * Located at address 0x1000
308  */
309 typedef struct _TXDMA_t {               /* Location: */
310         TXDMA_CSR_t csr;                /*  0x1000 */
311         u32 pr_base_hi;                 /*  0x1004 */
312         u32 pr_base_lo;                 /*  0x1008 */
313         TXDMA_PR_NUM_DES_t pr_num_des;  /*  0x100C */
314         u32 txq_wr_addr;                /*  0x1010 */
315         u32 txq_wr_addr_ext;            /*  0x1014 */
316         u32 txq_rd_addr;                /*  0x1018 */
317         u32 dma_wb_base_hi;             /*  0x101C */
318         u32 dma_wb_base_lo;             /*  0x1020 */
319         u32 service_request;            /*  0x1024 */
320         u32 service_complete;           /*  0x1028 */
321         u32 cache_rd_index;             /*  0x102C */
322         u32 cache_wr_index;             /*  0x1030 */
323         TXDMA_ERROR_t TxDmaError;       /*  0x1034 */
324         u32 DescAbortCount;             /*  0x1038 */
325         u32 PayloadAbortCnt;            /*  0x103c */
326         u32 WriteBackAbortCnt;          /*  0x1040 */
327         u32 DescTimeoutCnt;             /*  0x1044 */
328         u32 PayloadTimeoutCnt;          /*  0x1048 */
329         u32 WriteBackTimeoutCnt;        /*  0x104c */
330         u32 DescErrorCount;             /*  0x1050 */
331         u32 PayloadErrorCnt;            /*  0x1054 */
332         u32 WriteBackErrorCnt;          /*  0x1058 */
333         u32 DroppedTLPCount;            /*  0x105c */
334         u32 NewServiceComplete;         /*  0x1060 */
335         u32 EthernetPacketCount;        /*  0x1064 */
336 } TXDMA_t, *PTXDMA_t;
337
338 /* END OF TXDMA REGISTER ADDRESS MAP */
339
340
341 /* START OF RXDMA REGISTER ADDRESS MAP */
342
343 /*
344  * structure for control status reg in rxdma address map
345  * Located at address 0x2000
346  */
347 typedef union _RXDMA_CSR_t {
348         u32 value;
349         struct {
350 #ifdef _BIT_FIELDS_HTOL
351                 u32 unused2:14;         /* bits 18-31 */
352                 u32 halt_status:1;      /* bit 17 */
353                 u32 pkt_done_flush:1;   /* bit 16 */
354                 u32 pkt_drop_disable:1; /* bit 15 */
355                 u32 unused1:1;          /* bit 14 */
356                 u32 fbr1_enable:1;      /* bit 13 */
357                 u32 fbr1_size:2;        /* bits 11-12 */
358                 u32 fbr0_enable:1;      /* bit 10 */
359                 u32 fbr0_size:2;        /* bits 8-9 */
360                 u32 dma_big_endian:1;   /* bit 7 */
361                 u32 pkt_big_endian:1;   /* bit 6 */
362                 u32 psr_big_endian:1;   /* bit 5 */
363                 u32 fbr_big_endian:1;   /* bit 4 */
364                 u32 tc:3;               /* bits 1-3 */
365                 u32 halt:1;             /* bit 0 */
366 #else
367                 u32 halt:1;             /* bit 0 */
368                 u32 tc:3;               /* bits 1-3 */
369                 u32 fbr_big_endian:1;   /* bit 4 */
370                 u32 psr_big_endian:1;   /* bit 5 */
371                 u32 pkt_big_endian:1;   /* bit 6 */
372                 u32 dma_big_endian:1;   /* bit 7 */
373                 u32 fbr0_size:2;        /* bits 8-9 */
374                 u32 fbr0_enable:1;      /* bit 10 */
375                 u32 fbr1_size:2;        /* bits 11-12 */
376                 u32 fbr1_enable:1;      /* bit 13 */
377                 u32 unused1:1;          /* bit 14 */
378                 u32 pkt_drop_disable:1; /* bit 15 */
379                 u32 pkt_done_flush:1;   /* bit 16 */
380                 u32 halt_status:1;      /* bit 17 */
381                 u32 unused2:14;         /* bits 18-31 */
382 #endif
383         } bits;
384 } RXDMA_CSR_t, *PRXDMA_CSR_t;
385
386 /*
387  * structure for dma writeback lo reg in rxdma address map
388  * located at address 0x2004
389  * Defined earlier (u32)
390  */
391
392 /*
393  * structure for dma writeback hi reg in rxdma address map
394  * located at address 0x2008
395  * Defined earlier (u32)
396  */
397
398 /*
399  * structure for number of packets done reg in rxdma address map
400  * located at address 0x200C
401  */
402 typedef union _RXDMA_NUM_PKT_DONE_t {
403         u32 value;
404         struct {
405 #ifdef _BIT_FIELDS_HTOL
406                 u32 unused:24;  /* bits 8-31 */
407                 u32 num_done:8; /* bits 0-7 */
408 #else
409                 u32 num_done:8; /* bits 0-7 */
410                 u32 unused:24;  /* bits 8-31 */
411 #endif
412         } bits;
413 } RXDMA_NUM_PKT_DONE_t, *PRXDMA_NUM_PKT_DONE_t;
414
415 /*
416  * structure for max packet time reg in rxdma address map
417  * located at address 0x2010
418  */
419 typedef union _RXDMA_MAX_PKT_TIME_t {
420         u32 value;
421         struct {
422 #ifdef _BIT_FIELDS_HTOL
423                 u32 unused:14;          /* bits 18-31 */
424                 u32 time_done:18;       /* bits 0-17 */
425 #else
426                 u32 time_done:18;       /* bits 0-17 */
427                 u32 unused:14;          /* bits 18-31 */
428 #endif
429         } bits;
430 } RXDMA_MAX_PKT_TIME_t, *PRXDMA_MAX_PKT_TIME_t;
431
432 /*
433  * structure for rx queue read address reg in rxdma address map
434  * located at address 0x2014
435  * Defined earlier (u32)
436  */
437
438 /*
439  * structure for rx queue read address external reg in rxdma address map
440  * located at address 0x2018
441  * Defined earlier (u32)
442  */
443
444 /*
445  * structure for rx queue write address reg in rxdma address map
446  * located at address 0x201C
447  * Defined earlier (u32)
448  */
449
450 /*
451  * structure for packet status ring base address lo reg in rxdma address map
452  * located at address 0x2020
453  * Defined earlier (u32)
454  */
455
456 /*
457  * structure for packet status ring base address hi reg in rxdma address map
458  * located at address 0x2024
459  * Defined earlier (u32)
460  */
461
462 /*
463  * structure for packet status ring number of descriptors reg in rxdma address
464  * map.  Located at address 0x2028
465  */
466 typedef union _RXDMA_PSR_NUM_DES_t {
467         u32 value;
468         struct {
469 #ifdef _BIT_FIELDS_HTOL
470                 u32 unused:20;          /* bits 12-31 */
471                 u32 psr_ndes:12;        /* bit 0-11 */
472 #else
473                 u32 psr_ndes:12;        /* bit 0-11 */
474                 u32 unused:20;          /* bits 12-31 */
475 #endif
476         } bits;
477 } RXDMA_PSR_NUM_DES_t, *PRXDMA_PSR_NUM_DES_t;
478
479 /*
480  * structure for packet status ring available offset reg in rxdma address map
481  * located at address 0x202C
482  */
483 typedef union _RXDMA_PSR_AVAIL_OFFSET_t {
484         u32 value;
485         struct {
486 #ifdef _BIT_FIELDS_HTOL
487                 u32 unused:19;          /* bits 13-31 */
488                 u32 psr_avail_wrap:1;   /* bit 12 */
489                 u32 psr_avail:12;       /* bit 0-11 */
490 #else
491                 u32 psr_avail:12;       /* bit 0-11 */
492                 u32 psr_avail_wrap:1;   /* bit 12 */
493                 u32 unused:19;          /* bits 13-31 */
494 #endif
495         } bits;
496 } RXDMA_PSR_AVAIL_OFFSET_t, *PRXDMA_PSR_AVAIL_OFFSET_t;
497
498 /*
499  * structure for packet status ring full offset reg in rxdma address map
500  * located at address 0x2030
501  */
502 typedef union _RXDMA_PSR_FULL_OFFSET_t {
503         u32 value;
504         struct {
505 #ifdef _BIT_FIELDS_HTOL
506                 u32 unused:19;          /* bits 13-31 */
507                 u32 psr_full_wrap:1;    /* bit 12 */
508                 u32 psr_full:12;        /* bit 0-11 */
509 #else
510                 u32 psr_full:12;        /* bit 0-11 */
511                 u32 psr_full_wrap:1;    /* bit 12 */
512                 u32 unused:19;          /* bits 13-31 */
513 #endif
514         } bits;
515 } RXDMA_PSR_FULL_OFFSET_t, *PRXDMA_PSR_FULL_OFFSET_t;
516
517 /*
518  * structure for packet status ring access index reg in rxdma address map
519  * located at address 0x2034
520  */
521 typedef union _RXDMA_PSR_ACCESS_INDEX_t {
522         u32 value;
523         struct {
524 #ifdef _BIT_FIELDS_HTOL
525                 u32 unused:27;  /* bits 5-31 */
526                 u32 psr_ai:5;   /* bits 0-4 */
527 #else
528                 u32 psr_ai:5;   /* bits 0-4 */
529                 u32 unused:27;  /* bits 5-31 */
530 #endif
531         } bits;
532 } RXDMA_PSR_ACCESS_INDEX_t, *PRXDMA_PSR_ACCESS_INDEX_t;
533
534 /*
535  * structure for packet status ring minimum descriptors reg in rxdma address
536  * map.  Located at address 0x2038
537  */
538 typedef union _RXDMA_PSR_MIN_DES_t {
539         u32 value;
540         struct {
541 #ifdef _BIT_FIELDS_HTOL
542                 u32 unused:20;  /* bits 12-31 */
543                 u32 psr_min:12; /* bits 0-11 */
544 #else
545                 u32 psr_min:12; /* bits 0-11 */
546                 u32 unused:20;  /* bits 12-31 */
547 #endif
548         } bits;
549 } RXDMA_PSR_MIN_DES_t, *PRXDMA_PSR_MIN_DES_t;
550
551 /*
552  * structure for free buffer ring base lo address reg in rxdma address map
553  * located at address 0x203C
554  * Defined earlier (u32)
555  */
556
557 /*
558  * structure for free buffer ring base hi address reg in rxdma address map
559  * located at address 0x2040
560  * Defined earlier (u32)
561  */
562
563 /*
564  * structure for free buffer ring number of descriptors reg in rxdma address
565  * map.  Located at address 0x2044
566  */
567 typedef union _RXDMA_FBR_NUM_DES_t {
568         u32 value;
569         struct {
570 #ifdef _BIT_FIELDS_HTOL
571                 u32 unused:22;          /* bits 10-31 */
572                 u32 fbr_ndesc:10;       /* bits 0-9 */
573 #else
574                 u32 fbr_ndesc:10;       /* bits 0-9 */
575                 u32 unused:22;          /* bits 10-31 */
576 #endif
577         } bits;
578 } RXDMA_FBR_NUM_DES_t, *PRXDMA_FBR_NUM_DES_t;
579
580 /*
581  * structure for free buffer ring 0 available offset reg in rxdma address map
582  * located at address 0x2048
583  * Defined earlier (u32)
584  */
585
586 /*
587  * structure for free buffer ring 0 full offset reg in rxdma address map
588  * located at address 0x204C
589  * Defined earlier (u32)
590  */
591
592 /*
593  * structure for free buffer cache 0 full offset reg in rxdma address map
594  * located at address 0x2050
595  */
596 typedef union _RXDMA_FBC_RD_INDEX_t {
597         u32 value;
598         struct {
599 #ifdef _BIT_FIELDS_HTOL
600                 u32 unused:27;  /* bits 5-31 */
601                 u32 fbc_rdi:5;  /* bit 0-4 */
602 #else
603                 u32 fbc_rdi:5;  /* bit 0-4 */
604                 u32 unused:27;  /* bits 5-31 */
605 #endif
606         } bits;
607 } RXDMA_FBC_RD_INDEX_t, *PRXDMA_FBC_RD_INDEX_t;
608
609 /*
610  * structure for free buffer ring 0 minimum descriptor reg in rxdma address map
611  * located at address 0x2054
612  */
613 typedef union _RXDMA_FBR_MIN_DES_t {
614         u32 value;
615         struct {
616 #ifdef _BIT_FIELDS_HTOL
617                 u32 unused:22;  /* bits 10-31 */
618                 u32 fbr_min:10; /* bits 0-9 */
619 #else
620                 u32 fbr_min:10; /* bits 0-9 */
621                 u32 unused:22;  /* bits 10-31 */
622 #endif
623         } bits;
624 } RXDMA_FBR_MIN_DES_t, *PRXDMA_FBR_MIN_DES_t;
625
626 /*
627  * structure for free buffer ring 1 base address lo reg in rxdma address map
628  * located at address 0x2058 - 0x205C
629  * Defined earlier (RXDMA_FBR_BASE_LO_t and RXDMA_FBR_BASE_HI_t)
630  */
631
632 /*
633  * structure for free buffer ring 1 number of descriptors reg in rxdma address
634  * map.  Located at address 0x2060
635  * Defined earlier (RXDMA_FBR_NUM_DES_t)
636  */
637
638 /*
639  * structure for free buffer ring 1 available offset reg in rxdma address map
640  * located at address 0x2064
641  * Defined Earlier (RXDMA_FBR_AVAIL_OFFSET_t)
642  */
643
644 /*
645  * structure for free buffer ring 1 full offset reg in rxdma address map
646  * located at address 0x2068
647  * Defined Earlier (RXDMA_FBR_FULL_OFFSET_t)
648  */
649
650 /*
651  * structure for free buffer cache 1 read index reg in rxdma address map
652  * located at address 0x206C
653  * Defined Earlier (RXDMA_FBC_RD_INDEX_t)
654  */
655
656 /*
657  * structure for free buffer ring 1 minimum descriptor reg in rxdma address map
658  * located at address 0x2070
659  * Defined Earlier (RXDMA_FBR_MIN_DES_t)
660  */
661
662 /*
663  * Rx DMA Module of JAGCore Address Mapping
664  * Located at address 0x2000
665  */
666 typedef struct _RXDMA_t {                               /* Location: */
667         RXDMA_CSR_t csr;                                /*  0x2000 */
668         u32 dma_wb_base_lo;                             /*  0x2004 */
669         u32 dma_wb_base_hi;                             /*  0x2008 */
670         RXDMA_NUM_PKT_DONE_t num_pkt_done;              /*  0x200C */
671         RXDMA_MAX_PKT_TIME_t max_pkt_time;              /*  0x2010 */
672         u32 rxq_rd_addr;                                /*  0x2014 */
673         u32 rxq_rd_addr_ext;                    /*  0x2018 */
674         u32 rxq_wr_addr;                                /*  0x201C */
675         u32 psr_base_lo;                                /*  0x2020 */
676         u32 psr_base_hi;                                /*  0x2024 */
677         RXDMA_PSR_NUM_DES_t psr_num_des;                /*  0x2028 */
678         RXDMA_PSR_AVAIL_OFFSET_t psr_avail_offset;      /*  0x202C */
679         RXDMA_PSR_FULL_OFFSET_t psr_full_offset;        /*  0x2030 */
680         RXDMA_PSR_ACCESS_INDEX_t psr_access_index;      /*  0x2034 */
681         RXDMA_PSR_MIN_DES_t psr_min_des;                /*  0x2038 */
682         u32 fbr0_base_lo;                               /*  0x203C */
683         u32 fbr0_base_hi;                               /*  0x2040 */
684         RXDMA_FBR_NUM_DES_t fbr0_num_des;               /*  0x2044 */
685         u32 fbr0_avail_offset;                  /*  0x2048 */
686         u32 fbr0_full_offset;                   /*  0x204C */
687         RXDMA_FBC_RD_INDEX_t fbr0_rd_index;             /*  0x2050 */
688         RXDMA_FBR_MIN_DES_t fbr0_min_des;               /*  0x2054 */
689         u32 fbr1_base_lo;                               /*  0x2058 */
690         u32 fbr1_base_hi;                               /*  0x205C */
691         RXDMA_FBR_NUM_DES_t fbr1_num_des;               /*  0x2060 */
692         u32 fbr1_avail_offset;                  /*  0x2064 */
693         u32 fbr1_full_offset;                   /*  0x2068 */
694         RXDMA_FBC_RD_INDEX_t fbr1_rd_index;             /*  0x206C */
695         RXDMA_FBR_MIN_DES_t fbr1_min_des;               /*  0x2070 */
696 } RXDMA_t, *PRXDMA_t;
697
698 /* END OF RXDMA REGISTER ADDRESS MAP */
699
700
701 /* START OF TXMAC REGISTER ADDRESS MAP */
702
703 /*
704  * structure for control reg in txmac address map
705  * located at address 0x3000
706  */
707 typedef union _TXMAC_CTL_t {
708         u32 value;
709         struct {
710 #ifdef _BIT_FIELDS_HTOL
711                 u32 unused:24;          /* bits 8-31 */
712                 u32 cklseg_diable:1;    /* bit 7 */
713                 u32 ckbcnt_disable:1;   /* bit 6 */
714                 u32 cksegnum:1;         /* bit 5 */
715                 u32 async_disable:1;    /* bit 4 */
716                 u32 fc_disable:1;       /* bit 3 */
717                 u32 mcif_disable:1;     /* bit 2 */
718                 u32 mif_disable:1;      /* bit 1 */
719                 u32 txmac_en:1;         /* bit 0 */
720 #else
721                 u32 txmac_en:1;         /* bit 0 */
722                 u32 mif_disable:1;      /* bit 1 mac interface */
723                 u32 mcif_disable:1;     /* bit 2 mem. contr. interface */
724                 u32 fc_disable:1;       /* bit 3 */
725                 u32 async_disable:1;    /* bit 4 */
726                 u32 cksegnum:1;         /* bit 5 */
727                 u32 ckbcnt_disable:1;   /* bit 6 */
728                 u32 cklseg_diable:1;    /* bit 7 */
729                 u32 unused:24;          /* bits 8-31 */
730 #endif
731         } bits;
732 } TXMAC_CTL_t, *PTXMAC_CTL_t;
733
734 /*
735  * structure for shadow pointer reg in txmac address map
736  * located at address 0x3004
737  */
738 typedef union _TXMAC_SHADOW_PTR_t {
739         u32 value;
740         struct {
741 #ifdef _BIT_FIELDS_HTOL
742                 u32 reserved2:5;        /* bits 27-31 */
743                 u32 txq_rd_ptr:11;      /* bits 16-26 */
744                 u32 reserved:5;         /* bits 11-15 */
745                 u32 txq_wr_ptr:11;      /* bits 0-10 */
746 #else
747                 u32 txq_wr_ptr:11;      /* bits 0-10 */
748                 u32 reserved:5;         /* bits 11-15 */
749                 u32 txq_rd_ptr:11;      /* bits 16-26 */
750                 u32 reserved2:5;        /* bits 27-31 */
751 #endif
752         } bits;
753 } TXMAC_SHADOW_PTR_t, *PTXMAC_SHADOW_PTR_t;
754
755 /*
756  * structure for error count reg in txmac address map
757  * located at address 0x3008
758  */
759 typedef union _TXMAC_ERR_CNT_t {
760         u32 value;
761         struct {
762 #ifdef _BIT_FIELDS_HTOL
763                 u32 unused:20;          /* bits 12-31 */
764                 u32 reserved:4;         /* bits 8-11 */
765                 u32 txq_underrun:4;     /* bits 4-7 */
766                 u32 fifo_underrun:4;    /* bits 0-3 */
767 #else
768                 u32 fifo_underrun:4;    /* bits 0-3 */
769                 u32 txq_underrun:4;     /* bits 4-7 */
770                 u32 reserved:4;         /* bits 8-11 */
771                 u32 unused:20;          /* bits 12-31 */
772 #endif
773         } bits;
774 } TXMAC_ERR_CNT_t, *PTXMAC_ERR_CNT_t;
775
776 /*
777  * structure for max fill reg in txmac address map
778  * located at address 0x300C
779  */
780 typedef union _TXMAC_MAX_FILL_t {
781         u32 value;
782         struct {
783 #ifdef _BIT_FIELDS_HTOL
784                 u32 unused:20;          /* bits 12-31 */
785                 u32 max_fill:12;        /* bits 0-11 */
786 #else
787                 u32 max_fill:12;        /* bits 0-11 */
788                 u32 unused:20;          /* bits 12-31 */
789 #endif
790         } bits;
791 } TXMAC_MAX_FILL_t, *PTXMAC_MAX_FILL_t;
792
793 /*
794  * structure for cf parameter reg in txmac address map
795  * located at address 0x3010
796  */
797 typedef union _TXMAC_CF_PARAM_t {
798         u32 value;
799         struct {
800 #ifdef _BIT_FIELDS_HTOL
801                 u32 cfep:16;    /* bits 16-31 */
802                 u32 cfpt:16;    /* bits 0-15 */
803 #else
804                 u32 cfpt:16;    /* bits 0-15 */
805                 u32 cfep:16;    /* bits 16-31 */
806 #endif
807         } bits;
808 } TXMAC_CF_PARAM_t, *PTXMAC_CF_PARAM_t;
809
810 /*
811  * structure for tx test reg in txmac address map
812  * located at address 0x3014
813  */
814 typedef union _TXMAC_TXTEST_t {
815         u32 value;
816         struct {
817 #ifdef _BIT_FIELDS_HTOL
818                 u32 unused2:15;         /* bits 17-31 */
819                 u32 reserved1:1;        /* bit 16 */
820                 u32 txtest_en:1;        /* bit 15 */
821                 u32 unused1:4;          /* bits 11-14 */
822                 u32 txqtest_ptr:11;     /* bits 0-11 */
823 #else
824                 u32 txqtest_ptr:11;     /* bits 0-10 */
825                 u32 unused1:4;          /* bits 11-14 */
826                 u32 txtest_en:1;        /* bit 15 */
827                 u32 reserved1:1;        /* bit 16 */
828                 u32 unused2:15;         /* bits 17-31 */
829 #endif
830         } bits;
831 } TXMAC_TXTEST_t, *PTXMAC_TXTEST_t;
832
833 /*
834  * structure for error reg in txmac address map
835  * located at address 0x3018
836  */
837 typedef union _TXMAC_ERR_t {
838         u32 value;
839         struct {
840 #ifdef _BIT_FIELDS_HTOL
841                 u32 unused2:23;         /* bits 9-31 */
842                 u32 fifo_underrun:1;    /* bit 8 */
843                 u32 unused1:2;          /* bits 6-7 */
844                 u32 ctrl2_err:1;        /* bit 5 */
845                 u32 txq_underrun:1;     /* bit 4 */
846                 u32 bcnt_err:1;         /* bit 3 */
847                 u32 lseg_err:1;         /* bit 2 */
848                 u32 segnum_err:1;       /* bit 1 */
849                 u32 seg0_err:1;         /* bit 0 */
850 #else
851                 u32 seg0_err:1;         /* bit 0 */
852                 u32 segnum_err:1;       /* bit 1 */
853                 u32 lseg_err:1;         /* bit 2 */
854                 u32 bcnt_err:1;         /* bit 3 */
855                 u32 txq_underrun:1;     /* bit 4 */
856                 u32 ctrl2_err:1;        /* bit 5 */
857                 u32 unused1:2;          /* bits 6-7 */
858                 u32 fifo_underrun:1;    /* bit 8 */
859                 u32 unused2:23;         /* bits 9-31 */
860 #endif
861         } bits;
862 } TXMAC_ERR_t, *PTXMAC_ERR_t;
863
864 /*
865  * structure for error interrupt reg in txmac address map
866  * located at address 0x301C
867  */
868 typedef union _TXMAC_ERR_INT_t {
869         u32 value;
870         struct {
871 #ifdef _BIT_FIELDS_HTOL
872                 u32 unused2:23;         /* bits 9-31 */
873                 u32 fifo_underrun:1;    /* bit 8 */
874                 u32 unused1:2;          /* bits 6-7 */
875                 u32 ctrl2_err:1;        /* bit 5 */
876                 u32 txq_underrun:1;     /* bit 4 */
877                 u32 bcnt_err:1;         /* bit 3 */
878                 u32 lseg_err:1;         /* bit 2 */
879                 u32 segnum_err:1;       /* bit 1 */
880                 u32 seg0_err:1;         /* bit 0 */
881 #else
882                 u32 seg0_err:1;         /* bit 0 */
883                 u32 segnum_err:1;       /* bit 1 */
884                 u32 lseg_err:1;         /* bit 2 */
885                 u32 bcnt_err:1;         /* bit 3 */
886                 u32 txq_underrun:1;     /* bit 4 */
887                 u32 ctrl2_err:1;        /* bit 5 */
888                 u32 unused1:2;          /* bits 6-7 */
889                 u32 fifo_underrun:1;    /* bit 8 */
890                 u32 unused2:23;         /* bits 9-31 */
891 #endif
892         } bits;
893 } TXMAC_ERR_INT_t, *PTXMAC_ERR_INT_t;
894
895 /*
896  * structure for error interrupt reg in txmac address map
897  * located at address 0x3020
898  */
899 typedef union _TXMAC_CP_CTRL_t {
900         u32 value;
901         struct {
902 #ifdef _BIT_FIELDS_HTOL
903                 u32 unused:30;          /* bits 2-31 */
904                 u32 bp_req:1;           /* bit 1 */
905                 u32 bp_xonxoff:1;       /* bit 0 */
906 #else
907                 u32 bp_xonxoff:1;       /* bit 0 */
908                 u32 bp_req:1;           /* bit 1 */
909                 u32 unused:30;          /* bits 2-31 */
910 #endif
911         } bits;
912 } TXMAC_BP_CTRL_t, *PTXMAC_BP_CTRL_t;
913
914 /*
915  * Tx MAC Module of JAGCore Address Mapping
916  */
917 typedef struct _TXMAC_t {               /* Location: */
918         TXMAC_CTL_t ctl;                /*  0x3000 */
919         TXMAC_SHADOW_PTR_t shadow_ptr;  /*  0x3004 */
920         TXMAC_ERR_CNT_t err_cnt;        /*  0x3008 */
921         TXMAC_MAX_FILL_t max_fill;      /*  0x300C */
922         TXMAC_CF_PARAM_t cf_param;      /*  0x3010 */
923         TXMAC_TXTEST_t tx_test;         /*  0x3014 */
924         TXMAC_ERR_t err;                /*  0x3018 */
925         TXMAC_ERR_INT_t err_int;        /*  0x301C */
926         TXMAC_BP_CTRL_t bp_ctrl;        /*  0x3020 */
927 } TXMAC_t, *PTXMAC_t;
928
929 /* END OF TXMAC REGISTER ADDRESS MAP */
930
931 /* START OF RXMAC REGISTER ADDRESS MAP */
932
933 /*
934  * structure for rxmac control reg in rxmac address map
935  * located at address 0x4000
936  */
937 typedef union _RXMAC_CTRL_t {
938         u32 value;
939         struct {
940 #ifdef _BIT_FIELDS_HTOL
941                 u32 reserved:25;                /* bits 7-31 */
942                 u32 rxmac_int_disable:1;        /* bit 6 */
943                 u32 async_disable:1;            /* bit 5 */
944                 u32 mif_disable:1;              /* bit 4 */
945                 u32 wol_disable:1;              /* bit 3 */
946                 u32 pkt_filter_disable:1;       /* bit 2 */
947                 u32 mcif_disable:1;             /* bit 1 */
948                 u32 rxmac_en:1;                 /* bit 0 */
949 #else
950                 u32 rxmac_en:1;                 /* bit 0 */
951                 u32 mcif_disable:1;             /* bit 1 */
952                 u32 pkt_filter_disable:1;       /* bit 2 */
953                 u32 wol_disable:1;              /* bit 3 */
954                 u32 mif_disable:1;              /* bit 4 */
955                 u32 async_disable:1;            /* bit 5 */
956                 u32 rxmac_int_disable:1;        /* bit 6 */
957                 u32 reserved:25;                /* bits 7-31 */
958 #endif
959         } bits;
960 } RXMAC_CTRL_t, *PRXMAC_CTRL_t;
961
962 /*
963  * structure for Wake On Lan Control and CRC 0 reg in rxmac address map
964  * located at address 0x4004
965  */
966 typedef union _RXMAC_WOL_CTL_CRC0_t {
967         u32 value;
968         struct {
969 #ifdef _BIT_FIELDS_HTOL
970                 u32 crc0:16;            /* bits 16-31 */
971                 u32 reserve:4;          /* bits 12-15 */
972                 u32 ignore_pp:1;        /* bit 11 */
973                 u32 ignore_mp:1;        /* bit 10 */
974                 u32 clr_intr:1;         /* bit 9 */
975                 u32 ignore_link_chg:1;  /* bit 8 */
976                 u32 ignore_uni:1;       /* bit 7 */
977                 u32 ignore_multi:1;     /* bit 6 */
978                 u32 ignore_broad:1;     /* bit 5 */
979                 u32 valid_crc4:1;       /* bit 4 */
980                 u32 valid_crc3:1;       /* bit 3 */
981                 u32 valid_crc2:1;       /* bit 2 */
982                 u32 valid_crc1:1;       /* bit 1 */
983                 u32 valid_crc0:1;       /* bit 0 */
984 #else
985                 u32 valid_crc0:1;       /* bit 0 */
986                 u32 valid_crc1:1;       /* bit 1 */
987                 u32 valid_crc2:1;       /* bit 2 */
988                 u32 valid_crc3:1;       /* bit 3 */
989                 u32 valid_crc4:1;       /* bit 4 */
990                 u32 ignore_broad:1;     /* bit 5 */
991                 u32 ignore_multi:1;     /* bit 6 */
992                 u32 ignore_uni:1;       /* bit 7 */
993                 u32 ignore_link_chg:1;  /* bit 8 */
994                 u32 clr_intr:1;         /* bit 9 */
995                 u32 ignore_mp:1;        /* bit 10 */
996                 u32 ignore_pp:1;        /* bit 11 */
997                 u32 reserve:4;          /* bits 12-15 */
998                 u32 crc0:16;            /* bits 16-31 */
999 #endif
1000         } bits;
1001 } RXMAC_WOL_CTL_CRC0_t, *PRXMAC_WOL_CTL_CRC0_t;
1002
1003 /*
1004  * structure for CRC 1 and CRC 2 reg in rxmac address map
1005  * located at address 0x4008
1006  */
1007 typedef union _RXMAC_WOL_CRC12_t {
1008         u32 value;
1009         struct {
1010 #ifdef _BIT_FIELDS_HTOL
1011                 u32 crc2:16;    /* bits 16-31 */
1012                 u32 crc1:16;    /* bits 0-15 */
1013 #else
1014                 u32 crc1:16;    /* bits 0-15 */
1015                 u32 crc2:16;    /* bits 16-31 */
1016 #endif
1017         } bits;
1018 } RXMAC_WOL_CRC12_t, *PRXMAC_WOL_CRC12_t;
1019
1020 /*
1021  * structure for CRC 3 and CRC 4 reg in rxmac address map
1022  * located at address 0x400C
1023  */
1024 typedef union _RXMAC_WOL_CRC34_t {
1025         u32 value;
1026         struct {
1027 #ifdef _BIT_FIELDS_HTOL
1028                 u32 crc4:16;    /* bits 16-31 */
1029                 u32 crc3:16;    /* bits 0-15 */
1030 #else
1031                 u32 crc3:16;    /* bits 0-15 */
1032                 u32 crc4:16;    /* bits 16-31 */
1033 #endif
1034         } bits;
1035 } RXMAC_WOL_CRC34_t, *PRXMAC_WOL_CRC34_t;
1036
1037 /*
1038  * structure for Wake On Lan Source Address Lo reg in rxmac address map
1039  * located at address 0x4010
1040  */
1041 typedef union _RXMAC_WOL_SA_LO_t {
1042         u32 value;
1043         struct {
1044 #ifdef _BIT_FIELDS_HTOL
1045                 u32 sa3:8;      /* bits 24-31 */
1046                 u32 sa4:8;      /* bits 16-23 */
1047                 u32 sa5:8;      /* bits 8-15 */
1048                 u32 sa6:8;      /* bits 0-7 */
1049 #else
1050                 u32 sa6:8;      /* bits 0-7 */
1051                 u32 sa5:8;      /* bits 8-15 */
1052                 u32 sa4:8;      /* bits 16-23 */
1053                 u32 sa3:8;      /* bits 24-31 */
1054 #endif
1055         } bits;
1056 } RXMAC_WOL_SA_LO_t, *PRXMAC_WOL_SA_LO_t;
1057
1058 /*
1059  * structure for Wake On Lan Source Address Hi reg in rxmac address map
1060  * located at address 0x4014
1061  */
1062 typedef union _RXMAC_WOL_SA_HI_t {
1063         u32 value;
1064         struct {
1065 #ifdef _BIT_FIELDS_HTOL
1066                 u32 reserved:16;        /* bits 16-31 */
1067                 u32 sa1:8;              /* bits 8-15 */
1068                 u32 sa2:8;              /* bits 0-7 */
1069 #else
1070                 u32 sa2:8;              /* bits 0-7 */
1071                 u32 sa1:8;              /* bits 8-15 */
1072                 u32 reserved:16;        /* bits 16-31 */
1073 #endif
1074         } bits;
1075 } RXMAC_WOL_SA_HI_t, *PRXMAC_WOL_SA_HI_t;
1076
1077 /*
1078  * structure for Wake On Lan mask reg in rxmac address map
1079  * located at address 0x4018 - 0x4064
1080  * Defined earlier (u32)
1081  */
1082
1083 /*
1084  * structure for Unicast Paket Filter Address 1 reg in rxmac address map
1085  * located at address 0x4068
1086  */
1087 typedef union _RXMAC_UNI_PF_ADDR1_t {
1088         u32 value;
1089         struct {
1090 #ifdef _BIT_FIELDS_HTOL
1091                 u32 addr1_3:8;  /* bits 24-31 */
1092                 u32 addr1_4:8;  /* bits 16-23 */
1093                 u32 addr1_5:8;  /* bits 8-15 */
1094                 u32 addr1_6:8;  /* bits 0-7 */
1095 #else
1096                 u32 addr1_6:8;  /* bits 0-7 */
1097                 u32 addr1_5:8;  /* bits 8-15 */
1098                 u32 addr1_4:8;  /* bits 16-23 */
1099                 u32 addr1_3:8;  /* bits 24-31 */
1100 #endif
1101         } bits;
1102 } RXMAC_UNI_PF_ADDR1_t, *PRXMAC_UNI_PF_ADDR1_t;
1103
1104 /*
1105  * structure for Unicast Paket Filter Address 2 reg in rxmac address map
1106  * located at address 0x406C
1107  */
1108 typedef union _RXMAC_UNI_PF_ADDR2_t {
1109         u32 value;
1110         struct {
1111 #ifdef _BIT_FIELDS_HTOL
1112                 u32 addr2_3:8;  /* bits 24-31 */
1113                 u32 addr2_4:8;  /* bits 16-23 */
1114                 u32 addr2_5:8;  /* bits 8-15 */
1115                 u32 addr2_6:8;  /* bits 0-7 */
1116 #else
1117                 u32 addr2_6:8;  /* bits 0-7 */
1118                 u32 addr2_5:8;  /* bits 8-15 */
1119                 u32 addr2_4:8;  /* bits 16-23 */
1120                 u32 addr2_3:8;  /* bits 24-31 */
1121 #endif
1122         } bits;
1123 } RXMAC_UNI_PF_ADDR2_t, *PRXMAC_UNI_PF_ADDR2_t;
1124
1125 /*
1126  * structure for Unicast Paket Filter Address 1 & 2 reg in rxmac address map
1127  * located at address 0x4070
1128  */
1129 typedef union _RXMAC_UNI_PF_ADDR3_t {
1130         u32 value;
1131         struct {
1132 #ifdef _BIT_FIELDS_HTOL
1133                 u32 addr2_1:8;  /* bits 24-31 */
1134                 u32 addr2_2:8;  /* bits 16-23 */
1135                 u32 addr1_1:8;  /* bits 8-15 */
1136                 u32 addr1_2:8;  /* bits 0-7 */
1137 #else
1138                 u32 addr1_2:8;  /* bits 0-7 */
1139                 u32 addr1_1:8;  /* bits 8-15 */
1140                 u32 addr2_2:8;  /* bits 16-23 */
1141                 u32 addr2_1:8;  /* bits 24-31 */
1142 #endif
1143         } bits;
1144 } RXMAC_UNI_PF_ADDR3_t, *PRXMAC_UNI_PF_ADDR3_t;
1145
1146 /*
1147  * structure for Multicast Hash reg in rxmac address map
1148  * located at address 0x4074 - 0x4080
1149  * Defined earlier (u32)
1150  */
1151
1152 /*
1153  * structure for Packet Filter Control reg in rxmac address map
1154  * located at address 0x4084
1155  */
1156 typedef union _RXMAC_PF_CTRL_t {
1157         u32 value;
1158         struct {
1159 #ifdef _BIT_FIELDS_HTOL
1160                 u32 unused2:9;          /* bits 23-31 */
1161                 u32 min_pkt_size:7;     /* bits 16-22 */
1162                 u32 unused1:12;         /* bits 4-15 */
1163                 u32 filter_frag_en:1;   /* bit 3 */
1164                 u32 filter_uni_en:1;    /* bit 2 */
1165                 u32 filter_multi_en:1;  /* bit 1 */
1166                 u32 filter_broad_en:1;  /* bit 0 */
1167 #else
1168                 u32 filter_broad_en:1;  /* bit 0 */
1169                 u32 filter_multi_en:1;  /* bit 1 */
1170                 u32 filter_uni_en:1;    /* bit 2 */
1171                 u32 filter_frag_en:1;   /* bit 3 */
1172                 u32 unused1:12;         /* bits 4-15 */
1173                 u32 min_pkt_size:7;     /* bits 16-22 */
1174                 u32 unused2:9;          /* bits 23-31 */
1175 #endif
1176         } bits;
1177 } RXMAC_PF_CTRL_t, *PRXMAC_PF_CTRL_t;
1178
1179 /*
1180  * structure for Memory Controller Interface Control Max Segment reg in rxmac
1181  * address map.  Located at address 0x4088
1182  */
1183 typedef union _RXMAC_MCIF_CTRL_MAX_SEG_t {
1184         u32 value;
1185         struct {
1186 #ifdef _BIT_FIELDS_HTOL
1187                 u32 reserved:22;        /* bits 10-31 */
1188                 u32 max_size:8; /* bits 2-9 */
1189                 u32 fc_en:1;    /* bit 1 */
1190                 u32 seg_en:1;   /* bit 0 */
1191 #else
1192                 u32 seg_en:1;   /* bit 0 */
1193                 u32 fc_en:1;    /* bit 1 */
1194                 u32 max_size:8; /* bits 2-9 */
1195                 u32 reserved:22;        /* bits 10-31 */
1196 #endif
1197         } bits;
1198 } RXMAC_MCIF_CTRL_MAX_SEG_t, *PRXMAC_MCIF_CTRL_MAX_SEG_t;
1199
1200 /*
1201  * structure for Memory Controller Interface Water Mark reg in rxmac address
1202  * map.  Located at address 0x408C
1203  */
1204 typedef union _RXMAC_MCIF_WATER_MARK_t {
1205         u32 value;
1206         struct {
1207 #ifdef _BIT_FIELDS_HTOL
1208                 u32 reserved2:6;        /* bits 26-31 */
1209                 u32 mark_hi:10; /* bits 16-25 */
1210                 u32 reserved1:6;        /* bits 10-15 */
1211                 u32 mark_lo:10; /* bits 0-9 */
1212 #else
1213                 u32 mark_lo:10; /* bits 0-9 */
1214                 u32 reserved1:6;        /* bits 10-15 */
1215                 u32 mark_hi:10; /* bits 16-25 */
1216                 u32 reserved2:6;        /* bits 26-31 */
1217 #endif
1218         } bits;
1219 } RXMAC_MCIF_WATER_MARK_t, *PRXMAC_MCIF_WATER_MARK_t;
1220
1221 /*
1222  * structure for Rx Queue Dialog reg in rxmac address map.
1223  * located at address 0x4090
1224  */
1225 typedef union _RXMAC_RXQ_DIAG_t {
1226         u32 value;
1227         struct {
1228 #ifdef _BIT_FIELDS_HTOL
1229                 u32 reserved2:6;        /* bits 26-31 */
1230                 u32 rd_ptr:10;  /* bits 16-25 */
1231                 u32 reserved1:6;        /* bits 10-15 */
1232                 u32 wr_ptr:10;  /* bits 0-9 */
1233 #else
1234                 u32 wr_ptr:10;  /* bits 0-9 */
1235                 u32 reserved1:6;        /* bits 10-15 */
1236                 u32 rd_ptr:10;  /* bits 16-25 */
1237                 u32 reserved2:6;        /* bits 26-31 */
1238 #endif
1239         } bits;
1240 } RXMAC_RXQ_DIAG_t, *PRXMAC_RXQ_DIAG_t;
1241
1242 /*
1243  * structure for space availiable reg in rxmac address map.
1244  * located at address 0x4094
1245  */
1246 typedef union _RXMAC_SPACE_AVAIL_t {
1247         u32 value;
1248         struct {
1249 #ifdef _BIT_FIELDS_HTOL
1250                 u32 reserved2:15;               /* bits 17-31 */
1251                 u32 space_avail_en:1;   /* bit 16 */
1252                 u32 reserved1:6;                /* bits 10-15 */
1253                 u32 space_avail:10;     /* bits 0-9 */
1254 #else
1255                 u32 space_avail:10;     /* bits 0-9 */
1256                 u32 reserved1:6;                /* bits 10-15 */
1257                 u32 space_avail_en:1;   /* bit 16 */
1258                 u32 reserved2:15;               /* bits 17-31 */
1259 #endif
1260         } bits;
1261 } RXMAC_SPACE_AVAIL_t, *PRXMAC_SPACE_AVAIL_t;
1262
1263 /*
1264  * structure for management interface reg in rxmac address map.
1265  * located at address 0x4098
1266  */
1267 typedef union _RXMAC_MIF_CTL_t {
1268         u32 value;
1269         struct {
1270 #ifdef _BIT_FIELDS_HTOL
1271                 u32 reserve:14;         /* bits 18-31 */
1272                 u32 drop_pkt_en:1;              /* bit 17 */
1273                 u32 drop_pkt_mask:17;   /* bits 0-16 */
1274 #else
1275                 u32 drop_pkt_mask:17;   /* bits 0-16 */
1276                 u32 drop_pkt_en:1;              /* bit 17 */
1277                 u32 reserve:14;         /* bits 18-31 */
1278 #endif
1279         } bits;
1280 } RXMAC_MIF_CTL_t, *PRXMAC_MIF_CTL_t;
1281
1282 /*
1283  * structure for Error reg in rxmac address map.
1284  * located at address 0x409C
1285  */
1286 typedef union _RXMAC_ERROR_REG_t {
1287         u32 value;
1288         struct {
1289 #ifdef _BIT_FIELDS_HTOL
1290                 u32 reserve:28; /* bits 4-31 */
1291                 u32 mif:1;              /* bit 3 */
1292                 u32 async:1;    /* bit 2 */
1293                 u32 pkt_filter:1;       /* bit 1 */
1294                 u32 mcif:1;     /* bit 0 */
1295 #else
1296                 u32 mcif:1;     /* bit 0 */
1297                 u32 pkt_filter:1;       /* bit 1 */
1298                 u32 async:1;    /* bit 2 */
1299                 u32 mif:1;              /* bit 3 */
1300                 u32 reserve:28; /* bits 4-31 */
1301 #endif
1302         } bits;
1303 } RXMAC_ERROR_REG_t, *PRXMAC_ERROR_REG_t;
1304
1305 /*
1306  * Rx MAC Module of JAGCore Address Mapping
1307  */
1308 typedef struct _RXMAC_t {                               /* Location: */
1309         RXMAC_CTRL_t ctrl;                              /*  0x4000 */
1310         RXMAC_WOL_CTL_CRC0_t crc0;                      /*  0x4004 */
1311         RXMAC_WOL_CRC12_t crc12;                        /*  0x4008 */
1312         RXMAC_WOL_CRC34_t crc34;                        /*  0x400C */
1313         RXMAC_WOL_SA_LO_t sa_lo;                        /*  0x4010 */
1314         RXMAC_WOL_SA_HI_t sa_hi;                        /*  0x4014 */
1315         u32 mask0_word0;                                /*  0x4018 */
1316         u32 mask0_word1;                                /*  0x401C */
1317         u32 mask0_word2;                                /*  0x4020 */
1318         u32 mask0_word3;                                /*  0x4024 */
1319         u32 mask1_word0;                                /*  0x4028 */
1320         u32 mask1_word1;                                /*  0x402C */
1321         u32 mask1_word2;                                /*  0x4030 */
1322         u32 mask1_word3;                                /*  0x4034 */
1323         u32 mask2_word0;                                /*  0x4038 */
1324         u32 mask2_word1;                                /*  0x403C */
1325         u32 mask2_word2;                                /*  0x4040 */
1326         u32 mask2_word3;                                /*  0x4044 */
1327         u32 mask3_word0;                                /*  0x4048 */
1328         u32 mask3_word1;                                /*  0x404C */
1329         u32 mask3_word2;                                /*  0x4050 */
1330         u32 mask3_word3;                                /*  0x4054 */
1331         u32 mask4_word0;                                /*  0x4058 */
1332         u32 mask4_word1;                                /*  0x405C */
1333         u32 mask4_word2;                                /*  0x4060 */
1334         u32 mask4_word3;                                /*  0x4064 */
1335         RXMAC_UNI_PF_ADDR1_t uni_pf_addr1;              /*  0x4068 */
1336         RXMAC_UNI_PF_ADDR2_t uni_pf_addr2;              /*  0x406C */
1337         RXMAC_UNI_PF_ADDR3_t uni_pf_addr3;              /*  0x4070 */
1338         u32 multi_hash1;                                /*  0x4074 */
1339         u32 multi_hash2;                                /*  0x4078 */
1340         u32 multi_hash3;                                /*  0x407C */
1341         u32 multi_hash4;                                /*  0x4080 */
1342         RXMAC_PF_CTRL_t pf_ctrl;                        /*  0x4084 */
1343         RXMAC_MCIF_CTRL_MAX_SEG_t mcif_ctrl_max_seg;    /*  0x4088 */
1344         RXMAC_MCIF_WATER_MARK_t mcif_water_mark;        /*  0x408C */
1345         RXMAC_RXQ_DIAG_t rxq_diag;                      /*  0x4090 */
1346         RXMAC_SPACE_AVAIL_t space_avail;                /*  0x4094 */
1347
1348         RXMAC_MIF_CTL_t mif_ctrl;                       /*  0x4098 */
1349         RXMAC_ERROR_REG_t err_reg;                      /*  0x409C */
1350 } RXMAC_t, *PRXMAC_t;
1351
1352 /* END OF TXMAC REGISTER ADDRESS MAP */
1353
1354
1355 /* START OF MAC REGISTER ADDRESS MAP */
1356
1357 /*
1358  * structure for configuration #1 reg in mac address map.
1359  * located at address 0x5000
1360  */
1361 typedef union _MAC_CFG1_t {
1362         u32 value;
1363         struct {
1364 #ifdef _BIT_FIELDS_HTOL
1365                 u32 soft_reset:1;               /* bit 31 */
1366                 u32 sim_reset:1;                /* bit 30 */
1367                 u32 reserved3:10;               /* bits 20-29 */
1368                 u32 reset_rx_mc:1;              /* bit 19 */
1369                 u32 reset_tx_mc:1;              /* bit 18 */
1370                 u32 reset_rx_fun:1;     /* bit 17 */
1371                 u32 reset_tx_fun:1;     /* bit 16 */
1372                 u32 reserved2:7;                /* bits 9-15 */
1373                 u32 loop_back:1;                /* bit 8 */
1374                 u32 reserved1:2;                /* bits 6-7 */
1375                 u32 rx_flow:1;          /* bit 5 */
1376                 u32 tx_flow:1;          /* bit 4 */
1377                 u32 syncd_rx_en:1;              /* bit 3 */
1378                 u32 rx_enable:1;                /* bit 2 */
1379                 u32 syncd_tx_en:1;              /* bit 1 */
1380                 u32 tx_enable:1;                /* bit 0 */
1381 #else
1382                 u32 tx_enable:1;                /* bit 0 */
1383                 u32 syncd_tx_en:1;              /* bit 1 */
1384                 u32 rx_enable:1;                /* bit 2 */
1385                 u32 syncd_rx_en:1;              /* bit 3 */
1386                 u32 tx_flow:1;          /* bit 4 */
1387                 u32 rx_flow:1;          /* bit 5 */
1388                 u32 reserved1:2;                /* bits 6-7 */
1389                 u32 loop_back:1;                /* bit 8 */
1390                 u32 reserved2:7;                /* bits 9-15 */
1391                 u32 reset_tx_fun:1;     /* bit 16 */
1392                 u32 reset_rx_fun:1;     /* bit 17 */
1393                 u32 reset_tx_mc:1;              /* bit 18 */
1394                 u32 reset_rx_mc:1;              /* bit 19 */
1395                 u32 reserved3:10;               /* bits 20-29 */
1396                 u32 sim_reset:1;                /* bit 30 */
1397                 u32 soft_reset:1;               /* bit 31 */
1398 #endif
1399         } bits;
1400 } MAC_CFG1_t, *PMAC_CFG1_t;
1401
1402 /*
1403  * structure for configuration #2 reg in mac address map.
1404  * located at address 0x5004
1405  */
1406 typedef union _MAC_CFG2_t {
1407         u32 value;
1408         struct {
1409 #ifdef _BIT_FIELDS_HTOL
1410                 u32 reserved3:16;               /* bits 16-31 */
1411                 u32 preamble_len:4;     /* bits 12-15 */
1412                 u32 reserved2:2;                /* bits 10-11 */
1413                 u32 if_mode:2;          /* bits 8-9 */
1414                 u32 reserved1:2;                /* bits 6-7 */
1415                 u32 huge_frame:1;               /* bit 5 */
1416                 u32 len_check:1;                /* bit 4 */
1417                 u32 undefined:1;                /* bit 3 */
1418                 u32 pad_crc:1;          /* bit 2 */
1419                 u32 crc_enable:1;               /* bit 1 */
1420                 u32 full_duplex:1;              /* bit 0 */
1421 #else
1422                 u32 full_duplex:1;              /* bit 0 */
1423                 u32 crc_enable:1;               /* bit 1 */
1424                 u32 pad_crc:1;          /* bit 2 */
1425                 u32 undefined:1;                /* bit 3 */
1426                 u32 len_check:1;                /* bit 4 */
1427                 u32 huge_frame:1;               /* bit 5 */
1428                 u32 reserved1:2;                /* bits 6-7 */
1429                 u32 if_mode:2;          /* bits 8-9 */
1430                 u32 reserved2:2;                /* bits 10-11 */
1431                 u32 preamble_len:4;     /* bits 12-15 */
1432                 u32 reserved3:16;               /* bits 16-31 */
1433 #endif
1434         } bits;
1435 } MAC_CFG2_t, *PMAC_CFG2_t;
1436
1437 /*
1438  * structure for Interpacket gap reg in mac address map.
1439  * located at address 0x5008
1440  */
1441 typedef union _MAC_IPG_t {
1442         u32 value;
1443         struct {
1444 #ifdef _BIT_FIELDS_HTOL
1445                 u32 reserved:1;         /* bit 31 */
1446                 u32 non_B2B_ipg_1:7;    /* bits 24-30 */
1447                 u32 undefined2:1;               /* bit 23 */
1448                 u32 non_B2B_ipg_2:7;    /* bits 16-22 */
1449                 u32 min_ifg_enforce:8;  /* bits 8-15 */
1450                 u32 undefined1:1;               /* bit 7 */
1451                 u32 B2B_ipg:7;          /* bits 0-6 */
1452 #else
1453                 u32 B2B_ipg:7;          /* bits 0-6 */
1454                 u32 undefined1:1;               /* bit 7 */
1455                 u32 min_ifg_enforce:8;  /* bits 8-15 */
1456                 u32 non_B2B_ipg_2:7;    /* bits 16-22 */
1457                 u32 undefined2:1;               /* bit 23 */
1458                 u32 non_B2B_ipg_1:7;    /* bits 24-30 */
1459                 u32 reserved:1;         /* bit 31 */
1460 #endif
1461         } bits;
1462 } MAC_IPG_t, *PMAC_IPG_t;
1463
1464 /*
1465  * structure for half duplex reg in mac address map.
1466  * located at address 0x500C
1467  */
1468 typedef union _MAC_HFDP_t {
1469         u32 value;
1470         struct {
1471 #ifdef _BIT_FIELDS_HTOL
1472                 u32 reserved2:8;                /* bits 24-31 */
1473                 u32 alt_beb_trunc:4;    /* bits 23-20 */
1474                 u32 alt_beb_enable:1;   /* bit 19 */
1475                 u32 bp_no_backoff:1;    /* bit 18 */
1476                 u32 no_backoff:1;               /* bit 17 */
1477                 u32 excess_defer:1;     /* bit 16 */
1478                 u32 rexmit_max:4;               /* bits 12-15 */
1479                 u32 reserved1:2;                /* bits 10-11 */
1480                 u32 coll_window:10;     /* bits 0-9 */
1481 #else
1482                 u32 coll_window:10;     /* bits 0-9 */
1483                 u32 reserved1:2;                /* bits 10-11 */
1484                 u32 rexmit_max:4;               /* bits 12-15 */
1485                 u32 excess_defer:1;     /* bit 16 */
1486                 u32 no_backoff:1;               /* bit 17 */
1487                 u32 bp_no_backoff:1;    /* bit 18 */
1488                 u32 alt_beb_enable:1;   /* bit 19 */
1489                 u32 alt_beb_trunc:4;    /* bits 23-20 */
1490                 u32 reserved2:8;                /* bits 24-31 */
1491 #endif
1492         } bits;
1493 } MAC_HFDP_t, *PMAC_HFDP_t;
1494
1495 /*
1496  * structure for Maximum Frame Length reg in mac address map.
1497  * located at address 0x5010
1498  */
1499 typedef union _MAC_MAX_FM_LEN_t {
1500         u32 value;
1501         struct {
1502 #ifdef _BIT_FIELDS_HTOL
1503                 u32 reserved:16;        /* bits 16-31 */
1504                 u32 max_len:16; /* bits 0-15 */
1505 #else
1506                 u32 max_len:16; /* bits 0-15 */
1507                 u32 reserved:16;        /* bits 16-31 */
1508 #endif
1509         } bits;
1510 } MAC_MAX_FM_LEN_t, *PMAC_MAX_FM_LEN_t;
1511
1512 /*
1513  * structure for Reserve 1 reg in mac address map.
1514  * located at address 0x5014 - 0x5018
1515  * Defined earlier (u32)
1516  */
1517
1518 /*
1519  * structure for Test reg in mac address map.
1520  * located at address 0x501C
1521  */
1522 typedef union _MAC_TEST_t {
1523         u32 value;
1524         struct {
1525 #ifdef _BIT_FIELDS_HTOL
1526                 u32 unused:29;  /* bits 3-31 */
1527                 u32 mac_test:3; /* bits 0-2 */
1528 #else
1529                 u32 mac_test:3; /* bits 0-2 */
1530                 u32 unused:29;  /* bits 3-31 */
1531 #endif
1532         } bits;
1533 } MAC_TEST_t, *PMAC_TEST_t;
1534
1535 /*
1536  * structure for MII Management Configuration reg in mac address map.
1537  * located at address 0x5020
1538  */
1539 typedef union _MII_MGMT_CFG_t {
1540         u32 value;
1541         struct {
1542 #ifdef _BIT_FIELDS_HTOL
1543                 u32 reset_mii_mgmt:1;   /* bit 31 */
1544                 u32 reserved:25;                /* bits 6-30 */
1545                 u32 scan_auto_incremt:1;        /* bit 5 */
1546                 u32 preamble_suppress:1;        /* bit 4 */
1547                 u32 undefined:1;                /* bit 3 */
1548                 u32 mgmt_clk_reset:3;   /* bits 0-2 */
1549 #else
1550                 u32 mgmt_clk_reset:3;   /* bits 0-2 */
1551                 u32 undefined:1;                /* bit 3 */
1552                 u32 preamble_suppress:1;        /* bit 4 */
1553                 u32 scan_auto_incremt:1;        /* bit 5 */
1554                 u32 reserved:25;                /* bits 6-30 */
1555                 u32 reset_mii_mgmt:1;   /* bit 31 */
1556 #endif
1557         } bits;
1558 } MII_MGMT_CFG_t, *PMII_MGMT_CFG_t;
1559
1560 /*
1561  * structure for MII Management Command reg in mac address map.
1562  * located at address 0x5024
1563  */
1564 typedef union _MII_MGMT_CMD_t {
1565         u32 value;
1566         struct {
1567 #ifdef _BIT_FIELDS_HTOL
1568                 u32 reserved:30;        /* bits 2-31 */
1569                 u32 scan_cycle:1;       /* bit 1 */
1570                 u32 read_cycle:1;       /* bit 0 */
1571 #else
1572                 u32 read_cycle:1;       /* bit 0 */
1573                 u32 scan_cycle:1;       /* bit 1 */
1574                 u32 reserved:30;        /* bits 2-31 */
1575 #endif
1576         } bits;
1577 } MII_MGMT_CMD_t, *PMII_MGMT_CMD_t;
1578
1579 /*
1580  * structure for MII Management Address reg in mac address map.
1581  * located at address 0x5028
1582  */
1583 typedef union _MII_MGMT_ADDR_t {
1584         u32 value;
1585         struct {
1586 #ifdef _BIT_FIELDS_HTOL
1587                 u32 reserved2:19;       /* bit 13-31 */
1588                 u32 phy_addr:5; /* bits 8-12 */
1589                 u32 reserved1:3;        /* bits 5-7 */
1590                 u32 reg_addr:5; /* bits 0-4 */
1591 #else
1592                 u32 reg_addr:5; /* bits 0-4 */
1593                 u32 reserved1:3;        /* bits 5-7 */
1594                 u32 phy_addr:5; /* bits 8-12 */
1595                 u32 reserved2:19;       /* bit 13-31 */
1596 #endif
1597         } bits;
1598 } MII_MGMT_ADDR_t, *PMII_MGMT_ADDR_t;
1599
1600 /*
1601  * structure for MII Management Control reg in mac address map.
1602  * located at address 0x502C
1603  */
1604 typedef union _MII_MGMT_CTRL_t {
1605         u32 value;
1606         struct {
1607 #ifdef _BIT_FIELDS_HTOL
1608                 u32 reserved:16;        /* bits 16-31 */
1609                 u32 phy_ctrl:16;        /* bits 0-15 */
1610 #else
1611                 u32 phy_ctrl:16;        /* bits 0-15 */
1612                 u32 reserved:16;        /* bits 16-31 */
1613 #endif
1614         } bits;
1615 } MII_MGMT_CTRL_t, *PMII_MGMT_CTRL_t;
1616
1617 /*
1618  * structure for MII Management Status reg in mac address map.
1619  * located at address 0x5030
1620  */
1621 typedef union _MII_MGMT_STAT_t {
1622         u32 value;
1623         struct {
1624 #ifdef _BIT_FIELDS_HTOL
1625                 u32 reserved:16;        /* bits 16-31 */
1626                 u32 phy_stat:16;        /* bits 0-15 */
1627 #else
1628                 u32 phy_stat:16;        /* bits 0-15 */
1629                 u32 reserved:16;        /* bits 16-31 */
1630 #endif
1631         } bits;
1632 } MII_MGMT_STAT_t, *PMII_MGMT_STAT_t;
1633
1634 /*
1635  * structure for MII Management Indicators reg in mac address map.
1636  * located at address 0x5034
1637  */
1638 typedef union _MII_MGMT_INDICATOR_t {
1639         u32 value;
1640         struct {
1641 #ifdef _BIT_FIELDS_HTOL
1642                 u32 reserved:29;        /* bits 3-31 */
1643                 u32 not_valid:1;        /* bit 2 */
1644                 u32 scanning:1; /* bit 1 */
1645                 u32 busy:1;     /* bit 0 */
1646 #else
1647                 u32 busy:1;     /* bit 0 */
1648                 u32 scanning:1; /* bit 1 */
1649                 u32 not_valid:1;        /* bit 2 */
1650                 u32 reserved:29;        /* bits 3-31 */
1651 #endif
1652         } bits;
1653 } MII_MGMT_INDICATOR_t, *PMII_MGMT_INDICATOR_t;
1654
1655 /*
1656  * structure for Interface Control reg in mac address map.
1657  * located at address 0x5038
1658  */
1659 typedef union _MAC_IF_CTRL_t {
1660         u32 value;
1661         struct {
1662 #ifdef _BIT_FIELDS_HTOL
1663                 u32 reset_if_module:1;  /* bit 31 */
1664                 u32 reserved4:3;                /* bit 28-30 */
1665                 u32 tbi_mode:1;         /* bit 27 */
1666                 u32 ghd_mode:1;         /* bit 26 */
1667                 u32 lhd_mode:1;         /* bit 25 */
1668                 u32 phy_mode:1;         /* bit 24 */
1669                 u32 reset_per_mii:1;    /* bit 23 */
1670                 u32 reserved3:6;                /* bits 17-22 */
1671                 u32 speed:1;            /* bit 16 */
1672                 u32 reset_pe100x:1;     /* bit 15 */
1673                 u32 reserved2:4;                /* bits 11-14 */
1674                 u32 force_quiet:1;              /* bit 10 */
1675                 u32 no_cipher:1;                /* bit 9 */
1676                 u32 disable_link_fail:1;        /* bit 8 */
1677                 u32 reset_gpsi:1;               /* bit 7 */
1678                 u32 reserved1:6;                /* bits 1-6 */
1679                 u32 enab_jab_protect:1; /* bit 0 */
1680 #else
1681                 u32 enab_jab_protect:1; /* bit 0 */
1682                 u32 reserved1:6;                /* bits 1-6 */
1683                 u32 reset_gpsi:1;               /* bit 7 */
1684                 u32 disable_link_fail:1;        /* bit 8 */
1685                 u32 no_cipher:1;                /* bit 9 */
1686                 u32 force_quiet:1;              /* bit 10 */
1687                 u32 reserved2:4;                /* bits 11-14 */
1688                 u32 reset_pe100x:1;     /* bit 15 */
1689                 u32 speed:1;            /* bit 16 */
1690                 u32 reserved3:6;                /* bits 17-22 */
1691                 u32 reset_per_mii:1;    /* bit 23 */
1692                 u32 phy_mode:1;         /* bit 24 */
1693                 u32 lhd_mode:1;         /* bit 25 */
1694                 u32 ghd_mode:1;         /* bit 26 */
1695                 u32 tbi_mode:1;         /* bit 27 */
1696                 u32 reserved4:3;                /* bit 28-30 */
1697                 u32 reset_if_module:1;  /* bit 31 */
1698 #endif
1699         } bits;
1700 } MAC_IF_CTRL_t, *PMAC_IF_CTRL_t;
1701
1702 /*
1703  * structure for Interface Status reg in mac address map.
1704  * located at address 0x503C
1705  */
1706 typedef union _MAC_IF_STAT_t {
1707         u32 value;
1708         struct {
1709 #ifdef _BIT_FIELDS_HTOL
1710                 u32 reserved:22;                /* bits 10-31 */
1711                 u32 excess_defer:1;     /* bit 9 */
1712                 u32 clash:1;            /* bit 8 */
1713                 u32 phy_jabber:1;               /* bit 7 */
1714                 u32 phy_link_ok:1;              /* bit 6 */
1715                 u32 phy_full_duplex:1;  /* bit 5 */
1716                 u32 phy_speed:1;                /* bit 4 */
1717                 u32 pe100x_link_fail:1; /* bit 3 */
1718                 u32 pe10t_loss_carrie:1;        /* bit 2 */
1719                 u32 pe10t_sqe_error:1;  /* bit 1 */
1720                 u32 pe10t_jabber:1;     /* bit 0 */
1721 #else
1722                 u32 pe10t_jabber:1;     /* bit 0 */
1723                 u32 pe10t_sqe_error:1;  /* bit 1 */
1724                 u32 pe10t_loss_carrie:1;        /* bit 2 */
1725                 u32 pe100x_link_fail:1; /* bit 3 */
1726                 u32 phy_speed:1;                /* bit 4 */
1727                 u32 phy_full_duplex:1;  /* bit 5 */
1728                 u32 phy_link_ok:1;              /* bit 6 */
1729                 u32 phy_jabber:1;               /* bit 7 */
1730                 u32 clash:1;            /* bit 8 */
1731                 u32 excess_defer:1;     /* bit 9 */
1732                 u32 reserved:22;                /* bits 10-31 */
1733 #endif
1734         } bits;
1735 } MAC_IF_STAT_t, *PMAC_IF_STAT_t;
1736
1737 /*
1738  * structure for Mac Station Address, Part 1 reg in mac address map.
1739  * located at address 0x5040
1740  */
1741 typedef union _MAC_STATION_ADDR1_t {
1742         u32 value;
1743         struct {
1744 #ifdef _BIT_FIELDS_HTOL
1745                 u32 Octet6:8;   /* bits 24-31 */
1746                 u32 Octet5:8;   /* bits 16-23 */
1747                 u32 Octet4:8;   /* bits 8-15 */
1748                 u32 Octet3:8;   /* bits 0-7 */
1749 #else
1750                 u32 Octet3:8;   /* bits 0-7 */
1751                 u32 Octet4:8;   /* bits 8-15 */
1752                 u32 Octet5:8;   /* bits 16-23 */
1753                 u32 Octet6:8;   /* bits 24-31 */
1754 #endif
1755         } bits;
1756 } MAC_STATION_ADDR1_t, *PMAC_STATION_ADDR1_t;
1757
1758 /*
1759  * structure for Mac Station Address, Part 2 reg in mac address map.
1760  * located at address 0x5044
1761  */
1762 typedef union _MAC_STATION_ADDR2_t {
1763         u32 value;
1764         struct {
1765 #ifdef _BIT_FIELDS_HTOL
1766                 u32 Octet2:8;   /* bits 24-31 */
1767                 u32 Octet1:8;   /* bits 16-23 */
1768                 u32 reserved:16;        /* bits 0-15 */
1769 #else
1770                 u32 reserved:16;        /* bit 0-15 */
1771                 u32 Octet1:8;   /* bits 16-23 */
1772                 u32 Octet2:8;   /* bits 24-31 */
1773 #endif
1774         } bits;
1775 } MAC_STATION_ADDR2_t, *PMAC_STATION_ADDR2_t;
1776
1777 /*
1778  * MAC Module of JAGCore Address Mapping
1779  */
1780 typedef struct _MAC_t {                                 /* Location: */
1781         MAC_CFG1_t cfg1;                                /*  0x5000 */
1782         MAC_CFG2_t cfg2;                                /*  0x5004 */
1783         MAC_IPG_t ipg;                                  /*  0x5008 */
1784         MAC_HFDP_t hfdp;                                /*  0x500C */
1785         MAC_MAX_FM_LEN_t max_fm_len;                    /*  0x5010 */
1786         u32 rsv1;                                       /*  0x5014 */
1787         u32 rsv2;                                       /*  0x5018 */
1788         MAC_TEST_t mac_test;                            /*  0x501C */
1789         MII_MGMT_CFG_t mii_mgmt_cfg;                    /*  0x5020 */
1790         MII_MGMT_CMD_t mii_mgmt_cmd;                    /*  0x5024 */
1791         MII_MGMT_ADDR_t mii_mgmt_addr;                  /*  0x5028 */
1792         MII_MGMT_CTRL_t mii_mgmt_ctrl;                  /*  0x502C */
1793         MII_MGMT_STAT_t mii_mgmt_stat;                  /*  0x5030 */
1794         MII_MGMT_INDICATOR_t mii_mgmt_indicator;        /*  0x5034 */
1795         MAC_IF_CTRL_t if_ctrl;                          /*  0x5038 */
1796         MAC_IF_STAT_t if_stat;                          /*  0x503C */
1797         MAC_STATION_ADDR1_t station_addr_1;             /*  0x5040 */
1798         MAC_STATION_ADDR2_t station_addr_2;             /*  0x5044 */
1799 } MAC_t, *PMAC_t;
1800
1801 /* END OF MAC REGISTER ADDRESS MAP */
1802
1803 /* START OF MAC STAT REGISTER ADDRESS MAP */
1804
1805 /*
1806  * structure for Carry Register One and it's Mask Register reg located in mac
1807  * stat address map address 0x6130 and 0x6138.
1808  */
1809 typedef union _MAC_STAT_REG_1_t {
1810         u32 value;
1811         struct {
1812 #ifdef _BIT_FIELDS_HTOL
1813                 u32 tr64:1;     /* bit 31 */
1814                 u32 tr127:1;    /* bit 30 */
1815                 u32 tr255:1;    /* bit 29 */
1816                 u32 tr511:1;    /* bit 28 */
1817                 u32 tr1k:1;     /* bit 27 */
1818                 u32 trmax:1;    /* bit 26 */
1819                 u32 trmgv:1;    /* bit 25 */
1820                 u32 unused:8;   /* bits 17-24 */
1821                 u32 rbyt:1;     /* bit 16 */
1822                 u32 rpkt:1;     /* bit 15 */
1823                 u32 rfcs:1;     /* bit 14 */
1824                 u32 rmca:1;     /* bit 13 */
1825                 u32 rbca:1;     /* bit 12 */
1826                 u32 rxcf:1;     /* bit 11 */
1827                 u32 rxpf:1;     /* bit 10 */
1828                 u32 rxuo:1;     /* bit 9 */
1829                 u32 raln:1;     /* bit 8 */
1830                 u32 rflr:1;     /* bit 7 */
1831                 u32 rcde:1;     /* bit 6 */
1832                 u32 rcse:1;     /* bit 5 */
1833                 u32 rund:1;     /* bit 4 */
1834                 u32 rovr:1;     /* bit 3 */
1835                 u32 rfrg:1;     /* bit 2 */
1836                 u32 rjbr:1;     /* bit 1 */
1837                 u32 rdrp:1;     /* bit 0 */
1838 #else
1839                 u32 rdrp:1;     /* bit 0 */
1840                 u32 rjbr:1;     /* bit 1 */
1841                 u32 rfrg:1;     /* bit 2 */
1842                 u32 rovr:1;     /* bit 3 */
1843                 u32 rund:1;     /* bit 4 */
1844                 u32 rcse:1;     /* bit 5 */
1845                 u32 rcde:1;     /* bit 6 */
1846                 u32 rflr:1;     /* bit 7 */
1847                 u32 raln:1;     /* bit 8 */
1848                 u32 rxuo:1;     /* bit 9 */
1849                 u32 rxpf:1;     /* bit 10 */
1850                 u32 rxcf:1;     /* bit 11 */
1851                 u32 rbca:1;     /* bit 12 */
1852                 u32 rmca:1;     /* bit 13 */
1853                 u32 rfcs:1;     /* bit 14 */
1854                 u32 rpkt:1;     /* bit 15 */
1855                 u32 rbyt:1;     /* bit 16 */
1856                 u32 unused:8;   /* bits 17-24 */
1857                 u32 trmgv:1;    /* bit 25 */
1858                 u32 trmax:1;    /* bit 26 */
1859                 u32 tr1k:1;     /* bit 27 */
1860                 u32 tr511:1;    /* bit 28 */
1861                 u32 tr255:1;    /* bit 29 */
1862                 u32 tr127:1;    /* bit 30 */
1863                 u32 tr64:1;     /* bit 31 */
1864 #endif
1865         } bits;
1866 } MAC_STAT_REG_1_t, *PMAC_STAT_REG_1_t;
1867
1868 /*
1869  * structure for Carry Register Two Mask Register reg in mac stat address map.
1870  * located at address 0x613C
1871  */
1872 typedef union _MAC_STAT_REG_2_t {
1873         u32 value;
1874         struct {
1875 #ifdef _BIT_FIELDS_HTOL
1876                 u32 unused:12;  /* bit 20-31 */
1877                 u32 tjbr:1;     /* bit 19 */
1878                 u32 tfcs:1;     /* bit 18 */
1879                 u32 txcf:1;     /* bit 17 */
1880                 u32 tovr:1;     /* bit 16 */
1881                 u32 tund:1;     /* bit 15 */
1882                 u32 tfrg:1;     /* bit 14 */
1883                 u32 tbyt:1;     /* bit 13 */
1884                 u32 tpkt:1;     /* bit 12 */
1885                 u32 tmca:1;     /* bit 11 */
1886                 u32 tbca:1;     /* bit 10 */
1887                 u32 txpf:1;     /* bit 9 */
1888                 u32 tdfr:1;     /* bit 8 */
1889                 u32 tedf:1;     /* bit 7 */
1890                 u32 tscl:1;     /* bit 6 */
1891                 u32 tmcl:1;     /* bit 5 */
1892                 u32 tlcl:1;     /* bit 4 */
1893                 u32 txcl:1;     /* bit 3 */
1894                 u32 tncl:1;     /* bit 2 */
1895                 u32 tpfh:1;     /* bit 1 */
1896                 u32 tdrp:1;     /* bit 0 */
1897 #else
1898                 u32 tdrp:1;     /* bit 0 */
1899                 u32 tpfh:1;     /* bit 1 */
1900                 u32 tncl:1;     /* bit 2 */
1901                 u32 txcl:1;     /* bit 3 */
1902                 u32 tlcl:1;     /* bit 4 */
1903                 u32 tmcl:1;     /* bit 5 */
1904                 u32 tscl:1;     /* bit 6 */
1905                 u32 tedf:1;     /* bit 7 */
1906                 u32 tdfr:1;     /* bit 8 */
1907                 u32 txpf:1;     /* bit 9 */
1908                 u32 tbca:1;     /* bit 10 */
1909                 u32 tmca:1;     /* bit 11 */
1910                 u32 tpkt:1;     /* bit 12 */
1911                 u32 tbyt:1;     /* bit 13 */
1912                 u32 tfrg:1;     /* bit 14 */
1913                 u32 tund:1;     /* bit 15 */
1914                 u32 tovr:1;     /* bit 16 */
1915                 u32 txcf:1;     /* bit 17 */
1916                 u32 tfcs:1;     /* bit 18 */
1917                 u32 tjbr:1;     /* bit 19 */
1918                 u32 unused:12;  /* bit 20-31 */
1919 #endif
1920         } bits;
1921 } MAC_STAT_REG_2_t, *PMAC_STAT_REG_2_t;
1922
1923 /*
1924  * MAC STATS Module of JAGCore Address Mapping
1925  */
1926 typedef struct _MAC_STAT_t {            /* Location: */
1927         u32 pad[32];            /*  0x6000 - 607C */
1928
1929         /* Tx/Rx 0-64 Byte Frame Counter */
1930         u32 TR64;                       /*  0x6080 */
1931
1932         /* Tx/Rx 65-127 Byte Frame Counter */
1933         u32 TR127;                      /*  0x6084 */
1934
1935         /* Tx/Rx 128-255 Byte Frame Counter */
1936         u32 TR255;                      /*  0x6088 */
1937
1938         /* Tx/Rx 256-511 Byte Frame Counter */
1939         u32 TR511;                      /*  0x608C */
1940
1941         /* Tx/Rx 512-1023 Byte Frame Counter */
1942         u32 TR1K;                       /*  0x6090 */
1943
1944         /* Tx/Rx 1024-1518 Byte Frame Counter */
1945         u32 TRMax;                      /*  0x6094 */
1946
1947         /* Tx/Rx 1519-1522 Byte Good VLAN Frame Count */
1948         u32 TRMgv;                      /*  0x6098 */
1949
1950         /* Rx Byte Counter */
1951         u32 RByt;                       /*  0x609C */
1952
1953         /* Rx Packet Counter */
1954         u32 RPkt;                       /*  0x60A0 */
1955
1956         /* Rx FCS Error Counter */
1957         u32 RFcs;                       /*  0x60A4 */
1958
1959         /* Rx Multicast Packet Counter */
1960         u32 RMca;                       /*  0x60A8 */
1961
1962         /* Rx Broadcast Packet Counter */
1963         u32 RBca;                       /*  0x60AC */
1964
1965         /* Rx Control Frame Packet Counter */
1966         u32 RxCf;                       /*  0x60B0 */
1967
1968         /* Rx Pause Frame Packet Counter */
1969         u32 RxPf;                       /*  0x60B4 */
1970
1971         /* Rx Unknown OP Code Counter */
1972         u32 RxUo;                       /*  0x60B8 */
1973
1974         /* Rx Alignment Error Counter */
1975         u32 RAln;                       /*  0x60BC */
1976
1977         /* Rx Frame Length Error Counter */
1978         u32 RFlr;                       /*  0x60C0 */
1979
1980         /* Rx Code Error Counter */
1981         u32 RCde;                       /*  0x60C4 */
1982
1983         /* Rx Carrier Sense Error Counter */
1984         u32 RCse;                       /*  0x60C8 */
1985
1986         /* Rx Undersize Packet Counter */
1987         u32 RUnd;                       /*  0x60CC */
1988
1989         /* Rx Oversize Packet Counter */
1990         u32 ROvr;                       /*  0x60D0 */
1991
1992         /* Rx Fragment Counter */
1993         u32 RFrg;                       /*  0x60D4 */
1994
1995         /* Rx Jabber Counter */
1996         u32 RJbr;                       /*  0x60D8 */
1997
1998         /* Rx Drop */
1999         u32 RDrp;                       /*  0x60DC */
2000
2001         /* Tx Byte Counter */
2002         u32 TByt;                       /*  0x60E0 */
2003
2004         /* Tx Packet Counter */
2005         u32 TPkt;                       /*  0x60E4 */
2006
2007         /* Tx Multicast Packet Counter */
2008         u32 TMca;                       /*  0x60E8 */
2009
2010         /* Tx Broadcast Packet Counter */
2011         u32 TBca;                       /*  0x60EC */
2012
2013         /* Tx Pause Control Frame Counter */
2014         u32 TxPf;                       /*  0x60F0 */
2015
2016         /* Tx Deferral Packet Counter */
2017         u32 TDfr;                       /*  0x60F4 */
2018
2019         /* Tx Excessive Deferral Packet Counter */
2020         u32 TEdf;                       /*  0x60F8 */
2021
2022         /* Tx Single Collision Packet Counter */
2023         u32 TScl;                       /*  0x60FC */
2024
2025         /* Tx Multiple Collision Packet Counter */
2026         u32 TMcl;                       /*  0x6100 */
2027
2028         /* Tx Late Collision Packet Counter */
2029         u32 TLcl;                       /*  0x6104 */
2030
2031         /* Tx Excessive Collision Packet Counter */
2032         u32 TXcl;                       /*  0x6108 */
2033
2034         /* Tx Total Collision Packet Counter */
2035         u32 TNcl;                       /*  0x610C */
2036
2037         /* Tx Pause Frame Honored Counter */
2038         u32 TPfh;                       /*  0x6110 */
2039
2040         /* Tx Drop Frame Counter */
2041         u32 TDrp;                       /*  0x6114 */
2042
2043         /* Tx Jabber Frame Counter */
2044         u32 TJbr;                       /*  0x6118 */
2045
2046         /* Tx FCS Error Counter */
2047         u32 TFcs;                       /*  0x611C */
2048
2049         /* Tx Control Frame Counter */
2050         u32 TxCf;                       /*  0x6120 */
2051
2052         /* Tx Oversize Frame Counter */
2053         u32 TOvr;                       /*  0x6124 */
2054
2055         /* Tx Undersize Frame Counter */
2056         u32 TUnd;                       /*  0x6128 */
2057
2058         /* Tx Fragments Frame Counter */
2059         u32 TFrg;                       /*  0x612C */
2060
2061         /* Carry Register One Register */
2062         MAC_STAT_REG_1_t Carry1;        /*  0x6130 */
2063
2064         /* Carry Register Two Register */
2065         MAC_STAT_REG_2_t Carry2;        /*  0x6134 */
2066
2067         /* Carry Register One Mask Register */
2068         MAC_STAT_REG_1_t Carry1M;       /*  0x6138 */
2069
2070         /* Carry Register Two Mask Register */
2071         MAC_STAT_REG_2_t Carry2M;       /*  0x613C */
2072 } MAC_STAT_t, *PMAC_STAT_t;
2073
2074 /* END OF MAC STAT REGISTER ADDRESS MAP */
2075
2076
2077 /* START OF MMC REGISTER ADDRESS MAP */
2078
2079 /*
2080  * Main Memory Controller Control reg in mmc address map.
2081  * located at address 0x7000
2082  */
2083
2084 #define ET_MMC_ENABLE           1
2085 #define ET_MMC_ARB_DISABLE      2
2086 #define ET_MMC_RXMAC_DISABLE    4
2087 #define ET_MMC_TXMAC_DISABLE    8
2088 #define ET_MMC_TXDMA_DISABLE    16
2089 #define ET_MMC_RXDMA_DISABLE    32
2090 #define ET_MMC_FORCE_CE         64
2091
2092 /*
2093  * Main Memory Controller Host Memory Access Address reg in mmc
2094  * address map.  Located at address 0x7004. Top 16 bits hold the address bits
2095  */
2096
2097 #define ET_SRAM_REQ_ACCESS      1
2098 #define ET_SRAM_WR_ACCESS       2
2099 #define ET_SRAM_IS_CTRL         4
2100
2101 /*
2102  * structure for Main Memory Controller Host Memory Access Data reg in mmc
2103  * address map.  Located at address 0x7008 - 0x7014
2104  * Defined earlier (u32)
2105  */
2106
2107 /*
2108  * Memory Control Module of JAGCore Address Mapping
2109  */
2110 typedef struct _MMC_t {                 /* Location: */
2111         u32 mmc_ctrl;           /*  0x7000 */
2112         u32 sram_access;        /*  0x7004 */
2113         u32 sram_word1;         /*  0x7008 */
2114         u32 sram_word2;         /*  0x700C */
2115         u32 sram_word3;         /*  0x7010 */
2116         u32 sram_word4;         /*  0x7014 */
2117 } MMC_t, *PMMC_t;
2118
2119 /* END OF MMC REGISTER ADDRESS MAP */
2120
2121
2122 /* START OF EXP ROM REGISTER ADDRESS MAP */
2123
2124 /*
2125  * Expansion ROM Module of JAGCore Address Mapping
2126  */
2127
2128 /* Take this out until it is not empty */
2129 #if 0
2130 typedef struct _EXP_ROM_t {
2131
2132 } EXP_ROM_t, *PEXP_ROM_t;
2133 #endif
2134
2135 /* END OF EXP ROM REGISTER ADDRESS MAP */
2136
2137
2138 /*
2139  * JAGCore Address Mapping
2140  */
2141 typedef struct _ADDRESS_MAP_t {
2142         GLOBAL_t global;
2143         /* unused section of global address map */
2144         u8 unused_global[4096 - sizeof(GLOBAL_t)];
2145         TXDMA_t txdma;
2146         /* unused section of txdma address map */
2147         u8 unused_txdma[4096 - sizeof(TXDMA_t)];
2148         RXDMA_t rxdma;
2149         /* unused section of rxdma address map */
2150         u8 unused_rxdma[4096 - sizeof(RXDMA_t)];
2151         TXMAC_t txmac;
2152         /* unused section of txmac address map */
2153         u8 unused_txmac[4096 - sizeof(TXMAC_t)];
2154         RXMAC_t rxmac;
2155         /* unused section of rxmac address map */
2156         u8 unused_rxmac[4096 - sizeof(RXMAC_t)];
2157         MAC_t mac;
2158         /* unused section of mac address map */
2159         u8 unused_mac[4096 - sizeof(MAC_t)];
2160         MAC_STAT_t macStat;
2161         /* unused section of mac stat address map */
2162         u8 unused_mac_stat[4096 - sizeof(MAC_STAT_t)];
2163         MMC_t mmc;
2164         /* unused section of mmc address map */
2165         u8 unused_mmc[4096 - sizeof(MMC_t)];
2166         /* unused section of address map */
2167         u8 unused_[1015808];
2168
2169 /* Take this out until it is not empty */
2170 #if 0
2171         EXP_ROM_t exp_rom;
2172 #endif
2173
2174         u8 unused_exp_rom[4096];        /* MGS-size TBD */
2175         u8 unused__[524288];    /* unused section of address map */
2176 } ADDRESS_MAP_t, *PADDRESS_MAP_t;
2177
2178 #endif /* _ET1310_ADDRESS_MAP_H_ */