40 #ifndef _DEV_GTETHREG_H_ 41 #define _DEV_GTETHREG_H_ 43 #define ETH__BIT(bit) (1U << (bit)) 44 #define ETH__LLBIT(bit) (1LLU << (bit)) 45 #define ETH__MASK(bit) (ETH__BIT(bit) - 1) 46 #define ETH__LLMASK(bit) (ETH__LLBIT(bit) - 1) 47 #define ETH__GEN(n, off) (0x2400+((n) << 10)+(ETH__ ## off)) 48 #define ETH__EXT(data, bit, len) (((data) >> (bit)) & ETH__MASK(len)) 49 #define ETH__LLEXT(data, bit, len) (((data) >> (bit)) & ETH__LLMASK(len)) 50 #define ETH__CLR(data, bit, len) ((data) &= ~(ETH__MASK(len) << (bit))) 51 #define ETH__INS(new, bit) ((new) << (bit)) 52 #define ETH__LLINS(new, bit) ((uint64_t)(new) << (bit)) 62 #if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN 68 #if defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN 80 #define TX_STS_LC ETH__BIT(5) 81 #define TX_STS_UR ETH__BIT(6) 82 #define TX_STS_RL ETH__BIT(8) 83 #define TX_STS_COL ETH__BIT(9) 84 #define TX_STS_RC(v) ETH__GETBITS(v, 10, 4) 85 #define TX_STS_ES ETH__BIT(15) 86 #define TX_CMD_L ETH__BIT(16) 87 #define TX_CMD_F ETH__BIT(17) 88 #define TX_CMD_P ETH__BIT(18) 89 #define TX_CMD_GC ETH__BIT(22) 90 #define TX_CMD_EI ETH__BIT(23) 91 #define TX_CMD_AM ETH__BIT(30) 92 #define TX_CMD_O ETH__BIT(31) 94 #define TX_CMD_FIRST (TX_CMD_F|TX_CMD_O) 95 #define TX_CMD_LAST (TX_CMD_L|TX_CMD_GC|TX_CMD_P|TX_CMD_O) 101 #define RX_STS_CE ETH__BIT(0) 102 #define RX_STS_COL ETH__BIT(1) 103 #define RX_STS_LC ETH__BIT(5) 104 #define RX_STS_OR ETH__BIT(6) 105 #define RX_STS_MFL ETH__BIT(7) 106 #define RX_STS_SF ETH__BIT(8) 107 #define RX_STS_FT ETH__BIT(11) 108 #define RX_STS_M ETH__BIT(12) 109 #define RX_STS_HE ETH__BIT(13) 110 #define RX_STS_IGMP ETH__BIT(14) 111 #define RX_STS_ES ETH__BIT(15) 112 #define RX_CMD_L ETH__BIT(16) 113 #define RX_CMD_F ETH__BIT(17) 114 #define RX_CMD_EI ETH__BIT(23) 115 #define RX_CMD_AM ETH__BIT(30) 116 #define RX_CMD_O ETH__BIT(31) 120 #define HSH_V ETH__LLBIT(0) 121 #define HSH_S ETH__LLBIT(1) 122 #define HSH_RD ETH__LLBIT(2) 123 #define HSH_R ETH__LLBIT(2) 124 #define HSH_PRIO_GET(v) ETH__LLEXT(v, 51, 2) 125 #define HSH_PRIO_INS(v) ETH__LLINS(v, 51) 126 #define HSH_ADDR_MASK 0x7fffff8LLU 130 #define ETH_EPAR 0x2000 131 #define ETH_ESMIR 0x2010 133 #define ETH_BASE_ETH0 0x2400 134 #define ETH_BASE_ETH1 0x2800 135 #define ETH_BASE_ETH2 0x2c00 136 #define ETH_SIZE 0x0400 138 #define ETH__EBASE 0x0000 139 #define ETH__EPCR 0x0000 140 #define ETH__EPCXR 0x0008 141 #define ETH__EPCMR 0x0010 142 #define ETH__EPSR 0x0018 143 #define ETH__ESPR 0x0020 144 #define ETH__EHTPR 0x0028 145 #define ETH__EFCSAL 0x0030 146 #define ETH__EFCSAH 0x0038 147 #define ETH__ESDCR 0x0040 148 #define ETH__ESDCMR 0x0048 149 #define ETH__EICR 0x0050 150 #define ETH__EIMR 0x0058 151 #define ETH__EFRDP0 0x0080 152 #define ETH__EFRDP1 0x0084 153 #define ETH__EFRDP2 0x0088 154 #define ETH__EFRDP3 0x008c 155 #define ETH__ECRDP0 0x00a0 156 #define ETH__ECRDP1 0x00a4 157 #define ETH__ECRDP2 0x00a8 158 #define ETH__ECRDP3 0x00ac 159 #define ETH__ECTDP0 0x00e0 160 #define ETH__ECTDP1 0x00e4 161 #define ETH__EDSCP2P0L 0x0060 163 #define ETH__EDSCP2P0H 0x0064 165 #define ETH__EDSCP2P1L 0x0068 167 #define ETH__EDSCP2P1H 0x006c 169 #define ETH__EVPT2P 0x0068 170 #define ETH__EMIBCTRS 0x0100 172 #define ETH_BASE(n) ETH__GEN(n, EBASE) 173 #define ETH_EPCR(n) ETH__GEN(n, EPCR) 174 #define ETH_EPCXR(n) ETH__GEN(n, EPCXR) 175 #define ETH_EPCMR(n) ETH__GEN(n, EPCMR) 176 #define ETH_EPSR(n) ETH__GEN(n, EPSR) 177 #define ETH_ESPR(n) ETH__GEN(n, ESPR) 178 #define ETH_EHTPR(n) ETH__GEN(n, EHPTR) 179 #define ETH_EFCSAL(n) ETH__GEN(n, EFCSAL) 180 #define ETH_EFCSAH(n) ETH__GEN(n, EFCSAH) 181 #define ETH_ESDCR(n) ETH__GEN(n, ESDCR) 182 #define ETH_ESDCMR(n) ETH__GEN(n, ESDCMR) 183 #define ETH_EICR(n) ETH__GEN(n, EICR) 184 #define ETH_EIMR(n) ETH__GEN(n, EIMR) 185 #define ETH_EFRDP0(n) ETH__GEN(n, EFRDP0) 186 #define ETH_EFRDP1(n) ETH__GEN(n, EFRDP1) 187 #define ETH_EFRDP2(n) ETH__GEN(n, EFRDP2) 188 #define ETH_EFRDP3(n) ETH__GEN(n, EFRDP3) 189 #define ETH_ECRDP0(n) ETH__GEN(n, ECRDP0) 190 #define ETH_ECRDP1(n) ETH__GEN(n, ECRDP1) 191 #define ETH_ECRDP2(n) ETH__GEN(n, ECRDP2) 192 #define ETH_ECRDP3(n) ETH__GEN(n, ECRDP3) 193 #define ETH_ECTDP0(n) ETH__GEN(n, ECTDP0) 194 #define ETH_ECTDP1(n) ETH__GEN(n, ECTDP1) 195 #define ETH_EDSCP2P0L(n) ETH__GEN(n, EDSCP2P0L) 197 #define ETH_EDSCP2P0H(n) ETH__GEN(n, EDSCP2P0H) 199 #define ETH_EDSCP2P1L(n) ETH__GEN(n, EDSCP2P1L) 201 #define ETH_EDSCP2P1H(n) ETH__GEN(n, EDSCP1P1H) 203 #define ETH_EVPT2P(n) ETH__GEN(n, EVPT2P) 204 #define ETH_EMIBCTRS(n) ETH__GEN(n, EMIBCTRS) 206 #define ETH_EPAR_PhyAD_GET(v, n) (((v) >> ((n) * 5)) & 0x1f) 208 #define ETH_ESMIR_READ(phy, reg) (ETH__INS(phy, 16)|\ 210 ETH_ESMIR_ReadOpcode) 211 #define ETH_ESMIR_WRITE(phy, reg, val) (ETH__INS(phy, 16)|\ 214 ETH_ESMIR_WriteOpcode) 215 #define ETH_ESMIR_Value_GET(v) ETH__EXT(v, 0, 16) 216 #define ETH_ESMIR_WriteOpcode 0 217 #define ETH_ESMIR_ReadOpcode ETH__BIT(26) 218 #define ETH_ESMIR_ReadValid ETH__BIT(27) 219 #define ETH_ESMIR_Busy ETH__BIT(28) 276 #define ETH_EPCR_PM ETH__BIT(0) 277 #define ETH_EPCR_RBM ETH__BIT(1) 278 #define ETH_EPCR_PBF ETH__BIT(2) 279 #define ETH_EPCR_EN ETH__BIT(7) 280 #define ETH_EPCR_LPBK_GET(v) ETH__BIT(v, 8, 2) 281 #define ETH_EPCR_LPBK_Normal 0 282 #define ETH_EPCR_LPBK_Internal 1 283 #define ETH_EPCR_LPBK_External 2 284 #define ETH_EPCR_FC ETH__BIT(10) 286 #define ETH_EPCR_HS ETH__BIT(12) 287 #define ETH_EPCR_HS_8K 0 288 #define ETH_EPCR_HS_512 ETH_EPCR_HS 290 #define ETH_EPCR_HM ETH__BIT(13) 291 #define ETH_EPCR_HM_0 0 292 #define ETH_EPCR_HM_1 ETH_EPCR_HM 294 #define ETH_EPCR_HDM ETH__BIT(14) 295 #define ETH_EPCR_HDM_Discard 0 296 #define ETH_EPCR_HDM_Pass ETH_EPCR_HDM 298 #define ETH_EPCR_HD_Half 0 299 #define ETH_EPCR_HD_Full ETH_EPCR_HD_Full 301 #define ETH_EPCR_ACCS ETH__BIT(31) 378 #define ETH_EPCXR_IGMP ETH__BIT(0) 379 #define ETH_EPCXR_SPAN ETH__BIT(1) 380 #define ETH_EPCXR_PAR ETH__BIT(2) 381 #define ETH_EPCXR_PRIOtx_GET(v) ETH__EXT(v, 3, 3) 382 #define ETH_EPCXR_PRIOrx_GET(v) ETH__EXT(v, 3, 3) 383 #define ETH_EPCXR_PRIOrx_Override ETH__BIT(8) 384 #define ETH_EPCXR_DLPXen ETH__BIT(9) 385 #define ETH_EPCXR_FCTLen ETH__BIT(10) 386 #define ETH_EPCXR_FLP ETH__BIT(11) 387 #define ETH_EPCXR_FCTL ETH__BIT(12) 388 #define ETH_EPCXR_MFL_GET(v) ETH__EXT(v, 14, 2) 389 #define ETH_EPCXR_MFL_1518 0 390 #define ETH_EPCXR_MFL_1536 1 391 #define ETH_EPCXR_MFL_2084 2 392 #define ETH_EPCXR_MFL_64K 3 393 #define ETH_EPCXR_MIBclrMode ETH__BIT(16) 394 #define ETH_EPCXR_MIBctrMode ETH__BIT(17) 395 #define ETH_EPCXR_Speed ETH__BIT(18) 396 #define ETH_EPCXR_SpeedEn ETH__BIT(19) 397 #define ETH_EPCXR_RMIIEn ETH__BIT(20) 398 #define ETH_EPCXR_DSCPEn ETH__BIT(21) 421 #define ETH_EPCMR_FJ ETH__BIT(15) 449 #define ETH_EPSR_Speed ETH__BIT(0) 450 #define ETH_EPSR_Duplex ETH__BIT(1) 451 #define ETH_EPSR_Fctl ETH__BIT(2) 452 #define ETH_EPSR_Link ETH__BIT(3) 453 #define ETH_EPSR_Pause ETH__BIT(4) 454 #define ETH_EPSR_TxLow ETH__BIT(5) 455 #define ETH_EPSR_TxHigh ETH__BIT(6) 456 #define ETH_EPSR_TXinProg ETH__BIT(7) 500 #define ETH_ESPR_JAM_LENGTH_GET(v) ETH__EXT(v, 0, 2) 501 #define ETH_ESPR_JAM_IPG_GET(v) ETH__EXT(v, 2, 5) 502 #define ETH_ESPR_IPG_JAM_TO_DATA_GET(v) ETH__EXT(v, 7, 5) 503 #define ETH_ESPR_IPG_DATA_GET(v) ETH__EXT(v, 12, 5) 504 #define ETH_ESPR_Data_Bilnd_GET(v) ETH__EXT(v, 17, 5) 505 #define ETH_ESPR_Limit4(v) ETH__BIT(22) 573 #define ETH_ESDCR_RC_GET(v) ETH__EXT(v, 2, 4) 574 #define ETH_ESDCR_BLMR ETH__BIT(6) 575 #define ETH_ESDCR_BLMT ETH__BIT(7) 576 #define ETH_ESDCR_POVR ETH__BIT(8) 577 #define ETH_ESDCR_RIFB ETH__BIT(9) 578 #define ETH_ESDCR_BSZ_GET(v) ETH__EXT(v, 12, 2) 579 #define ETH_ESDCR_BSZ_SET(v, n) (ETH__CLR(v, 12, 2),\ 580 (v) |= ETH__INS(n, 12)) 581 #define ETH_ESDCR_BSZ_1 0 582 #define ETH_ESDCR_BSZ_2 1 583 #define ETH_ESDCR_BSZ_4 2 584 #define ETH_ESDCR_BSZ_8 3 586 #define ETH_ESDCR_BSZ_Strings { "1 64-bit word", "2 64-bit words", \ 587 "4 64-bit words", "8 64-bit words" } 642 #define ETH_ESDCMR_ERD ETH__BIT(7) 643 #define ETH_ESDCMR_AR ETH__BIT(15) 644 #define ETH_ESDCMR_STDH ETH__BIT(16) 645 #define ETH_ESDCMR_STDL ETH__BIT(17) 646 #define ETH_ESDCMR_TXDH ETH__BIT(23) 647 #define ETH_ESDCMR_TXDL ETH__BIT(24) 648 #define ETH_ESDCMR_AT ETH__BIT(31) 761 #define ETH_IR_RxBuffer ETH__BIT(0) 762 #define ETH_IR_TxBufferHigh ETH__BIT(2) 763 #define ETH_IR_TxBufferLow ETH__BIT(3) 764 #define ETH_IR_TxEndHigh ETH__BIT(6) 765 #define ETH_IR_TxEndLow ETH__BIT(7) 766 #define ETH_IR_RxError ETH__BIT(8) 767 #define ETH_IR_TxErrorHigh ETH__BIT(10) 768 #define ETH_IR_TxErrorLow ETH__BIT(11) 769 #define ETH_IR_RxOVR ETH__BIT(12) 770 #define ETH_IR_TxUdr ETH__BIT(13) 771 #define ETH_IR_RxBuffer_0 ETH__BIT(16) 772 #define ETH_IR_RxBuffer_1 ETH__BIT(17) 773 #define ETH_IR_RxBuffer_2 ETH__BIT(18) 774 #define ETH_IR_RxBuffer_3 ETH__BIT(19) 775 #define ETH_IR_RxBuffer_GET(v) ETH__EXT(v, 16, 4) 776 #define ETH_IR_RxError_0 ETH__BIT(20) 777 #define ETH_IR_RxError_1 ETH__BIT(21) 778 #define ETH_IR_RxError_2 ETH__BIT(22) 779 #define ETH_IR_RxError_3 ETH__BIT(23) 780 #define ETH_IR_RxError_GET(v) ETH__EXT(v, 20, 4) 781 #define ETH_IR_RxBits (ETH_IR_RxBuffer_0|\ 789 #define ETH_IR_MIIPhySTC ETH__BIT(28) 790 #define ETH_IR_SMIdone ETH__BIT(29) 791 #define ETH_IR_EtherIntSum ETH__BIT(31) 792 #define ETH_IR_Summary ETH__BIT(31) 831 #define ETH_ACTL_0_LO 0xf200 838 #define RxBSnoopEn ETH__BIT(6) 839 #define TxBSnoopEn ETH__BIT(14) 840 #define RxDSnoopEn ETH__BIT(22) 841 #define TxDSnoopEn ETH__BIT(30) 843 #define ETH_ACTL_0_HI 0xf204 845 #define HashSnoopEn ETH__BIT(6) 848 #define ETH_ACTL_1_LO 0xf220 849 #define ETH_ACTL_1_HI 0xf224 850 #define ETH_ACTL_2_LO 0xf240 851 #define ETH_ACTL_2_HI 0xf244 Definition: gtethreg.h:61