xref: /freebsd/sys/contrib/ncsw/Peripherals/FM/MAC/tgec.h (revision 0aeed3e99367bed5755068d9218cd8041644ff2b)
1*0aeed3e9SJustin Hibbits /* Copyright (c) 2008-2011 Freescale Semiconductor, Inc.
2*0aeed3e9SJustin Hibbits  * All rights reserved.
3*0aeed3e9SJustin Hibbits  *
4*0aeed3e9SJustin Hibbits  * Redistribution and use in source and binary forms, with or without
5*0aeed3e9SJustin Hibbits  * modification, are permitted provided that the following conditions are met:
6*0aeed3e9SJustin Hibbits  *     * Redistributions of source code must retain the above copyright
7*0aeed3e9SJustin Hibbits  *       notice, this list of conditions and the following disclaimer.
8*0aeed3e9SJustin Hibbits  *     * Redistributions in binary form must reproduce the above copyright
9*0aeed3e9SJustin Hibbits  *       notice, this list of conditions and the following disclaimer in the
10*0aeed3e9SJustin Hibbits  *       documentation and/or other materials provided with the distribution.
11*0aeed3e9SJustin Hibbits  *     * Neither the name of Freescale Semiconductor nor the
12*0aeed3e9SJustin Hibbits  *       names of its contributors may be used to endorse or promote products
13*0aeed3e9SJustin Hibbits  *       derived from this software without specific prior written permission.
14*0aeed3e9SJustin Hibbits  *
15*0aeed3e9SJustin Hibbits  *
16*0aeed3e9SJustin Hibbits  * ALTERNATIVELY, this software may be distributed under the terms of the
17*0aeed3e9SJustin Hibbits  * GNU General Public License ("GPL") as published by the Free Software
18*0aeed3e9SJustin Hibbits  * Foundation, either version 2 of that License or (at your option) any
19*0aeed3e9SJustin Hibbits  * later version.
20*0aeed3e9SJustin Hibbits  *
21*0aeed3e9SJustin Hibbits  * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
22*0aeed3e9SJustin Hibbits  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23*0aeed3e9SJustin Hibbits  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24*0aeed3e9SJustin Hibbits  * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
25*0aeed3e9SJustin Hibbits  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26*0aeed3e9SJustin Hibbits  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27*0aeed3e9SJustin Hibbits  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28*0aeed3e9SJustin Hibbits  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29*0aeed3e9SJustin Hibbits  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30*0aeed3e9SJustin Hibbits  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31*0aeed3e9SJustin Hibbits  */
32*0aeed3e9SJustin Hibbits 
33*0aeed3e9SJustin Hibbits /******************************************************************************
34*0aeed3e9SJustin Hibbits  @File          tgec.h
35*0aeed3e9SJustin Hibbits 
36*0aeed3e9SJustin Hibbits  @Description   FM 10G MAC ...
37*0aeed3e9SJustin Hibbits *//***************************************************************************/
38*0aeed3e9SJustin Hibbits #ifndef __TGEC_H
39*0aeed3e9SJustin Hibbits #define __TGEC_H
40*0aeed3e9SJustin Hibbits 
41*0aeed3e9SJustin Hibbits #include "std_ext.h"
42*0aeed3e9SJustin Hibbits #include "error_ext.h"
43*0aeed3e9SJustin Hibbits #include "list_ext.h"
44*0aeed3e9SJustin Hibbits #include "tgec_mii_acc.h"
45*0aeed3e9SJustin Hibbits #include "fm_mac.h"
46*0aeed3e9SJustin Hibbits 
47*0aeed3e9SJustin Hibbits 
48*0aeed3e9SJustin Hibbits /* Interrupt Mask Register (IMASK) */
49*0aeed3e9SJustin Hibbits #define IMASK_MDIO_SCAN_EVENTMDIO   0x00010000  /* MDIO_SCAN_EVENTMDIO scan event interrupt mask.
50*0aeed3e9SJustin Hibbits                                                  * 0 masked
51*0aeed3e9SJustin Hibbits                                                  * 1 enabled
52*0aeed3e9SJustin Hibbits                                                  */
53*0aeed3e9SJustin Hibbits #define IMASK_MDIO_CMD_CMPL         0x00008000  /* 16 MDIO_CMD_CMPL MDIO command completion interrupt mask.
54*0aeed3e9SJustin Hibbits                                                  * 0 masked
55*0aeed3e9SJustin Hibbits                                                  * 1 enabled
56*0aeed3e9SJustin Hibbits                                                  */
57*0aeed3e9SJustin Hibbits #define IMASK_REM_FAULT             0x00004000  /* 17 REM_FAULT Remote fault interrupt mask.
58*0aeed3e9SJustin Hibbits                                                  * 0 masked
59*0aeed3e9SJustin Hibbits                                                  * 1 enabled
60*0aeed3e9SJustin Hibbits                                                  */
61*0aeed3e9SJustin Hibbits #define IMASK_LOC_FAULT             0x00002000  /* 18 LOC_FAULT Local fault interrupt mask.
62*0aeed3e9SJustin Hibbits                                                  * 0 masked
63*0aeed3e9SJustin Hibbits                                                  * 1 enabled
64*0aeed3e9SJustin Hibbits                                                  */
65*0aeed3e9SJustin Hibbits #define IMASK_1TX_ECC_ER            0x00001000  /* 19 TX_ECC_ER Transmit frame ECC error interrupt mask.
66*0aeed3e9SJustin Hibbits                                                  * 0 masked
67*0aeed3e9SJustin Hibbits                                                  * 1 enabled
68*0aeed3e9SJustin Hibbits                                                  */
69*0aeed3e9SJustin Hibbits #define IMASK_TX_FIFO_UNFL          0x00000800  /* 20 TX_FIFO_UNFL Transmit FIFO underflow interrupt mask.
70*0aeed3e9SJustin Hibbits                                                  * 0 masked
71*0aeed3e9SJustin Hibbits                                                  * 1 enabled
72*0aeed3e9SJustin Hibbits                                                  */
73*0aeed3e9SJustin Hibbits #define IMASK_TX_FIFO_OVFL          0x00000400  /* 21 TX_FIFO_OVFL Transmit FIFO overflow interrupt mask.
74*0aeed3e9SJustin Hibbits                                                  * 0 masked
75*0aeed3e9SJustin Hibbits                                                  * 1 enabled
76*0aeed3e9SJustin Hibbits                                                  */
77*0aeed3e9SJustin Hibbits #define IMASK_TX_ER                 0x00000200  /* 22 TX_ER Transmit frame error interrupt mask.
78*0aeed3e9SJustin Hibbits                                                  * 0 masked
79*0aeed3e9SJustin Hibbits                                                  * 1 enabled
80*0aeed3e9SJustin Hibbits                                                  */
81*0aeed3e9SJustin Hibbits #define IMASK_RX_FIFO_OVFL          0x00000100  /* 23 RX_FIFO_OVFL Receive FIFO overflow interrupt mask.
82*0aeed3e9SJustin Hibbits                                                  * 0 masked
83*0aeed3e9SJustin Hibbits                                                  * 1 enabled
84*0aeed3e9SJustin Hibbits                                                  */
85*0aeed3e9SJustin Hibbits #define IMASK_RX_ECC_ER             0x00000080  /* 24 RX_ECC_ER Receive frame ECC error interrupt mask.
86*0aeed3e9SJustin Hibbits                                                  * 0 masked
87*0aeed3e9SJustin Hibbits                                                  * 1 enabled
88*0aeed3e9SJustin Hibbits                                                  */
89*0aeed3e9SJustin Hibbits #define IMASK_RX_JAB_FRM            0x00000040  /* 25 RX_JAB_FRM Receive jabber frame interrupt mask.
90*0aeed3e9SJustin Hibbits                                                  * 0 masked
91*0aeed3e9SJustin Hibbits                                                  * 1 enabled
92*0aeed3e9SJustin Hibbits                                                  */
93*0aeed3e9SJustin Hibbits #define IMASK_RX_OVRSZ_FRM          0x00000020  /* 26 RX_OVRSZ_FRM Receive oversized frame interrupt mask.
94*0aeed3e9SJustin Hibbits                                                  * 0 masked
95*0aeed3e9SJustin Hibbits                                                  * 1 enabled
96*0aeed3e9SJustin Hibbits                                                  */
97*0aeed3e9SJustin Hibbits #define IMASK_RX_RUNT_FRM           0x00000010  /* 27 RX_RUNT_FRM Receive runt frame interrupt mask.
98*0aeed3e9SJustin Hibbits                                                  * 0 masked
99*0aeed3e9SJustin Hibbits                                                  * 1 enabled
100*0aeed3e9SJustin Hibbits                                                  */
101*0aeed3e9SJustin Hibbits #define IMASK_RX_FRAG_FRM           0x00000008  /* 28 RX_FRAG_FRM Receive fragment frame interrupt mask.
102*0aeed3e9SJustin Hibbits                                                  * 0 masked
103*0aeed3e9SJustin Hibbits                                                  * 1 enabled
104*0aeed3e9SJustin Hibbits                                                  */
105*0aeed3e9SJustin Hibbits #define IMASK_RX_LEN_ER             0x00000004  /* 29 RX_LEN_ER Receive payload length error interrupt mask.
106*0aeed3e9SJustin Hibbits                                                  * 0 masked
107*0aeed3e9SJustin Hibbits                                                  * 1 enabled
108*0aeed3e9SJustin Hibbits                                                  */
109*0aeed3e9SJustin Hibbits #define IMASK_RX_CRC_ER             0x00000002  /* 30 RX_CRC_ER Receive CRC error interrupt mask.
110*0aeed3e9SJustin Hibbits                                                  * 0 masked
111*0aeed3e9SJustin Hibbits                                                  * 1 enabled
112*0aeed3e9SJustin Hibbits                                                  */
113*0aeed3e9SJustin Hibbits #define IMASK_RX_ALIGN_ER           0x00000001  /* 31 RX_ALIGN_ER Receive alignment error interrupt mask.
114*0aeed3e9SJustin Hibbits                                                  * 0 masked
115*0aeed3e9SJustin Hibbits                                                  * 1 enabled
116*0aeed3e9SJustin Hibbits                                                  */
117*0aeed3e9SJustin Hibbits 
118*0aeed3e9SJustin Hibbits #define EVENTS_MASK                 ((uint32_t)(IMASK_MDIO_SCAN_EVENTMDIO |  \
119*0aeed3e9SJustin Hibbits                                                 IMASK_MDIO_CMD_CMPL       |  \
120*0aeed3e9SJustin Hibbits                                                 IMASK_REM_FAULT           |  \
121*0aeed3e9SJustin Hibbits                                                 IMASK_LOC_FAULT           |  \
122*0aeed3e9SJustin Hibbits                                                 IMASK_1TX_ECC_ER          |  \
123*0aeed3e9SJustin Hibbits                                                 IMASK_TX_FIFO_UNFL        |  \
124*0aeed3e9SJustin Hibbits                                                 IMASK_TX_FIFO_OVFL        |  \
125*0aeed3e9SJustin Hibbits                                                 IMASK_TX_ER               |  \
126*0aeed3e9SJustin Hibbits                                                 IMASK_RX_FIFO_OVFL        |  \
127*0aeed3e9SJustin Hibbits                                                 IMASK_RX_ECC_ER           |  \
128*0aeed3e9SJustin Hibbits                                                 IMASK_RX_JAB_FRM          |  \
129*0aeed3e9SJustin Hibbits                                                 IMASK_RX_OVRSZ_FRM        |  \
130*0aeed3e9SJustin Hibbits                                                 IMASK_RX_RUNT_FRM         |  \
131*0aeed3e9SJustin Hibbits                                                 IMASK_RX_FRAG_FRM         |  \
132*0aeed3e9SJustin Hibbits                                                 IMASK_RX_LEN_ER           |  \
133*0aeed3e9SJustin Hibbits                                                 IMASK_RX_CRC_ER           |  \
134*0aeed3e9SJustin Hibbits                                                 IMASK_RX_ALIGN_ER))
135*0aeed3e9SJustin Hibbits 
136*0aeed3e9SJustin Hibbits #define GET_EXCEPTION_FLAG(bitMask, exception)       switch(exception){ \
137*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_MDIO_SCAN_EVENTMDIO:                                    \
138*0aeed3e9SJustin Hibbits         bitMask = IMASK_MDIO_SCAN_EVENTMDIO; break;                              \
139*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_MDIO_CMD_CMPL:                                          \
140*0aeed3e9SJustin Hibbits         bitMask = IMASK_MDIO_CMD_CMPL      ; break;                              \
141*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_REM_FAULT:                                              \
142*0aeed3e9SJustin Hibbits         bitMask = IMASK_REM_FAULT          ; break;                              \
143*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_LOC_FAULT:                                              \
144*0aeed3e9SJustin Hibbits         bitMask = IMASK_LOC_FAULT          ; break;                              \
145*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_1TX_ECC_ER:                                             \
146*0aeed3e9SJustin Hibbits         bitMask = IMASK_1TX_ECC_ER         ; break;                              \
147*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_TX_FIFO_UNFL:                                           \
148*0aeed3e9SJustin Hibbits         bitMask = IMASK_TX_FIFO_UNFL       ; break;                              \
149*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_TX_FIFO_OVFL:                                           \
150*0aeed3e9SJustin Hibbits         bitMask = IMASK_TX_FIFO_OVFL       ; break;                              \
151*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_TX_ER:                                                  \
152*0aeed3e9SJustin Hibbits         bitMask = IMASK_TX_ER              ; break;                              \
153*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_RX_FIFO_OVFL:                                           \
154*0aeed3e9SJustin Hibbits         bitMask = IMASK_RX_FIFO_OVFL       ; break;                              \
155*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_RX_ECC_ER:                                              \
156*0aeed3e9SJustin Hibbits         bitMask = IMASK_RX_ECC_ER          ; break;                              \
157*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_RX_JAB_FRM:                                             \
158*0aeed3e9SJustin Hibbits         bitMask = IMASK_RX_JAB_FRM         ; break;                              \
159*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_RX_OVRSZ_FRM:                                           \
160*0aeed3e9SJustin Hibbits         bitMask = IMASK_RX_OVRSZ_FRM       ; break;                              \
161*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_RX_RUNT_FRM:                                            \
162*0aeed3e9SJustin Hibbits         bitMask = IMASK_RX_RUNT_FRM        ; break;                              \
163*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_RX_FRAG_FRM:                                            \
164*0aeed3e9SJustin Hibbits         bitMask = IMASK_RX_FRAG_FRM        ; break;                              \
165*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_RX_LEN_ER:                                              \
166*0aeed3e9SJustin Hibbits         bitMask = IMASK_RX_LEN_ER          ; break;                              \
167*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_RX_CRC_ER:                                              \
168*0aeed3e9SJustin Hibbits         bitMask = IMASK_RX_CRC_ER          ; break;                              \
169*0aeed3e9SJustin Hibbits     case e_FM_MAC_EX_10G_RX_ALIGN_ER:                                            \
170*0aeed3e9SJustin Hibbits         bitMask = IMASK_RX_ALIGN_ER        ; break;                              \
171*0aeed3e9SJustin Hibbits     default: bitMask = 0;break;}
172*0aeed3e9SJustin Hibbits 
173*0aeed3e9SJustin Hibbits 
174*0aeed3e9SJustin Hibbits /* Default Config Params */
175*0aeed3e9SJustin Hibbits #define DEFAULT_wanModeEnable               FALSE
176*0aeed3e9SJustin Hibbits #define DEFAULT_promiscuousModeEnable       FALSE
177*0aeed3e9SJustin Hibbits 
178*0aeed3e9SJustin Hibbits 
179*0aeed3e9SJustin Hibbits #define DEFAULT_pauseForwardEnable          FALSE
180*0aeed3e9SJustin Hibbits #define DEFAULT_pauseIgnore                 FALSE
181*0aeed3e9SJustin Hibbits #define DEFAULT_txAddrInsEnable             FALSE
182*0aeed3e9SJustin Hibbits 
183*0aeed3e9SJustin Hibbits #define DEFAULT_loopbackEnable              FALSE
184*0aeed3e9SJustin Hibbits #define DEFAULT_cmdFrameEnable              FALSE
185*0aeed3e9SJustin Hibbits #define DEFAULT_rxErrorDiscard              FALSE
186*0aeed3e9SJustin Hibbits #define DEFAULT_phyTxenaOn                  FALSE
187*0aeed3e9SJustin Hibbits #define DEFAULT_sendIdleEnable              FALSE
188*0aeed3e9SJustin Hibbits #define DEFAULT_noLengthCheckEnable         TRUE
189*0aeed3e9SJustin Hibbits #define DEFAULT_lgthCheckNostdr             FALSE
190*0aeed3e9SJustin Hibbits #define DEFAULT_timeStampEnable             FALSE
191*0aeed3e9SJustin Hibbits #define DEFAULT_rxSfdAny                    FALSE
192*0aeed3e9SJustin Hibbits #define DEFAULT_rxPblFwd                    FALSE
193*0aeed3e9SJustin Hibbits #define DEFAULT_txPblFwd                    FALSE
194*0aeed3e9SJustin Hibbits #define DEFAULT_txIpgLength                 12
195*0aeed3e9SJustin Hibbits 
196*0aeed3e9SJustin Hibbits #define DEFAULT_maxFrameLength              0x600
197*0aeed3e9SJustin Hibbits 
198*0aeed3e9SJustin Hibbits #define DEFAULT_debugMode                   FALSE
199*0aeed3e9SJustin Hibbits #define DEFAULT_pauseTime                   0xf000
200*0aeed3e9SJustin Hibbits #define DEFAULT_imask                       0xf000
201*0aeed3e9SJustin Hibbits #ifdef FM_TX_ECC_FRMS_ERRATA_10GMAC_A004
202*0aeed3e9SJustin Hibbits #define DEFAULT_skipFman11Workaround        FALSE
203*0aeed3e9SJustin Hibbits #endif /* FM_TX_ECC_FRMS_ERRATA_10GMAC_A004 */
204*0aeed3e9SJustin Hibbits 
205*0aeed3e9SJustin Hibbits #define DEFAULT_exceptions          ((uint32_t)(IMASK_MDIO_SCAN_EVENTMDIO |  \
206*0aeed3e9SJustin Hibbits                                                 IMASK_REM_FAULT           |  \
207*0aeed3e9SJustin Hibbits                                                 IMASK_LOC_FAULT           |  \
208*0aeed3e9SJustin Hibbits                                                 IMASK_1TX_ECC_ER          |  \
209*0aeed3e9SJustin Hibbits                                                 IMASK_TX_FIFO_UNFL        |  \
210*0aeed3e9SJustin Hibbits                                                 IMASK_TX_FIFO_OVFL        |  \
211*0aeed3e9SJustin Hibbits                                                 IMASK_TX_ER               |  \
212*0aeed3e9SJustin Hibbits                                                 IMASK_RX_FIFO_OVFL        |  \
213*0aeed3e9SJustin Hibbits                                                 IMASK_RX_ECC_ER           |  \
214*0aeed3e9SJustin Hibbits                                                 IMASK_RX_JAB_FRM          |  \
215*0aeed3e9SJustin Hibbits                                                 IMASK_RX_OVRSZ_FRM        |  \
216*0aeed3e9SJustin Hibbits                                                 IMASK_RX_RUNT_FRM         |  \
217*0aeed3e9SJustin Hibbits                                                 IMASK_RX_FRAG_FRM         |  \
218*0aeed3e9SJustin Hibbits                                                 IMASK_RX_CRC_ER           |  \
219*0aeed3e9SJustin Hibbits                                                 IMASK_RX_ALIGN_ER))
220*0aeed3e9SJustin Hibbits 
221*0aeed3e9SJustin Hibbits #define MAX_PACKET_ALIGNMENT        31
222*0aeed3e9SJustin Hibbits #define MAX_INTER_PACKET_GAP        0x7f
223*0aeed3e9SJustin Hibbits #define MAX_INTER_PALTERNATE_BEB    0x0f
224*0aeed3e9SJustin Hibbits #define MAX_RETRANSMISSION          0x0f
225*0aeed3e9SJustin Hibbits #define MAX_COLLISION_WINDOW        0x03ff
226*0aeed3e9SJustin Hibbits 
227*0aeed3e9SJustin Hibbits 
228*0aeed3e9SJustin Hibbits #define TGEC_NUM_OF_PADDRS          1                   /* number of pattern match registers (entries) */
229*0aeed3e9SJustin Hibbits 
230*0aeed3e9SJustin Hibbits #define GROUP_ADDRESS               0x0000010000000000LL /* Group address bit indication */
231*0aeed3e9SJustin Hibbits 
232*0aeed3e9SJustin Hibbits #define HASH_TABLE_SIZE             512                 /* Hash table size (= 32 bits * 8 regs) */
233*0aeed3e9SJustin Hibbits 
234*0aeed3e9SJustin Hibbits #define TGEC_TO_MII_OFFSET          0x1030              /* Offset from the MEM map to the MDIO mem map */
235*0aeed3e9SJustin Hibbits 
236*0aeed3e9SJustin Hibbits /* 10-gigabit Ethernet MAC Controller ID (10GEC_ID) */
237*0aeed3e9SJustin Hibbits #define TGEC_ID_ID                  0xffff0000
238*0aeed3e9SJustin Hibbits #define TGEC_ID_MAC_VERSION         0x0000FF00
239*0aeed3e9SJustin Hibbits #define TGEC_ID_MAC_REV             0x000000ff
240*0aeed3e9SJustin Hibbits 
241*0aeed3e9SJustin Hibbits /* Command and Configuration Register (COMMAND_CONFIG) */
242*0aeed3e9SJustin Hibbits #define CMD_CFG_TX_PBL_FWD          0x00800000  /* 08 Transmit Preamble Forwarding (custom preamble).
243*0aeed3e9SJustin Hibbits                                                  */
244*0aeed3e9SJustin Hibbits #define CMD_CFG_RX_PBL_FWD          0x00400000  /* 09 Receive Preamble Forwarding (custom preamble).
245*0aeed3e9SJustin Hibbits                                                  */
246*0aeed3e9SJustin Hibbits #define RX_SFD_ANY                  0x00200000  /* 10 Enables, when set, that any character is allowed at the SFD position of the preamble and the frame will be accepted.
247*0aeed3e9SJustin Hibbits                                                  */
248*0aeed3e9SJustin Hibbits #define CMD_CFG_EN_TIMESTAMP        0x00100000  /* 11 EN_TIMESTAMP IEEE 1588 timeStamp functionality control.
249*0aeed3e9SJustin Hibbits                                                  * 0 disabled
250*0aeed3e9SJustin Hibbits                                                  * 1 enabled
251*0aeed3e9SJustin Hibbits                                                  */
252*0aeed3e9SJustin Hibbits #define CMD_CFG_TX_ADDR_INS_SEL     0x00080000  /* 12 TX_ADDR_INS_SEL Transmit MAC address select
253*0aeed3e9SJustin Hibbits                                                  * 0 insert using first MAC address
254*0aeed3e9SJustin Hibbits                                                  * 1 insert using second MAC address
255*0aeed3e9SJustin Hibbits                                                  */
256*0aeed3e9SJustin Hibbits #define CMD_CFG_LEN_CHK_NOSTDR      0x00040000  /* 13 LEN_CHK_NOSTDR
257*0aeed3e9SJustin Hibbits                                                  */
258*0aeed3e9SJustin Hibbits #define CMD_CFG_NO_LEN_CHK          0x00020000  /* 14 NO_LEN_CHK Payload length check disable
259*0aeed3e9SJustin Hibbits                                                  * 0 MAC compares the frame payload length with the frame length/type field.
260*0aeed3e9SJustin Hibbits                                                  * 1 Payload length check is disabled.
261*0aeed3e9SJustin Hibbits                                                  */
262*0aeed3e9SJustin Hibbits #define CMD_CFG_SEND_IDLE           0x00010000  /* 15 SEND_IDLE Force idle generation
263*0aeed3e9SJustin Hibbits                                                  * 0 Normal operation.
264*0aeed3e9SJustin Hibbits                                                 * 1 MAC permanently sends XGMII idle sequences even when faults are received.
265*0aeed3e9SJustin Hibbits                                                  */
266*0aeed3e9SJustin Hibbits #define CMD_CFG_PHY_TX_EN           0x00008000  /* 16 PHY_TX_EN PHY transmit enable
267*0aeed3e9SJustin Hibbits                                                  * 0 PHY transmit is disabled.
268*0aeed3e9SJustin Hibbits                                                  * 1 PHY transmit is enabled.
269*0aeed3e9SJustin Hibbits                                                  */
270*0aeed3e9SJustin Hibbits #define CMD_CFG_RX_ER_DISC          0x00004000  /* 17 RX_ER_DISC Receive error frame discard enable
271*0aeed3e9SJustin Hibbits                                                  * 0 Received error frames are processed.
272*0aeed3e9SJustin Hibbits                                                  * 1 Any frame received with an error is discarded.
273*0aeed3e9SJustin Hibbits                                                  */
274*0aeed3e9SJustin Hibbits #define CMD_CFG_CMD_FRM_EN          0x00002000  /* 18 CMD_FRM_EN Command frame reception enable
275*0aeed3e9SJustin Hibbits                                                  * 0 Only Pause frames are accepted (all other command frames are rejected).
276*0aeed3e9SJustin Hibbits                                                  * 1 All command frames are accepted.
277*0aeed3e9SJustin Hibbits                                                  */
278*0aeed3e9SJustin Hibbits #define CMD_CFG_STAT_CLR            0x00001000  /* 19 STAT_CLR Clear statistics
279*0aeed3e9SJustin Hibbits                                                  * 0 Normal operations.
280*0aeed3e9SJustin Hibbits                                                  * 1 All statistics counters are cleared.
281*0aeed3e9SJustin Hibbits                                                  */
282*0aeed3e9SJustin Hibbits #define CMD_CFG_LOOPBACK_EN         0x00000400  /* 21 LOOPBAC_EN PHY interface loopback enable
283*0aeed3e9SJustin Hibbits                                                  * 0 Configure PHY for normal operation.
284*0aeed3e9SJustin Hibbits                                                  * 1 Configure PHY for loopback mode.
285*0aeed3e9SJustin Hibbits                                                  */
286*0aeed3e9SJustin Hibbits #define CMD_CFG_TX_ADDR_INS         0x00000200  /* 22 TX_ADDR_INS Transmit source MAC address insertion
287*0aeed3e9SJustin Hibbits                                                  * 0 MAC transmits the source MAC address unmodified.
288*0aeed3e9SJustin Hibbits                                                  * 1 MAC overwrites the source MAC address with address specified by COMMAND_CONFIG[TX_ADDR_INS_SEL].
289*0aeed3e9SJustin Hibbits                                                  */
290*0aeed3e9SJustin Hibbits #define CMD_CFG_PAUSE_IGNORE        0x00000100  /* 23 PAUSE_IGNORE Ignore Pause frame quanta
291*0aeed3e9SJustin Hibbits                                                  * 0 MAC stops transmit process for the duration specified in the Pause frame quanta of a received Pause frame.
292*0aeed3e9SJustin Hibbits                                                  * 1 MAC ignores received Pause frames.
293*0aeed3e9SJustin Hibbits                                                  */
294*0aeed3e9SJustin Hibbits #define CMD_CFG_PAUSE_FWD           0x00000080  /* 24 PAUSE_FWD Terminate/forward received Pause frames
295*0aeed3e9SJustin Hibbits                                                  * 0 MAC terminates and discards received Pause frames.
296*0aeed3e9SJustin Hibbits                                                  * 1 MAC forwards Pause frames to the user application.
297*0aeed3e9SJustin Hibbits                                                  */
298*0aeed3e9SJustin Hibbits #define CMD_CFG_PROMIS_EN           0x00000010  /* 27 PROMIS_EN Promiscuous operation enable
299*0aeed3e9SJustin Hibbits                                                  * 0 Unicast frames with a destination address not matching the core MAC address (defined by registers, MAC_ADDR_0 and MAC_ADDR_1) are rejected.
300*0aeed3e9SJustin Hibbits                                                  * 1 All frames are received without any MAC address filtering.
301*0aeed3e9SJustin Hibbits                                                  */
302*0aeed3e9SJustin Hibbits #define CMD_CFG_WAN_MODE            0x00000008  /* 28 WAN_MODE WAN mode enable
303*0aeed3e9SJustin Hibbits                                                  * 0 Configure MAC for LAN mode.
304*0aeed3e9SJustin Hibbits                                                  * 1 Configure MAC for WAN mode.
305*0aeed3e9SJustin Hibbits                                                  */
306*0aeed3e9SJustin Hibbits #define CMD_CFG_RX_EN               0x00000002  /* 30 RX_EN MAC receive path enable
307*0aeed3e9SJustin Hibbits                                                  * 0 MAC receive path is disabled
308*0aeed3e9SJustin Hibbits                                                  * 1 MAC receive path is enabled.
309*0aeed3e9SJustin Hibbits                                                  */
310*0aeed3e9SJustin Hibbits #define CMD_CFG_TX_EN               0x00000001  /* 31 TX_EN MAC transmit path enable
311*0aeed3e9SJustin Hibbits                                                  * 0 MAC transmit path is disabled
312*0aeed3e9SJustin Hibbits                                                  * 1 MAC transmit path is enabled.
313*0aeed3e9SJustin Hibbits                                                  */
314*0aeed3e9SJustin Hibbits 
315*0aeed3e9SJustin Hibbits /* Hashtable Control Register (HASHTABLE_CTRL) */
316*0aeed3e9SJustin Hibbits #define HASH_CTRL_MCAST_SHIFT       23
317*0aeed3e9SJustin Hibbits 
318*0aeed3e9SJustin Hibbits #define HASH_CTRL_MCAST_RD          0x00000400  /* 22 MCAST_READ Entry Multicast frame reception for the hash entry.
319*0aeed3e9SJustin Hibbits                                                  * 0 disabled
320*0aeed3e9SJustin Hibbits                                                  * 1 enabled
321*0aeed3e9SJustin Hibbits                                                  */
322*0aeed3e9SJustin Hibbits #define HASH_CTRL_MCAST_EN          0x00000200  /* 22 MCAST_EN Multicast frame reception for the hash entry.
323*0aeed3e9SJustin Hibbits                                                  * 0 disabled
324*0aeed3e9SJustin Hibbits                                                  * 1 enabled
325*0aeed3e9SJustin Hibbits                                                  */
326*0aeed3e9SJustin Hibbits #define HASH_ADDR_MASK              0x000001ff  /* 23-31 HASH_ADDR Hash table address code.
327*0aeed3e9SJustin Hibbits                                                  */
328*0aeed3e9SJustin Hibbits 
329*0aeed3e9SJustin Hibbits /* Transmit Inter-Packet Gap Length Register (TX_IPG_LENGTH) */
330*0aeed3e9SJustin Hibbits #define TX_IPG_LENGTH_MASK          0x000003ff
331*0aeed3e9SJustin Hibbits 
332*0aeed3e9SJustin Hibbits 
333*0aeed3e9SJustin Hibbits 
334*0aeed3e9SJustin Hibbits #if defined(__MWERKS__) && !defined(__GNUC__)
335*0aeed3e9SJustin Hibbits #pragma pack(push,1)
336*0aeed3e9SJustin Hibbits #endif /* defined(__MWERKS__) && ... */
337*0aeed3e9SJustin Hibbits #define MEM_MAP_START
338*0aeed3e9SJustin Hibbits 
339*0aeed3e9SJustin Hibbits /*
340*0aeed3e9SJustin Hibbits  * 10G memory map
341*0aeed3e9SJustin Hibbits  */
342*0aeed3e9SJustin Hibbits typedef _Packed struct {
343*0aeed3e9SJustin Hibbits /* 10Ge General Control and Status */
344*0aeed3e9SJustin Hibbits     volatile uint32_t   tgec_id;            /* 0x000 10GEC_ID - Controller ID register */
345*0aeed3e9SJustin Hibbits     volatile uint32_t   scratch;            /* 0x004  */
346*0aeed3e9SJustin Hibbits     volatile uint32_t   cmd_conf_ctrl;      /* 0x008 COMMAND_CONFIG - Control and configuration register */
347*0aeed3e9SJustin Hibbits     volatile uint32_t   mac_addr_0;         /* 0x00C MAC_ADDR_0 - Lower 32 bits of the first 48-bit MAC address */
348*0aeed3e9SJustin Hibbits     volatile uint32_t   mac_addr_1;         /* 0x010 MAC_ADDR_1 - Upper 16 bits of the first 48-bit MAC address */
349*0aeed3e9SJustin Hibbits     volatile uint32_t   maxfrm;             /* 0x014 MAXFRM - Maximum frame length register */
350*0aeed3e9SJustin Hibbits     volatile uint32_t   pause_quant;        /* 0x018 PAUSE_QUANT - Pause quanta register */
351*0aeed3e9SJustin Hibbits     volatile uint32_t   rx_fifo_sections;   /* 0x01c  */
352*0aeed3e9SJustin Hibbits     volatile uint32_t   tx_fifo_sections;   /* 0x020  */
353*0aeed3e9SJustin Hibbits     volatile uint32_t   rx_fifo_almost_f_e; /* 0x024  */
354*0aeed3e9SJustin Hibbits     volatile uint32_t   tx_fifo_almost_f_e; /* 0x028  */
355*0aeed3e9SJustin Hibbits     volatile uint32_t   hashtable_ctrl;     /* 0x02C HASHTABLE_CTRL - Hash table control register */
356*0aeed3e9SJustin Hibbits     volatile uint32_t   mdio_cfg_status;    /* 0x030  */
357*0aeed3e9SJustin Hibbits     volatile uint32_t   mdio_command;       /* 0x034  */
358*0aeed3e9SJustin Hibbits     volatile uint32_t   mdio_data;          /* 0x038  */
359*0aeed3e9SJustin Hibbits     volatile uint32_t   mdio_regaddr;       /* 0x03c  */
360*0aeed3e9SJustin Hibbits     volatile uint32_t   status;             /* 0x040  */
361*0aeed3e9SJustin Hibbits     volatile uint32_t   tx_ipg_len;         /* 0x044 TX_IPG_LENGTH - Transmitter inter-packet-gap register */
362*0aeed3e9SJustin Hibbits     volatile uint32_t   mac_addr_2;         /* 0x048 MAC_ADDR_2 - Lower 32 bits of the second 48-bit MAC address */
363*0aeed3e9SJustin Hibbits     volatile uint32_t   mac_addr_3;         /* 0x04C MAC_ADDR_3 - Upper 16 bits of the second 48-bit MAC address */
364*0aeed3e9SJustin Hibbits     volatile uint32_t   rx_fifo_ptr_rd;     /* 0x050  */
365*0aeed3e9SJustin Hibbits     volatile uint32_t   rx_fifo_ptr_wr;     /* 0x054  */
366*0aeed3e9SJustin Hibbits     volatile uint32_t   tx_fifo_ptr_rd;     /* 0x058  */
367*0aeed3e9SJustin Hibbits     volatile uint32_t   tx_fifo_ptr_wr;     /* 0x05c  */
368*0aeed3e9SJustin Hibbits     volatile uint32_t   imask;              /* 0x060 IMASK - Interrupt mask register */
369*0aeed3e9SJustin Hibbits     volatile uint32_t   ievent;             /* 0x064 IEVENT - Interrupt event register */
370*0aeed3e9SJustin Hibbits     volatile uint32_t   udp_port;           /* 0x068 Defines a UDP Port number. When an UDP/IP frame is received with a matching UDP destination port, the receive status indication pin ff_rx_ts_frm will be asserted.*/
371*0aeed3e9SJustin Hibbits     volatile uint32_t   type_1588v2;        /* 0x06c Type field for 1588v2 layer 2 frames. IEEE1588 defines the type 0x88f7 for 1588 frames. */
372*0aeed3e9SJustin Hibbits     volatile uint32_t   TENGEC_RESERVED4[4];
373*0aeed3e9SJustin Hibbits /*10Ge Statistics Counter */
374*0aeed3e9SJustin Hibbits     volatile uint64_t   TFRM;        /* 80 aFramesTransmittedOK */
375*0aeed3e9SJustin Hibbits     volatile uint64_t   RFRM;        /* 88 aFramesReceivedOK */
376*0aeed3e9SJustin Hibbits     volatile uint64_t   RFCS;        /* 90 aFrameCheckSequenceErrors */
377*0aeed3e9SJustin Hibbits     volatile uint64_t   RALN;        /* 98 aAlignmentErrors */
378*0aeed3e9SJustin Hibbits     volatile uint64_t   TXPF;        /* A0 aPAUSEMACCtrlFramesTransmitted */
379*0aeed3e9SJustin Hibbits     volatile uint64_t   RXPF;        /* A8 aPAUSEMACCtrlFramesReceived */
380*0aeed3e9SJustin Hibbits     volatile uint64_t   RLONG;       /* B0 aFrameTooLongErrors */
381*0aeed3e9SJustin Hibbits     volatile uint64_t   RFLR;        /* B8 aInRangeLengthErrors */
382*0aeed3e9SJustin Hibbits     volatile uint64_t   TVLAN;       /* C0 VLANTransmittedOK */
383*0aeed3e9SJustin Hibbits     volatile uint64_t   RVLAN;       /* C8 VLANReceivedOK */
384*0aeed3e9SJustin Hibbits     volatile uint64_t   TOCT;        /* D0 ifOutOctets */
385*0aeed3e9SJustin Hibbits     volatile uint64_t   ROCT;        /* D8 ifInOctets */
386*0aeed3e9SJustin Hibbits     volatile uint64_t   RUCA;        /* E0 ifInUcastPkts */
387*0aeed3e9SJustin Hibbits     volatile uint64_t   RMCA;        /* E8 ifInMulticastPkts */
388*0aeed3e9SJustin Hibbits     volatile uint64_t   RBCA;        /* F0 ifInBroadcastPkts */
389*0aeed3e9SJustin Hibbits     volatile uint64_t   TERR;        /* F8 ifOutErrors */
390*0aeed3e9SJustin Hibbits     volatile uint32_t   TENGEC_RESERVED6[2];
391*0aeed3e9SJustin Hibbits     volatile uint64_t   TUCA;        /* 108 ifOutUcastPkts */
392*0aeed3e9SJustin Hibbits     volatile uint64_t   TMCA;        /* 110 ifOutMulticastPkts */
393*0aeed3e9SJustin Hibbits     volatile uint64_t   TBCA;        /* 118 ifOutBroadcastPkts */
394*0aeed3e9SJustin Hibbits     volatile uint64_t   RDRP;        /* 120 etherStatsDropEvents */
395*0aeed3e9SJustin Hibbits     volatile uint64_t   REOCT;       /* 128 etherStatsOctets */
396*0aeed3e9SJustin Hibbits     volatile uint64_t   RPKT;        /* 130 etherStatsPkts */
397*0aeed3e9SJustin Hibbits     volatile uint64_t   TRUND;       /* 138 etherStatsUndersizePkts */
398*0aeed3e9SJustin Hibbits     volatile uint64_t   R64;         /* 140 etherStatsPkts64Octets */
399*0aeed3e9SJustin Hibbits     volatile uint64_t   R127;        /* 148 etherStatsPkts65to127Octets */
400*0aeed3e9SJustin Hibbits     volatile uint64_t   R255;        /* 150 etherStatsPkts128to255Octets */
401*0aeed3e9SJustin Hibbits     volatile uint64_t   R511;        /* 158 etherStatsPkts256to511Octets */
402*0aeed3e9SJustin Hibbits     volatile uint64_t   R1023;       /* 160 etherStatsPkts512to1023Octets */
403*0aeed3e9SJustin Hibbits     volatile uint64_t   R1518;       /* 168 etherStatsPkts1024to1518Octets */
404*0aeed3e9SJustin Hibbits     volatile uint64_t   R1519X;      /* 170 etherStatsPkts1519toX */
405*0aeed3e9SJustin Hibbits     volatile uint64_t   TROVR;       /* 178 etherStatsOversizePkts */
406*0aeed3e9SJustin Hibbits     volatile uint64_t   TRJBR;       /* 180 etherStatsJabbers */
407*0aeed3e9SJustin Hibbits     volatile uint64_t   TRFRG;       /* 188 etherStatsFragments */
408*0aeed3e9SJustin Hibbits     volatile uint64_t   RERR;        /* 190 ifInErrors */
409*0aeed3e9SJustin Hibbits } _PackedType t_TgecMemMap;
410*0aeed3e9SJustin Hibbits 
411*0aeed3e9SJustin Hibbits #define MEM_MAP_END
412*0aeed3e9SJustin Hibbits #if defined(__MWERKS__) && !defined(__GNUC__)
413*0aeed3e9SJustin Hibbits #pragma pack(pop)
414*0aeed3e9SJustin Hibbits #endif /* defined(__MWERKS__) && ... */
415*0aeed3e9SJustin Hibbits 
416*0aeed3e9SJustin Hibbits 
417*0aeed3e9SJustin Hibbits typedef struct {
418*0aeed3e9SJustin Hibbits     bool wanModeEnable;             /* WAN Mode Enable. Sets WAN mode (1) or LAN mode (0, default) of operation. */
419*0aeed3e9SJustin Hibbits     bool promiscuousModeEnable;     /* Enables MAC promiscuous operation. When set to '1', all frames are received without any MAC address filtering, when set to '0' (Reset value) Unicast Frames with a destination address not matching the Core MAC Address (MAC Address programmed in Registers MAC_ADDR_0 and MAC_ADDR_1 or the MAC address programmed in Registers MAC_ADDR_2 and MAC_ADDR_3 ) are rejected. */
420*0aeed3e9SJustin Hibbits     bool pauseForwardEnable;        /* Terminate / Forward Pause Frames. If set to '1' pause frames are forwarded to the user application. When set to '0' (Reset value) pause frames are terminated and discarded within the MAC. */
421*0aeed3e9SJustin Hibbits     bool pauseIgnore;               /* Ignore Pause Frame Quanta. If set to '1' received pause frames are ignored by the MAC. When set to '0' (Reset value) the transmit process is stopped for the amount of time specified in the pause quanta received within a pause frame. */
422*0aeed3e9SJustin Hibbits     bool txAddrInsEnable;           /* Set Source MAC Address on Transmit.
423*0aeed3e9SJustin Hibbits                                         If set to '1' the MAC overwrites the source MAC address received from the Client Interface with one of the MAC addresses (Refer to section 10.4)
424*0aeed3e9SJustin Hibbits                                         If set to '0' (Reset value), the source MAC address from the Client Interface is transmitted unmodified to the line. */
425*0aeed3e9SJustin Hibbits     bool loopbackEnable;            /* PHY Interface Loopback. When set to '1', the signal loop_ena is set to '1', when set to '0' (Reset value) the signal loop_ena is set to '0'. */
426*0aeed3e9SJustin Hibbits     bool cmdFrameEnable;            /* Enables reception of all command frames. When set to '1' all Command Frames are accepted, when set to '0' (Reset Value) only Pause Frames are accepted and all other Command Frames are rejected. */
427*0aeed3e9SJustin Hibbits     bool rxErrorDiscard;            /* Receive Errored Frame Discard Enable. When set to �1�, any frame received with an error is discarded in the Core and not forwarded to the Client interface. When set to �0� (Reset value), errored Frames are forwarded to the Client interface with ff_rx_err asserted. */
428*0aeed3e9SJustin Hibbits     bool phyTxenaOn;                /* PHY Transmit Enable. When set to '1', the signal phy_txena is set to '1', when set to '0' (Reset value) the signal phy_txena is set to '0' */
429*0aeed3e9SJustin Hibbits     bool sendIdleEnable;            /* Force Idle Generation. When set to '1', the MAC permanently sends XGMII Idle sequences even when faults are received. */
430*0aeed3e9SJustin Hibbits     bool noLengthCheckEnable;       /* Payload Length Check Disable. When set to �0� (Reset value), the Core checks the frame's payload length with the Frame Length/Type field, when set to �1�, the payload length check is disabled. */
431*0aeed3e9SJustin Hibbits     bool lgthCheckNostdr;           /* The Core interprets the Length/Type field differently depending on the value of this Bit */
432*0aeed3e9SJustin Hibbits     bool timeStampEnable;           /* This bit selects between enabling and disabling the IEEE 1588 functionality.
433*0aeed3e9SJustin Hibbits                                         1: IEEE 1588 is enabled.
434*0aeed3e9SJustin Hibbits                                         0: IEEE 1588 is disabled. */
435*0aeed3e9SJustin Hibbits     bool rxSfdAny;                  /* Enables, when set, that any character is allowed at the SFD position of the preamble and the frame will be accepted.
436*0aeed3e9SJustin Hibbits                                         If cleared (default) the frame is accepted only if the 8th byte of the preamble contains the SFD value 0xd5. If another value is received, the frame is discarded and the alignment error counter increments. */
437*0aeed3e9SJustin Hibbits     bool rxPblFwd;                  /* Receive Preamble Forwarding (custom preamble).
438*0aeed3e9SJustin Hibbits                                         If set, the first word (ff_rx_sop) of every received frame contains the preamble of the frame. The frame data starts with the 2nd word from the FIFO.
439*0aeed3e9SJustin Hibbits                                         If the bit is cleared (default) the preamble is removed from the frame before it is written into the receive FIFO. */
440*0aeed3e9SJustin Hibbits     bool txPblFwd;                  /* Transmit Preamble Forwarding (custom preamble).
441*0aeed3e9SJustin Hibbits                                         If set, the first word written into the TX FIFO is considered as frame preamble. The MAC will not add a preamble in front of the frame. Note that bits 7:0 of the preamble word will still be overwritten with the XGMII start character upon transmission.
442*0aeed3e9SJustin Hibbits                                         If cleared (default) the MAC */
443*0aeed3e9SJustin Hibbits     uint32_t txIpgLength;           /*Transmit Inter-Packet-Gap (IPG) value.
444*0aeed3e9SJustin Hibbits                                       A 6-bit value: Depending on LAN or WAN mode of operation (see COMMAND_CONFIG, 19.2.1 page 91) the value has the following meaning:
445*0aeed3e9SJustin Hibbits                                         - LAN Mode: Number of octets in steps of 4. Valid values are 8, 12, 16, ... 100. DIC is fully supported (see 10.6.1 page 49) for any setting. A default of 12 (reset value) must be set to conform to IEEE802.3ae. Warning: When set to 8, PCS layers may not be able to perform clock rate compensation.
446*0aeed3e9SJustin Hibbits                                         - WAN Mode: Stretch factor. Valid values are 4..15. The stretch factor is calculated as (value+1)*8. A default of 12 (reset value) must be set to conform to IEEE 802.3ae (i.e. 13*8=104). A larger value shrinks the IPG (increasing bandwidth). */
447*0aeed3e9SJustin Hibbits /*.. */
448*0aeed3e9SJustin Hibbits     uint16_t    maxFrameLength;
449*0aeed3e9SJustin Hibbits     bool        debugMode;
450*0aeed3e9SJustin Hibbits     uint16_t    pauseTime;
451*0aeed3e9SJustin Hibbits #ifdef FM_TX_ECC_FRMS_ERRATA_10GMAC_A004
452*0aeed3e9SJustin Hibbits     bool        skipFman11Workaround;
453*0aeed3e9SJustin Hibbits #endif /* FM_TX_ECC_FRMS_ERRATA_10GMAC_A004 */
454*0aeed3e9SJustin Hibbits } t_TgecDriverParam;
455*0aeed3e9SJustin Hibbits 
456*0aeed3e9SJustin Hibbits typedef struct {
457*0aeed3e9SJustin Hibbits     t_FmMacControllerDriver     fmMacControllerDriver;              /**< Upper Mac control block */
458*0aeed3e9SJustin Hibbits     t_Handle                    h_App;                              /**< Handle to the upper layer application  */
459*0aeed3e9SJustin Hibbits     t_TgecMemMap                *p_MemMap;                          /**< pointer to 10G memory mapped registers. */
460*0aeed3e9SJustin Hibbits     t_TgecMiiAccessMemMap       *p_MiiMemMap;                       /**< pointer to MII memory mapped registers.          */
461*0aeed3e9SJustin Hibbits     uint64_t                    addr;                               /**< MAC address of device; */
462*0aeed3e9SJustin Hibbits     e_EnetMode                  enetMode;                           /**< Ethernet physical interface  */
463*0aeed3e9SJustin Hibbits     t_FmMacExceptionCallback    *f_Exception;
464*0aeed3e9SJustin Hibbits     int                         mdioIrq;
465*0aeed3e9SJustin Hibbits     t_FmMacExceptionCallback    *f_Event;
466*0aeed3e9SJustin Hibbits     bool                        indAddrRegUsed[TGEC_NUM_OF_PADDRS]; /**< Whether a particular individual address recognition register is being used */
467*0aeed3e9SJustin Hibbits     uint64_t                    paddr[TGEC_NUM_OF_PADDRS];          /**< MAC address for particular individual address recognition register */
468*0aeed3e9SJustin Hibbits     uint8_t                     numOfIndAddrInRegs;                 /**< Number of individual addresses in registers for this station. */
469*0aeed3e9SJustin Hibbits     t_EthHash                   *p_MulticastAddrHash;               /**< pointer to driver's global address hash table  */
470*0aeed3e9SJustin Hibbits     t_EthHash                   *p_UnicastAddrHash;                 /**< pointer to driver's individual address hash table  */
471*0aeed3e9SJustin Hibbits     bool                        debugMode;
472*0aeed3e9SJustin Hibbits     uint8_t                     macId;
473*0aeed3e9SJustin Hibbits     uint32_t                    exceptions;
474*0aeed3e9SJustin Hibbits     t_TgecDriverParam           *p_TgecDriverParam;
475*0aeed3e9SJustin Hibbits } t_Tgec;
476*0aeed3e9SJustin Hibbits 
477*0aeed3e9SJustin Hibbits 
478*0aeed3e9SJustin Hibbits t_Error TGEC_MII_WritePhyReg(t_Handle h_Tgec, uint8_t phyAddr, uint8_t reg, uint16_t data);
479*0aeed3e9SJustin Hibbits t_Error TGEC_MII_ReadPhyReg(t_Handle h_Tgec,  uint8_t phyAddr, uint8_t reg, uint16_t *p_Data);
480*0aeed3e9SJustin Hibbits 
481*0aeed3e9SJustin Hibbits 
482*0aeed3e9SJustin Hibbits #endif /* __TGEC_H */
483