38 #ifndef __DRIVERLIB_EMAC_H__ 39 #define __DRIVERLIB_EMAC_H__ 67 #define EMAC_PHY_ADDR 0 81 ((((a) >> 24) & 0x000000ff) | \ 82 (((a) >> 8) & 0x0000ff00) | \ 83 (((a) << 8) & 0x00ff0000) | \ 84 (((a) << 24) & 0xff000000)) 88 #define ntohl(a) htonl((a)) 99 ((((a) >> 8) & 0x00ff) | \ 100 (((a) << 8) & 0xff00)) 104 #define ntohs(a) htons((a)) 211 #define DES0_TX_CTRL_OWN 0x80000000 212 #define DES0_TX_CTRL_INTERRUPT 0x40000000 213 #define DES0_TX_CTRL_LAST_SEG 0x20000000 214 #define DES0_TX_CTRL_FIRST_SEG 0x10000000 227 #define DES0_TX_CTRL_DISABLE_CRC 0x08000000 228 #define DES0_TX_CTRL_DISABLE_PADDING 0x04000000 229 #define DES0_TX_CTRL_ENABLE_TS 0x02000000 236 #define DES0_TX_CTRL_REPLACE_CRC 0x01000000 237 #define DES0_TX_CTRL_CHKSUM_M 0x00C00000 238 #define DES0_TX_CTRL_NO_CHKSUM 0x00000000 239 #define DES0_TX_CTRL_IP_HDR_CHKSUM 0x00400000 240 #define DES0_TX_CTRL_IP_HDR_PAY_CHKSUM 0x00800000 241 #define DES0_TX_CTRL_IP_ALL_CKHSUMS 0x00C00000 242 #define DES0_TX_CTRL_END_OF_RING 0x00200000 243 #define DES0_TX_CTRL_CHAINED 0x00100000 244 #define DES0_TX_CTRL_VLAN_M 0x000C0000 245 #define DES0_TX_CTRL_VLAN_NONE 0x00000000 246 #define DES0_TX_CTRL_VLAN_REMOVE 0x00040000 247 #define DES0_TX_CTRL_VLAN_INSERT 0x00080000 248 #define DES0_TX_CTRL_VLAN_REPLACE 0x000C0000 249 #define DES0_TX_STAT_TS_CAPTURED 0x00020000 250 #define DES0_TX_STAT_IPH_ERR 0x00010000 251 #define DES0_TX_STAT_ERR 0x00008000 252 #define DES0_TX_STAT_JABBER_TO 0x00004000 253 #define DES0_TX_STAT_FLUSHED 0x00002000 254 #define DES0_TX_STAT_PAYLOAD_ERR 0x00001000 255 #define DES0_TX_STAT_CARRIER_LOST 0x00000800 256 #define DES0_TX_STAT_NO_CARRIER 0x00000400 257 #define DES0_TX_STAT_TX_L_COLLISION 0x00000200 258 #define DES0_TX_STAT_E_COLLISION 0x00000100 259 #define DES0_TX_STAT_VLAN_FRAME 0x00000080 260 #define DES0_TX_STAT_COL_COUNT_M 0x00000078 261 #define DES0_TX_STAT_COL_COUNT_S 3 262 #define DES0_TX_STAT_E_DEFERRAL 0x00000004 263 #define DES0_TX_STAT_UNDERFLOW 0x00000002 264 #define DES0_TX_STAT_DEFERRED 0x00000001 272 #define DES1_TX_CTRL_SADDR_MAC1 0x80000000 273 #define DES1_TX_CTRL_SADDR_M 0x60000000 274 #define DES1_TX_CTRL_SADDR_NONE 0x00000000 275 #define DES1_TX_CTRL_SADDR_INSERT 0x20000000 276 #define DES1_TX_CTRL_SADDR_REPLACE 0x40000000 277 #define DES1_TX_CTRL_BUFF2_SIZE_M 0x1FFF0000 278 #define DES1_TX_CTRL_BUFF1_SIZE_M 0x00001FFF 279 #define DES1_TX_CTRL_BUFF2_SIZE_S 16 280 #define DES1_TX_CTRL_BUFF1_SIZE_S 0 288 #define DES0_RX_CTRL_OWN 0x80000000 289 #define DES0_RX_STAT_DEST_ADDR_FAIL 0x40000000 290 #define DES0_RX_STAT_FRAME_LENGTH_M 0x3FFF0000 291 #define DES0_RX_STAT_FRAME_LENGTH_S 16 292 #define DES0_RX_STAT_ERR 0x00008000 293 #define DES0_RX_STAT_DESCRIPTOR_ERR 0x00004000 294 #define DES0_RX_STAT_SRC_ADDR_FAIL 0x00002000 295 #define DES0_RX_STAT_LENGTH_ERR 0x00001000 296 #define DES0_RX_STAT_OVERFLOW 0x00000800 297 #define DES0_RX_STAT_VLAN_TAG 0x00000400 298 #define DES0_RX_STAT_FIRST_DESC 0x00000200 299 #define DES0_RX_STAT_LAST_DESC 0x00000100 300 #define DES0_RX_STAT_TS_AVAILABLE 0x00000080 301 #define DES0_RX_STAT_RX_L_COLLISION 0x00000040 302 #define DES0_RX_STAT_FRAME_TYPE 0x00000020 303 #define DES0_RX_STAT_WDOG_TIMEOUT 0x00000010 304 #define DES0_RX_STAT_RX_ERR 0x00000008 305 #define DES0_RX_STAT_DRIBBLE_ERR 0x00000004 306 #define DES0_RX_STAT_CRC_ERR 0x00000002 307 #define DES0_RX_STAT_MAC_ADDR 0x00000001 308 #define DES0_RX_STAT_EXT_AVAILABLE 0x00000001 316 #define DES1_RX_CTRL_DISABLE_INT 0x80000000 317 #define DES1_RX_CTRL_BUFF2_SIZE_M 0x1FFF0000 318 #define DES1_RX_CTRL_BUFF2_SIZE_S 16 319 #define DES1_RX_CTRL_END_OF_RING 0x00008000 320 #define DES1_RX_CTRL_CHAINED 0x00004000 321 #define DES1_RX_CTRL_BUFF1_SIZE_M 0x00001FFF 322 #define DES1_RX_CTRL_BUFF1_SIZE_S 0 330 #define DES4_RX_STAT_TS_DROPPED 0x00004000 331 #define DES4_RX_STAT_PTP_VERSION2 0x00002000 332 #define DES4_RX_STAT_PTP_TYPE_ETH 0x00001000 333 #define DES4_RX_STAT_PTP_TYPE_UDP 0x00000000 334 #define DES4_RX_STAT_PTP_MT_M 0x00000F00 335 #define DES4_RX_STAT_PTP_MT_NONE 0x00000000 336 #define DES4_RX_STAT_PTP_MT_SYNC 0x00000100 337 #define DES4_RX_STAT_PTP_MT_FOLLOW_UP 0x00000200 338 #define DES4_RX_STAT_PTP_MT_DELAY_REQ 0x00000300 339 #define DES4_RX_STAT_PTP_MT_DELAY_RESP 0x00000400 340 #define DES4_RX_STAT_PTP_MT_PDELAY_REQ 0x00000500 341 #define DES4_RX_STAT_PTP_MT_PDELAY_RESP 0x00000600 342 #define DES4_RX_STAT_PTP_MT_PDELAY_RFU 0x00000700 343 #define DES4_RX_STAT_PTP_MT_ANNOUNCE 0x00000800 344 #define DES4_RX_STAT_PTP_MT_SIGNALLING 0x00000A00 345 #define DES4_RX_STAT_PTP_MT_RESERVED 0x00000F00 346 #define DES4_RX_STAT_IPV6 0x00000080 347 #define DES4_RX_STAT_IPV4 0x00000040 348 #define DES4_RX_STAT_IP_CHK_BYPASSED 0x00000020 349 #define DES4_RX_STAT_IP_PAYLOAD_ERR 0x00000010 350 #define DES4_RX_STAT_IP_HEADER_ERR 0x00000008 351 #define DES4_RX_STAT_PAYLOAD_M 0x00000007 352 #define DES4_RX_STAT_PAYLOAD_UNKNOWN 0x00000000 353 #define DES4_RX_STAT_PAYLOAD_UDP 0x00000001 354 #define DES4_RX_STAT_PAYLOAD_TCP 0x00000002 355 #define DES4_RX_STAT_PAYLOAD_ICMP 0x00000003 362 #define EMAC_BCONFIG_DMA_PRIO_WEIGHT_M 0x30000000 363 #define EMAC_BCONFIG_DMA_PRIO_WEIGHT_1 0x00000000 364 #define EMAC_BCONFIG_DMA_PRIO_WEIGHT_2 0x10000000 365 #define EMAC_BCONFIG_DMA_PRIO_WEIGHT_3 0x20000000 366 #define EMAC_BCONFIG_DMA_PRIO_WEIGHT_4 0x30000000 367 #define EMAC_BCONFIG_TX_PRIORITY 0x08000000 368 #define EMAC_BCONFIG_ADDR_ALIGNED 0x02000000 369 #define EMAC_BCONFIG_PRIORITY_M 0x0000C000 370 #define EMAC_BCONFIG_PRIORITY_1_1 (0 << 14) 371 #define EMAC_BCONFIG_PRIORITY_2_1 (1 << 14) 372 #define EMAC_BCONFIG_PRIORITY_3_1 (2 << 14) 373 #define EMAC_BCONFIG_PRIORITY_4_1 (3 << 14) 374 #define EMAC_BCONFIG_PRIORITY_FIXED 0x00000002 375 #define EMAC_BCONFIG_FIXED_BURST 0x00010000 376 #define EMAC_BCONFIG_MIXED_BURST 0x04000000 383 #define EMAC_PHY_TYPE_INTERNAL 0x00000000 384 #define EMAC_PHY_TYPE_EXTERNAL_MII 0x80000000 385 #define EMAC_PHY_TYPE_EXTERNAL_RMII 0xC0000000 386 #define EMAC_PHY_INT_NIB_TXERR_DET_DIS 0x01000000 387 #define EMAC_PHY_INT_RX_ER_DURING_IDLE 0x00800000 388 #define EMAC_PHY_INT_ISOLATE_MII_LLOSS 0x00400000 389 #define EMAC_PHY_INT_LINK_LOSS_RECOVERY 0x00200000 390 #define EMAC_PHY_INT_TDRRUN 0x00100000 391 #define EMAC_PHY_INT_LD_ON_RX_ERR_COUNT 0x00040000 392 #define EMAC_PHY_INT_LD_ON_MTL3_ERR_COUNT 0x00020000 393 #define EMAC_PHY_INT_LD_ON_LOW_SNR 0x00010000 394 #define EMAC_PHY_INT_LD_ON_SIGNAL_ENERGY 0x00008000 395 #define EMAC_PHY_INT_POLARITY_SWAP 0x00004000 396 #define EMAC_PHY_INT_MDI_SWAP 0x00002000 397 #define EMAC_PHY_INT_ROBUST_MDIX 0x00001000 398 #define EMAC_PHY_INT_FAST_MDIX 0x00000800 399 #define EMAC_PHY_INT_MDIX_EN 0x00000400 400 #define EMAC_PHY_INT_FAST_RXDV_DETECT 0x00000200 401 #define EMAC_PHY_INT_FAST_L_UP_DETECT 0x00000100 402 #define EMAC_PHY_INT_EXT_FULL_DUPLEX 0x00000080 403 #define EMAC_PHY_INT_FAST_AN_80_50_35 0x00000040 404 #define EMAC_PHY_INT_FAST_AN_120_75_50 0x00000050 405 #define EMAC_PHY_INT_FAST_AN_140_150_100 0x00000060 406 #define EMAC_PHY_FORCE_10B_T_HALF_DUPLEX 0x00000000 407 #define EMAC_PHY_FORCE_10B_T_FULL_DUPLEX 0x00000002 408 #define EMAC_PHY_FORCE_100B_T_HALF_DUPLEX 0x00000004 409 #define EMAC_PHY_FORCE_100B_T_FULL_DUPLEX 0x00000006 410 #define EMAC_PHY_AN_10B_T_HALF_DUPLEX 0x00000008 411 #define EMAC_PHY_AN_10B_T_FULL_DUPLEX 0x0000000A 412 #define EMAC_PHY_AN_100B_T_HALF_DUPLEX 0x0000000C 413 #define EMAC_PHY_AN_100B_T_FULL_DUPLEX 0x0000000E 414 #define EMAC_PHY_INT_HOLD 0x00000001 416 #define EMAC_PHY_TYPE_MASK 0xC0000000 423 #define EMAC_CONFIG_USE_MACADDR1 0x40000000 424 #define EMAC_CONFIG_USE_MACADDR0 0x00000000 425 #define EMAC_CONFIG_SA_FROM_DESCRIPTOR 0x00000000 426 #define EMAC_CONFIG_SA_INSERT 0x20000000 427 #define EMAC_CONFIG_SA_REPLACE 0x30000000 428 #define EMAC_CONFIG_2K_PACKETS 0x08000000 429 #define EMAC_CONFIG_STRIP_CRC 0x02000000 430 #define EMAC_CONFIG_JABBER_DISABLE 0x00400000 431 #define EMAC_CONFIG_JUMBO_ENABLE 0x00100000 432 #define EMAC_CONFIG_IF_GAP_MASK 0x000E0000 433 #define EMAC_CONFIG_IF_GAP_96BITS (0x0 << 17) 434 #define EMAC_CONFIG_IF_GAP_88BITS (0x1 << 17) 435 #define EMAC_CONFIG_IF_GAP_80BITS (0x2 << 17) 436 #define EMAC_CONFIG_IF_GAP_72BITS (0x3 << 17) 437 #define EMAC_CONFIG_IF_GAP_64BITS (0x4 << 17) 438 #define EMAC_CONFIG_IF_GAP_56BITS (0x5 << 17) 439 #define EMAC_CONFIG_IF_GAP_48BITS (0x6 << 17) 440 #define EMAC_CONFIG_IF_GAP_40BITS (0x7 << 17) 441 #define EMAC_CONFIG_CS_DISABLE 0x00010000 442 #define EMAC_CONFIG_100MBPS 0x00004000 443 #define EMAC_CONFIG_10MBPS 0x00000000 444 #define EMAC_CONFIG_RX_OWN_DISABLE 0x00002000 445 #define EMAC_CONFIG_LOOPBACK 0x00001000 446 #define EMAC_CONFIG_FULL_DUPLEX 0x00000800 447 #define EMAC_CONFIG_HALF_DUPLEX 0x00000000 448 #define EMAC_CONFIG_CHECKSUM_OFFLOAD 0x00000400 449 #define EMAC_CONFIG_RETRY_DISABLE 0x00000200 450 #define EMAC_CONFIG_AUTO_CRC_STRIPPING 0x00000080 451 #define EMAC_CONFIG_BO_MASK 0x00000060 452 #define EMAC_CONFIG_BO_LIMIT_1024 (0x0 << 5) 453 #define EMAC_CONFIG_BO_LIMIT_256 (0x1 << 5) 454 #define EMAC_CONFIG_BO_LIMIT_16 (0x2 << 5) 455 #define EMAC_CONFIG_BO_LIMIT_2 (0x3 << 5) 456 #define EMAC_CONFIG_DEFERRAL_CHK_ENABLE 0x00000010 457 #define EMAC_CONFIG_PREAMBLE_MASK 0x00000003 458 #define EMAC_CONFIG_7BYTE_PREAMBLE 0x00000000 459 #define EMAC_CONFIG_5BYTE_PREAMBLE 0x00000001 460 #define EMAC_CONFIG_3BYTE_PREAMBLE 0x00000002 467 #define EMAC_MODE_KEEP_BAD_CRC 0x04000000 468 #define EMAC_MODE_RX_STORE_FORWARD 0x02000000 469 #define EMAC_MODE_RX_FLUSH_DISABLE 0x01000000 470 #define EMAC_MODE_TX_STORE_FORWARD 0x00200000 471 #define EMAC_MODE_TX_THRESHOLD_16_BYTES (7 << 14) 472 #define EMAC_MODE_TX_THRESHOLD_24_BYTES (6 << 14) 473 #define EMAC_MODE_TX_THRESHOLD_32_BYTES (5 << 14) 474 #define EMAC_MODE_TX_THRESHOLD_40_BYTES (4 << 14) 475 #define EMAC_MODE_TX_THRESHOLD_64_BYTES (0 << 14) 476 #define EMAC_MODE_TX_THRESHOLD_128_BYTES (1 << 14) 477 #define EMAC_MODE_TX_THRESHOLD_192_BYTES (2 << 14) 478 #define EMAC_MODE_TX_THRESHOLD_256_BYTES (3 << 14) 479 #define EMAC_MODE_RX_ERROR_FRAMES 0x00000080 480 #define EMAC_MODE_RX_UNDERSIZED_FRAMES 0x00000040 481 #define EMAC_MODE_RX_THRESHOLD_64_BYTES (0 << 3) 482 #define EMAC_MODE_RX_THRESHOLD_32_BYTES (1 << 3) 483 #define EMAC_MODE_RX_THRESHOLD_96_BYTES (2 << 3) 484 #define EMAC_MODE_RX_THRESHOLD_128_BYTES (3 << 3) 485 #define EMAC_MODE_OPERATE_2ND_FRAME 0x00000002 495 #define EMAC_CONFIG_TX_ENABLED 0x00000008 496 #define EMAC_CONFIG_RX_ENABLED 0x00000004 506 #define EMAC_MODE_TX_DMA_ENABLED 0x00002000 507 #define EMAC_MODE_RX_DMA_ENABLED 0x00000002 515 #define EMAC_FRMFILTER_RX_ALL 0x80000000 516 #define EMAC_FRMFILTER_VLAN 0x00010000 517 #define EMAC_FRMFILTER_HASH_AND_PERFECT 0x00000400 518 #define EMAC_FRMFILTER_SADDR 0x00000200 519 #define EMAC_FRMFILTER_INV_SADDR 0x00000100 520 #define EMAC_FRMFILTER_PASS_MASK (0x03 << 6) 521 #define EMAC_FRMFILTER_PASS_NO_CTRL (0x00 << 6) 522 #define EMAC_FRMFILTER_PASS_NO_PAUSE (0x01 << 6) 523 #define EMAC_FRMFILTER_PASS_ALL_CTRL (0x02 << 6) 524 #define EMAC_FRMFILTER_PASS_ADDR_CTRL (0x03 << 6) 525 #define EMAC_FRMFILTER_BROADCAST 0x00000020 526 #define EMAC_FRMFILTER_PASS_MULTICAST 0x00000010 527 #define EMAC_FRMFILTER_INV_DADDR 0x00000008 528 #define EMAC_FRMFILTER_HASH_MULTICAST 0x00000004 529 #define EMAC_FRMFILTER_HASH_UNICAST 0x00000002 530 #define EMAC_FRMFILTER_PROMISCUOUS 0x00000001 537 #define EMAC_STATUS_TX_NOT_EMPTY 0x01000000 538 #define EMAC_STATUS_TX_WRITING_FIFO 0x00400000 539 #define EMAC_STATUS_TRC_STATE_MASK 0x00300000 540 #define EMAC_STATUS_TRC_STATE_IDLE (0x00 << 20) 541 #define EMAC_STATUS_TRC_STATE_READING (0x01 << 20) 542 #define EMAC_STATUS_TRC_STATE_WAITING (0x02 << 20) 543 #define EMAC_STATUS_TRC_STATE_STATUS (0x03 << 20) 544 #define EMAC_STATUS_TX_PAUSED 0x00080000 545 #define EMAC_STATUS_TFC_STATE_MASK 0x00060000 546 #define EMAC_STATUS_TFC_STATE_IDLE (0x00 << 17) 547 #define EMAC_STATUS_TFC_STATE_WAITING (0x01 << 17) 548 #define EMAC_STATUS_TFC_STATE_PAUSING (0x02 << 17) 549 #define EMAC_STATUS_TFC_STATE_WRITING (0x03 << 17) 550 #define EMAC_STATUS_MAC_NOT_IDLE 0x00010000 551 #define EMAC_STATUS_RX_FIFO_LEVEL_MASK 0x00000300 552 #define EMAC_STATUS_RX_FIFO_EMPTY (0x00 << 8) 553 #define EMAC_STATUS_RX_FIFO_BELOW (0x01 << 8) 554 #define EMAC_STATUS_RX_FIFO_ABOVE (0x02 << 8) 555 #define EMAC_STATUS_RX_FIFO_FULL (0x03 << 8) 556 #define EMAC_STATUS_RX_FIFO_STATE_MASK 0x00000060 557 #define EMAC_STATUS_RX_FIFO_IDLE (0x00 << 5) 558 #define EMAC_STATUS_RX_FIFO_READING (0x01 << 5) 559 #define EMAC_STATUS_RX_FIFO_STATUS (0x02 << 5) 560 #define EMAC_STATUS_RX_FIFO_FLUSHING (0x03 << 5) 561 #define EMAC_STATUS_RWC_ACTIVE 0x00000010 562 #define EMAC_STATUS_RPE_ACTIVE 0x00000001 569 #define EMAC_DMA_TXSTAT_MASK (0x07 << 20) 570 #define EMAC_DMA_TXSTAT_STOPPED (0x00 << 20) 571 #define EMAC_DMA_TXSTAT_RUN_FETCH_DESC (0x01 << 20) 572 #define EMAC_DMA_TXSTAT_RUN_WAIT_STATUS (0x02 << 20) 573 #define EMAC_DMA_TXSTAT_RUN_READING (0x03 << 20) 574 #define EMAC_DMA_TXSTAT_RUN_CLOSE_DESC (0x07 << 20) 575 #define EMAC_DMA_TXSTAT_TS_WRITE (0x04 << 20) 576 #define EMAC_DMA_TXSTAT_SUSPENDED (0x06 << 20) 578 #define EMAC_DMA_RXSTAT_MASK (0x07 << 17) 579 #define EMAC_DMA_RXSTAT_STOPPED (0x00 << 17) 580 #define EMAC_DMA_RXSTAT_RUN_FETCH_DESC (0x01 << 17) 581 #define EMAC_DMA_RXSTAT_RUN_WAIT_PACKET (0x03 << 17) 582 #define EMAC_DMA_RXSTAT_SUSPENDED (0x04 << 17) 583 #define EMAC_DMA_RXSTAT_RUN_CLOSE_DESC (0x05 << 17) 584 #define EMAC_DMA_RXSTAT_TS_WRITE (0x06 << 17) 585 #define EMAC_DMA_RXSTAT_RUN_RECEIVING (0x07 << 17) 587 #define EMAC_TX_DMA_STATE(x) ((x) & EMAC_DMA_TXSTAT_MASK) 588 #define EMAC_RX_DMA_STATE(x) ((x) & EMAC_DMA_RXSTAT_MASK) 590 #define EMAC_DMA_ERROR 0x00002000 591 #define EMAC_DMA_ERR_MASK 0x03800000 592 #define EMAC_DMA_ERR_RX_DATA_WRITE 0x00000000 593 #define EMAC_DMA_ERR_TX_DATA_READ 0x01800000 594 #define EMAC_DMA_ERR_RX_DESC_WRITE 0x02000000 595 #define EMAC_DMA_ERR_TX_DESC_WRITE 0x02800000 596 #define EMAC_DMA_ERR_RX_DESC_READ 0x03000000 597 #define EMAC_DMA_ERR_TX_DESC_READ 0x03800000 605 #define EMAC_FILTER_ADDR_ENABLE 0x80000000 606 #define EMAC_FILTER_SOURCE_ADDR 0x40000000 607 #define EMAC_FILTER_MASK_BYTE_6 0x20000000 608 #define EMAC_FILTER_MASK_BYTE_5 0x10000000 609 #define EMAC_FILTER_MASK_BYTE_4 0x08000000 610 #define EMAC_FILTER_MASK_BYTE_3 0x04000000 611 #define EMAC_FILTER_MASK_BYTE_2 0x03000000 612 #define EMAC_FILTER_MASK_BYTE_1 0x01000000 614 #define EMAC_FILTER_BYTE_MASK_M 0x3F000000 615 #define EMAC_FILTER_BYTE_MASK_S 24 623 #define EMAC_TS_MAC_FILTER_ENABLE 0x00040000 624 #define EMAC_TS_MAC_FILTER_DISABLE 0x00000000 625 #define EMAC_TS_SYNC_FOLLOW_DREQ_DRESP 0x00000000 626 #define EMAC_TS_SYNC_ONLY 0x00004000 627 #define EMAC_TS_DELAYREQ_ONLY 0x0000C000 628 #define EMAC_TS_ALL 0x00010000 629 #define EMAC_TS_SYNC_PDREQ_PDRESP 0x00014000 630 #define EMAC_TS_DREQ_PDREQ_PDRESP 0x0001C000 631 #define EMAC_TS_SYNC_DELAYREQ 0x00020000 632 #define EMAC_TS_PDREQ_PDRESP 0x00030000 633 #define EMAC_TS_PROCESS_IPV4_UDP 0x00002000 634 #define EMAC_TS_PROCESS_IPV6_UDP 0x00001000 635 #define EMAC_TS_PROCESS_ETHERNET 0x00000800 636 #define EMAC_TS_PTP_VERSION_2 0x00000400 637 #define EMAC_TS_PTP_VERSION_1 0x00000000 638 #define EMAC_TS_DIGITAL_ROLLOVER 0x00000200 639 #define EMAC_TS_BINARY_ROLLOVER 0x00000000 640 #define EMAC_TS_ALL_RX_FRAMES 0x00000100 641 #define EMAC_TS_UPDATE_FINE 0x00000002 642 #define EMAC_TS_UPDATE_COARSE 0x00000000 651 #define EPHY_SCR_INPOL_EXT 0x00000008 652 #define EPHY_SCR_TINT_EXT 0x00000004 653 #define EPHY_SCR_INTEN_EXT 0x00000002 654 #define EPHY_SCR_INTOE_EXT 0x00000001 677 #define EMAC_INT_PHY 0x80000000 678 #define EMAC_INT_EARLY_RECEIVE 0x00004000 679 #define EMAC_INT_BUS_ERROR 0x00002000 680 #define EMAC_INT_EARLY_TRANSMIT 0x00000400 681 #define EMAC_INT_RX_WATCHDOG 0x00000200 682 #define EMAC_INT_RX_STOPPED 0x00000100 683 #define EMAC_INT_RX_NO_BUFFER 0x00000080 684 #define EMAC_INT_RECEIVE 0x00000040 685 #define EMAC_INT_TX_UNDERFLOW 0x00000020 686 #define EMAC_INT_RX_OVERFLOW 0x00000010 687 #define EMAC_INT_TX_JABBER 0x00000008 688 #define EMAC_INT_TX_NO_BUFFER 0x00000004 689 #define EMAC_INT_TX_STOPPED 0x00000002 690 #define EMAC_INT_TRANSMIT 0x00000001 708 #define EMAC_INT_NORMAL_INT 0x00010000 709 #define EMAC_INT_ABNORMAL_INT 0x00008000 715 #define EMAC_INT_LPI 0x40000000 721 #define EMAC_INT_TIMESTAMP 0x20000000 726 #define EMAC_TS_INT_TARGET_REACHED 0x00000002 727 #define EMAC_TS_INT_TS_SEC_OVERFLOW 0x00000001 733 #define EMAC_INT_POWER_MGMNT 0x10000000 741 #define EMAC_PPS_SINGLE_PULSE 0x00000000 742 #define EMAC_PPS_1HZ 0x00000001 743 #define EMAC_PPS_2HZ 0x00000002 744 #define EMAC_PPS_4HZ 0x00000003 745 #define EMAC_PPS_8HZ 0x00000004 746 #define EMAC_PPS_16HZ 0x00000005 747 #define EMAC_PPS_32HZ 0x00000006 748 #define EMAC_PPS_64HZ 0x00000007 749 #define EMAC_PPS_128HZ 0x00000008 750 #define EMAC_PPS_256HZ 0x00000009 751 #define EMAC_PPS_512HZ 0x0000000A 752 #define EMAC_PPS_1024HZ 0x0000000B 753 #define EMAC_PPS_2048HZ 0x0000000C 754 #define EMAC_PPS_4096HZ 0x0000000D 755 #define EMAC_PPS_8192HZ 0x0000000E 756 #define EMAC_PPS_16384HZ 0x0000000F 757 #define EMAC_PPS_32768HZ 0x00000010 765 #define EMAC_PPS_TARGET_INT 0x00000000 766 #define EMAC_PPS_TARGET_PPS 0x00000060 767 #define EMAC_PPS_TARGET_BOTH 0x00000040 774 #define EMAC_PPS_COMMAND_NONE 0x00 775 #define EMAC_PPS_COMMAND_START_SINGLE 0x01 776 #define EMAC_PPS_COMMAND_START_TRAIN 0x02 777 #define EMAC_PPS_COMMAND_CANCEL_START 0x03 778 #define EMAC_PPS_COMMAND_STOP_AT_TIME 0x04 779 #define EMAC_PPS_COMMAND_STOP_NOW 0x05 780 #define EMAC_PPS_COMMAND_CANCEL_STOP 0x06 788 #define EMAC_VLAN_RX_HASH_ENABLE 0x00080000 789 #define EMAC_VLAN_RX_HASH_DISABLE 0x00000000 790 #define EMAC_VLAN_RX_SVLAN_ENABLE 0x00040000 791 #define EMAC_VLAN_RX_SVLAN_DISABLE 0x00000000 792 #define EMAC_VLAN_RX_NORMAL_MATCH 0x00000000 793 #define EMAC_VLAN_RX_INVERSE_MATCH 0x00020000 794 #define EMAC_VLAN_RX_12BIT_TAG 0x00010000 795 #define EMAC_VLAN_RX_16BIT_TAG 0x00000000 803 #define EMAC_VLAN_TX_CVLAN 0x00000000 804 #define EMAC_VLAN_TX_SVLAN 0x00080000 805 #define EMAC_VLAN_TX_USE_VLC 0x00040000 806 #define EMAC_VLAN_TX_VLC_NONE 0x00000000 807 #define EMAC_VLAN_TX_VLC_DELETE 0x00010000 808 #define EMAC_VLAN_TX_VLC_INSERT 0x00020000 809 #define EMAC_VLAN_TX_VLC_REPLACE 0x00030000 811 #define EMAC_VLAN_TX_VLC_MASK 0x00030000 813 #define EMAC_RWU_FILTER_ENABLE 1 814 #define EMAC_RWU_FILTER_DISABLE 0 815 #define EMAC_RWU_FILTER_MULTICAST 8 816 #define EMAC_RWU_FILTER_UNICAST 0 841 uint32_t pui32ByteMask[4];
849 uint8_t pui8Command[4];
856 uint8_t pui8Offset[4];
862 uint16_t pui16CRC[4];
864 #if defined(__TI_ARM__) || \ 865 defined(codered) || \ 866 defined(__GNUC__) || \ 868 defined(__ARMCC_VERSION) || \ 872 tEMACWakeUpFrameFilter;
891 #define EMAC_PMT_GLOBAL_UNICAST_ENABLE 0x00000200 892 #define EMAC_PMT_WAKEUP_PACKET_ENABLE 0x00000004 893 #define EMAC_PMT_MAGIC_PACKET_ENABLE 0x00000002 894 #define EMAC_PMT_POWER_DOWN 0x00000001 903 #define EMAC_PMT_WAKEUP_PACKET_RECEIVED 0x00000040 904 #define EMAC_PMT_MAGIC_PACKET_RECEIVED 0x00000020 918 extern void EMACInit(uint32_t ui32Base, uint32_t ui32SysClk,
919 uint32_t ui32BusConfig, uint32_t ui32RxBurst,
920 uint32_t ui32TxBurst, uint32_t ui32DescSkipSize);
921 extern void EMACReset(uint32_t ui32Base);
923 extern void EMACConfigSet(uint32_t ui32Base, uint32_t ui32Config,
924 uint32_t ui32ModeFlags,
925 uint32_t ui32RxMaxFrameSize);
929 uint32_t ui32HashLo);
931 uint32_t *pui32HashLo);
945 extern void EMACConfigGet(uint32_t ui32Base, uint32_t *pui32Config,
946 uint32_t *pui32Mode, uint32_t *pui32RxMaxFrameSize);
947 extern void EMACAddrSet(uint32_t ui32Base, uint32_t ui32Index,
948 const uint8_t *pui8MACAddr);
949 extern void EMACAddrGet(uint32_t ui32Base, uint32_t ui32Index,
950 uint8_t *pui8MACAddr);
953 uint32_t ui32Config);
963 extern void EMACIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags);
964 extern void EMACIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags);
965 extern uint32_t
EMACIntStatus(uint32_t ui32Base,
bool bMasked);
966 extern void EMACIntClear(uint32_t ui32Base, uint32_t ui32IntFlags);
967 extern void EMACIntRegister(uint32_t ui32Base,
void (*pfnHandler)(
void));
969 extern void EMACPHYWrite(uint32_t ui32Base, uint8_t ui8PhyAddr,
970 uint8_t ui8RegAddr, uint16_t ui16Data);
972 uint16_t ui16RegAddr, uint16_t ui16Data);
973 extern uint16_t
EMACPHYRead(uint32_t ui32Base, uint8_t ui8PhyAddr,
976 uint16_t ui16RegAddr);
978 extern void EMACPHYPowerOn(uint32_t ui32Base, uint8_t ui8PhyAddr);
980 uint32_t ui32SubSecondInc);
982 uint32_t *pui32SubSecondInc);
987 uint32_t ui32SubSeconds);
989 uint32_t *pui32SubSeconds);
991 uint32_t ui32SubSeconds,
bool bInc);
993 uint32_t ui32Nanoseconds);
998 uint32_t ui32FreqConfig);
1000 uint32_t ui32Config);
1003 uint32_t ui32Width);
1005 uint32_t ui32Config);
1008 uint32_t ui32Config);
1014 const tEMACWakeUpFrameFilter *pFilter);
1016 tEMACWakeUpFrameFilter *pFilter);
1018 uint32_t ui32Flags);
1022 extern void EMACLPIConfig(uint32_t ui32Base,
bool bLPIConfig,
1023 uint16_t ui16LPILSTimer, uint16_t ui16LPITWTimer);
1029 uint16_t ui16RegAddr, uint16_t ui16Data);
1030 extern uint16_t
EMACPHYMMDRead(uint32_t ui32Base, uint8_t ui8PhyAddr,
1031 uint16_t ui16RegAddr);
1041 #endif // __DRIVERLIB_EMAC_H__ uint32_t EMACTimestampIntStatus(uint32_t ui32Base)
Definition: emac.c:3718
tEMACDES3 DES3
Definition: emac.h:175
uint32_t EMACHashFilterBitCalculate(uint8_t *pui8MACAddr)
Definition: emac.c:1677
void EMACLPILinkSet(uint32_t ui32Base)
Definition: emac.c:4857
uint8_t * EMACTxDMACurrentBufferGet(uint32_t ui32Base)
Definition: emac.c:2099
void EMACRxDMADescriptorListSet(uint32_t ui32Base, tEMACDMADescriptor *pDescriptor)
Definition: emac.c:1907
void EMACIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: emac.c:2460
void EMACTxFlush(uint32_t ui32Base)
Definition: emac.c:2203
tEMACDMADescriptor * pLink
Definition: emac.h:126
uint16_t EMACPHYRead(uint32_t ui32Base, uint8_t ui8PhyAddr, uint8_t ui8RegAddr)
Definition: emac.c:2905
void EMACTxDMAPollDemand(uint32_t ui32Base)
Definition: emac.c:1831
void EMACTimestampEnable(uint32_t ui32Base)
Definition: emac.c:3320
uint8_t * EMACRxDMACurrentBufferGet(uint32_t ui32Base)
Definition: emac.c:1979
void EMACTimestampTargetIntEnable(uint32_t ui32Base)
Definition: emac.c:3651
void EMACLPILinkClear(uint32_t ui32Base)
Definition: emac.c:4883
uint32_t EMACAddrFilterGet(uint32_t ui32Base, uint32_t ui32Index)
Definition: emac.c:1399
void EMACReset(uint32_t ui32Base)
Definition: emac.c:430
void EMACVLANTxConfigSet(uint32_t ui32Base, uint16_t ui16Tag, uint32_t ui32Config)
Definition: emac.c:4163
void EMACAddrFilterSet(uint32_t ui32Base, uint32_t ui32Index, uint32_t ui32Config)
Definition: emac.c:1328
void EMACRxWatchdogTimerSet(uint32_t ui32Base, uint8_t ui8Timeout)
Definition: emac.c:1738
uint32_t ui32Reserved
Definition: emac.h:187
void EMACRxEnable(uint32_t ui32Base)
Definition: emac.c:2291
void EMACPHYWrite(uint32_t ui32Base, uint8_t ui8PhyAddr, uint8_t ui8RegAddr, uint16_t ui16Data)
Definition: emac.c:2848
uint32_t EMACPowerManagementStatusGet(uint32_t ui32Base)
Definition: emac.c:4673
void EMACTxEnable(uint32_t ui32Base)
Definition: emac.c:2238
void * pvBuffer2
Definition: emac.h:133
void EMACIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: emac.c:2786
void EMACLPIEnter(uint32_t ui32Base)
Definition: emac.c:4808
void EMACTimestampPPSCommand(uint32_t ui32Base, uint8_t ui8Cmd)
Definition: emac.c:3924
void EMACTimestampSysTimeUpdate(uint32_t ui32Base, uint32_t ui32Seconds, uint32_t ui32SubSeconds, bool bInc)
Definition: emac.c:3491
void EMACInit(uint32_t ui32Base, uint32_t ui32SysClk, uint32_t ui32BusConfig, uint32_t ui32RxBurst, uint32_t ui32TxBurst, uint32_t ui32DescSkipSize)
Definition: emac.c:310
uint16_t EMACPHYExtendedRead(uint32_t ui32Base, uint8_t ui8PhyAddr, uint16_t ui16RegAddr)
Definition: emac.c:2958
void EMACTimestampPPSPeriodSet(uint32_t ui32Base, uint32_t ui32Period, uint32_t ui32Width)
Definition: emac.c:3980
void EMACTimestampSysTimeGet(uint32_t ui32Base, uint32_t *pui32Seconds, uint32_t *pui32SubSeconds)
Definition: emac.c:3442
volatile uint32_t ui32CtrlStatus
Definition: emac.h:150
uint32_t EMACFrameFilterGet(uint32_t ui32Base)
Definition: emac.c:1569
void EMACPHYConfigSet(uint32_t ui32Base, uint32_t ui32Config)
Definition: emac.c:583
volatile uint32_t ui32IEEE1588TimeHi
Definition: emac.h:202
void EMACHashFilterGet(uint32_t ui32Base, uint32_t *pui32HashHi, uint32_t *pui32HashLo)
Definition: emac.c:1643
void EMACRemoteWakeUpFrameFilterSet(uint32_t ui32Base, const tEMACWakeUpFrameFilter *pFilter)
Definition: emac.c:4416
void EMACVLANRxConfigSet(uint32_t ui32Base, uint16_t ui16Tag, uint32_t ui32Config)
Definition: emac.c:4043
A structure defining a single Ethernet DMA buffer descriptor.
Definition: emac.h:142
void EMACAddrGet(uint32_t ui32Base, uint32_t ui32Index, uint8_t *pui8MACAddr)
Definition: emac.c:1231
uint32_t EMACDMAStateGet(uint32_t ui32Base)
Definition: emac.c:2178
void EMACHashFilterSet(uint32_t ui32Base, uint32_t ui32HashHi, uint32_t ui32HashLo)
Definition: emac.c:1608
void EMACLPIConfig(uint32_t ui32Base, bool bLPIConfig, uint16_t ui16LPILSTimer, uint16_t ui16LPITWTimer)
Definition: emac.c:4763
void EMACTimestampTargetIntDisable(uint32_t ui32Base)
Definition: emac.c:3680
void EMACPHYPowerOn(uint32_t ui32Base, uint8_t ui8PhyAddr)
Definition: emac.c:3061
void EMACTimestampPPSSimpleModeSet(uint32_t ui32Base, uint32_t ui32FreqConfig)
Definition: emac.c:3776
void EMACVLANHashFilterSet(uint32_t ui32Base, uint32_t ui32Hash)
Definition: emac.c:4322
void EMACPHYPowerOff(uint32_t ui32Base, uint8_t ui8PhyAddr)
Definition: emac.c:3035
tEMACDMADescriptor * EMACRxDMADescriptorListGet(uint32_t ui32Base)
Definition: emac.c:1935
void EMACAddrSet(uint32_t ui32Base, uint32_t ui32Index, const uint8_t *pui8MACAddr)
Definition: emac.c:1176
void EMACRxDMAPollDemand(uint32_t ui32Base)
Definition: emac.c:1858
uint32_t EMACVLANHashFilterBitCalculate(uint16_t ui16Tag)
Definition: emac.c:4267
uint32_t EMACPowerManagementControlGet(uint32_t ui32Base)
Definition: emac.c:4633
void EMACConfigSet(uint32_t ui32Base, uint32_t ui32Config, uint32_t ui32ModeFlags, uint32_t ui32RxMaxFrameSize)
Definition: emac.c:824
void EMACRxDisable(uint32_t ui32Base)
Definition: emac.c:2317
void EMACTxDisable(uint32_t ui32Base)
Definition: emac.c:2264
void EMACTimestampConfigSet(uint32_t ui32Base, uint32_t ui32Config, uint32_t ui32SubSecondInc)
Definition: emac.c:3195
uint16_t EMACLPIStatus(uint32_t ui32Base)
Definition: emac.c:4831
uint16_t EMACPHYMMDRead(uint32_t ui32Base, uint8_t ui8PhyAddr, uint16_t ui16RegAddr)
Definition: emac.c:4953
void * pvBuffer1
Definition: emac.h:166
void EMACIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: emac.c:2566
tEMACDMADescriptor * EMACTxDMADescriptorListGet(uint32_t ui32Base)
Definition: emac.c:2055
volatile uint32_t ui32Count
Definition: emac.h:157
void EMACTxDMADescriptorListSet(uint32_t ui32Base, tEMACDMADescriptor *pDescriptor)
Definition: emac.c:2027
tEMACDMADescriptor * EMACRxDMACurrentDescriptorGet(uint32_t ui32Base)
Definition: emac.c:1957
tEMACDMADescriptor * EMACTxDMACurrentDescriptorGet(uint32_t ui32Base)
Definition: emac.c:2077
void EMACIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: emac.c:2351
uint32_t EMACVLANTxConfigGet(uint32_t ui32Base, uint16_t *pui16Tag)
Definition: emac.c:4221
void EMACTimestampAddendSet(uint32_t ui32Base, uint32_t ui32Seconds)
Definition: emac.c:3560
void EMACPHYMMDWrite(uint32_t ui32Base, uint8_t ui8PhyAddr, uint16_t ui16RegAddr, uint16_t ui16Data)
Definition: emac.c:4914
uint32_t EMACVLANRxConfigGet(uint32_t ui32Base, uint16_t *pui16Tag)
Definition: emac.c:4092
volatile uint32_t ui32IEEE1588TimeLo
Definition: emac.h:196
void EMACTimestampTargetSet(uint32_t ui32Base, uint32_t ui32Seconds, uint32_t ui32Nanoseconds)
Definition: emac.c:3611
void EMACRemoteWakeUpFrameFilterGet(uint32_t ui32Base, tEMACWakeUpFrameFilter *pFilter)
Definition: emac.c:4499
void EMACIntUnregister(uint32_t ui32Base)
Definition: emac.c:2386
void EMACTimestampSysTimeSet(uint32_t ui32Base, uint32_t ui32Seconds, uint32_t ui32SubSeconds)
Definition: emac.c:3392
void EMACTimestampPPSCommandModeSet(uint32_t ui32Base, uint32_t ui32Config)
Configures the Ethernet MAC PPS output in command mode.
Definition: emac.c:3859
void EMACTimestampDisable(uint32_t ui32Base)
Definition: emac.c:3356
void EMACConfigGet(uint32_t ui32Base, uint32_t *pui32Config, uint32_t *pui32Mode, uint32_t *pui32RxMaxFrameSize)
Definition: emac.c:1059
volatile uint32_t ui32ExtRxStatus
Definition: emac.h:181
uint32_t EMACVLANHashFilterGet(uint32_t ui32Base)
Definition: emac.c:4351
void EMACFrameFilterSet(uint32_t ui32Base, uint32_t ui32FilterOpts)
Definition: emac.c:1489
uint32_t EMACNumAddrGet(uint32_t ui32Base)
Definition: emac.c:1272
void EMACWoLEnter(uint32_t ui32Base)
Definition: emac.c:4705
uint32_t EMACIntStatus(uint32_t ui32Base, bool bMasked)
Definition: emac.c:2681
void EMACPHYExtendedWrite(uint32_t ui32Base, uint8_t ui8PhyAddr, uint16_t ui16RegAddr, uint16_t ui16Data)
Definition: emac.c:2998
uint32_t EMACTimestampConfigGet(uint32_t ui32Base, uint32_t *pui32SubSecondInc)
Definition: emac.c:3287
void EMACPowerManagementControlSet(uint32_t ui32Base, uint32_t ui32Flags)
Definition: emac.c:4581
uint32_t EMACStatusGet(uint32_t ui32Base)
Definition: emac.c:1805