Blame view
include/tsec.h
11.8 KB
83d290c56 SPDX: Convert all... |
1 |
/* SPDX-License-Identifier: GPL-2.0+ */ |
42d1f0394 * Patches by Xian... |
2 3 4 5 6 |
/* * tsec.h * * Driver for the Motorola Triple Speed Ethernet Controller * |
aec84bf67 net: tsec: Cleanu... |
7 |
* Copyright 2004, 2007, 2009, 2011, 2013 Freescale Semiconductor, Inc. |
42d1f0394 * Patches by Xian... |
8 9 10 |
* (C) Copyright 2003, Motorola, Inc. * maintained by Xianghua Xiao (x.xiao@motorola.com) * author Andy Fleming |
42d1f0394 * Patches by Xian... |
11 12 13 14 15 16 |
*/ #ifndef __TSEC_H #define __TSEC_H #include <net.h> |
f046ccd15 * Patch by Eran L... |
17 |
#include <config.h> |
063c12633 tsec: Convert tse... |
18 |
#include <phy.h> |
f046ccd15 * Patch by Eran L... |
19 |
|
bca686a4f net: tsec: Fix of... |
20 |
#define TSEC_MDIO_REGS_OFFSET 0x520 |
9a1d6af55 net: tsec: Add dr... |
21 |
#ifndef CONFIG_DM_ETH |
73fb58382 armv7: ls1021a: D... |
22 |
#ifdef CONFIG_ARCH_LS1021A |
52d00a812 ls102xa: etsec: A... |
23 24 25 |
#define TSEC_SIZE 0x40000 #define TSEC_MDIO_OFFSET 0x40000 #else |
b9e186fc3 NET: Move MDIO re... |
26 27 |
#define TSEC_SIZE 0x01000 #define TSEC_MDIO_OFFSET 0x01000 |
52d00a812 ls102xa: etsec: A... |
28 |
#endif |
f046ccd15 * Patch by Eran L... |
29 |
|
bca686a4f net: tsec: Fix of... |
30 |
#define CONFIG_SYS_MDIO_BASE_ADDR (MDIO_BASE_ADDR + TSEC_MDIO_REGS_OFFSET) |
063c12633 tsec: Convert tse... |
31 |
|
aec84bf67 net: tsec: Cleanu... |
32 33 34 35 36 37 38 39 40 41 42 43 44 |
#define TSEC_GET_REGS(num, offset) \ (struct tsec __iomem *)\ (TSEC_BASE_ADDR + (((num) - 1) * (offset))) #define TSEC_GET_REGS_BASE(num) \ TSEC_GET_REGS((num), TSEC_SIZE) #define TSEC_GET_MDIO_REGS(num, offset) \ (struct tsec_mii_mng __iomem *)\ (CONFIG_SYS_MDIO_BASE_ADDR + ((num) - 1) * (offset)) #define TSEC_GET_MDIO_REGS_BASE(num) \ TSEC_GET_MDIO_REGS((num), TSEC_MDIO_OFFSET) |
063c12633 tsec: Convert tse... |
45 |
#define DEFAULT_MII_NAME "FSL_MDIO" |
75b9d4ae0 Pass in tsec_info... |
46 47 |
#define STD_TSEC_INFO(num) \ { \ |
aec84bf67 net: tsec: Cleanu... |
48 49 |
.regs = TSEC_GET_REGS_BASE(num), \ .miiregs_sgmii = TSEC_GET_MDIO_REGS_BASE(num), \ |
75b9d4ae0 Pass in tsec_info... |
50 51 |
.devname = CONFIG_TSEC##num##_NAME, \ .phyaddr = TSEC##num##_PHY_ADDR, \ |
063c12633 tsec: Convert tse... |
52 53 |
.flags = TSEC##num##_FLAGS, \ .mii_devname = DEFAULT_MII_NAME \ |
75b9d4ae0 Pass in tsec_info... |
54 55 56 57 |
} #define SET_STD_TSEC_INFO(x, num) \ { \ |
aec84bf67 net: tsec: Cleanu... |
58 59 |
x.regs = TSEC_GET_REGS_BASE(num); \ x.miiregs_sgmii = TSEC_GET_MDIO_REGS_BASE(num); \ |
75b9d4ae0 Pass in tsec_info... |
60 61 62 |
x.devname = CONFIG_TSEC##num##_NAME; \ x.phyaddr = TSEC##num##_PHY_ADDR; \ x.flags = TSEC##num##_FLAGS;\ |
063c12633 tsec: Convert tse... |
63 |
x.mii_devname = DEFAULT_MII_NAME;\ |
75b9d4ae0 Pass in tsec_info... |
64 |
} |
9a1d6af55 net: tsec: Add dr... |
65 |
#endif /* CONFIG_DM_ETH */ |
9872b736f net: tsec: fsl_md... |
66 |
#define MAC_ADDR_LEN 6 |
42d1f0394 * Patches by Xian... |
67 |
|
53677ef18 Big white-space c... |
68 |
/* #define TSEC_TIMEOUT 1000000 */ |
9872b736f net: tsec: fsl_md... |
69 70 |
#define TSEC_TIMEOUT 1000 #define TOUT_LOOP 1000000 |
42d1f0394 * Patches by Xian... |
71 |
|
2abe361c0 Add SGMII support... |
72 73 74 75 76 77 78 79 80 81 |
/* TBI register addresses */ #define TBI_CR 0x00 #define TBI_SR 0x01 #define TBI_ANA 0x04 #define TBI_ANLPBPA 0x05 #define TBI_ANEX 0x06 #define TBI_TBICON 0x11 /* TBI MDIO register bit fields*/ #define TBICON_CLK_SELECT 0x0020 |
9872b736f net: tsec: fsl_md... |
82 83 |
#define TBIANA_ASYMMETRIC_PAUSE 0x0100 #define TBIANA_SYMMETRIC_PAUSE 0x0080 |
2abe361c0 Add SGMII support... |
84 85 86 87 88 89 90 |
#define TBIANA_HALF_DUPLEX 0x0040 #define TBIANA_FULL_DUPLEX 0x0020 #define TBICR_PHY_RESET 0x8000 #define TBICR_ANEG_ENABLE 0x1000 #define TBICR_RESTART_ANEG 0x0200 #define TBICR_FULL_DUPLEX 0x0100 #define TBICR_SPEED1_SET 0x0040 |
42d1f0394 * Patches by Xian... |
91 92 93 94 95 |
/* MAC register bits */ #define MACCFG1_SOFT_RESET 0x80000000 #define MACCFG1_RESET_RX_MC 0x00080000 #define MACCFG1_RESET_TX_MC 0x00040000 #define MACCFG1_RESET_RX_FUN 0x00020000 |
9872b736f net: tsec: fsl_md... |
96 |
#define MACCFG1_RESET_TX_FUN 0x00010000 |
42d1f0394 * Patches by Xian... |
97 98 99 100 101 102 103 104 105 106 |
#define MACCFG1_LOOPBACK 0x00000100 #define MACCFG1_RX_FLOW 0x00000020 #define MACCFG1_TX_FLOW 0x00000010 #define MACCFG1_SYNCD_RX_EN 0x00000008 #define MACCFG1_RX_EN 0x00000004 #define MACCFG1_SYNCD_TX_EN 0x00000002 #define MACCFG1_TX_EN 0x00000001 #define MACCFG2_INIT_SETTINGS 0x00007205 #define MACCFG2_FULL_DUPLEX 0x00000001 |
53677ef18 Big white-space c... |
107 |
#define MACCFG2_IF 0x00000300 |
97d80fc39 Patches Part 1 by... |
108 |
#define MACCFG2_GMII 0x00000200 |
53677ef18 Big white-space c... |
109 |
#define MACCFG2_MII 0x00000100 |
42d1f0394 * Patches by Xian... |
110 111 |
#define ECNTRL_INIT_SETTINGS 0x00001000 |
53677ef18 Big white-space c... |
112 |
#define ECNTRL_TBI_MODE 0x00000020 |
063c12633 tsec: Convert tse... |
113 |
#define ECNTRL_REDUCED_MODE 0x00000010 |
d9b94f28a * Patch by Jon Lo... |
114 |
#define ECNTRL_R100 0x00000008 |
063c12633 tsec: Convert tse... |
115 |
#define ECNTRL_REDUCED_MII_MODE 0x00000004 |
81f481ca7 Enable 8544 support |
116 |
#define ECNTRL_SGMII_MODE 0x00000002 |
42d1f0394 * Patches by Xian... |
117 |
|
6d0f6bcf3 rename CFG_ macro... |
118 |
#ifndef CONFIG_SYS_TBIPA_VALUE |
9872b736f net: tsec: fsl_md... |
119 |
# define CONFIG_SYS_TBIPA_VALUE 0x1f |
dcb84b720 tsec: Allow Ten B... |
120 |
#endif |
42d1f0394 * Patches by Xian... |
121 122 123 124 |
#define MRBLR_INIT_SETTINGS PKTSIZE_ALIGN #define MINFLR_INIT_SETTINGS 0x00000040 |
53677ef18 Big white-space c... |
125 126 127 |
#define DMACTRL_INIT_SETTINGS 0x000000c3 #define DMACTRL_GRS 0x00000010 #define DMACTRL_GTS 0x00000008 |
52d00a812 ls102xa: etsec: A... |
128 |
#define DMACTRL_LE 0x00008000 |
42d1f0394 * Patches by Xian... |
129 |
|
53677ef18 Big white-space c... |
130 131 |
#define TSTAT_CLEAR_THALT 0x80000000 #define RSTAT_CLEAR_RHALT 0x00800000 |
42d1f0394 * Patches by Xian... |
132 |
|
42d1f0394 * Patches by Xian... |
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
#define IEVENT_INIT_CLEAR 0xffffffff #define IEVENT_BABR 0x80000000 #define IEVENT_RXC 0x40000000 #define IEVENT_BSY 0x20000000 #define IEVENT_EBERR 0x10000000 #define IEVENT_MSRO 0x04000000 #define IEVENT_GTSC 0x02000000 #define IEVENT_BABT 0x01000000 #define IEVENT_TXC 0x00800000 #define IEVENT_TXE 0x00400000 #define IEVENT_TXB 0x00200000 #define IEVENT_TXF 0x00100000 #define IEVENT_IE 0x00080000 #define IEVENT_LC 0x00040000 #define IEVENT_CRL 0x00020000 #define IEVENT_XFUN 0x00010000 #define IEVENT_RXB0 0x00008000 #define IEVENT_GRSC 0x00000100 #define IEVENT_RXF0 0x00000080 #define IMASK_INIT_CLEAR 0x00000000 #define IMASK_TXEEN 0x00400000 #define IMASK_TXBEN 0x00200000 |
53677ef18 Big white-space c... |
156 |
#define IMASK_TXFEN 0x00100000 |
42d1f0394 * Patches by Xian... |
157 |
#define IMASK_RXFEN0 0x00000080 |
42d1f0394 * Patches by Xian... |
158 |
/* Default Attribute fields */ |
9872b736f net: tsec: fsl_md... |
159 160 |
#define ATTR_INIT_SETTINGS 0x000000c0 #define ATTRELI_INIT_SETTINGS 0x00000000 |
42d1f0394 * Patches by Xian... |
161 162 163 164 165 166 167 168 169 170 171 172 |
/* TxBD status field bits */ #define TXBD_READY 0x8000 #define TXBD_PADCRC 0x4000 #define TXBD_WRAP 0x2000 #define TXBD_INTERRUPT 0x1000 #define TXBD_LAST 0x0800 #define TXBD_CRC 0x0400 #define TXBD_DEF 0x0200 #define TXBD_HUGEFRAME 0x0080 #define TXBD_LATECOLLISION 0x0080 #define TXBD_RETRYLIMIT 0x0040 |
9872b736f net: tsec: fsl_md... |
173 |
#define TXBD_RETRYCOUNTMASK 0x003c |
42d1f0394 * Patches by Xian... |
174 |
#define TXBD_UNDERRUN 0x0002 |
53677ef18 Big white-space c... |
175 |
#define TXBD_STATS 0x03ff |
42d1f0394 * Patches by Xian... |
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
/* RxBD status field bits */ #define RXBD_EMPTY 0x8000 #define RXBD_RO1 0x4000 #define RXBD_WRAP 0x2000 #define RXBD_INTERRUPT 0x1000 #define RXBD_LAST 0x0800 #define RXBD_FIRST 0x0400 #define RXBD_MISS 0x0100 #define RXBD_BROADCAST 0x0080 #define RXBD_MULTICAST 0x0040 #define RXBD_LARGE 0x0020 #define RXBD_NONOCTET 0x0010 #define RXBD_SHORT 0x0008 #define RXBD_CRCERR 0x0004 #define RXBD_OVERRUN 0x0002 #define RXBD_TRUNCATED 0x0001 #define RXBD_STATS 0x003f |
9c9141fd0 net: tsec: Use po... |
194 |
struct txbd8 { |
9872b736f net: tsec: fsl_md... |
195 196 197 |
uint16_t status; /* Status Fields */ uint16_t length; /* Buffer length */ uint32_t bufptr; /* Buffer Pointer */ |
9c9141fd0 net: tsec: Use po... |
198 199 200 |
}; struct rxbd8 { |
9872b736f net: tsec: fsl_md... |
201 202 203 |
uint16_t status; /* Status Fields */ uint16_t length; /* Buffer Length */ uint32_t bufptr; /* Buffer Pointer */ |
9c9141fd0 net: tsec: Use po... |
204 |
}; |
42d1f0394 * Patches by Xian... |
205 |
|
82ef75ca5 net: tsec: Use po... |
206 |
struct tsec_rmon_mib { |
42d1f0394 * Patches by Xian... |
207 |
/* Transmit and Receive Counters */ |
82ef75ca5 net: tsec: Use po... |
208 209 210 211 212 213 214 |
u32 tr64; /* Tx/Rx 64-byte Frame Counter */ u32 tr127; /* Tx/Rx 65-127 byte Frame Counter */ u32 tr255; /* Tx/Rx 128-255 byte Frame Counter */ u32 tr511; /* Tx/Rx 256-511 byte Frame Counter */ u32 tr1k; /* Tx/Rx 512-1023 byte Frame Counter */ u32 trmax; /* Tx/Rx 1024-1518 byte Frame Counter */ u32 trmgv; /* Tx/Rx 1519-1522 byte Good VLAN Frame */ |
42d1f0394 * Patches by Xian... |
215 |
/* Receive Counters */ |
82ef75ca5 net: tsec: Use po... |
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
u32 rbyt; /* Receive Byte Counter */ u32 rpkt; /* Receive Packet Counter */ u32 rfcs; /* Receive FCS Error Counter */ u32 rmca; /* Receive Multicast Packet (Counter) */ u32 rbca; /* Receive Broadcast Packet */ u32 rxcf; /* Receive Control Frame Packet */ u32 rxpf; /* Receive Pause Frame Packet */ u32 rxuo; /* Receive Unknown OP Code */ u32 raln; /* Receive Alignment Error */ u32 rflr; /* Receive Frame Length Error */ u32 rcde; /* Receive Code Error */ u32 rcse; /* Receive Carrier Sense Error */ u32 rund; /* Receive Undersize Packet */ u32 rovr; /* Receive Oversize Packet */ u32 rfrg; /* Receive Fragments */ u32 rjbr; /* Receive Jabber */ u32 rdrp; /* Receive Drop */ |
42d1f0394 * Patches by Xian... |
233 |
/* Transmit Counters */ |
82ef75ca5 net: tsec: Use po... |
234 235 236 237 238 239 240 241 |
u32 tbyt; /* Transmit Byte Counter */ u32 tpkt; /* Transmit Packet */ u32 tmca; /* Transmit Multicast Packet */ u32 tbca; /* Transmit Broadcast Packet */ u32 txpf; /* Transmit Pause Control Frame */ u32 tdfr; /* Transmit Deferral Packet */ u32 tedf; /* Transmit Excessive Deferral Packet */ u32 tscl; /* Transmit Single Collision Packet */ |
42d1f0394 * Patches by Xian... |
242 |
/* (0x2_n700) */ |
82ef75ca5 net: tsec: Use po... |
243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
u32 tmcl; /* Transmit Multiple Collision Packet */ u32 tlcl; /* Transmit Late Collision Packet */ u32 txcl; /* Transmit Excessive Collision Packet */ u32 tncl; /* Transmit Total Collision */ u32 res2; u32 tdrp; /* Transmit Drop Frame */ u32 tjbr; /* Transmit Jabber Frame */ u32 tfcs; /* Transmit FCS Error */ u32 txcf; /* Transmit Control Frame */ u32 tovr; /* Transmit Oversize Frame */ u32 tund; /* Transmit Undersize Frame */ u32 tfrg; /* Transmit Fragments Frame */ |
42d1f0394 * Patches by Xian... |
257 |
/* General Registers */ |
82ef75ca5 net: tsec: Use po... |
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
u32 car1; /* Carry Register One */ u32 car2; /* Carry Register Two */ u32 cam1; /* Carry Register One Mask */ u32 cam2; /* Carry Register Two Mask */ }; struct tsec_hash_regs { u32 iaddr0; /* Individual Address Register 0 */ u32 iaddr1; /* Individual Address Register 1 */ u32 iaddr2; /* Individual Address Register 2 */ u32 iaddr3; /* Individual Address Register 3 */ u32 iaddr4; /* Individual Address Register 4 */ u32 iaddr5; /* Individual Address Register 5 */ u32 iaddr6; /* Individual Address Register 6 */ u32 iaddr7; /* Individual Address Register 7 */ u32 res1[24]; u32 gaddr0; /* Group Address Register 0 */ u32 gaddr1; /* Group Address Register 1 */ u32 gaddr2; /* Group Address Register 2 */ u32 gaddr3; /* Group Address Register 3 */ u32 gaddr4; /* Group Address Register 4 */ u32 gaddr5; /* Group Address Register 5 */ u32 gaddr6; /* Group Address Register 6 */ u32 gaddr7; /* Group Address Register 7 */ u32 res2[24]; }; |
42d1f0394 * Patches by Xian... |
284 |
|
aec84bf67 net: tsec: Cleanu... |
285 |
struct tsec { |
42d1f0394 * Patches by Xian... |
286 |
/* General Control and Status Registers (0x2_n000) */ |
82ef75ca5 net: tsec: Use po... |
287 |
u32 res000[4]; |
42d1f0394 * Patches by Xian... |
288 |
|
82ef75ca5 net: tsec: Use po... |
289 290 291 292 293 294 295 296 297 |
u32 ievent; /* Interrupt Event */ u32 imask; /* Interrupt Mask */ u32 edis; /* Error Disabled */ u32 res01c; u32 ecntrl; /* Ethernet Control */ u32 minflr; /* Minimum Frame Length */ u32 ptv; /* Pause Time Value */ u32 dmactrl; /* DMA Control */ u32 tbipa; /* TBI PHY Address */ |
42d1f0394 * Patches by Xian... |
298 |
|
82ef75ca5 net: tsec: Use po... |
299 300 |
u32 res034[3]; u32 res040[48]; |
42d1f0394 * Patches by Xian... |
301 302 |
/* Transmit Control and Status Registers (0x2_n100) */ |
82ef75ca5 net: tsec: Use po... |
303 304 305 306 307 308 309 310 311 |
u32 tctrl; /* Transmit Control */ u32 tstat; /* Transmit Status */ u32 res108; u32 tbdlen; /* Tx BD Data Length */ u32 res110[5]; u32 ctbptr; /* Current TxBD Pointer */ u32 res128[23]; u32 tbptr; /* TxBD Pointer */ u32 res188[30]; |
42d1f0394 * Patches by Xian... |
312 |
/* (0x2_n200) */ |
82ef75ca5 net: tsec: Use po... |
313 314 315 316 317 318 |
u32 res200; u32 tbase; /* TxBD Base Address */ u32 res208[42]; u32 ostbd; /* Out of Sequence TxBD */ u32 ostbdp; /* Out of Sequence Tx Data Buffer Pointer */ u32 res2b8[18]; |
42d1f0394 * Patches by Xian... |
319 320 |
/* Receive Control and Status Registers (0x2_n300) */ |
82ef75ca5 net: tsec: Use po... |
321 322 323 324 325 326 |
u32 rctrl; /* Receive Control */ u32 rstat; /* Receive Status */ u32 res308; u32 rbdlen; /* RxBD Data Length */ u32 res310[4]; u32 res320; |
9872b736f net: tsec: fsl_md... |
327 |
u32 crbptr; /* Current Receive Buffer Pointer */ |
82ef75ca5 net: tsec: Use po... |
328 |
u32 res328[6]; |
9872b736f net: tsec: fsl_md... |
329 |
u32 mrblr; /* Maximum Receive Buffer Length */ |
82ef75ca5 net: tsec: Use po... |
330 |
u32 res344[16]; |
9872b736f net: tsec: fsl_md... |
331 |
u32 rbptr; /* RxBD Pointer */ |
82ef75ca5 net: tsec: Use po... |
332 |
u32 res388[30]; |
42d1f0394 * Patches by Xian... |
333 |
/* (0x2_n400) */ |
82ef75ca5 net: tsec: Use po... |
334 |
u32 res400; |
9872b736f net: tsec: fsl_md... |
335 |
u32 rbase; /* RxBD Base Address */ |
82ef75ca5 net: tsec: Use po... |
336 |
u32 res408[62]; |
42d1f0394 * Patches by Xian... |
337 338 |
/* MAC Registers (0x2_n500) */ |
82ef75ca5 net: tsec: Use po... |
339 340 341 342 343 344 345 |
u32 maccfg1; /* MAC Configuration #1 */ u32 maccfg2; /* MAC Configuration #2 */ u32 ipgifg; /* Inter Packet Gap/Inter Frame Gap */ u32 hafdup; /* Half-duplex */ u32 maxfrm; /* Maximum Frame */ u32 res514; u32 res518; |
42d1f0394 * Patches by Xian... |
346 |
|
82ef75ca5 net: tsec: Use po... |
347 |
u32 res51c; |
42d1f0394 * Patches by Xian... |
348 |
|
82ef75ca5 net: tsec: Use po... |
349 |
u32 resmdio[6]; |
42d1f0394 * Patches by Xian... |
350 |
|
82ef75ca5 net: tsec: Use po... |
351 |
u32 res538; |
42d1f0394 * Patches by Xian... |
352 |
|
82ef75ca5 net: tsec: Use po... |
353 354 355 356 |
u32 ifstat; /* Interface Status */ u32 macstnaddr1; /* Station Address, part 1 */ u32 macstnaddr2; /* Station Address, part 2 */ u32 res548[46]; |
42d1f0394 * Patches by Xian... |
357 358 |
/* (0x2_n600) */ |
82ef75ca5 net: tsec: Use po... |
359 |
u32 res600[32]; |
42d1f0394 * Patches by Xian... |
360 361 |
/* RMON MIB Registers (0x2_n680-0x2_n73c) */ |
82ef75ca5 net: tsec: Use po... |
362 363 |
struct tsec_rmon_mib rmon; u32 res740[48]; |
42d1f0394 * Patches by Xian... |
364 365 |
/* Hash Function Registers (0x2_n800) */ |
82ef75ca5 net: tsec: Use po... |
366 |
struct tsec_hash_regs hash; |
42d1f0394 * Patches by Xian... |
367 |
|
82ef75ca5 net: tsec: Use po... |
368 |
u32 res900[128]; |
42d1f0394 * Patches by Xian... |
369 370 |
/* Pattern Registers (0x2_nb00) */ |
82ef75ca5 net: tsec: Use po... |
371 372 373 |
u32 resb00[62]; u32 attr; /* Default Attribute Register */ u32 attreli; /* Default Attribute Extract Length and Index */ |
42d1f0394 * Patches by Xian... |
374 375 |
/* TSEC Future Expansion Space (0x2_nc00-0x2_nffc) */ |
82ef75ca5 net: tsec: Use po... |
376 |
u32 resc00[256]; |
aec84bf67 net: tsec: Cleanu... |
377 |
}; |
42d1f0394 * Patches by Xian... |
378 |
|
9872b736f net: tsec: fsl_md... |
379 |
#define TSEC_GIGABIT (1 << 0) |
d9b94f28a * Patch by Jon Lo... |
380 |
|
063c12633 tsec: Convert tse... |
381 |
/* These flags currently only have meaning if we're using the eTSEC */ |
5f6b14422 tsec: Add TSEC_FI... |
382 383 |
#define TSEC_REDUCED (1 << 1) /* MAC-PHY interface uses RGMII */ #define TSEC_SGMII (1 << 2) /* MAC-PHY interface uses SGMII */ |
d9b94f28a * Patch by Jon Lo... |
384 |
|
e677da972 net: tsec: Move r... |
385 |
#define TX_BUF_CNT 2 |
97d80fc39 Patches Part 1 by... |
386 |
struct tsec_private { |
e677da972 net: tsec: Move r... |
387 388 |
struct txbd8 __iomem txbd[TX_BUF_CNT]; struct rxbd8 __iomem rxbd[PKTBUFSRX]; |
aec84bf67 net: tsec: Cleanu... |
389 390 |
struct tsec __iomem *regs; struct tsec_mii_mng __iomem *phyregs_sgmii; |
063c12633 tsec: Convert tse... |
391 392 393 |
struct phy_device *phydev; phy_interface_t interface; struct mii_dev *bus; |
97d80fc39 Patches Part 1 by... |
394 |
uint phyaddr; |
a1c76c150 net: tsec: Use pr... |
395 |
uint tbiaddr; |
063c12633 tsec: Convert tse... |
396 |
char mii_devname[16]; |
d9b94f28a * Patch by Jon Lo... |
397 |
u32 flags; |
362b123f4 net: tsec: Move r... |
398 399 |
uint rx_idx; /* index of the current RX buffer */ uint tx_idx; /* index of the current TX buffer */ |
9a1d6af55 net: tsec: Add dr... |
400 |
#ifndef CONFIG_DM_ETH |
56a27a1e6 net: tsec: Use ts... |
401 |
struct eth_device *dev; |
9a1d6af55 net: tsec: Add dr... |
402 403 404 |
#else struct udevice *dev; #endif |
97d80fc39 Patches Part 1 by... |
405 |
}; |
dd3d1f56a tsec: Move tsec.h... |
406 |
struct tsec_info_struct { |
aec84bf67 net: tsec: Cleanu... |
407 408 |
struct tsec __iomem *regs; struct tsec_mii_mng __iomem *miiregs_sgmii; |
75b9d4ae0 Pass in tsec_info... |
409 |
char *devname; |
063c12633 tsec: Convert tse... |
410 411 |
char *mii_devname; phy_interface_t interface; |
dd3d1f56a tsec: Move tsec.h... |
412 413 |
unsigned int phyaddr; u32 flags; |
dd3d1f56a tsec: Move tsec.h... |
414 |
}; |
9a1d6af55 net: tsec: Add dr... |
415 |
#ifndef CONFIG_DM_ETH |
75b9d4ae0 Pass in tsec_info... |
416 417 |
int tsec_standard_init(bd_t *bis); int tsec_eth_init(bd_t *bis, struct tsec_info_struct *tsec_info, int num); |
9a1d6af55 net: tsec: Add dr... |
418 |
#endif |
75b9d4ae0 Pass in tsec_info... |
419 |
|
42d1f0394 * Patches by Xian... |
420 |
#endif /* __TSEC_H */ |