46 #define EFAB_REGDUMP(...) 47 #define EFAB_TRACE(...) DBGP(__VA_ARGS__) 50 #define EFAB_LOG(...) DBG(__VA_ARGS__) 51 #define EFAB_ERR(...) DBG(__VA_ARGS__) 53 #define FALCON_USE_IO_BAR 0 65 #define FQS(_prefix, _x) \ 66 ( ( (_x) == 512 ) ? _prefix ## _SIZE_512 : \ 67 ( ( (_x) == 1024 ) ? _prefix ## _SIZE_1K : \ 68 ( ( (_x) == 2048 ) ? _prefix ## _SIZE_2K : \ 69 ( ( (_x) == 4096) ? _prefix ## _SIZE_4K : \ 70 __invalid_queue_size ) ) ) ) 73 #define EFAB_MAX_FRAME_LEN(mtu) \ 74 ( ( ( ( mtu ) + 4 ) + 7 ) & ~7 ) 84 int location,
int value );
88 #define GMII_PSSR 0x11 91 #define LPA_EF_1000FULL 0x00020000 92 #define LPA_EF_1000HALF 0x00010000 93 #define LPA_EF_10000FULL 0x00040000 94 #define LPA_EF_10000HALF 0x00080000 96 #define LPA_EF_1000 ( LPA_EF_1000FULL | LPA_EF_1000HALF ) 97 #define LPA_EF_10000 ( LPA_EF_10000FULL | LPA_EF_10000HALF ) 98 #define LPA_EF_DUPLEX ( LPA_10FULL | LPA_100FULL | LPA_EF_1000FULL | \ 102 #define LPA_OTHER ~( LPA_10FULL | LPA_10HALF | LPA_100FULL | \ 103 LPA_100HALF | LPA_EF_1000FULL | LPA_EF_1000HALF ) 106 #define PSSR_LSTATUS 0x0400 115 unsigned int mii_advertise;
116 unsigned int gmii_advertise;
122 return ( ( gmii_advertise << 16 ) | mii_advertise );
132 unsigned int mii_lpa;
133 unsigned int gmii_lpa;
138 return ( ( gmii_lpa << 16 ) | mii_lpa );
148 unsigned int other_bits;
203 #define MDIO_MMD_PMAPMD (1) 205 #define MDIO_MMD_WIS (2) 207 #define MDIO_MMD_PCS (3) 209 #define MDIO_MMD_PHYXS (4) 211 #define MDIO_MMD_DTEXS (5) 213 #define MDIO_MMD_TC (6) 215 #define MDIO_MMD_AN (7) 218 #define MDIO_MMDREG_CTRL1 (0) 219 #define MDIO_MMDREG_STAT1 (1) 220 #define MDIO_MMDREG_DEVS0 (5) 221 #define MDIO_MMDREG_STAT2 (8) 225 #define MDIO_MMDREG_CTRL1_RESET_LBN (15) 226 #define MDIO_MMDREG_CTRL1_RESET_WIDTH (1) 229 #define MDIO_MMDREG_STAT1_FAULT_LBN (7) 230 #define MDIO_MMDREG_STAT1_FAULT_WIDTH (1) 233 #define MDIO_MMDREG_STAT1_LINK_LBN (2) 234 #define MDIO_MMDREG_STAT1_LINK_WIDTH (1) 237 #define DEV_PRESENT_BIT(_b) (1 << _b) 239 #define MDIO_MMDREG_DEVS0_DTEXS DEV_PRESENT_BIT(MDIO_MMD_DTEXS) 240 #define MDIO_MMDREG_DEVS0_PHYXS DEV_PRESENT_BIT(MDIO_MMD_PHYXS) 241 #define MDIO_MMDREG_DEVS0_PCS DEV_PRESENT_BIT(MDIO_MMD_PCS) 242 #define MDIO_MMDREG_DEVS0_WIS DEV_PRESENT_BIT(MDIO_MMD_WIS) 243 #define MDIO_MMDREG_DEVS0_PMAPMD DEV_PRESENT_BIT(MDIO_MMD_PMAPMD) 245 #define MDIO_MMDREG_DEVS0_AN DEV_PRESENT_BIT(MDIO_MMD_AN) 248 #define MDIO_MMDREG_STAT2_PRESENT_VAL (2) 249 #define MDIO_MMDREG_STAT2_PRESENT_LBN (14) 250 #define MDIO_MMDREG_STAT2_PRESENT_WIDTH (2) 253 #define MDIO_PHYXS_LANE_STATE (0x18) 254 #define MDIO_PHYXS_LANE_ALIGNED_LBN (12) 255 #define MDIO_PHYXS_LANE_SYNC0_LBN (0) 256 #define MDIO_PHYXS_LANE_SYNC1_LBN (1) 257 #define MDIO_PHYXS_LANE_SYNC2_LBN (2) 258 #define MDIO_PHYXS_LANE_SYNC3_LBN (3) 261 #define MDIO45_RESET_TRIES 100 262 #define MDIO45_RESET_SPINTIME 10 279 EFAB_ERR(
"Failed to read status of MMD %d\n",
285 in_reset |= (1 << mmd);
296 EFAB_ERR(
"Not all MMDs came out of reset in time. MMDs " 297 "still in reset: %x\n", in_reset);
321 EFAB_ERR (
"Failed to reset mmd %d\n", mmd );
346 mmd_mask = (mmd_mask >> 1);
362 EFAB_ERR (
"Failed to read devices present\n" );
365 if ( ( devices & mmd_mask ) != mmd_mask ) {
366 EFAB_ERR (
"required MMDs not present: got %x, wanted %x\n",
373 if ( mmd_mask & 1 ) {
379 MDIO_MMDREG_STAT2_PRESENT );
394 #define FCN_IOM_IND_ADR_REG 0x0 397 #define FCN_IOM_IND_DAT_REG 0x4 400 #define FCN_ADR_REGION_REG_KER 0x00 401 #define FCN_ADR_REGION0_LBN 0 402 #define FCN_ADR_REGION0_WIDTH 18 403 #define FCN_ADR_REGION1_LBN 32 404 #define FCN_ADR_REGION1_WIDTH 18 405 #define FCN_ADR_REGION2_LBN 64 406 #define FCN_ADR_REGION2_WIDTH 18 407 #define FCN_ADR_REGION3_LBN 96 408 #define FCN_ADR_REGION3_WIDTH 18 411 #define FCN_INT_EN_REG_KER 0x0010 412 #define FCN_MEM_PERR_INT_EN_KER_LBN 5 413 #define FCN_MEM_PERR_INT_EN_KER_WIDTH 1 414 #define FCN_KER_INT_CHAR_LBN 4 415 #define FCN_KER_INT_CHAR_WIDTH 1 416 #define FCN_KER_INT_KER_LBN 3 417 #define FCN_KER_INT_KER_WIDTH 1 418 #define FCN_ILL_ADR_ERR_INT_EN_KER_LBN 2 419 #define FCN_ILL_ADR_ERR_INT_EN_KER_WIDTH 1 420 #define FCN_SRM_PERR_INT_EN_KER_LBN 1 421 #define FCN_SRM_PERR_INT_EN_KER_WIDTH 1 422 #define FCN_DRV_INT_EN_KER_LBN 0 423 #define FCN_DRV_INT_EN_KER_WIDTH 1 426 #define FCN_INT_ADR_REG_KER 0x0030 427 #define FCN_INT_ADR_KER_LBN 0 428 #define FCN_INT_ADR_KER_WIDTH EFAB_DMA_TYPE_WIDTH ( 64 ) 431 #define INT_ISR0_B0 0x90 432 #define INT_ISR1_B0 0xA0 435 #define FCN_INT_ACK_KER_REG_A1 0x0050 436 #define INT_ACK_DUMMY_DATA_LBN 0 437 #define INT_ACK_DUMMY_DATA_WIDTH 32 440 #define WORK_AROUND_BROKEN_PCI_READS_REG_KER_A1 0x0070 443 #define FCN_HW_INIT_REG_KER 0x00c0 444 #define FCN_BCSR_TARGET_MASK_LBN 101 445 #define FCN_BCSR_TARGET_MASK_WIDTH 4 448 #define FCN_EE_SPI_HCMD_REG 0x0100 449 #define FCN_EE_SPI_HCMD_CMD_EN_LBN 31 450 #define FCN_EE_SPI_HCMD_CMD_EN_WIDTH 1 451 #define FCN_EE_WR_TIMER_ACTIVE_LBN 28 452 #define FCN_EE_WR_TIMER_ACTIVE_WIDTH 1 453 #define FCN_EE_SPI_HCMD_SF_SEL_LBN 24 454 #define FCN_EE_SPI_HCMD_SF_SEL_WIDTH 1 455 #define FCN_EE_SPI_EEPROM 0 456 #define FCN_EE_SPI_FLASH 1 457 #define FCN_EE_SPI_HCMD_DABCNT_LBN 16 458 #define FCN_EE_SPI_HCMD_DABCNT_WIDTH 5 459 #define FCN_EE_SPI_HCMD_READ_LBN 15 460 #define FCN_EE_SPI_HCMD_READ_WIDTH 1 461 #define FCN_EE_SPI_READ 1 462 #define FCN_EE_SPI_WRITE 0 463 #define FCN_EE_SPI_HCMD_DUBCNT_LBN 12 464 #define FCN_EE_SPI_HCMD_DUBCNT_WIDTH 2 465 #define FCN_EE_SPI_HCMD_ADBCNT_LBN 8 466 #define FCN_EE_SPI_HCMD_ADBCNT_WIDTH 2 467 #define FCN_EE_SPI_HCMD_ENC_LBN 0 468 #define FCN_EE_SPI_HCMD_ENC_WIDTH 8 471 #define FCN_EE_SPI_HADR_REG 0x0110 472 #define FCN_EE_SPI_HADR_DUBYTE_LBN 24 473 #define FCN_EE_SPI_HADR_DUBYTE_WIDTH 8 474 #define FCN_EE_SPI_HADR_ADR_LBN 0 475 #define FCN_EE_SPI_HADR_ADR_WIDTH 24 478 #define FCN_EE_SPI_HDATA_REG 0x0120 479 #define FCN_EE_SPI_HDATA3_LBN 96 480 #define FCN_EE_SPI_HDATA3_WIDTH 32 481 #define FCN_EE_SPI_HDATA2_LBN 64 482 #define FCN_EE_SPI_HDATA2_WIDTH 32 483 #define FCN_EE_SPI_HDATA1_LBN 32 484 #define FCN_EE_SPI_HDATA1_WIDTH 32 485 #define FCN_EE_SPI_HDATA0_LBN 0 486 #define FCN_EE_SPI_HDATA0_WIDTH 32 489 #define FCN_EE_VPD_CFG_REG 0x0140 490 #define FCN_EE_VPD_EN_LBN 0 491 #define FCN_EE_VPD_EN_WIDTH 1 492 #define FCN_EE_VPD_EN_AD9_MODE_LBN 1 493 #define FCN_EE_VPD_EN_AD9_MODE_WIDTH 1 494 #define FCN_EE_EE_CLOCK_DIV_LBN 112 495 #define FCN_EE_EE_CLOCK_DIV_WIDTH 7 496 #define FCN_EE_SF_CLOCK_DIV_LBN 120 497 #define FCN_EE_SF_CLOCK_DIV_WIDTH 7 501 #define FCN_NIC_STAT_REG 0x0200 502 #define FCN_ONCHIP_SRAM_LBN 16 503 #define FCN_ONCHIP_SRAM_WIDTH 1 504 #define FCN_SF_PRST_LBN 9 505 #define FCN_SF_PRST_WIDTH 1 506 #define FCN_EE_PRST_LBN 8 507 #define FCN_EE_PRST_WIDTH 1 508 #define FCN_EE_STRAP_LBN 7 509 #define FCN_EE_STRAP_WIDTH 1 510 #define FCN_PCI_PCIX_MODE_LBN 4 511 #define FCN_PCI_PCIX_MODE_WIDTH 3 512 #define FCN_PCI_PCIX_MODE_PCI33_DECODE 0 513 #define FCN_PCI_PCIX_MODE_PCI66_DECODE 1 514 #define FCN_PCI_PCIX_MODE_PCIX66_DECODE 5 515 #define FCN_PCI_PCIX_MODE_PCIX100_DECODE 6 516 #define FCN_PCI_PCIX_MODE_PCIX133_DECODE 7 517 #define FCN_STRAP_ISCSI_EN_LBN 3 518 #define FCN_STRAP_ISCSI_EN_WIDTH 1 519 #define FCN_STRAP_PINS_LBN 0 520 #define FCN_STRAP_PINS_WIDTH 3 521 #define FCN_STRAP_10G_LBN 2 522 #define FCN_STRAP_10G_WIDTH 1 523 #define FCN_STRAP_DUAL_PORT_LBN 1 524 #define FCN_STRAP_DUAL_PORT_WIDTH 1 525 #define FCN_STRAP_PCIE_LBN 0 526 #define FCN_STRAP_PCIE_WIDTH 1 529 #define FALCON_REV_A0 0 530 #define FALCON_REV_A1 1 531 #define FALCON_REV_B0 2 534 #define FCN_GPIO_CTL_REG_KER 0x0210 535 #define FCN_GPIO_CTL_REG_KER 0x0210 537 #define FCN_GPIO3_OEN_LBN 27 538 #define FCN_GPIO3_OEN_WIDTH 1 539 #define FCN_GPIO2_OEN_LBN 26 540 #define FCN_GPIO2_OEN_WIDTH 1 541 #define FCN_GPIO1_OEN_LBN 25 542 #define FCN_GPIO1_OEN_WIDTH 1 543 #define FCN_GPIO0_OEN_LBN 24 544 #define FCN_GPIO0_OEN_WIDTH 1 546 #define FCN_GPIO3_OUT_LBN 19 547 #define FCN_GPIO3_OUT_WIDTH 1 548 #define FCN_GPIO2_OUT_LBN 18 549 #define FCN_GPIO2_OUT_WIDTH 1 550 #define FCN_GPIO1_OUT_LBN 17 551 #define FCN_GPIO1_OUT_WIDTH 1 552 #define FCN_GPIO0_OUT_LBN 16 553 #define FCN_GPIO0_OUT_WIDTH 1 555 #define FCN_GPIO3_IN_LBN 11 556 #define FCN_GPIO3_IN_WIDTH 1 557 #define FCN_GPIO2_IN_LBN 10 558 #define FCN_GPIO2_IN_WIDTH 1 559 #define FCN_GPIO1_IN_LBN 9 560 #define FCN_GPIO1_IN_WIDTH 1 561 #define FCN_GPIO0_IN_LBN 8 562 #define FCN_GPIO0_IN_WIDTH 1 564 #define FCN_FLASH_PRESENT_LBN 7 565 #define FCN_FLASH_PRESENT_WIDTH 1 566 #define FCN_EEPROM_PRESENT_LBN 6 567 #define FCN_EEPROM_PRESENT_WIDTH 1 568 #define FCN_BOOTED_USING_NVDEVICE_LBN 3 569 #define FCN_BOOTED_USING_NVDEVICE_WIDTH 1 572 #define FCN_NV_MAGIC_NUMBER 0xFA1C 575 #define FCN_GLB_CTL_REG_KER 0x0220 576 #define FCN_EXT_PHY_RST_CTL_LBN 63 577 #define FCN_EXT_PHY_RST_CTL_WIDTH 1 578 #define FCN_PCIE_SD_RST_CTL_LBN 61 579 #define FCN_PCIE_SD_RST_CTL_WIDTH 1 580 #define FCN_PCIE_STCK_RST_CTL_LBN 59 581 #define FCN_PCIE_STCK_RST_CTL_WIDTH 1 582 #define FCN_PCIE_NSTCK_RST_CTL_LBN 58 583 #define FCN_PCIE_NSTCK_RST_CTL_WIDTH 1 584 #define FCN_PCIE_CORE_RST_CTL_LBN 57 585 #define FCN_PCIE_CORE_RST_CTL_WIDTH 1 586 #define FCN_EE_RST_CTL_LBN 49 587 #define FCN_EE_RST_CTL_WIDTH 1 588 #define FCN_RST_EXT_PHY_LBN 31 589 #define FCN_RST_EXT_PHY_WIDTH 1 590 #define FCN_EXT_PHY_RST_DUR_LBN 1 591 #define FCN_EXT_PHY_RST_DUR_WIDTH 3 592 #define FCN_SWRST_LBN 0 593 #define FCN_SWRST_WIDTH 1 594 #define INCLUDE_IN_RESET 0 595 #define EXCLUDE_FROM_RESET 1 598 #define FCN_ALTERA_BUILD_REG_KER 0x0300 599 #define FCN_VER_MAJOR_LBN 24 600 #define FCN_VER_MAJOR_WIDTH 8 601 #define FCN_VER_MINOR_LBN 16 602 #define FCN_VER_MINOR_WIDTH 8 603 #define FCN_VER_BUILD_LBN 0 604 #define FCN_VER_BUILD_WIDTH 16 605 #define FCN_VER_ALL_LBN 0 606 #define FCN_VER_ALL_WIDTH 32 609 #define FCN_SPARE_REG_KER 0x310 610 #define FCN_MEM_PERR_EN_TX_DATA_LBN 72 611 #define FCN_MEM_PERR_EN_TX_DATA_WIDTH 2 614 #define FCN_TIMER_CMD_REG_KER 0x420 615 #define FCN_TIMER_MODE_LBN 12 616 #define FCN_TIMER_MODE_WIDTH 2 617 #define FCN_TIMER_MODE_DIS 0 618 #define FCN_TIMER_MODE_INT_HLDOFF 1 619 #define FCN_TIMER_VAL_LBN 0 620 #define FCN_TIMER_VAL_WIDTH 12 623 #define FCN_RX_CFG_REG_KER 0x800 624 #define FCN_RX_XOFF_EN_LBN 0 625 #define FCN_RX_XOFF_EN_WIDTH 1 628 #define FCN_SRM_RX_DC_CFG_REG_KER 0x610 629 #define FCN_SRM_RX_DC_BASE_ADR_LBN 0 630 #define FCN_SRM_RX_DC_BASE_ADR_WIDTH 21 633 #define FCN_SRM_TX_DC_CFG_REG_KER 0x620 634 #define FCN_SRM_TX_DC_BASE_ADR_LBN 0 635 #define FCN_SRM_TX_DC_BASE_ADR_WIDTH 21 638 #define FCN_SRM_CFG_REG_KER 0x630 639 #define FCN_SRAM_OOB_ADR_INTEN_LBN 5 640 #define FCN_SRAM_OOB_ADR_INTEN_WIDTH 1 641 #define FCN_SRAM_OOB_BUF_INTEN_LBN 4 642 #define FCN_SRAM_OOB_BUF_INTEN_WIDTH 1 643 #define FCN_SRAM_OOB_BT_INIT_EN_LBN 3 644 #define FCN_SRAM_OOB_BT_INIT_EN_WIDTH 1 645 #define FCN_SRM_NUM_BANK_LBN 2 646 #define FCN_SRM_NUM_BANK_WIDTH 1 647 #define FCN_SRM_BANK_SIZE_LBN 0 648 #define FCN_SRM_BANK_SIZE_WIDTH 2 649 #define FCN_SRM_NUM_BANKS_AND_BANK_SIZE_LBN 0 650 #define FCN_SRM_NUM_BANKS_AND_BANK_SIZE_WIDTH 3 652 #define FCN_RX_CFG_REG_KER 0x800 653 #define FCN_RX_INGR_EN_B0_LBN 47 654 #define FCN_RX_INGR_EN_B0_WIDTH 1 655 #define FCN_RX_USR_BUF_SIZE_B0_LBN 19 656 #define FCN_RX_USR_BUF_SIZE_B0_WIDTH 9 657 #define FCN_RX_XON_MAC_TH_B0_LBN 10 658 #define FCN_RX_XON_MAC_TH_B0_WIDTH 9 659 #define FCN_RX_XOFF_MAC_TH_B0_LBN 1 660 #define FCN_RX_XOFF_MAC_TH_B0_WIDTH 9 661 #define FCN_RX_XOFF_MAC_EN_B0_LBN 0 662 #define FCN_RX_XOFF_MAC_EN_B0_WIDTH 1 663 #define FCN_RX_USR_BUF_SIZE_A1_LBN 11 664 #define FCN_RX_USR_BUF_SIZE_A1_WIDTH 9 665 #define FCN_RX_XON_MAC_TH_A1_LBN 6 666 #define FCN_RX_XON_MAC_TH_A1_WIDTH 5 667 #define FCN_RX_XOFF_MAC_TH_A1_LBN 1 668 #define FCN_RX_XOFF_MAC_TH_A1_WIDTH 5 669 #define FCN_RX_XOFF_MAC_EN_A1_LBN 0 670 #define FCN_RX_XOFF_MAC_EN_A1_WIDTH 1 672 #define FCN_RX_USR_BUF_SIZE_A1_LBN 11 673 #define FCN_RX_USR_BUF_SIZE_A1_WIDTH 9 674 #define FCN_RX_XOFF_MAC_EN_A1_LBN 0 675 #define FCN_RX_XOFF_MAC_EN_A1_WIDTH 1 678 #define FCN_RX_FILTER_CTL_REG_KER 0x810 679 #define FCN_UDP_FULL_SRCH_LIMIT_LBN 32 680 #define FCN_UDP_FULL_SRCH_LIMIT_WIDTH 8 681 #define FCN_NUM_KER_LBN 24 682 #define FCN_NUM_KER_WIDTH 2 683 #define FCN_UDP_WILD_SRCH_LIMIT_LBN 16 684 #define FCN_UDP_WILD_SRCH_LIMIT_WIDTH 8 685 #define FCN_TCP_WILD_SRCH_LIMIT_LBN 8 686 #define FCN_TCP_WILD_SRCH_LIMIT_WIDTH 8 687 #define FCN_TCP_FULL_SRCH_LIMIT_LBN 0 688 #define FCN_TCP_FULL_SRCH_LIMIT_WIDTH 8 691 #define FCN_RX_FLUSH_DESCQ_REG_KER 0x0820 692 #define FCN_RX_FLUSH_DESCQ_CMD_LBN 24 693 #define FCN_RX_FLUSH_DESCQ_CMD_WIDTH 1 694 #define FCN_RX_FLUSH_DESCQ_LBN 0 695 #define FCN_RX_FLUSH_DESCQ_WIDTH 12 698 #define FCN_RX_DESC_UPD_REG_KER 0x0830 699 #define FCN_RX_DESC_WPTR_LBN 96 700 #define FCN_RX_DESC_WPTR_WIDTH 12 701 #define FCN_RX_DESC_UPD_REG_KER_DWORD ( FCN_RX_DESC_UPD_REG_KER + 12 ) 702 #define FCN_RX_DESC_WPTR_DWORD_LBN 0 703 #define FCN_RX_DESC_WPTR_DWORD_WIDTH 12 706 #define FCN_RX_DC_CFG_REG_KER 0x840 707 #define FCN_RX_DC_SIZE_LBN 0 708 #define FCN_RX_DC_SIZE_WIDTH 2 710 #define FCN_RX_SELF_RST_REG_KER 0x890 711 #define FCN_RX_ISCSI_DIS_LBN 17 712 #define FCN_RX_ISCSI_DIS_WIDTH 1 713 #define FCN_RX_NODESC_WAIT_DIS_LBN 9 714 #define FCN_RX_NODESC_WAIT_DIS_WIDTH 1 715 #define FCN_RX_RECOVERY_EN_LBN 8 716 #define FCN_RX_RECOVERY_EN_WIDTH 1 719 #define FCN_TX_FLUSH_DESCQ_REG_KER 0x0a00 720 #define FCN_TX_FLUSH_DESCQ_CMD_LBN 12 721 #define FCN_TX_FLUSH_DESCQ_CMD_WIDTH 1 722 #define FCN_TX_FLUSH_DESCQ_LBN 0 723 #define FCN_TX_FLUSH_DESCQ_WIDTH 12 726 #define FCN_TX_CFG2_REG_KER 0xa80 727 #define FCN_TX_DIS_NON_IP_EV_LBN 17 728 #define FCN_TX_DIS_NON_IP_EV_WIDTH 1 731 #define FCN_TX_DESC_UPD_REG_KER 0x0a10 732 #define FCN_TX_DESC_WPTR_LBN 96 733 #define FCN_TX_DESC_WPTR_WIDTH 12 734 #define FCN_TX_DESC_UPD_REG_KER_DWORD ( FCN_TX_DESC_UPD_REG_KER + 12 ) 735 #define FCN_TX_DESC_WPTR_DWORD_LBN 0 736 #define FCN_TX_DESC_WPTR_DWORD_WIDTH 12 739 #define FCN_TX_DC_CFG_REG_KER 0xa20 740 #define FCN_TX_DC_SIZE_LBN 0 741 #define FCN_TX_DC_SIZE_WIDTH 2 744 #define FCN_MD_TXD_REG_KER 0xc00 745 #define FCN_MD_TXD_LBN 0 746 #define FCN_MD_TXD_WIDTH 16 749 #define FCN_MD_RXD_REG_KER 0xc10 750 #define FCN_MD_RXD_LBN 0 751 #define FCN_MD_RXD_WIDTH 16 754 #define FCN_MD_CS_REG_KER 0xc20 755 #define FCN_MD_GC_LBN 4 756 #define FCN_MD_GC_WIDTH 1 757 #define FCN_MD_RIC_LBN 2 758 #define FCN_MD_RIC_WIDTH 1 759 #define FCN_MD_RDC_LBN 1 760 #define FCN_MD_RDC_WIDTH 1 761 #define FCN_MD_WRC_LBN 0 762 #define FCN_MD_WRC_WIDTH 1 765 #define FCN_MD_PHY_ADR_REG_KER 0xc30 766 #define FCN_MD_PHY_ADR_LBN 0 767 #define FCN_MD_PHY_ADR_WIDTH 16 770 #define FCN_MD_ID_REG_KER 0xc40 771 #define FCN_MD_PRT_ADR_LBN 11 772 #define FCN_MD_PRT_ADR_WIDTH 5 773 #define FCN_MD_DEV_ADR_LBN 6 774 #define FCN_MD_DEV_ADR_WIDTH 5 777 #define FCN_MD_STAT_REG_KER 0xc50 778 #define FCN_MD_PINT_LBN 4 779 #define FCN_MD_PINT_WIDTH 1 780 #define FCN_MD_DONE_LBN 3 781 #define FCN_MD_DONE_WIDTH 1 782 #define FCN_MD_BSERR_LBN 2 783 #define FCN_MD_BSERR_WIDTH 1 784 #define FCN_MD_LNFL_LBN 1 785 #define FCN_MD_LNFL_WIDTH 1 786 #define FCN_MD_BSY_LBN 0 787 #define FCN_MD_BSY_WIDTH 1 790 #define FCN_MAC0_CTRL_REG_KER 0xc80 791 #define FCN_MAC1_CTRL_REG_KER 0xc90 792 #define FCN_MAC_XOFF_VAL_LBN 16 793 #define FCN_MAC_XOFF_VAL_WIDTH 16 794 #define FCN_MAC_BCAD_ACPT_LBN 4 795 #define FCN_MAC_BCAD_ACPT_WIDTH 1 796 #define FCN_MAC_UC_PROM_LBN 3 797 #define FCN_MAC_UC_PROM_WIDTH 1 798 #define FCN_MAC_LINK_STATUS_LBN 2 799 #define FCN_MAC_LINK_STATUS_WIDTH 1 800 #define FCN_MAC_SPEED_LBN 0 801 #define FCN_MAC_SPEED_WIDTH 2 804 #define XX_TXDRV_DEQ_DEFAULT 0xe 805 #define XX_TXDRV_DTX_DEFAULT 0x5 806 #define XX_SD_CTL_DRV_DEFAULT 0 809 #define FALCON_GMAC_REGBANK 0xe00 810 #define FALCON_GMAC_REGBANK_SIZE 0x200 811 #define FALCON_GMAC_REG_SIZE 0x10 814 #define FALCON_XMAC_REGBANK 0x1200 815 #define FALCON_XMAC_REGBANK_SIZE 0x200 816 #define FALCON_XMAC_REG_SIZE 0x10 819 #define FCN_XM_ADR_LO_REG_MAC 0x00 820 #define FCN_XM_ADR_3_LBN 24 821 #define FCN_XM_ADR_3_WIDTH 8 822 #define FCN_XM_ADR_2_LBN 16 823 #define FCN_XM_ADR_2_WIDTH 8 824 #define FCN_XM_ADR_1_LBN 8 825 #define FCN_XM_ADR_1_WIDTH 8 826 #define FCN_XM_ADR_0_LBN 0 827 #define FCN_XM_ADR_0_WIDTH 8 830 #define FCN_XM_ADR_HI_REG_MAC 0x01 831 #define FCN_XM_ADR_5_LBN 8 832 #define FCN_XM_ADR_5_WIDTH 8 833 #define FCN_XM_ADR_4_LBN 0 834 #define FCN_XM_ADR_4_WIDTH 8 837 #define FCN_XM_GLB_CFG_REG_MAC 0x02 838 #define FCN_XM_RX_STAT_EN_LBN 11 839 #define FCN_XM_RX_STAT_EN_WIDTH 1 840 #define FCN_XM_TX_STAT_EN_LBN 10 841 #define FCN_XM_TX_STAT_EN_WIDTH 1 842 #define FCN_XM_RX_JUMBO_MODE_LBN 6 843 #define FCN_XM_RX_JUMBO_MODE_WIDTH 1 844 #define FCN_XM_CORE_RST_LBN 0 845 #define FCN_XM_CORE_RST_WIDTH 1 848 #define FCN_XM_TX_CFG_REG_MAC 0x03 849 #define FCN_XM_IPG_LBN 16 850 #define FCN_XM_IPG_WIDTH 4 851 #define FCN_XM_FCNTL_LBN 10 852 #define FCN_XM_FCNTL_WIDTH 1 853 #define FCN_XM_TXCRC_LBN 8 854 #define FCN_XM_TXCRC_WIDTH 1 855 #define FCN_XM_AUTO_PAD_LBN 5 856 #define FCN_XM_AUTO_PAD_WIDTH 1 857 #define FCN_XM_TX_PRMBL_LBN 2 858 #define FCN_XM_TX_PRMBL_WIDTH 1 859 #define FCN_XM_TXEN_LBN 1 860 #define FCN_XM_TXEN_WIDTH 1 863 #define FCN_XM_RX_CFG_REG_MAC 0x04 864 #define FCN_XM_PASS_CRC_ERR_LBN 25 865 #define FCN_XM_PASS_CRC_ERR_WIDTH 1 866 #define FCN_XM_AUTO_DEPAD_LBN 8 867 #define FCN_XM_AUTO_DEPAD_WIDTH 1 868 #define FCN_XM_RXEN_LBN 1 869 #define FCN_XM_RXEN_WIDTH 1 872 #define FCN_XM_MGT_INT_MSK_REG_MAC_B0 0x5 873 #define FCN_XM_MSK_PRMBLE_ERR_LBN 2 874 #define FCN_XM_MSK_PRMBLE_ERR_WIDTH 1 875 #define FCN_XM_MSK_RMTFLT_LBN 1 876 #define FCN_XM_MSK_RMTFLT_WIDTH 1 877 #define FCN_XM_MSK_LCLFLT_LBN 0 878 #define FCN_XM_MSK_LCLFLT_WIDTH 1 881 #define FCN_XM_FC_REG_MAC 0x7 882 #define FCN_XM_PAUSE_TIME_LBN 16 883 #define FCN_XM_PAUSE_TIME_WIDTH 16 884 #define FCN_XM_DIS_FCNTL_LBN 0 885 #define FCN_XM_DIS_FCNTL_WIDTH 1 888 #define FCN_XM_TX_PARAM_REG_MAC 0x0d 889 #define FCN_XM_TX_JUMBO_MODE_LBN 31 890 #define FCN_XM_TX_JUMBO_MODE_WIDTH 1 891 #define FCN_XM_MAX_TX_FRM_SIZE_LBN 16 892 #define FCN_XM_MAX_TX_FRM_SIZE_WIDTH 14 893 #define FCN_XM_ACPT_ALL_MCAST_LBN 11 894 #define FCN_XM_ACPT_ALL_MCAST_WIDTH 1 897 #define FCN_XM_RX_PARAM_REG_MAC 0x0e 898 #define FCN_XM_MAX_RX_FRM_SIZE_LBN 0 899 #define FCN_XM_MAX_RX_FRM_SIZE_WIDTH 14 902 #define FCN_XM_MGT_INT_REG_MAC_B0 0x0f 903 #define FCN_XM_PRMBLE_ERR 2 904 #define FCN_XM_PRMBLE_WIDTH 1 905 #define FCN_XM_RMTFLT_LBN 1 906 #define FCN_XM_RMTFLT_WIDTH 1 907 #define FCN_XM_LCLFLT_LBN 0 908 #define FCN_XM_LCLFLT_WIDTH 1 911 #define FCN_XX_ALIGN_DONE_LBN 20 912 #define FCN_XX_ALIGN_DONE_WIDTH 1 913 #define FCN_XX_CORE_STAT_REG_MAC 0x16 914 #define FCN_XX_SYNC_STAT_LBN 16 915 #define FCN_XX_SYNC_STAT_WIDTH 4 916 #define FCN_XX_SYNC_STAT_DECODE_SYNCED 0xf 917 #define FCN_XX_COMMA_DET_LBN 12 918 #define FCN_XX_COMMA_DET_WIDTH 4 919 #define FCN_XX_COMMA_DET_RESET 0xf 920 #define FCN_XX_CHARERR_LBN 4 921 #define FCN_XX_CHARERR_WIDTH 4 922 #define FCN_XX_CHARERR_RESET 0xf 923 #define FCN_XX_DISPERR_LBN 0 924 #define FCN_XX_DISPERR_WIDTH 4 925 #define FCN_XX_DISPERR_RESET 0xf 928 #define FCN_XX_PWR_RST_REG_MAC 0x10 929 #define FCN_XX_PWRDND_EN_LBN 15 930 #define FCN_XX_PWRDND_EN_WIDTH 1 931 #define FCN_XX_PWRDNC_EN_LBN 14 932 #define FCN_XX_PWRDNC_EN_WIDTH 1 933 #define FCN_XX_PWRDNB_EN_LBN 13 934 #define FCN_XX_PWRDNB_EN_WIDTH 1 935 #define FCN_XX_PWRDNA_EN_LBN 12 936 #define FCN_XX_PWRDNA_EN_WIDTH 1 937 #define FCN_XX_RSTPLLCD_EN_LBN 9 938 #define FCN_XX_RSTPLLCD_EN_WIDTH 1 939 #define FCN_XX_RSTPLLAB_EN_LBN 8 940 #define FCN_XX_RSTPLLAB_EN_WIDTH 1 941 #define FCN_XX_RESETD_EN_LBN 7 942 #define FCN_XX_RESETD_EN_WIDTH 1 943 #define FCN_XX_RESETC_EN_LBN 6 944 #define FCN_XX_RESETC_EN_WIDTH 1 945 #define FCN_XX_RESETB_EN_LBN 5 946 #define FCN_XX_RESETB_EN_WIDTH 1 947 #define FCN_XX_RESETA_EN_LBN 4 948 #define FCN_XX_RESETA_EN_WIDTH 1 949 #define FCN_XX_RSTXGXSRX_EN_LBN 2 950 #define FCN_XX_RSTXGXSRX_EN_WIDTH 1 951 #define FCN_XX_RSTXGXSTX_EN_LBN 1 952 #define FCN_XX_RSTXGXSTX_EN_WIDTH 1 953 #define FCN_XX_RST_XX_EN_LBN 0 954 #define FCN_XX_RST_XX_EN_WIDTH 1 958 #define FCN_XX_SD_CTL_REG_MAC 0x11 959 #define FCN_XX_TERMADJ1_LBN 17 960 #define FCN_XX_TERMADJ1_WIDTH 1 961 #define FCN_XX_TERMADJ0_LBN 16 962 #define FCN_XX_TERMADJ0_WIDTH 1 963 #define FCN_XX_HIDRVD_LBN 15 964 #define FCN_XX_HIDRVD_WIDTH 1 965 #define FCN_XX_LODRVD_LBN 14 966 #define FCN_XX_LODRVD_WIDTH 1 967 #define FCN_XX_HIDRVC_LBN 13 968 #define FCN_XX_HIDRVC_WIDTH 1 969 #define FCN_XX_LODRVC_LBN 12 970 #define FCN_XX_LODRVC_WIDTH 1 971 #define FCN_XX_HIDRVB_LBN 11 972 #define FCN_XX_HIDRVB_WIDTH 1 973 #define FCN_XX_LODRVB_LBN 10 974 #define FCN_XX_LODRVB_WIDTH 1 975 #define FCN_XX_HIDRVA_LBN 9 976 #define FCN_XX_HIDRVA_WIDTH 1 977 #define FCN_XX_LODRVA_LBN 8 978 #define FCN_XX_LODRVA_WIDTH 1 979 #define FCN_XX_LPBKD_LBN 3 980 #define FCN_XX_LPBKD_WIDTH 1 981 #define FCN_XX_LPBKC_LBN 2 982 #define FCN_XX_LPBKC_WIDTH 1 983 #define FCN_XX_LPBKB_LBN 1 984 #define FCN_XX_LPBKB_WIDTH 1 985 #define FCN_XX_LPBKA_LBN 0 986 #define FCN_XX_LPBKA_WIDTH 1 988 #define FCN_XX_TXDRV_CTL_REG_MAC 0x12 989 #define FCN_XX_DEQD_LBN 28 990 #define FCN_XX_DEQD_WIDTH 4 991 #define FCN_XX_DEQC_LBN 24 992 #define FCN_XX_DEQC_WIDTH 4 993 #define FCN_XX_DEQB_LBN 20 994 #define FCN_XX_DEQB_WIDTH 4 995 #define FCN_XX_DEQA_LBN 16 996 #define FCN_XX_DEQA_WIDTH 4 997 #define FCN_XX_DTXD_LBN 12 998 #define FCN_XX_DTXD_WIDTH 4 999 #define FCN_XX_DTXC_LBN 8 1000 #define FCN_XX_DTXC_WIDTH 4 1001 #define FCN_XX_DTXB_LBN 4 1002 #define FCN_XX_DTXB_WIDTH 4 1003 #define FCN_XX_DTXA_LBN 0 1004 #define FCN_XX_DTXA_WIDTH 4 1007 #define FCN_RX_FILTER_TBL0 0xF00000 1010 #define FCN_RX_DESC_PTR_TBL_KER_A1 0x11800 1011 #define FCN_RX_DESC_PTR_TBL_KER_B0 0xF40000 1012 #define FCN_RX_ISCSI_DDIG_EN_LBN 88 1013 #define FCN_RX_ISCSI_DDIG_EN_WIDTH 1 1014 #define FCN_RX_ISCSI_HDIG_EN_LBN 87 1015 #define FCN_RX_ISCSI_HDIG_EN_WIDTH 1 1016 #define FCN_RX_DESCQ_BUF_BASE_ID_LBN 36 1017 #define FCN_RX_DESCQ_BUF_BASE_ID_WIDTH 20 1018 #define FCN_RX_DESCQ_EVQ_ID_LBN 24 1019 #define FCN_RX_DESCQ_EVQ_ID_WIDTH 12 1020 #define FCN_RX_DESCQ_OWNER_ID_LBN 10 1021 #define FCN_RX_DESCQ_OWNER_ID_WIDTH 14 1022 #define FCN_RX_DESCQ_SIZE_LBN 3 1023 #define FCN_RX_DESCQ_SIZE_WIDTH 2 1024 #define FCN_RX_DESCQ_SIZE_4K 3 1025 #define FCN_RX_DESCQ_SIZE_2K 2 1026 #define FCN_RX_DESCQ_SIZE_1K 1 1027 #define FCN_RX_DESCQ_SIZE_512 0 1028 #define FCN_RX_DESCQ_TYPE_LBN 2 1029 #define FCN_RX_DESCQ_TYPE_WIDTH 1 1030 #define FCN_RX_DESCQ_JUMBO_LBN 1 1031 #define FCN_RX_DESCQ_JUMBO_WIDTH 1 1032 #define FCN_RX_DESCQ_EN_LBN 0 1033 #define FCN_RX_DESCQ_EN_WIDTH 1 1036 #define FCN_TX_DESC_PTR_TBL_KER_A1 0x11900 1037 #define FCN_TX_DESC_PTR_TBL_KER_B0 0xF50000 1038 #define FCN_TX_NON_IP_DROP_DIS_B0_LBN 91 1039 #define FCN_TX_NON_IP_DROP_DIS_B0_WIDTH 1 1040 #define FCN_TX_DESCQ_EN_LBN 88 1041 #define FCN_TX_DESCQ_EN_WIDTH 1 1042 #define FCN_TX_ISCSI_DDIG_EN_LBN 87 1043 #define FCN_TX_ISCSI_DDIG_EN_WIDTH 1 1044 #define FCN_TX_ISCSI_HDIG_EN_LBN 86 1045 #define FCN_TX_ISCSI_HDIG_EN_WIDTH 1 1046 #define FCN_TX_DESCQ_BUF_BASE_ID_LBN 36 1047 #define FCN_TX_DESCQ_BUF_BASE_ID_WIDTH 20 1048 #define FCN_TX_DESCQ_EVQ_ID_LBN 24 1049 #define FCN_TX_DESCQ_EVQ_ID_WIDTH 12 1050 #define FCN_TX_DESCQ_OWNER_ID_LBN 10 1051 #define FCN_TX_DESCQ_OWNER_ID_WIDTH 14 1052 #define FCN_TX_DESCQ_SIZE_LBN 3 1053 #define FCN_TX_DESCQ_SIZE_WIDTH 2 1054 #define FCN_TX_DESCQ_SIZE_4K 3 1055 #define FCN_TX_DESCQ_SIZE_2K 2 1056 #define FCN_TX_DESCQ_SIZE_1K 1 1057 #define FCN_TX_DESCQ_SIZE_512 0 1058 #define FCN_TX_DESCQ_TYPE_LBN 1 1059 #define FCN_TX_DESCQ_TYPE_WIDTH 2 1060 #define FCN_TX_DESCQ_FLUSH_LBN 0 1061 #define FCN_TX_DESCQ_FLUSH_WIDTH 1 1064 #define FCN_EVQ_PTR_TBL_KER_A1 0x11a00 1065 #define FCN_EVQ_PTR_TBL_KER_B0 0xf60000 1066 #define FCN_EVQ_EN_LBN 23 1067 #define FCN_EVQ_EN_WIDTH 1 1068 #define FCN_EVQ_SIZE_LBN 20 1069 #define FCN_EVQ_SIZE_WIDTH 3 1070 #define FCN_EVQ_SIZE_32K 6 1071 #define FCN_EVQ_SIZE_16K 5 1072 #define FCN_EVQ_SIZE_8K 4 1073 #define FCN_EVQ_SIZE_4K 3 1074 #define FCN_EVQ_SIZE_2K 2 1075 #define FCN_EVQ_SIZE_1K 1 1076 #define FCN_EVQ_SIZE_512 0 1077 #define FCN_EVQ_BUF_BASE_ID_LBN 0 1078 #define FCN_EVQ_BUF_BASE_ID_WIDTH 20 1081 #define FCN_RX_RSS_INDIR_TBL_B0 0xFB0000 1084 #define FCN_EVQ_RPTR_REG_KER_A1 0x11b00 1085 #define FCN_EVQ_RPTR_REG_KER_B0 0xfa0000 1086 #define FCN_EVQ_RPTR_LBN 0 1087 #define FCN_EVQ_RPTR_WIDTH 14 1088 #define FCN_EVQ_RPTR_REG_KER_DWORD_A1 ( FCN_EVQ_RPTR_REG_KER_A1 + 0 ) 1089 #define FCN_EVQ_RPTR_REG_KER_DWORD_B0 ( FCN_EVQ_RPTR_REG_KER_B0 + 0 ) 1090 #define FCN_EVQ_RPTR_DWORD_LBN 0 1091 #define FCN_EVQ_RPTR_DWORD_WIDTH 14 1094 #define FCN_BUF_FULL_TBL_KER_A1 0x18000 1095 #define FCN_BUF_FULL_TBL_KER_B0 0x800000 1096 #define FCN_IP_DAT_BUF_SIZE_LBN 50 1097 #define FCN_IP_DAT_BUF_SIZE_WIDTH 1 1098 #define FCN_IP_DAT_BUF_SIZE_8K 1 1099 #define FCN_IP_DAT_BUF_SIZE_4K 0 1100 #define FCN_BUF_ADR_FBUF_LBN 14 1101 #define FCN_BUF_ADR_FBUF_WIDTH 34 1102 #define FCN_BUF_OWNER_ID_FBUF_LBN 0 1103 #define FCN_BUF_OWNER_ID_FBUF_WIDTH 14 1106 #define FALCON_GMAC_REG( efab, mac_reg ) \ 1107 ( FALCON_GMAC_REGBANK + \ 1108 ( (mac_reg) * FALCON_GMAC_REG_SIZE ) ) 1111 #define FALCON_XMAC_REG( efab_port, mac_reg ) \ 1112 ( FALCON_XMAC_REGBANK + \ 1113 ( (mac_reg) * FALCON_XMAC_REG_SIZE ) ) 1115 #define FCN_MAC_DATA_LBN 0 1116 #define FCN_MAC_DATA_WIDTH 32 1119 #define FCN_TX_KER_PORT_LBN 63 1120 #define FCN_TX_KER_PORT_WIDTH 1 1121 #define FCN_TX_KER_BYTE_CNT_LBN 48 1122 #define FCN_TX_KER_BYTE_CNT_WIDTH 14 1123 #define FCN_TX_KER_BUF_ADR_LBN 0 1124 #define FCN_TX_KER_BUF_ADR_WIDTH EFAB_DMA_TYPE_WIDTH ( 46 ) 1128 #define FCN_RX_KER_BUF_SIZE_LBN 48 1129 #define FCN_RX_KER_BUF_SIZE_WIDTH 14 1130 #define FCN_RX_KER_BUF_ADR_LBN 0 1131 #define FCN_RX_KER_BUF_ADR_WIDTH EFAB_DMA_TYPE_WIDTH ( 46 ) 1134 #define FCN_EV_CODE_LBN 60 1135 #define FCN_EV_CODE_WIDTH 4 1136 #define FCN_RX_IP_EV_DECODE 0 1137 #define FCN_TX_IP_EV_DECODE 2 1138 #define FCN_DRIVER_EV_DECODE 5 1141 #define FCN_RX_EV_PKT_OK_LBN 56 1142 #define FCN_RX_EV_PKT_OK_WIDTH 1 1143 #define FCN_RX_PORT_LBN 30 1144 #define FCN_RX_PORT_WIDTH 1 1145 #define FCN_RX_EV_BYTE_CNT_LBN 16 1146 #define FCN_RX_EV_BYTE_CNT_WIDTH 14 1147 #define FCN_RX_EV_DESC_PTR_LBN 0 1148 #define FCN_RX_EV_DESC_PTR_WIDTH 12 1151 #define FCN_TX_EV_DESC_PTR_LBN 0 1152 #define FCN_TX_EV_DESC_PTR_WIDTH 12 1162 #define FCN_REVISION_REG(efab, reg) \ 1163 ( ( efab->pci_revision == FALCON_REV_B0 ) ? reg ## _B0 : reg ## _A1 ) 1165 #define EFAB_SET_OWORD_FIELD_VER(efab, reg, field, val) \ 1166 if ( efab->pci_revision == FALCON_REV_B0 ) \ 1167 EFAB_SET_OWORD_FIELD ( reg, field ## _B0, val ); \ 1169 EFAB_SET_OWORD_FIELD ( reg, field ## _A1, val ); 1171 #if FALCON_USE_IO_BAR 1175 unsigned int reg ) {
1182 unsigned int reg ) {
1189 #define _falcon_writel( efab, value, reg ) \ 1190 writel ( (value), (efab)->membase + (reg) ) 1191 #define _falcon_readl( efab, reg ) readl ( (efab)->membase + (reg) ) 1220 unsigned int index )
1223 (
index *
sizeof ( *value ) ) );
1268 unsigned int index )
1271 (
index *
sizeof ( *value ) ) );
1291 #define FCN_DUMP_REG( efab, _reg ) do { \ 1293 falcon_read ( efab, ®, _reg ); \ 1294 EFAB_LOG ( #_reg " = " EFAB_OWORD_FMT "\n", \ 1295 EFAB_OWORD_VAL ( reg ) ); \ 1298 #define FCN_DUMP_MAC_REG( efab, _mac_reg ) do { \ 1300 efab->mac_op->mac_readl ( efab, ®, _mac_reg ); \ 1301 EFAB_LOG ( #_mac_reg " = " EFAB_DWORD_FMT "\n", \ 1302 EFAB_DWORD_VAL ( reg ) ); \ 1345 falcon_dump_regs (
struct efab_nic *efab )
1382 FCN_KER_INT_KER, force,
1383 FCN_DRV_INT_EN_KER,
enabled );
1397 #define FALCON_SPI_MAX_LEN 16 1411 }
while ( ++
count < 1000 );
1413 EFAB_ERR (
"Timed out waiting for SPI\n" );
1420 const void* data_out,
void *data_in,
size_t len )
1440 EFAB_TRACE (
"Executing spi command %d on device %d at %d for %zd bytes\n",
1464 FCN_EE_SPI_HCMD_CMD_EN, 1,
1466 FCN_EE_SPI_HCMD_DABCNT,
len,
1468 FCN_EE_SPI_HCMD_DUBCNT, 0,
1470 FCN_EE_SPI_HCMD_ENC,
command );
1488 EFAB_ERR (
"Failed SPI command %d to device %d address 0x%x len 0x%zx\n",
1504 unsigned long data )
1519 EFAB_ERR (
"%s bit=%d\n", __func__, bit_id );
1542 EFAB_ERR (
"%s bit=%d\n", __func__, bit_id );
1575 EFAB_ERR (
"Error from GMII access " 1585 EFAB_ERR (
"Timed out waiting for GMII\n" );
1591 int location,
int value )
1595 EFAB_TRACE (
"Writing GMII %d register %02x with %04x\n",
1610 FCN_MD_DEV_ADR,
device );
1618 FCN_MD_DEV_ADR, location );
1629 FCN_MD_GC, ( efab->
phy_10g ? 0 : 1 ) );
1660 FCN_MD_DEV_ADR,
device );
1674 FCN_MD_DEV_ADR, location );
1701 EFAB_TRACE (
"Read from GMII %d register %02x, got %04x\n",
1731 FCN_MAC_XOFF_VAL, 0xffff ,
1732 FCN_MAC_BCAD_ACPT, 1,
1734 FCN_MAC_LINK_STATUS, 1,
1735 FCN_MAC_SPEED, link_speed );
1749 #define GM_CFG1_REG_MAC 0x00 1750 #define GM_SW_RST_LBN 31 1751 #define GM_SW_RST_WIDTH 1 1752 #define GM_RX_FC_EN_LBN 5 1753 #define GM_RX_FC_EN_WIDTH 1 1754 #define GM_TX_FC_EN_LBN 4 1755 #define GM_TX_FC_EN_WIDTH 1 1756 #define GM_RX_EN_LBN 2 1757 #define GM_RX_EN_WIDTH 1 1758 #define GM_TX_EN_LBN 0 1759 #define GM_TX_EN_WIDTH 1 1762 #define GM_CFG2_REG_MAC 0x01 1763 #define GM_PAMBL_LEN_LBN 12 1764 #define GM_PAMBL_LEN_WIDTH 4 1765 #define GM_IF_MODE_LBN 8 1766 #define GM_IF_MODE_WIDTH 2 1767 #define GM_PAD_CRC_EN_LBN 2 1768 #define GM_PAD_CRC_EN_WIDTH 1 1770 #define GM_FD_WIDTH 1 1773 #define GM_MAX_FLEN_REG_MAC 0x04 1774 #define GM_MAX_FLEN_LBN 0 1775 #define GM_MAX_FLEN_WIDTH 16 1778 #define GM_MII_MGMT_CFG_REG_MAC 0x08 1779 #define GM_MGMT_CLK_SEL_LBN 0 1780 #define GM_MGMT_CLK_SEL_WIDTH 3 1783 #define GM_MII_MGMT_CMD_REG_MAC 0x09 1784 #define GM_MGMT_SCAN_CYC_LBN 1 1785 #define GM_MGMT_SCAN_CYC_WIDTH 1 1786 #define GM_MGMT_RD_CYC_LBN 0 1787 #define GM_MGMT_RD_CYC_WIDTH 1 1790 #define GM_MII_MGMT_ADR_REG_MAC 0x0a 1791 #define GM_MGMT_PHY_ADDR_LBN 8 1792 #define GM_MGMT_PHY_ADDR_WIDTH 5 1793 #define GM_MGMT_REG_ADDR_LBN 0 1794 #define GM_MGMT_REG_ADDR_WIDTH 5 1797 #define GM_MII_MGMT_CTL_REG_MAC 0x0b 1798 #define GM_MGMT_CTL_LBN 0 1799 #define GM_MGMT_CTL_WIDTH 16 1802 #define GM_MII_MGMT_STAT_REG_MAC 0x0c 1803 #define GM_MGMT_STAT_LBN 0 1804 #define GM_MGMT_STAT_WIDTH 16 1807 #define GM_MII_MGMT_IND_REG_MAC 0x0d 1808 #define GM_MGMT_BUSY_LBN 0 1809 #define GM_MGMT_BUSY_WIDTH 1 1812 #define GM_ADR1_REG_MAC 0x10 1813 #define GM_HWADDR_5_LBN 24 1814 #define GM_HWADDR_5_WIDTH 8 1815 #define GM_HWADDR_4_LBN 16 1816 #define GM_HWADDR_4_WIDTH 8 1817 #define GM_HWADDR_3_LBN 8 1818 #define GM_HWADDR_3_WIDTH 8 1819 #define GM_HWADDR_2_LBN 0 1820 #define GM_HWADDR_2_WIDTH 8 1823 #define GM_ADR2_REG_MAC 0x11 1824 #define GM_HWADDR_1_LBN 24 1825 #define GM_HWADDR_1_WIDTH 8 1826 #define GM_HWADDR_0_LBN 16 1827 #define GM_HWADDR_0_WIDTH 8 1830 #define GMF_CFG0_REG_MAC 0x12 1831 #define GMF_FTFENREQ_LBN 12 1832 #define GMF_FTFENREQ_WIDTH 1 1833 #define GMF_STFENREQ_LBN 11 1834 #define GMF_STFENREQ_WIDTH 1 1835 #define GMF_FRFENREQ_LBN 10 1836 #define GMF_FRFENREQ_WIDTH 1 1837 #define GMF_SRFENREQ_LBN 9 1838 #define GMF_SRFENREQ_WIDTH 1 1839 #define GMF_WTMENREQ_LBN 8 1840 #define GMF_WTMENREQ_WIDTH 1 1843 #define GMF_CFG1_REG_MAC 0x13 1844 #define GMF_CFGFRTH_LBN 16 1845 #define GMF_CFGFRTH_WIDTH 5 1846 #define GMF_CFGXOFFRTX_LBN 0 1847 #define GMF_CFGXOFFRTX_WIDTH 16 1850 #define GMF_CFG2_REG_MAC 0x14 1851 #define GMF_CFGHWM_LBN 16 1852 #define GMF_CFGHWM_WIDTH 6 1853 #define GMF_CFGLWM_LBN 0 1854 #define GMF_CFGLWM_WIDTH 6 1857 #define GMF_CFG3_REG_MAC 0x15 1858 #define GMF_CFGHWMFT_LBN 16 1859 #define GMF_CFGHWMFT_WIDTH 6 1860 #define GMF_CFGFTTH_LBN 0 1861 #define GMF_CFGFTTH_WIDTH 6 1864 #define GMF_CFG4_REG_MAC 0x16 1865 #define GMF_HSTFLTRFRM_PAUSE_LBN 12 1866 #define GMF_HSTFLTRFRM_PAUSE_WIDTH 12 1869 #define GMF_CFG5_REG_MAC 0x17 1870 #define GMF_CFGHDPLX_LBN 22 1871 #define GMF_CFGHDPLX_WIDTH 1 1872 #define GMF_CFGBYTMODE_LBN 19 1873 #define GMF_CFGBYTMODE_WIDTH 1 1874 #define GMF_HSTDRPLT64_LBN 18 1875 #define GMF_HSTDRPLT64_WIDTH 1 1876 #define GMF_HSTFLTRFRMDC_PAUSE_LBN 12 1877 #define GMF_HSTFLTRFRMDC_PAUSE_WIDTH 1 1881 unsigned int mac_reg )
1892 unsigned int mac_reg )
1928 int pause, if_mode, full_duplex, bytemode, half_duplex;
1949 GM_IF_MODE, if_mode,
1952 GM_PAMBL_LEN, 0x7 );
1975 GMF_CFGXOFFRTX, 0xffff );
1989 GMF_CFGFTTH, 0x08 );
2065 unsigned int mac_reg )
2081 unsigned int mac_reg )
2156 FCN_XM_MSK_RMTFLT, !enable,
2157 FCN_XM_MSK_LCLFLT, !enable);
2206 EFAB_ERR (
"timed out waiting for XAUI/XGXS reset\n" );
2214 int align_done, lane_status,
sync;
2227 link_ok = align_done &&
sync;
2240 if ( link_ok && has_phyxs ) {
2246 EFAB_LOG (
"XGXS lane status: %x\n", lane_status );
2264 FCN_XM_RX_JUMBO_MODE, 1,
2265 FCN_XM_TX_STAT_EN, 1,
2266 FCN_XM_RX_STAT_EN, 1);
2282 FCN_XM_AUTO_DEPAD, 0,
2283 FCN_XM_ACPT_ALL_MCAST, 1,
2284 FCN_XM_PASS_CRC_ERR, 1 );
2290 FCN_XM_MAX_RX_FRM_SIZE, max_frame_len );
2293 FCN_XM_MAX_TX_FRM_SIZE, max_frame_len,
2294 FCN_XM_TX_JUMBO_MODE, 1 );
2299 FCN_XM_PAUSE_TIME, 0xfffe,
2300 FCN_XM_DIS_FCNTL, 0 );
2327 EFAB_ERR (
"unable to initialise PHY\n" );
2351 if ((
count % 5) == 0)
2426 unsigned int advertised, lpa;
2454 #define XFP_REQUIRED_DEVS ( MDIO_MMDREG_DEVS0_PCS | \ 2455 MDIO_MMDREG_DEVS0_PMAPMD | \ 2456 MDIO_MMDREG_DEVS0_PHYXS ) 2488 #define TXC_GLRGS_GLCMD (0xc004) 2489 #define TXC_GLCMD_LMTSWRST_LBN (14) 2492 #define TXC_ALRGS_ATXAMP0 (0xc041) 2493 #define TXC_ALRGS_ATXAMP1 (0xc042) 2495 #define TXC_ATXAMP_LANE02_LBN (3) 2496 #define TXC_ATXAMP_LANE13_LBN (11) 2498 #define TXC_ATXAMP_1280_mV (0) 2499 #define TXC_ATXAMP_1200_mV (8) 2500 #define TXC_ATXAMP_1120_mV (12) 2501 #define TXC_ATXAMP_1060_mV (14) 2502 #define TXC_ATXAMP_0820_mV (25) 2503 #define TXC_ATXAMP_0720_mV (26) 2504 #define TXC_ATXAMP_0580_mV (27) 2505 #define TXC_ATXAMP_0440_mV (28) 2507 #define TXC_ATXAMP_0820_BOTH ( (TXC_ATXAMP_0820_mV << TXC_ATXAMP_LANE02_LBN) | \ 2508 (TXC_ATXAMP_0820_mV << TXC_ATXAMP_LANE13_LBN) ) 2510 #define TXC_ATXAMP_DEFAULT (0x6060) 2513 #define TXC_ALRGS_ATXPRE0 (0xc043) 2514 #define TXC_ALRGS_ATXPRE1 (0xc044) 2516 #define TXC_ATXPRE_NONE (0) 2517 #define TXC_ATXPRE_DEFAULT (0x1010) 2519 #define TXC_REQUIRED_DEVS ( MDIO_MMDREG_DEVS0_PCS | \ 2520 MDIO_MMDREG_DEVS0_PMAPMD | \ 2521 MDIO_MMDREG_DEVS0_PHYXS ) 2540 EFAB_ERR (
"logic reset failed\n" );
2617 #define TENXPRESS_REQUIRED_DEVS ( MDIO_MMDREG_DEVS0_PMAPMD | \ 2618 MDIO_MMDREG_DEVS0_PCS | \ 2619 MDIO_MMDREG_DEVS0_PHYXS ) 2621 #define PCS_TEST_SELECT_REG 0xd807 2622 #define CLK312_EN_LBN 3 2623 #define CLK312_EN_WIDTH 1 2625 #define PCS_CLOCK_CTRL_REG 0xd801 2626 #define PLL312_RST_N_LBN 2 2629 #define PMA_PMD_EXT_CTRL_REG 49152 2630 #define PMA_PMD_EXT_SSR_LBN 15 2633 #define PCS_BOOT_STATUS_REG 0xd000 2634 #define PCS_BOOT_FATAL_ERR_LBN 0 2635 #define PCS_BOOT_PROGRESS_LBN 1 2636 #define PCS_BOOT_PROGRESS_WIDTH 2 2637 #define PCS_BOOT_COMPLETE_LBN 3 2639 #define PCS_SOFT_RST2_REG 0xd806 2640 #define SERDES_RST_N_LBN 13 2641 #define XGXS_RST_N_LBN 12 2659 EFAB_ERR (
"C11 failed to boot\n" );
2713 #define PM8358_REQUIRED_DEVS (MDIO_MMDREG_DEVS0_DTEXS) 2717 #define PMC_MASTER_REG (0xd000) 2719 #define PMC_MASTER_ANLG_CTRL (1<< 11) 2722 #define PMC_MCONF2_REG (0xd002) 2724 #define PMC_MCONF2_TEDGE (1 << 2) 2726 #define PMC_MCONF2_REDGE (1 << 3) 2729 #define PMC_ANALOG_RX_CFG0 (0xd025) 2730 #define PMC_ANALOG_RX_CFG1 (0xd02d) 2731 #define PMC_ANALOG_RX_CFG2 (0xd035) 2732 #define PMC_ANALOG_RX_CFG3 (0xd03d) 2735 #define PMC_ANALOG_RX_TERM (1 << 15) 2737 #define PMC_ANALOG_RX_EQ_MASK (3 << 8) 2738 #define PMC_ANALOG_RX_EQ_NONE (0 << 8) 2739 #define PMC_ANALOG_RX_EQ_HALF (1 << 8) 2740 #define PMC_ANALOG_RX_EQ_FULL (2 << 8) 2741 #define PMC_ANALOG_RX_EQ_RSVD (3 << 8) 2761 for (i=0; i< 3; i++) {
2790 #define MAX_TEMP_THRESH 90 2793 #define PCA9539 0x74 2797 #define P0_CONFIG 0x06 2799 #define P0_EN_1V0X_LBN 0 2800 #define P0_EN_1V0X_WIDTH 1 2801 #define P0_EN_1V2_LBN 1 2802 #define P0_EN_1V2_WIDTH 1 2803 #define P0_EN_2V5_LBN 2 2804 #define P0_EN_2V5_WIDTH 1 2805 #define P0_EN_3V3X_LBN 3 2806 #define P0_EN_3V3X_WIDTH 1 2807 #define P0_EN_5V_LBN 4 2808 #define P0_EN_5V_WIDTH 1 2809 #define P0_X_TRST_LBN 6 2810 #define P0_X_TRST_WIDTH 1 2813 #define P1_CONFIG 0x07 2815 #define P1_AFE_PWD_LBN 0 2816 #define P1_AFE_PWD_WIDTH 1 2817 #define P1_DSP_PWD25_LBN 1 2818 #define P1_DSP_PWD25_WIDTH 1 2819 #define P1_SPARE_LBN 4 2820 #define P1_SPARE_WIDTH 4 2823 #define MAX6647 0x4e 2850 EFAB_LOG (
"Initialise SFE4001 board\n" );
2854 FCN_XX_PWRDNA_EN, 1,
2855 FCN_XX_PWRDNB_EN, 1,
2856 FCN_XX_RSTPLLAB_EN, 1,
2857 FCN_XX_RESETA_EN, 1,
2858 FCN_XX_RESETB_EN, 1,
2859 FCN_XX_RSTXGXSRX_EN, 1,
2860 FCN_XX_RSTXGXSTX_EN, 1 );
2876 EFAB_ERR (
"Unable to verify MAX6647 limit (requested=%d " 2877 "confirmed=%d)\n",
cfg,
in );
2959 EFAB_ERR (
"Failed initialising SFE4001 board\n" );
2969 EFAB_ERR (
"Turning off SFE4001\n" );
3041 unsigned long dma_addr;
3054 while ( remaining > 0 ) {
3057 FCN_BUF_ADR_FBUF, ( dma_addr >> 12 ),
3058 FCN_BUF_OWNER_ID_FBUF, 0 );
3067 EFAB_TRACE (
"Allocated 0x%x bytes at %p backed by buffer table " 3085 FCN_ADR_REGION1, ( 1 << 16 ),
3086 FCN_ADR_REGION2, ( 2 << 16 ),
3087 FCN_ADR_REGION3, ( 3 << 16 ) );
3090 EFAB_TRACE (
"Clearing filter and RSS tables\n" );
3101 for (
offset = 0x2800000 ;
3121 FCN_EXT_PHY_RST_DUR, 0x7,
3144 #define FALCON_MAC_ADDRESS_OFFSET 0x310 3149 #define SF_NV_CONFIG_BASE 0x300 3150 #define SF_NV_CONFIG_EXTRA 0xA0 3172 #define BOARD_TYPE(_rev) (_rev >> 8) 3188 efab->
is_asic = (fpga_version == 0);
3221 int has_flash, has_eeprom, ad9bit;
3246 if ( has_flash && ad9bit )
3259 EFAB_LOG (
"flash is %s, EEPROM is %s%s\n",
3260 ( has_flash ?
"present" :
"absent" ),
3261 ( has_eeprom ?
"present " :
"absent" ),
3262 ( has_eeprom ? (ad9bit ?
"(9bit)" :
"(16bit)") :
"") );
3265 if ( ! efab->
spi ) {
3266 EFAB_ERR (
"Device appears to have no flash or eeprom\n" );
3284 int rc, board_revision;
3294 &nv,
sizeof ( nv ) );
3309 EFAB_ERR (
"NVram is not recognised\n" );
3315 EFAB_TRACE (
"Falcon board %d phy %d @ addr %d\n",
3330 EFAB_ERR (
"Unrecognised board type\n" );
3387 FCN_SRAM_OOB_BT_INIT_EN, 1,
3388 FCN_SRM_NUM_BANKS_AND_BANK_SIZE, 0 );
3401 }
while (++
count < 20);
3403 EFAB_ERR (
"timed out waiting for SRAM reset\n");
3412 int tx_fc, xoff_thresh, xon_thresh;
3436 FCN_UDP_FULL_SRCH_LIMIT, 8,
3437 FCN_UDP_WILD_SRCH_LIMIT, 8,
3438 FCN_TCP_WILD_SRCH_LIMIT, 8,
3439 FCN_TCP_FULL_SRCH_LIMIT, 8);
3457 xoff_thresh = 54272;
3466 tx_fc = xoff_thresh = xon_thresh = 0;
3512 FCN_EVQ_BUF_BASE_ID, ev_queue->
entry.
id );
3519 FCN_TX_ISCSI_DDIG_EN, 0,
3520 FCN_TX_ISCSI_DDIG_EN, 0,
3521 FCN_TX_DESCQ_BUF_BASE_ID, tx_queue->
entry.
id,
3522 FCN_TX_DESCQ_EVQ_ID, 0,
3524 FCN_TX_DESCQ_TYPE, 0 ,
3525 FCN_TX_NON_IP_DROP_DIS_B0, 1 );
3532 FCN_RX_ISCSI_DDIG_EN, 0,
3533 FCN_RX_ISCSI_HDIG_EN, 0,
3534 FCN_RX_DESCQ_BUF_BASE_ID, rx_queue->
entry.
id,
3535 FCN_RX_DESCQ_EVQ_ID, 0,
3537 FCN_RX_DESCQ_TYPE, 0 ,
3538 FCN_RX_DESCQ_JUMBO, jumbo,
3539 FCN_RX_DESCQ_EN, 1 );
3562 FCN_TX_FLUSH_DESCQ_CMD, 1,
3563 FCN_TX_FLUSH_DESCQ, 0 );
3568 FCN_RX_FLUSH_DESCQ_CMD, 1,
3569 FCN_RX_FLUSH_DESCQ, 0 );
3624 FCN_TX_KER_BYTE_CNT,
iob_len ( iob ),
3667 EFAB_TRACE (
"pushing rx_buf[%d] iob %p data %p\n",
3668 buf_id, iob, iob->
data );
3670 rx_queue->
buf[buf_id] = iob;
3671 rxd = rx_queue->
ring + desc_id;
3683 EFAB_TRACE (
"pushed %d rx buffers to fill level %d\n",
3684 pushed, fill_level );
3687 if ( fill_level == 0 )
3700 assert (
id == read_ptr );
3703 iob = rx_queue->
buf[buf_ptr];
3704 rx_queue->
buf[buf_ptr] =
NULL;
3706 EFAB_TRACE (
"popping rx_buf[%d] iob %p data %p with %d bytes %s\n",
3707 id, iob, iob->
data,
len, drop ?
"bad" :
"ok" );
3733 int fill_level, space;
3745 tx_queue->
buf[buf_id] = iob;
3747 EFAB_TRACE (
"tx_buf[%d] for iob %p data %p len %zd\n",
3751 txd = tx_queue->
ring + buf_id;
3776 tx_queue->
buf[read_ptr] =
NULL;
3815 int ev_code, desc_ptr,
len, drop;
3819 switch ( ev_code ) {
3834 EFAB_TRACE (
"Unknown event type %d\n", ev_code );
3860 EFAB_TRACE (
"Event at index 0x%x address %p is " 3923 if ( rx_queue->
buf[i] )
3928 if ( tx_queue->
buf[i] )
3932 if ( rx_queue->
ring )
3935 if ( tx_queue->
ring )
3938 if ( ev_queue->
ring )
3941 memset ( rx_queue, 0,
sizeof ( *rx_queue ) );
3942 memset ( tx_queue, 0,
sizeof ( *tx_queue ) );
3943 memset ( ev_queue, 0,
sizeof ( *ev_queue ) );
3961 if ( !ev_queue->
ring )
3971 if ( ! tx_queue->
ring )
3978 if ( ! rx_queue->
ring )
3999 EFAB_LOG (
"Waiting for link..\n" );
4003 EFAB_ERR (
"Failed reinitialising MAC, error %s\n",
4024 "full" :
"half" ) );
4031 EFAB_ERR (
"timed initialising MAC\n" );
4134 unsigned long mmio_start, mmio_len;
4150 memset ( efab, 0,
sizeof ( *efab ) );
4157 EFAB_TRACE (
"BAR of %lx bytes at phys %lx mapped at %p\n",
4158 mmio_len, mmio_start, efab->
membase );
4190 EFAB_LOG (
"Found %s EtherFabric %s %s revision %d\n", pci->
id->
name,
4191 efab->
is_asic ?
"ASIC" :
"FPGA",
4211 PCI_ROM(0x1924, 0x0703,
"falcon",
"EtherFabric Falcon", 0),
4212 PCI_ROM(0x1924, 0x0710,
"falconb0",
"EtherFabric FalconB0", 0),
#define FCN_RX_CFG_REG_KER
#define XX_TXDRV_DEQ_DEFAULT
#define FCN_XX_SD_CTL_REG_MAC
static void falcon_reconfigure_mac_wrapper(struct efab_nic *efab)
static void efab_free_resources(struct efab_nic *efab)
#define FCN_SRM_CFG_REG_KER
#define EINVAL
Invalid argument.
static void falcon_readl(struct efab_nic *efab, efab_dword_t *value, unsigned int reg)
Read dword from a portion of a Falcon register.
#define FCN_DUMP_MAC_REG(efab, _mac_reg)
struct arbelprm_rc_send_wqe rc
static unsigned int gmii_autoneg_lpa(struct efab_nic *efab)
Retrieve GMII autonegotiation link partner abilities.
#define FCN_MD_TXD_REG_KER
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
#define FCN_TX_IP_EV_DECODE
struct efab_special_buffer entry
static void falcon_xmac_readl(struct efab_nic *efab, efab_dword_t *value, unsigned int mac_reg)
Read dword from a Falcon XMAC register.
static int sfe4003_init(struct efab_nic *efab)
#define TXC_ALRGS_ATXAMP0
static int falcon_reset_xaui(struct efab_nic *efab)
#define FALCON_SPI_MAX_LEN
Maximum length for a single SPI transaction.
#define iob_put(iobuf, len)
struct efab_ev_queue ev_queue
#define FCN_EE_VPD_CFG_REG
#define MDIO45_RESET_TRIES
#define FCN_XX_PWR_RST_REG_MAC
int(* rw)(struct spi_bus *bus, struct spi_device *device, unsigned int command, int address, const void *data_out, void *data_in, size_t len)
Read/write data via SPI bus.
#define EFAB_DWORD_IS_ALL_ONES(dword)
#define FALCON_MAC_ADDRESS_OFFSET
Offset of MAC address within EEPROM or Flash.
#define TXC_ALRGS_ATXPRE1
static int falcon_spi_wait(struct efab_nic *efab)
#define FCN_EE_SPI_HADR_REG
static struct efab_mac_operations falcon_gmac_operations
uint8_t mac_addr[ETH_ALEN]
MAC address.
#define FCN_RX_DESC_UPD_REG_KER_DWORD
static int falcon_tenxpress_check_c11(struct efab_nic *efab)
static unsigned int unsigned int reg
#define TXC_ALRGS_ATXAMP1
int(* write)(struct i2c_interface *i2c, struct i2c_device *i2cdev, unsigned int offset, const uint8_t *data, unsigned int len)
Write data to I2C device.
int(* open)(struct net_device *netdev)
Open network device.
struct efab_special_buffer entry
#define EFAB_POPULATE_DWORD_5(dword,...)
static struct efab_phy_operations falcon_xaui_phy_ops
#define PMC_ANALOG_RX_CFG0
#define FCN_RX_IP_EV_DECODE
#define FCN_XM_ADR_HI_REG_MAC
#define FCN_XM_RX_PARAM_REG_MAC
unsigned long ioaddr
I/O address.
#define FCN_IP_DAT_BUF_SIZE_4K
static int falcon_pm8358_phy_init(struct efab_nic *efab)
static unsigned int gmii_autoneg_advertised(struct efab_nic *efab)
Retrieve GMII autonegotiation advertised abilities.
#define FCN_XX_CHARERR_RESET
static void efab_poll(struct net_device *netdev)
#define MDIO_MMDREG_DEVS0_DTEXS
#define FCN_XM_RX_CFG_REG_MAC
static int gmii_link_ok(struct efab_nic *efab)
Check GMII PHY link status.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
A non-volatile storage device.
#define FCN_DUMP_REG(efab, _reg)
struct pci_device_id * ids
PCI ID table.
#define FCN_SRM_RX_DC_CFG_REG_KER
#define TXC_ATXAMP_0820_BOTH
uint64_t address
Base address.
int register_nvo(struct nvo_block *nvo, struct settings *parent)
Register non-volatile stored options.
#define FCN_XM_MGT_INT_REG_MAC_B0
#define EFAB_REGDUMP(...)
#define XFP_REQUIRED_DEVS
static void mentormac_reset(struct efab_nic *efab)
#define XX_SD_CTL_DRV_DEFAULT
#define XX_TXDRV_DTX_DEFAULT
static void falcon_notify_rx_desc(struct efab_nic *efab, struct efab_rx_queue *rx_queue)
#define EFAB_SET_OWORD_FIELD_VER(efab, reg, field, val)
struct efab_phy_operations * phy_op
static void falcon_write(struct efab_nic *efab, efab_oword_t *value, unsigned int reg)
Write to a Falcon register.
struct net_device * netdev
static void *__malloc malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
efab_qword_t falcon_rx_desc_t
#define EFAB_POPULATE_DWORD_3(dword,...)
#define FCN_XM_MGT_INT_MSK_REG_MAC_B0
static struct i2c_device i2c_pca9539
#define EFAB_SET_OWORD_FIELD
#define FCN_XX_SYNC_STAT_DECODE_SYNCED
static void falcon_reconfigure_xmac(struct efab_nic *efab)
Initialise XMAC.
static void falcon_build_tx_desc(falcon_tx_desc_t *txd, struct io_buffer *iob)
#define PCS_BOOT_STATUS_REG
#define FCN_MD_STAT_REG_KER
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
unsigned int dev_addr
Address of this device.
struct io_buffer * buf[EFAB_TXD_SIZE]
#define EFAB_SET_DWORD_FIELD(dword, field, value)
#define PM8358_REQUIRED_DEVS
static struct efab_phy_operations falcon_alaska_phy_ops
static struct efab_mac_operations falcon_xmac_operations
#define FCN_INT_EN_REG_KER
#define GM_MAX_FLEN_REG_MAC
#define FCN_TIMER_CMD_REG_KER
static void * falcon_alloc_special_buffer(struct efab_nic *efab, int bytes, struct efab_special_buffer *entry)
static void falcon_init_spi_device(struct efab_nic *efab, struct spi_device *spi)
static int alaska_init(struct efab_nic *efab)
Initialise Alaska PHY.
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
static struct efab_phy_operations falcon_pm8358_phy_ops
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define EFAB_DWORD_VAL(dword)
printk parameters for printing an efab_dword_t
static void falcon_clear_interrupts(struct efab_nic *efab)
struct device dev
Generic device.
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
uint32_t enabled
Bitmask of enabled AENQ groups (host -> device)
static struct efab_phy_operations falcon_tenxpress_phy_ops
#define FCN_MAC1_CTRL_REG_KER
static void efab_receive(struct efab_nic *efab, unsigned int id, int len, int drop)
#define EFAB_POPULATE_DWORD_7(dword,...)
efab_oword_t int_ker
INT_REG_KER.
Dynamic memory allocation.
#define EFAB_POPULATE_OWORD_2(oword,...)
static void falcon_writel(struct efab_nic *efab, efab_dword_t *value, unsigned int reg)
Write dword to Falcon register that allows partial writes.
static void falcon_gmac_writel(struct efab_nic *efab, efab_dword_t *value, unsigned int mac_reg)
static void falcon_notify_tx_desc(struct efab_nic *efab, struct efab_tx_queue *tx_queue)
struct efab_tx_queue tx_queue
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
struct spi_device spi_eeprom
#define FCN_XX_TXDRV_CTL_REG_MAC
int(* init)(struct efab_nic *efab)
#define FCN_GLB_CTL_REG_KER
#define FCN_TX_CFG2_REG_KER
#define FCN_XM_GLB_CFG_REG_MAC
static void falcon_read(struct efab_nic *efab, efab_oword_t *value, unsigned int reg)
Read from a Falcon register.
static struct pci_device_id efab_nics[]
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
#define EFAB_QWORD_FMT
Format string for printing an efab_qword_t.
#define ENOMEM
Not enough space.
static void efab_close(struct net_device *netdev)
static void falcon_mdio_write(struct efab_nic *efab, int device, int location, int value)
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint16_t asic_sub_revision
#define FCN_NV_MAGIC_NUMBER
#define TXC_ATXPRE_DEFAULT
#define FCN_EE_SPI_HDATA_REG
static int falcon_txc_logic_reset(struct efab_nic *efab)
static int falcon_mdio_read(struct efab_nic *efab, int device, int location)
uint32_t minor
Minor version.
#define MDIO_MMDREG_STAT2
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
#define FCN_RX_FILTER_TBL0
Etherfabric bitfield access.
#define EFAB_ZERO_DWORD(dword)
static int falcon_i2c_bit_read(struct bit_basher *basher, unsigned int bit_id)
#define MDIO_MMDREG_CTRL1
unsigned int block_size
Data block size (in words)
#define EFAB_MAX_FRAME_LEN(mtu)
#define MDIO_PHYXS_LANE_STATE
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define container_of(ptr, type, field)
Get containing structure.
int sync(unsigned long timeout)
Wait for pending operations to complete.
static void falcon_interrupts(struct efab_nic *efab, int enabled, int force)
static struct efab_phy_operations falcon_txc_phy_ops
#define FCN_MD_CS_REG_KER
static int mdio_clause45_reset_mmd(struct efab_nic *efab, int mmd)
#define FCN_RX_SELF_RST_REG_KER
#define EFAB_OWORD_VAL(oword)
printk parameters for printing an efab_oword_t
struct i2c_interface i2c
I2C interface.
void * priv
Driver private data.
pseudo_bit_t value[0x00020]
static int falcon_spi_rw(struct spi_bus *bus, struct spi_device *device, unsigned int command, int address, const void *data_out, void *data_in, size_t len)
#define EFAB_POPULATE_OWORD_7(oword,...)
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
#define PCI_BASE_ADDRESS_2
static int mdio_clause45_links_ok(struct efab_nic *efab)
static void falcon_init_resources(struct efab_nic *efab)
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
static struct net_device * netdev
static int falcon_init_xmac(struct efab_nic *efab)
static int falcon_probe_spi(struct efab_nic *efab)
static void falcon_probe_nic_variant(struct efab_nic *efab, struct pci_device *pci)
static int efab_transmit_done(struct efab_nic *efab, int id)
uint16_t count
Number of entries.
unsigned long pci_bar_start(struct pci_device *pci, unsigned int reg)
Find the start of a PCI BAR.
static struct net_device_operations efab_operations
#define MDIO_PHYXS_LANE_ALIGNED_LBN
void * membase
Memory and IO base.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
#define TXC_REQUIRED_DEVS
#define FCN_TX_DESC_UPD_REG_KER_DWORD
void unregister_nvo(struct nvo_block *nvo)
Unregister non-volatile stored options.
static struct bit_basher_operations falcon_i2c_bit_ops
struct efab_mac_operations * mac_op
#define EFAB_POPULATE_OWORD_4(oword,...)
uint32_t revision
Entry point revision.
static int sfe4001_init(struct efab_nic *efab)
struct bit_basher basher
Bit-bashing interface.
#define PCS_TEST_SELECT_REG
int(* read)(struct bit_basher *basher, unsigned int bit_id)
Read input bit.
#define EFAB_POPULATE_DWORD_2(dword,...)
void(* fini)(struct efab_nic *efab)
struct nvs_device * nvs
Underlying non-volatile storage device.
struct spi_bus spi_bus
SPI bus and devices, and the user visible NVO area.
char * strerror(int errno)
Retrieve string representation of error number.
struct refcnt refcnt
Reference counter.
#define FCN_XM_TX_CFG_REG_MAC
static void falcon_fini_resources(struct efab_nic *efab)
void nvo_init(struct nvo_block *nvo, struct nvs_device *nvs, size_t address, size_t len, int(*resize)(struct nvo_block *nvo, size_t len), struct refcnt *refcnt)
Initialise non-volatile stored options.
#define FCN_TX_DC_CFG_REG_KER
#define EFAB_POPULATE_QWORD_3(qword,...)
#define MDIO_MMDREG_STAT2_PRESENT_VAL
unsigned int link_options
GMII link options.
#define FCN_RX_DC_CFG_REG_KER
#define EFAB_SET_QWORD(qword)
#define outl(data, io_addr)
#define FCN_RX_FILTER_CTL_REG_KER
int register_netdev(struct net_device *netdev)
Register network device.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define EFAB_POPULATE_OWORD_1(oword,...)
#define FCN_MD_PHY_ADR_REG_KER
#define PCS_BOOT_COMPLETE_LBN
static void falcon_eventq_read_ack(struct efab_nic *efab, struct efab_ev_queue *ev_queue)
#define _falcon_writel(efab, value, reg)
static void falcon_write_sram(struct efab_nic *efab, efab_qword_t *value, unsigned int index)
Write to Falcon SRAM.
#define FCN_XX_COMMA_DET_RESET
static int mdio_clause45_check_mmds(struct efab_nic *efab)
static void sfe4003_fini(struct efab_nic *efab)
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
#define FCN_INT_ADR_REG_KER
struct efab_board_operations sfe4002_ops
#define FCN_XX_CORE_STAT_REG_MAC
static void falcon_xmac_writel(struct efab_nic *efab, efab_dword_t *value, unsigned int mac_reg)
Write dword to a Falcon XMAC register.
#define FCN_IOM_IND_ADR_REG
static void falcon_build_rx_desc(falcon_rx_desc_t *rxd, struct io_buffer *iob)
#define SF_NV_CONFIG_EXTRA
static int falcon_xaui_phy_init(struct efab_nic *efab)
A PCI device ID list entry.
#define EXCLUDE_FROM_RESET
#define le16_to_cpu(value)
int(* read)(struct i2c_interface *i2c, struct i2c_device *i2cdev, unsigned int offset, uint8_t *data, unsigned int len)
Read data from I2C device.
static void falcon_setup_xaui(struct efab_nic *efab)
Configure Falcon XAUI output.
struct efab_board_operations sfe4003_ops
struct spi_device spi_flash
#define FCN_SRM_TX_DC_CFG_REG_KER
#define FCN_REVISION_REG(efab, reg)
An octword (eight-word, i.e.
static void falcon_handle_event(struct efab_nic *efab, falcon_event_t *evt)
#define EAGAIN
Resource temporarily unavailable.
static void falcon_free_special_buffer(void *p)
#define FCN_XM_FC_REG_MAC
static struct i2c_device i2c_max6647
static int falcon_reset(struct efab_nic *efab)
static void sfe4001_fini(struct efab_nic *efab)
Network device operations.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
struct device * dev
Underlying hardware device.
#define EFAB_DWORD_FMT
Format string for printing an efab_dword_t.
static int falcon_init_sram(struct efab_nic *efab)
struct efab_board_operations * board_op
Board, MAC, and PHY operations tables.
#define PMC_MASTER_ANLG_CTRL
Network device management.
static int mdio_clause45_wait_reset_mmds(struct efab_nic *efab)
#define FCN_TIMER_MODE_DIS
struct nvs_device nvs
NVS device.
#define FALCON_XMAC_REG(efab_port, mac_reg)
Offset of an XMAC register within Falcon.
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
#define FALCON_GMAC_REG(efab, mac_reg)
Offset of a GMAC register within Falcon.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
static int falcon_init_gmac(struct efab_nic *efab)
struct efab_board_operations sfe4001_ops
#define SF_NV_CONFIG_BASE
#define PMC_ANALOG_RX_EQ_FULL
#define EFAB_POPULATE_QWORD_2(qword,...)
static int falcon_gmii_wait(struct efab_nic *efab)
static int efab_fill_rx_queue(struct efab_nic *efab, struct efab_rx_queue *rx_queue)
#define MDIO_MMDREG_STAT1
static unsigned int gmii_nway_result(unsigned int negotiated)
Calculate GMII autonegotiated link technology.
static void sfe4002_fini(struct efab_nic *efab)
#define FCN_IOM_IND_DAT_REG
#define ENOBUFS
No buffer space available.
#define FCN_MAC0_CTRL_REG_KER
Media Independent Interface constants.
static int falcon_tenxpress_phy_init(struct efab_nic *efab)
static void falcon_gmac_readl(struct efab_nic *efab, efab_dword_t *value, unsigned int mac_reg)
#define TXC_ALRGS_ATXPRE0
#define MDIO_MMDREG_DEVS0
void * data
Start of data.
efab_qword_t falcon_tx_desc_t
static int falcon_reset_xmac(struct efab_nic *efab)
Reset 10G MAC connected to port.
static int falcon_xaui_link_ok(struct efab_nic *efab)
#define EIO
Input/output error.
struct spi_bus * bus
SPI bus to which device is attached.
#define TXC_ATXAMP_DEFAULT
#define FCN_EE_SPI_EEPROM
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
static int falcon_txc_phy_init(struct efab_nic *efab)
#define EFAB_POPULATE_DWORD_4(dword,...)
static void falcon_mask_status_intr(struct efab_nic *efab, int enable)
struct pci_device_id * id
Driver device ID.
static int falcon_xgmii_status(struct efab_nic *efab)
#define _falcon_readl(efab, reg)
static int efab_init_mac(struct efab_nic *efab)
static int sfe4002_init(struct efab_nic *efab)
void iounmap(volatile const void *io_addr)
Unmap I/O address.
uint8_t data[48]
Additional event data.
#define PCI_REVISION
PCI revision.
static int efab_probe(struct pci_device *pci)
#define FCN_ADR_REGION_REG_KER
#define EFAB_POPULATE_OWORD_8(oword,...)
#define FCN_MD_ID_REG_KER
#define WORK_AROUND_BROKEN_PCI_READS_REG_KER_A1
static void falcon_setup_nic(struct efab_nic *efab)
struct efab_special_buffer entry
int nvs_read(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read from non-volatile storage device.
#define EFAB_POPULATE_DWORD_1(dword,...)
static void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
#define EFAB_ZERO_OWORD(oword)
static void mentormac_init(struct efab_nic *efab)
#define MDIO_MMDREG_CTRL1_RESET_LBN
uint16_t offset
Offset to command line.
#define EFAB_OWORD_FMT
Format string for printing an efab_oword_t.
static int efab_transmit(struct net_device *netdev, struct io_buffer *iob)
void mb(void)
Memory barrier.
#define FCN_INT_ACK_KER_REG_A1
#define FCN_ALTERA_BUILD_REG_KER
static void clear_b0_fpga_memories(struct efab_nic *efab)
#define MDIO45_RESET_SPINTIME
static int efab_alloc_resources(struct efab_nic *efab)
#define FCN_RX_RSS_INDIR_TBL_B0
struct pci_driver etherfabric_driver __pci_driver
#define FCN_XX_DISPERR_RESET
#define FCN_SPARE_REG_KER
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
#define FCN_MD_RXD_REG_KER
#define EFAB_POPULATE_OWORD_3(oword,...)
#define PMC_ANALOG_RX_EQ_MASK
struct efab_rx_queue rx_queue
#define FCN_GPIO_CTL_REG_KER
#define GM_MII_MGMT_CFG_REG_MAC
int init_i2c_bit_basher(struct i2c_bit_basher *i2cbit, struct bit_basher_operations *bash_op)
Initialise I2C bit-bashing interface.
static struct efab_phy_operations falcon_xfp_phy_ops
struct io_buffer * buf[EFAB_NUM_RX_DESC]
#define EFAB_POPULATE_OWORD_6(oword,...)
#define FCN_EE_SPI_HCMD_REG
int(* init)(struct efab_nic *efab)
int(* init)(struct efab_nic *efab)
static struct command_descriptor read_cmd
"read" command descriptor
#define TXC_GLCMD_LMTSWRST_LBN
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
int putchar(int character)
Write a single character to each console device.
static int falcon_xfp_phy_init(struct efab_nic *efab)
static void efab_irq(struct net_device *netdev, int enable)
#define ETIMEDOUT
Connection timed out.
static void efab_remove(struct pci_device *pci)
#define PCI_ROM(_vendor, _device, _name, _description, _data)
#define EFAB_POPULATE_DWORD_8(dword,...)
#define TENXPRESS_REQUIRED_DEVS
static int efab_open(struct net_device *netdev)
#define EFAB_POPULATE_DWORD_6(dword,...)
#define FCN_XM_TX_PARAM_REG_MAC
static void falcon_i2c_bit_write(struct bit_basher *basher, unsigned int bit_id, unsigned long data)
#define EFAB_QWORD_VAL(qword)
printk parameters for printing an efab_qword_t
static int falcon_event_present(falcon_event_t *event)
See if an event is present.
struct i2c_bit_basher i2c_bb
#define MDIO_MMDREG_STAT1_LINK_LBN
#define EFAB_POPULATE_OWORD_5(oword,...)
#define EFAB_DWORD_FIELD(dword, field)
static void falcon_read_sram(struct efab_nic *efab, efab_qword_t *value, unsigned int index)
Read from Falcon SRAM.
static int falcon_probe_nvram(struct efab_nic *efab)
#define FCN_XM_ADR_LO_REG_MAC
void * memset(void *dest, int character, size_t len) __nonnull
int pci_read_config_byte(struct pci_device *pci, unsigned int where, uint8_t *value)
Read byte from PCI configuration space.
efab_qword_t falcon_event_t