1146740f9SSasha Neftin /* SPDX-License-Identifier: GPL-2.0 */ 2146740f9SSasha Neftin /* Copyright (c) 2018 Intel Corporation */ 3146740f9SSasha Neftin 4146740f9SSasha Neftin #ifndef _IGC_DEFINES_H_ 5146740f9SSasha Neftin #define _IGC_DEFINES_H_ 6146740f9SSasha Neftin 78c5ad0daSSasha Neftin /* Number of Transmit and Receive Descriptors must be a multiple of 8 */ 88c5ad0daSSasha Neftin #define REQ_TX_DESCRIPTOR_MULTIPLE 8 98c5ad0daSSasha Neftin #define REQ_RX_DESCRIPTOR_MULTIPLE 8 108c5ad0daSSasha Neftin 1187938851SEderson de Souza #define IGC_CTRL_EXT_SDP2_DIR 0x00000400 /* SDP2 Data direction */ 1287938851SEderson de Souza #define IGC_CTRL_EXT_SDP3_DIR 0x00000800 /* SDP3 Data direction */ 13c9a11c23SSasha Neftin #define IGC_CTRL_EXT_DRV_LOAD 0x10000000 /* Drv loaded bit for FW */ 14c9a11c23SSasha Neftin 159513d2a5SSasha Neftin /* Definitions for power management and wakeup registers */ 169513d2a5SSasha Neftin /* Wake Up Control */ 179513d2a5SSasha Neftin #define IGC_WUC_PME_EN 0x00000002 /* PME Enable */ 189513d2a5SSasha Neftin 199513d2a5SSasha Neftin /* Wake Up Filter Control */ 209513d2a5SSasha Neftin #define IGC_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */ 21e055600dSSasha Neftin #define IGC_WUFC_MAG 0x00000002 /* Magic Packet Wakeup Enable */ 22e055600dSSasha Neftin #define IGC_WUFC_EX 0x00000004 /* Directed Exact Wakeup Enable */ 239513d2a5SSasha Neftin #define IGC_WUFC_MC 0x00000008 /* Directed Multicast Wakeup Enable */ 24e055600dSSasha Neftin #define IGC_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */ 256574631bSKurt Kanzenbach #define IGC_WUFC_FLEX_HQ BIT(14) /* Flex Filters Host Queuing */ 266574631bSKurt Kanzenbach #define IGC_WUFC_FLX0 BIT(16) /* Flexible Filter 0 Enable */ 276574631bSKurt Kanzenbach #define IGC_WUFC_FLX1 BIT(17) /* Flexible Filter 1 Enable */ 286574631bSKurt Kanzenbach #define IGC_WUFC_FLX2 BIT(18) /* Flexible Filter 2 Enable */ 296574631bSKurt Kanzenbach #define IGC_WUFC_FLX3 BIT(19) /* Flexible Filter 3 Enable */ 306574631bSKurt Kanzenbach #define IGC_WUFC_FLX4 BIT(20) /* Flexible Filter 4 Enable */ 316574631bSKurt Kanzenbach #define IGC_WUFC_FLX5 BIT(21) /* Flexible Filter 5 Enable */ 326574631bSKurt Kanzenbach #define IGC_WUFC_FLX6 BIT(22) /* Flexible Filter 6 Enable */ 336574631bSKurt Kanzenbach #define IGC_WUFC_FLX7 BIT(23) /* Flexible Filter 7 Enable */ 349513d2a5SSasha Neftin 352b477d05SKurt Kanzenbach #define IGC_WUFC_FILTER_MASK GENMASK(23, 14) 362b477d05SKurt Kanzenbach 379513d2a5SSasha Neftin #define IGC_CTRL_ADVD3WUC 0x00100000 /* D3 WUC */ 389513d2a5SSasha Neftin 399513d2a5SSasha Neftin /* Wake Up Status */ 409513d2a5SSasha Neftin #define IGC_WUS_EX 0x00000004 /* Directed Exact */ 419513d2a5SSasha Neftin #define IGC_WUS_ARPD 0x00000020 /* Directed ARP Request */ 429513d2a5SSasha Neftin #define IGC_WUS_IPV4 0x00000040 /* Directed IPv4 */ 439513d2a5SSasha Neftin #define IGC_WUS_IPV6 0x00000080 /* Directed IPv6 */ 449513d2a5SSasha Neftin #define IGC_WUS_NSD 0x00000400 /* Directed IPv6 Neighbor Solicitation */ 459513d2a5SSasha Neftin 469513d2a5SSasha Neftin /* Packet types that are enabled for wake packet delivery */ 479513d2a5SSasha Neftin #define WAKE_PKT_WUS ( \ 489513d2a5SSasha Neftin IGC_WUS_EX | \ 499513d2a5SSasha Neftin IGC_WUS_ARPD | \ 509513d2a5SSasha Neftin IGC_WUS_IPV4 | \ 519513d2a5SSasha Neftin IGC_WUS_IPV6 | \ 529513d2a5SSasha Neftin IGC_WUS_NSD) 539513d2a5SSasha Neftin 549513d2a5SSasha Neftin /* Wake Up Packet Length */ 559513d2a5SSasha Neftin #define IGC_WUPL_MASK 0x00000FFF 569513d2a5SSasha Neftin 579513d2a5SSasha Neftin /* Wake Up Packet Memory stores the first 128 bytes of the wake up packet */ 589513d2a5SSasha Neftin #define IGC_WUPM_BYTES 128 599513d2a5SSasha Neftin 606574631bSKurt Kanzenbach /* Wakeup Filter Control Extended */ 616574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX8 BIT(8) /* Flexible Filter 8 Enable */ 626574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX9 BIT(9) /* Flexible Filter 9 Enable */ 636574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX10 BIT(10) /* Flexible Filter 10 Enable */ 646574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX11 BIT(11) /* Flexible Filter 11 Enable */ 656574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX12 BIT(12) /* Flexible Filter 12 Enable */ 666574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX13 BIT(13) /* Flexible Filter 13 Enable */ 676574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX14 BIT(14) /* Flexible Filter 14 Enable */ 686574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX15 BIT(15) /* Flexible Filter 15 Enable */ 696574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX16 BIT(16) /* Flexible Filter 16 Enable */ 706574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX17 BIT(17) /* Flexible Filter 17 Enable */ 716574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX18 BIT(18) /* Flexible Filter 18 Enable */ 726574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX19 BIT(19) /* Flexible Filter 19 Enable */ 736574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX20 BIT(20) /* Flexible Filter 20 Enable */ 746574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX21 BIT(21) /* Flexible Filter 21 Enable */ 756574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX22 BIT(22) /* Flexible Filter 22 Enable */ 766574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX23 BIT(23) /* Flexible Filter 23 Enable */ 776574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX24 BIT(24) /* Flexible Filter 24 Enable */ 786574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX25 BIT(25) /* Flexible Filter 25 Enable */ 796574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX26 BIT(26) /* Flexible Filter 26 Enable */ 806574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX27 BIT(27) /* Flexible Filter 27 Enable */ 816574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX28 BIT(28) /* Flexible Filter 28 Enable */ 826574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX29 BIT(29) /* Flexible Filter 29 Enable */ 836574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX30 BIT(30) /* Flexible Filter 30 Enable */ 846574631bSKurt Kanzenbach #define IGC_WUFC_EXT_FLX31 BIT(31) /* Flexible Filter 31 Enable */ 856574631bSKurt Kanzenbach 862b477d05SKurt Kanzenbach #define IGC_WUFC_EXT_FILTER_MASK GENMASK(31, 8) 872b477d05SKurt Kanzenbach 884eb80801SSasha Neftin /* Loop limit on how long we wait for auto-negotiation to complete */ 894eb80801SSasha Neftin #define COPPER_LINK_UP_LIMIT 10 904eb80801SSasha Neftin #define PHY_AUTO_NEG_LIMIT 45 914eb80801SSasha Neftin 92c0071c7aSSasha Neftin /* Number of 100 microseconds we wait for PCI Express master disable */ 93c0071c7aSSasha Neftin #define MASTER_DISABLE_TIMEOUT 800 94c0071c7aSSasha Neftin /*Blocks new Master requests */ 95c0071c7aSSasha Neftin #define IGC_CTRL_GIO_MASTER_DISABLE 0x00000004 96c0071c7aSSasha Neftin /* Status of Master requests. */ 97c0071c7aSSasha Neftin #define IGC_STATUS_GIO_MASTER_ENABLE 0x00080000 98c0071c7aSSasha Neftin 99c9a11c23SSasha Neftin /* Receive Address 100c9a11c23SSasha Neftin * Number of high/low register pairs in the RAR. The RAR (Receive Address 101c9a11c23SSasha Neftin * Registers) holds the directed and multicast addresses that we monitor. 102c9a11c23SSasha Neftin * Technically, we have 16 spots. However, we reserve one of these spots 103c9a11c23SSasha Neftin * (RAR[15]) for our directed address used by controllers with 104c9a11c23SSasha Neftin * manageability enabled, allowing us room for 15 multicast addresses. 105c9a11c23SSasha Neftin */ 106d66358caSAndre Guedes #define IGC_RAH_RAH_MASK 0x0000FFFF 107750433d0SAndre Guedes #define IGC_RAH_ASEL_MASK 0x00030000 108750433d0SAndre Guedes #define IGC_RAH_ASEL_SRC_ADDR BIT(16) 10927945ebeSAndre Guedes #define IGC_RAH_QSEL_MASK 0x000C0000 11027945ebeSAndre Guedes #define IGC_RAH_QSEL_SHIFT 18 11127945ebeSAndre Guedes #define IGC_RAH_QSEL_ENABLE BIT(28) 112c9a11c23SSasha Neftin #define IGC_RAH_AV 0x80000000 /* Receive descriptor valid */ 11327945ebeSAndre Guedes 114ab405612SSasha Neftin #define IGC_RAL_MAC_ADDR_LEN 4 115ab405612SSasha Neftin #define IGC_RAH_MAC_ADDR_LEN 2 116c9a11c23SSasha Neftin 117146740f9SSasha Neftin /* Error Codes */ 118146740f9SSasha Neftin #define IGC_SUCCESS 0 119146740f9SSasha Neftin #define IGC_ERR_NVM 1 120146740f9SSasha Neftin #define IGC_ERR_PHY 2 121146740f9SSasha Neftin #define IGC_ERR_CONFIG 3 122146740f9SSasha Neftin #define IGC_ERR_PARAM 4 123146740f9SSasha Neftin #define IGC_ERR_MAC_INIT 5 124146740f9SSasha Neftin #define IGC_ERR_RESET 9 125c0071c7aSSasha Neftin #define IGC_ERR_MASTER_REQUESTS_PENDING 10 1265586838fSSasha Neftin #define IGC_ERR_BLK_PHY_RESET 12 127c0071c7aSSasha Neftin #define IGC_ERR_SWFW_SYNC 13 128c0071c7aSSasha Neftin 129c0071c7aSSasha Neftin /* Device Control */ 130e377a063SSasha Neftin #define IGC_CTRL_RST 0x04000000 /* Global reset */ 131146740f9SSasha Neftin 1325586838fSSasha Neftin #define IGC_CTRL_PHY_RST 0x80000000 /* PHY Reset */ 1334eb80801SSasha Neftin #define IGC_CTRL_SLU 0x00000040 /* Set link up (Force Link) */ 1344eb80801SSasha Neftin #define IGC_CTRL_FRCSPD 0x00000800 /* Force Speed */ 1354eb80801SSasha Neftin #define IGC_CTRL_FRCDPX 0x00001000 /* Force Duplex */ 1368d744963SMuhammad Husaini Zulkifli #define IGC_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */ 1374eb80801SSasha Neftin 1384eb80801SSasha Neftin #define IGC_CTRL_RFCE 0x08000000 /* Receive Flow Control enable */ 1394eb80801SSasha Neftin #define IGC_CTRL_TFCE 0x10000000 /* Transmit flow control enable */ 1405586838fSSasha Neftin 14187938851SEderson de Souza #define IGC_CTRL_SDP0_DIR 0x00400000 /* SDP0 Data direction */ 14287938851SEderson de Souza #define IGC_CTRL_SDP1_DIR 0x00800000 /* SDP1 Data direction */ 14387938851SEderson de Souza 1440373ad4dSSasha Neftin /* As per the EAS the maximum supported size is 9.5KB (9728 bytes) */ 1450373ad4dSSasha Neftin #define MAX_JUMBO_FRAME_SIZE 0x2600 1460373ad4dSSasha Neftin 147c9a11c23SSasha Neftin /* PBA constants */ 148c9a11c23SSasha Neftin #define IGC_PBA_34K 0x0022 149c9a11c23SSasha Neftin 150c0071c7aSSasha Neftin /* SW Semaphore Register */ 151c0071c7aSSasha Neftin #define IGC_SWSM_SMBI 0x00000001 /* Driver Semaphore bit */ 152c0071c7aSSasha Neftin #define IGC_SWSM_SWESMBI 0x00000002 /* FW Semaphore bit */ 153c0071c7aSSasha Neftin 154ab405612SSasha Neftin /* SWFW_SYNC Definitions */ 155ab405612SSasha Neftin #define IGC_SWFW_EEP_SM 0x1 156ab405612SSasha Neftin #define IGC_SWFW_PHY0_SM 0x2 157ab405612SSasha Neftin 1584eb80801SSasha Neftin /* Autoneg Advertisement Register */ 1594eb80801SSasha Neftin #define NWAY_AR_10T_HD_CAPS 0x0020 /* 10T Half Duplex Capable */ 1604eb80801SSasha Neftin #define NWAY_AR_10T_FD_CAPS 0x0040 /* 10T Full Duplex Capable */ 1614eb80801SSasha Neftin #define NWAY_AR_100TX_HD_CAPS 0x0080 /* 100TX Half Duplex Capable */ 1624eb80801SSasha Neftin #define NWAY_AR_100TX_FD_CAPS 0x0100 /* 100TX Full Duplex Capable */ 1634eb80801SSasha Neftin #define NWAY_AR_PAUSE 0x0400 /* Pause operation desired */ 1644eb80801SSasha Neftin #define NWAY_AR_ASM_DIR 0x0800 /* Asymmetric Pause Direction bit */ 1654eb80801SSasha Neftin 1664eb80801SSasha Neftin /* Link Partner Ability Register (Base Page) */ 1674eb80801SSasha Neftin #define NWAY_LPAR_PAUSE 0x0400 /* LP Pause operation desired */ 1684eb80801SSasha Neftin #define NWAY_LPAR_ASM_DIR 0x0800 /* LP Asymmetric Pause Direction bit */ 1694eb80801SSasha Neftin 1704eb80801SSasha Neftin /* 1000BASE-T Control Register */ 1714eb80801SSasha Neftin #define CR_1000T_HD_CAPS 0x0100 /* Advertise 1000T HD capability */ 1724eb80801SSasha Neftin #define CR_1000T_FD_CAPS 0x0200 /* Advertise 1000T FD capability */ 1734eb80801SSasha Neftin 174208983f0SSasha Neftin /* 1000BASE-T Status Register */ 175208983f0SSasha Neftin #define SR_1000T_REMOTE_RX_STATUS 0x1000 /* Remote receiver OK */ 176208983f0SSasha Neftin 1774eb80801SSasha Neftin /* PHY GPY 211 registers */ 1784eb80801SSasha Neftin #define STANDARD_AN_REG_MASK 0x0007 /* MMD */ 1794eb80801SSasha Neftin #define ANEG_MULTIGBT_AN_CTRL 0x0020 /* MULTI GBT AN Control Register */ 1804eb80801SSasha Neftin #define MMD_DEVADDR_SHIFT 16 /* Shift MMD to higher bits */ 1814eb80801SSasha Neftin #define CR_2500T_FD_CAPS 0x0080 /* Advertise 2500T FD capability */ 1824eb80801SSasha Neftin 183ab405612SSasha Neftin /* NVM Control */ 184c0071c7aSSasha Neftin /* Number of milliseconds for NVM auto read done after MAC reset. */ 185c0071c7aSSasha Neftin #define AUTO_READ_DONE_TIMEOUT 10 186c0071c7aSSasha Neftin #define IGC_EECD_AUTO_RD 0x00000200 /* NVM Auto Read done */ 187ab405612SSasha Neftin #define IGC_EECD_REQ 0x00000040 /* NVM Access Request */ 188ab405612SSasha Neftin #define IGC_EECD_GNT 0x00000080 /* NVM Access Grant */ 189ab405612SSasha Neftin /* NVM Addressing bits based on type 0=small, 1=large */ 190ab405612SSasha Neftin #define IGC_EECD_ADDR_BITS 0x00000400 191ab405612SSasha Neftin #define IGC_NVM_GRANT_ATTEMPTS 1000 /* NVM # attempts to gain grant */ 192ab405612SSasha Neftin #define IGC_EECD_SIZE_EX_MASK 0x00007800 /* NVM Size */ 193ab405612SSasha Neftin #define IGC_EECD_SIZE_EX_SHIFT 11 194ab405612SSasha Neftin #define IGC_EECD_FLUPD_I225 0x00800000 /* Update FLASH */ 195ab405612SSasha Neftin #define IGC_EECD_FLUDONE_I225 0x04000000 /* Update FLASH done*/ 196ab405612SSasha Neftin #define IGC_EECD_FLASH_DETECTED_I225 0x00080000 /* FLASH detected */ 197ab405612SSasha Neftin #define IGC_FLUDONE_ATTEMPTS 20000 198ab405612SSasha Neftin #define IGC_EERD_EEWR_MAX_COUNT 512 /* buffered EEPROM words rw */ 199ab405612SSasha Neftin 200ab405612SSasha Neftin /* Offset to data in NVM read/write registers */ 201ab405612SSasha Neftin #define IGC_NVM_RW_REG_DATA 16 202ab405612SSasha Neftin #define IGC_NVM_RW_REG_DONE 2 /* Offset to READ/WRITE done bit */ 203ab405612SSasha Neftin #define IGC_NVM_RW_REG_START 1 /* Start operation */ 204ab405612SSasha Neftin #define IGC_NVM_RW_ADDR_SHIFT 2 /* Shift to the address bits */ 205ab405612SSasha Neftin #define IGC_NVM_POLL_READ 0 /* Flag for polling for read complete */ 20601bb6129SSasha Neftin #define IGC_NVM_DEV_STARTER 5 /* Dev_starter Version */ 207ab405612SSasha Neftin 208ab405612SSasha Neftin /* NVM Word Offsets */ 209ab405612SSasha Neftin #define NVM_CHECKSUM_REG 0x003F 210ab405612SSasha Neftin 211ab405612SSasha Neftin /* For checksumming, the sum of all words in the NVM should equal 0xBABA. */ 212ab405612SSasha Neftin #define NVM_SUM 0xBABA 213ab405612SSasha Neftin #define NVM_WORD_SIZE_BASE_SHIFT 6 214ab405612SSasha Neftin 215ab405612SSasha Neftin /* Collision related configuration parameters */ 216ab405612SSasha Neftin #define IGC_COLLISION_THRESHOLD 15 217ab405612SSasha Neftin #define IGC_CT_SHIFT 4 218ab405612SSasha Neftin #define IGC_COLLISION_DISTANCE 63 219ab405612SSasha Neftin #define IGC_COLD_SHIFT 12 220c0071c7aSSasha Neftin 221146740f9SSasha Neftin /* Device Status */ 222146740f9SSasha Neftin #define IGC_STATUS_FD 0x00000001 /* Full duplex.0=half,1=full */ 223146740f9SSasha Neftin #define IGC_STATUS_LU 0x00000002 /* Link up.0=no,1=link */ 224146740f9SSasha Neftin #define IGC_STATUS_FUNC_MASK 0x0000000C /* PCI Function Mask */ 225146740f9SSasha Neftin #define IGC_STATUS_FUNC_SHIFT 2 226146740f9SSasha Neftin #define IGC_STATUS_TXOFF 0x00000010 /* transmission paused */ 227146740f9SSasha Neftin #define IGC_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */ 228146740f9SSasha Neftin #define IGC_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */ 229ab405612SSasha Neftin #define IGC_STATUS_SPEED_2500 0x00400000 /* Speed 2.5Gb/s */ 230ab405612SSasha Neftin 231ab405612SSasha Neftin #define SPEED_10 10 232ab405612SSasha Neftin #define SPEED_100 100 233ab405612SSasha Neftin #define SPEED_1000 1000 234ab405612SSasha Neftin #define SPEED_2500 2500 235ab405612SSasha Neftin #define HALF_DUPLEX 1 236ab405612SSasha Neftin #define FULL_DUPLEX 2 237146740f9SSasha Neftin 2385586838fSSasha Neftin /* 1Gbps and 2.5Gbps half duplex is not supported, nor spec-compliant. */ 2395586838fSSasha Neftin #define ADVERTISE_10_HALF 0x0001 2405586838fSSasha Neftin #define ADVERTISE_10_FULL 0x0002 2415586838fSSasha Neftin #define ADVERTISE_100_HALF 0x0004 2425586838fSSasha Neftin #define ADVERTISE_100_FULL 0x0008 2435586838fSSasha Neftin #define ADVERTISE_1000_HALF 0x0010 /* Not used, just FYI */ 2445586838fSSasha Neftin #define ADVERTISE_1000_FULL 0x0020 2455586838fSSasha Neftin #define ADVERTISE_2500_HALF 0x0040 /* Not used, just FYI */ 2465586838fSSasha Neftin #define ADVERTISE_2500_FULL 0x0080 2475586838fSSasha Neftin 2485586838fSSasha Neftin #define IGC_ALL_SPEED_DUPLEX_2500 ( \ 2495586838fSSasha Neftin ADVERTISE_10_HALF | ADVERTISE_10_FULL | ADVERTISE_100_HALF | \ 2505586838fSSasha Neftin ADVERTISE_100_FULL | ADVERTISE_1000_FULL | ADVERTISE_2500_FULL) 2515586838fSSasha Neftin 2525586838fSSasha Neftin #define AUTONEG_ADVERTISE_SPEED_DEFAULT_2500 IGC_ALL_SPEED_DUPLEX_2500 2535586838fSSasha Neftin 2543df25e4cSSasha Neftin /* Interrupt Cause Read */ 2553df25e4cSSasha Neftin #define IGC_ICR_TXDW BIT(0) /* Transmit desc written back */ 2563df25e4cSSasha Neftin #define IGC_ICR_TXQE BIT(1) /* Transmit Queue empty */ 2573df25e4cSSasha Neftin #define IGC_ICR_LSC BIT(2) /* Link Status Change */ 2583df25e4cSSasha Neftin #define IGC_ICR_RXSEQ BIT(3) /* Rx sequence error */ 2593df25e4cSSasha Neftin #define IGC_ICR_RXDMT0 BIT(4) /* Rx desc min. threshold (0) */ 2603df25e4cSSasha Neftin #define IGC_ICR_RXO BIT(6) /* Rx overrun */ 2613df25e4cSSasha Neftin #define IGC_ICR_RXT0 BIT(7) /* Rx timer intr (ring 0) */ 2625f295805SVinicius Costa Gomes #define IGC_ICR_TS BIT(19) /* Time Sync Interrupt */ 2633df25e4cSSasha Neftin #define IGC_ICR_DRSTA BIT(30) /* Device Reset Asserted */ 26413b5b7fdSSasha Neftin 26513b5b7fdSSasha Neftin /* If this bit asserted, the driver should claim the interrupt */ 26613b5b7fdSSasha Neftin #define IGC_ICR_INT_ASSERTED BIT(31) 26713b5b7fdSSasha Neftin 2683df25e4cSSasha Neftin #define IGC_ICS_RXT0 IGC_ICR_RXT0 /* Rx timer intr */ 2693df25e4cSSasha Neftin 2703df25e4cSSasha Neftin #define IMS_ENABLE_MASK ( \ 2713df25e4cSSasha Neftin IGC_IMS_RXT0 | \ 2723df25e4cSSasha Neftin IGC_IMS_TXDW | \ 2733df25e4cSSasha Neftin IGC_IMS_RXDMT0 | \ 2743df25e4cSSasha Neftin IGC_IMS_RXSEQ | \ 2753df25e4cSSasha Neftin IGC_IMS_LSC) 2763df25e4cSSasha Neftin 2773df25e4cSSasha Neftin /* Interrupt Mask Set */ 2783df25e4cSSasha Neftin #define IGC_IMS_TXDW IGC_ICR_TXDW /* Tx desc written back */ 2793df25e4cSSasha Neftin #define IGC_IMS_RXSEQ IGC_ICR_RXSEQ /* Rx sequence error */ 2803df25e4cSSasha Neftin #define IGC_IMS_LSC IGC_ICR_LSC /* Link Status Change */ 2813df25e4cSSasha Neftin #define IGC_IMS_DOUTSYNC IGC_ICR_DOUTSYNC /* NIC DMA out of sync */ 2823df25e4cSSasha Neftin #define IGC_IMS_DRSTA IGC_ICR_DRSTA /* Device Reset Asserted */ 2833df25e4cSSasha Neftin #define IGC_IMS_RXT0 IGC_ICR_RXT0 /* Rx timer intr */ 2843df25e4cSSasha Neftin #define IGC_IMS_RXDMT0 IGC_ICR_RXDMT0 /* Rx desc min. threshold */ 2855f295805SVinicius Costa Gomes #define IGC_IMS_TS IGC_ICR_TS /* Time Sync Interrupt */ 2863df25e4cSSasha Neftin 2873df25e4cSSasha Neftin #define IGC_QVECTOR_MASK 0x7FFC /* Q-vector mask */ 2883df25e4cSSasha Neftin #define IGC_ITR_VAL_MASK 0x04 /* ITR value mask */ 2893df25e4cSSasha Neftin 290208983f0SSasha Neftin /* Interrupt Cause Set */ 291208983f0SSasha Neftin #define IGC_ICS_LSC IGC_ICR_LSC /* Link Status Change */ 292208983f0SSasha Neftin #define IGC_ICS_RXDMT0 IGC_ICR_RXDMT0 /* rx desc min. threshold */ 293208983f0SSasha Neftin 2943df25e4cSSasha Neftin #define IGC_ICR_DOUTSYNC 0x10000000 /* NIC DMA out of sync */ 2953df25e4cSSasha Neftin #define IGC_EITR_CNT_IGNR 0x80000000 /* Don't reset counters on write */ 2963df25e4cSSasha Neftin #define IGC_IVAR_VALID 0x80 2973df25e4cSSasha Neftin #define IGC_GPIE_NSICR 0x00000001 2983df25e4cSSasha Neftin #define IGC_GPIE_MSIX_MODE 0x00000010 2993df25e4cSSasha Neftin #define IGC_GPIE_EIAME 0x40000000 3003df25e4cSSasha Neftin #define IGC_GPIE_PBA 0x80000000 3013df25e4cSSasha Neftin 3029c384ee3SSasha Neftin /* Receive Descriptor bit definitions */ 3039c384ee3SSasha Neftin #define IGC_RXD_STAT_DD 0x01 /* Descriptor Done */ 3049c384ee3SSasha Neftin 3050507ef8aSSasha Neftin /* Transmit Descriptor bit definitions */ 3060507ef8aSSasha Neftin #define IGC_TXD_DTYP_D 0x00100000 /* Data Descriptor */ 3070507ef8aSSasha Neftin #define IGC_TXD_DTYP_C 0x00000000 /* Context Descriptor */ 3080507ef8aSSasha Neftin #define IGC_TXD_POPTS_IXSM 0x01 /* Insert IP checksum */ 3090507ef8aSSasha Neftin #define IGC_TXD_POPTS_TXSM 0x02 /* Insert TCP/UDP checksum */ 3100507ef8aSSasha Neftin #define IGC_TXD_CMD_EOP 0x01000000 /* End of Packet */ 3110507ef8aSSasha Neftin #define IGC_TXD_CMD_IC 0x04000000 /* Insert Checksum */ 3120507ef8aSSasha Neftin #define IGC_TXD_CMD_DEXT 0x20000000 /* Desc extension (0 = legacy) */ 3130507ef8aSSasha Neftin #define IGC_TXD_CMD_VLE 0x40000000 /* Add VLAN tag */ 3140507ef8aSSasha Neftin #define IGC_TXD_STAT_DD 0x00000001 /* Descriptor Done */ 3150507ef8aSSasha Neftin #define IGC_TXD_CMD_TCP 0x01000000 /* TCP packet */ 3160507ef8aSSasha Neftin #define IGC_TXD_CMD_IP 0x02000000 /* IP packet */ 3170507ef8aSSasha Neftin #define IGC_TXD_CMD_TSE 0x04000000 /* TCP Seg enable */ 3180507ef8aSSasha Neftin #define IGC_TXD_EXTCMD_TSTAMP 0x00000010 /* IEEE1588 Timestamp packet */ 3190507ef8aSSasha Neftin 320f38b782dSSasha Neftin /* IPSec Encrypt Enable */ 321f38b782dSSasha Neftin #define IGC_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */ 322f38b782dSSasha Neftin #define IGC_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */ 323f38b782dSSasha Neftin 324db0b124fSVinicius Costa Gomes #define IGC_ADVTXD_TSN_CNTX_FIRST 0x00000080 325db0b124fSVinicius Costa Gomes 32613b5b7fdSSasha Neftin /* Transmit Control */ 32713b5b7fdSSasha Neftin #define IGC_TCTL_EN 0x00000002 /* enable Tx */ 32813b5b7fdSSasha Neftin #define IGC_TCTL_PSP 0x00000008 /* pad short packets */ 32913b5b7fdSSasha Neftin #define IGC_TCTL_CT 0x00000ff0 /* collision threshold */ 33013b5b7fdSSasha Neftin #define IGC_TCTL_COLD 0x003ff000 /* collision distance */ 33113b5b7fdSSasha Neftin #define IGC_TCTL_RTLC 0x01000000 /* Re-transmit on late collision */ 33213b5b7fdSSasha Neftin 333c0071c7aSSasha Neftin /* Flow Control Constants */ 334c0071c7aSSasha Neftin #define FLOW_CONTROL_ADDRESS_LOW 0x00C28001 335c0071c7aSSasha Neftin #define FLOW_CONTROL_ADDRESS_HIGH 0x00000100 336c0071c7aSSasha Neftin #define FLOW_CONTROL_TYPE 0x8808 337c0071c7aSSasha Neftin /* Enable XON frame transmission */ 338c0071c7aSSasha Neftin #define IGC_FCRTL_XONE 0x80000000 339c0071c7aSSasha Neftin 34013b5b7fdSSasha Neftin /* Management Control */ 34113b5b7fdSSasha Neftin #define IGC_MANC_RCV_TCO_EN 0x00020000 /* Receive TCO Packets Enabled */ 3425586838fSSasha Neftin #define IGC_MANC_BLK_PHY_RST_ON_IDE 0x00040000 /* Block phy resets */ 34313b5b7fdSSasha Neftin 34413b5b7fdSSasha Neftin /* Receive Control */ 34513b5b7fdSSasha Neftin #define IGC_RCTL_RST 0x00000001 /* Software reset */ 34613b5b7fdSSasha Neftin #define IGC_RCTL_EN 0x00000002 /* enable */ 34713b5b7fdSSasha Neftin #define IGC_RCTL_SBP 0x00000004 /* store bad packet */ 34813b5b7fdSSasha Neftin #define IGC_RCTL_UPE 0x00000008 /* unicast promisc enable */ 34913b5b7fdSSasha Neftin #define IGC_RCTL_MPE 0x00000010 /* multicast promisc enable */ 35013b5b7fdSSasha Neftin #define IGC_RCTL_LPE 0x00000020 /* long packet enable */ 35113b5b7fdSSasha Neftin #define IGC_RCTL_LBM_MAC 0x00000040 /* MAC loopback mode */ 35213b5b7fdSSasha Neftin #define IGC_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */ 35313b5b7fdSSasha Neftin 35413b5b7fdSSasha Neftin #define IGC_RCTL_RDMTS_HALF 0x00000000 /* Rx desc min thresh size */ 35513b5b7fdSSasha Neftin #define IGC_RCTL_BAM 0x00008000 /* broadcast enable */ 35613b5b7fdSSasha Neftin 35781b05520SVinicius Costa Gomes /* Split Replication Receive Control */ 35881b05520SVinicius Costa Gomes #define IGC_SRRCTL_TIMESTAMP 0x40000000 35981b05520SVinicius Costa Gomes #define IGC_SRRCTL_TIMER1SEL(timer) (((timer) & 0x3) << 14) 36081b05520SVinicius Costa Gomes #define IGC_SRRCTL_TIMER0SEL(timer) (((timer) & 0x3) << 17) 36181b05520SVinicius Costa Gomes 3620507ef8aSSasha Neftin /* Receive Descriptor bit definitions */ 3630507ef8aSSasha Neftin #define IGC_RXD_STAT_EOP 0x02 /* End of Packet */ 3643bdd7086SSasha Neftin #define IGC_RXD_STAT_IXSM 0x04 /* Ignore checksum */ 3653bdd7086SSasha Neftin #define IGC_RXD_STAT_UDPCS 0x10 /* UDP xsum calculated */ 3663bdd7086SSasha Neftin #define IGC_RXD_STAT_TCPCS 0x20 /* TCP xsum calculated */ 3678d744963SMuhammad Husaini Zulkifli #define IGC_RXD_STAT_VP 0x08 /* IEEE VLAN Packet */ 3688d744963SMuhammad Husaini Zulkifli 3698d744963SMuhammad Husaini Zulkifli #define IGC_RXDEXT_STATERR_LB 0x00040000 3700507ef8aSSasha Neftin 37181b05520SVinicius Costa Gomes /* Advanced Receive Descriptor bit definitions */ 37281b05520SVinicius Costa Gomes #define IGC_RXDADV_STAT_TSIP 0x08000 /* timestamp in packet */ 37381b05520SVinicius Costa Gomes 374ef8a17a2SAndre Guedes #define IGC_RXDEXT_STATERR_L4E 0x20000000 3750507ef8aSSasha Neftin #define IGC_RXDEXT_STATERR_IPE 0x40000000 3760507ef8aSSasha Neftin #define IGC_RXDEXT_STATERR_RXE 0x80000000 3770507ef8aSSasha Neftin 3782121c271SSasha Neftin #define IGC_MRQC_RSS_FIELD_IPV4_TCP 0x00010000 3792121c271SSasha Neftin #define IGC_MRQC_RSS_FIELD_IPV4 0x00020000 3802121c271SSasha Neftin #define IGC_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000 3812121c271SSasha Neftin #define IGC_MRQC_RSS_FIELD_IPV6 0x00100000 3822121c271SSasha Neftin #define IGC_MRQC_RSS_FIELD_IPV6_TCP 0x00200000 3832121c271SSasha Neftin 38413b5b7fdSSasha Neftin /* Header split receive */ 38513b5b7fdSSasha Neftin #define IGC_RFCTL_IPV6_EX_DIS 0x00010000 38613b5b7fdSSasha Neftin #define IGC_RFCTL_LEF 0x00040000 38713b5b7fdSSasha Neftin 38813b5b7fdSSasha Neftin #define IGC_RCTL_SZ_256 0x00030000 /* Rx buffer size 256 */ 38913b5b7fdSSasha Neftin 39013b5b7fdSSasha Neftin #define IGC_RCTL_MO_SHIFT 12 /* multicast offset shift */ 39113b5b7fdSSasha Neftin #define IGC_RCTL_CFIEN 0x00080000 /* canonical form enable */ 39213b5b7fdSSasha Neftin #define IGC_RCTL_DPF 0x00400000 /* discard pause frames */ 39313b5b7fdSSasha Neftin #define IGC_RCTL_PMCF 0x00800000 /* pass MAC control frames */ 39413b5b7fdSSasha Neftin #define IGC_RCTL_SECRC 0x04000000 /* Strip Ethernet CRC */ 39513b5b7fdSSasha Neftin 3960507ef8aSSasha Neftin #define I225_RXPBSIZE_DEFAULT 0x000000A2 /* RXPBSIZE default */ 3970507ef8aSSasha Neftin #define I225_TXPBSIZE_DEFAULT 0x04000014 /* TXPBSIZE default */ 39881b05520SVinicius Costa Gomes #define IGC_RXPBS_CFG_TS_EN 0x80000000 /* Timestamp in Rx buffer */ 3990507ef8aSSasha Neftin 400ec50a9d4SVinicius Costa Gomes #define IGC_TXPBSIZE_TSN 0x04145145 /* 5k bytes buffer for each queue */ 401ec50a9d4SVinicius Costa Gomes 402ec50a9d4SVinicius Costa Gomes #define IGC_DTXMXPKTSZ_TSN 0x19 /* 1600 bytes of max TX DMA packet size */ 403ec50a9d4SVinicius Costa Gomes #define IGC_DTXMXPKTSZ_DEFAULT 0x98 /* 9728-byte Jumbo frames */ 404ec50a9d4SVinicius Costa Gomes 405*3fa593dbSFaizal Rahim /* Retry Buffer Control */ 406*3fa593dbSFaizal Rahim #define IGC_RETX_CTL 0x041C 407*3fa593dbSFaizal Rahim #define IGC_RETX_CTL_WATERMARK_MASK 0xF 408*3fa593dbSFaizal Rahim #define IGC_RETX_CTL_QBVFULLTH_SHIFT 8 /* QBV Retry Buffer Full Threshold */ 409*3fa593dbSFaizal Rahim #define IGC_RETX_CTL_QBVFULLEN 0x1000 /* Enable QBV Retry Buffer Full Threshold */ 410*3fa593dbSFaizal Rahim 411790835fcSMuhammad Husaini Zulkifli /* Transmit Scheduling Latency */ 412790835fcSMuhammad Husaini Zulkifli /* Latency between transmission scheduling (LaunchTime) and the time 413790835fcSMuhammad Husaini Zulkifli * the packet is transmitted to the network in nanosecond. 414790835fcSMuhammad Husaini Zulkifli */ 415790835fcSMuhammad Husaini Zulkifli #define IGC_TXOFFSET_SPEED_10 0x000034BC 416790835fcSMuhammad Husaini Zulkifli #define IGC_TXOFFSET_SPEED_100 0x00000578 417790835fcSMuhammad Husaini Zulkifli #define IGC_TXOFFSET_SPEED_1000 0x0000012C 418790835fcSMuhammad Husaini Zulkifli #define IGC_TXOFFSET_SPEED_2500 0x00000578 419790835fcSMuhammad Husaini Zulkifli 4205f295805SVinicius Costa Gomes /* Time Sync Interrupt Causes */ 4215f295805SVinicius Costa Gomes #define IGC_TSICR_SYS_WRAP BIT(0) /* SYSTIM Wrap around. */ 4225f295805SVinicius Costa Gomes #define IGC_TSICR_TXTS BIT(1) /* Transmit Timestamp. */ 4235f295805SVinicius Costa Gomes #define IGC_TSICR_TT0 BIT(3) /* Target Time 0 Trigger. */ 4245f295805SVinicius Costa Gomes #define IGC_TSICR_TT1 BIT(4) /* Target Time 1 Trigger. */ 4255f295805SVinicius Costa Gomes #define IGC_TSICR_AUTT0 BIT(5) /* Auxiliary Timestamp 0 Taken. */ 4265f295805SVinicius Costa Gomes #define IGC_TSICR_AUTT1 BIT(6) /* Auxiliary Timestamp 1 Taken. */ 4275f295805SVinicius Costa Gomes 4285f295805SVinicius Costa Gomes #define IGC_TSICR_INTERRUPTS IGC_TSICR_TXTS 4295f295805SVinicius Costa Gomes 43081b05520SVinicius Costa Gomes #define IGC_FTQF_VF_BP 0x00008000 43181b05520SVinicius Costa Gomes #define IGC_FTQF_1588_TIME_STAMP 0x08000000 43281b05520SVinicius Costa Gomes #define IGC_FTQF_MASK 0xF0000000 43381b05520SVinicius Costa Gomes #define IGC_FTQF_MASK_PROTO_BP 0x10000000 43481b05520SVinicius Costa Gomes 43581b05520SVinicius Costa Gomes /* Time Sync Receive Control bit definitions */ 43681b05520SVinicius Costa Gomes #define IGC_TSYNCRXCTL_TYPE_MASK 0x0000000E /* Rx type mask */ 43781b05520SVinicius Costa Gomes #define IGC_TSYNCRXCTL_TYPE_L2_V2 0x00 43881b05520SVinicius Costa Gomes #define IGC_TSYNCRXCTL_TYPE_L4_V1 0x02 43981b05520SVinicius Costa Gomes #define IGC_TSYNCRXCTL_TYPE_L2_L4_V2 0x04 44081b05520SVinicius Costa Gomes #define IGC_TSYNCRXCTL_TYPE_ALL 0x08 44181b05520SVinicius Costa Gomes #define IGC_TSYNCRXCTL_TYPE_EVENT_V2 0x0A 44281b05520SVinicius Costa Gomes #define IGC_TSYNCRXCTL_ENABLED 0x00000010 /* enable Rx timestamping */ 44381b05520SVinicius Costa Gomes #define IGC_TSYNCRXCTL_SYSCFI 0x00000020 /* Sys clock frequency */ 444a299df35SVinicius Costa Gomes #define IGC_TSYNCRXCTL_RXSYNSIG 0x00000400 /* Sample RX tstamp in PHY sop */ 44581b05520SVinicius Costa Gomes 44681b05520SVinicius Costa Gomes /* Time Sync Receive Configuration */ 44781b05520SVinicius Costa Gomes #define IGC_TSYNCRXCFG_PTP_V1_CTRLT_MASK 0x000000FF 44881b05520SVinicius Costa Gomes #define IGC_TSYNCRXCFG_PTP_V1_SYNC_MESSAGE 0x00 44981b05520SVinicius Costa Gomes #define IGC_TSYNCRXCFG_PTP_V1_DELAY_REQ_MESSAGE 0x01 45081b05520SVinicius Costa Gomes 4512c344ae2SVinicius Costa Gomes /* Immediate Interrupt Receive */ 4522c344ae2SVinicius Costa Gomes #define IGC_IMIR_CLEAR_MASK 0xF001FFFF /* IMIR Reg Clear Mask */ 4532c344ae2SVinicius Costa Gomes #define IGC_IMIR_PORT_BYPASS 0x20000 /* IMIR Port Bypass Bit */ 4542c344ae2SVinicius Costa Gomes #define IGC_IMIR_PRIORITY_SHIFT 29 /* IMIR Priority Shift */ 4552c344ae2SVinicius Costa Gomes #define IGC_IMIREXT_CLEAR_MASK 0x7FFFF /* IMIREXT Reg Clear Mask */ 4562c344ae2SVinicius Costa Gomes 45781b05520SVinicius Costa Gomes /* Immediate Interrupt Receive Extended */ 45881b05520SVinicius Costa Gomes #define IGC_IMIREXT_CTRL_BP 0x00080000 /* Bypass check of ctrl bits */ 45981b05520SVinicius Costa Gomes #define IGC_IMIREXT_SIZE_BP 0x00001000 /* Packet size bypass */ 46081b05520SVinicius Costa Gomes 4612c344ae2SVinicius Costa Gomes /* Time Sync Transmit Control bit definitions */ 46277370df3SAndre Guedes #define IGC_TSYNCTXCTL_TXTT_0 0x00000001 /* Tx timestamp reg 0 valid */ 4633ed247e7SVinicius Costa Gomes #define IGC_TSYNCTXCTL_TXTT_1 0x00000002 /* Tx timestamp reg 1 valid */ 4643ed247e7SVinicius Costa Gomes #define IGC_TSYNCTXCTL_TXTT_2 0x00000004 /* Tx timestamp reg 2 valid */ 4653ed247e7SVinicius Costa Gomes #define IGC_TSYNCTXCTL_TXTT_3 0x00000008 /* Tx timestamp reg 3 valid */ 4662c344ae2SVinicius Costa Gomes #define IGC_TSYNCTXCTL_ENABLED 0x00000010 /* enable Tx timestamping */ 4672c344ae2SVinicius Costa Gomes #define IGC_TSYNCTXCTL_MAX_ALLOWED_DLY_MASK 0x0000F000 /* max delay */ 4682c344ae2SVinicius Costa Gomes #define IGC_TSYNCTXCTL_SYNC_COMP_ERR 0x20000000 /* sync err */ 4692c344ae2SVinicius Costa Gomes #define IGC_TSYNCTXCTL_SYNC_COMP 0x40000000 /* sync complete */ 4702c344ae2SVinicius Costa Gomes #define IGC_TSYNCTXCTL_START_SYNC 0x80000000 /* initiate sync */ 471a299df35SVinicius Costa Gomes #define IGC_TSYNCTXCTL_TXSYNSIG 0x00000020 /* Sample TX tstamp in PHY sop */ 4722c344ae2SVinicius Costa Gomes 4733ed247e7SVinicius Costa Gomes #define IGC_TSYNCTXCTL_TXTT_ANY ( \ 4743ed247e7SVinicius Costa Gomes IGC_TSYNCTXCTL_TXTT_0 | IGC_TSYNCTXCTL_TXTT_1 | \ 4753ed247e7SVinicius Costa Gomes IGC_TSYNCTXCTL_TXTT_2 | IGC_TSYNCTXCTL_TXTT_3) 4763ed247e7SVinicius Costa Gomes 47787938851SEderson de Souza /* Timer selection bits */ 47887938851SEderson de Souza #define IGC_AUX_IO_TIMER_SEL_SYSTIM0 (0u << 30) /* Select SYSTIM0 for auxiliary time stamp */ 47987938851SEderson de Souza #define IGC_AUX_IO_TIMER_SEL_SYSTIM1 (1u << 30) /* Select SYSTIM1 for auxiliary time stamp */ 48087938851SEderson de Souza #define IGC_AUX_IO_TIMER_SEL_SYSTIM2 (2u << 30) /* Select SYSTIM2 for auxiliary time stamp */ 48187938851SEderson de Souza #define IGC_AUX_IO_TIMER_SEL_SYSTIM3 (3u << 30) /* Select SYSTIM3 for auxiliary time stamp */ 48287938851SEderson de Souza #define IGC_TT_IO_TIMER_SEL_SYSTIM0 (0u << 30) /* Select SYSTIM0 for target time stamp */ 48387938851SEderson de Souza #define IGC_TT_IO_TIMER_SEL_SYSTIM1 (1u << 30) /* Select SYSTIM1 for target time stamp */ 48487938851SEderson de Souza #define IGC_TT_IO_TIMER_SEL_SYSTIM2 (2u << 30) /* Select SYSTIM2 for target time stamp */ 48587938851SEderson de Souza #define IGC_TT_IO_TIMER_SEL_SYSTIM3 (3u << 30) /* Select SYSTIM3 for target time stamp */ 48687938851SEderson de Souza 48787938851SEderson de Souza /* TSAUXC Configuration Bits */ 48887938851SEderson de Souza #define IGC_TSAUXC_EN_TT0 BIT(0) /* Enable target time 0. */ 48987938851SEderson de Souza #define IGC_TSAUXC_EN_TT1 BIT(1) /* Enable target time 1. */ 49087938851SEderson de Souza #define IGC_TSAUXC_EN_CLK0 BIT(2) /* Enable Configurable Frequency Clock 0. */ 4915e91c72eSChristopher S Hall #define IGC_TSAUXC_ST0 BIT(4) /* Start Clock 0 Toggle on Target Time 0. */ 49287938851SEderson de Souza #define IGC_TSAUXC_EN_CLK1 BIT(5) /* Enable Configurable Frequency Clock 1. */ 4935e91c72eSChristopher S Hall #define IGC_TSAUXC_ST1 BIT(7) /* Start Clock 1 Toggle on Target Time 1. */ 49487938851SEderson de Souza #define IGC_TSAUXC_EN_TS0 BIT(8) /* Enable hardware timestamp 0. */ 49587938851SEderson de Souza #define IGC_TSAUXC_AUTT0 BIT(9) /* Auxiliary Timestamp Taken. */ 49687938851SEderson de Souza #define IGC_TSAUXC_EN_TS1 BIT(10) /* Enable hardware timestamp 0. */ 49787938851SEderson de Souza #define IGC_TSAUXC_AUTT1 BIT(11) /* Auxiliary Timestamp Taken. */ 49887938851SEderson de Souza #define IGC_TSAUXC_PLSG BIT(17) /* Generate a pulse. */ 49987938851SEderson de Souza #define IGC_TSAUXC_DISABLE1 BIT(27) /* Disable SYSTIM0 Count Operation. */ 50087938851SEderson de Souza #define IGC_TSAUXC_DISABLE2 BIT(28) /* Disable SYSTIM1 Count Operation. */ 50187938851SEderson de Souza #define IGC_TSAUXC_DISABLE3 BIT(29) /* Disable SYSTIM2 Count Operation. */ 50287938851SEderson de Souza #define IGC_TSAUXC_DIS_TS_CLEAR BIT(30) /* Disable EN_TT0/1 auto clear. */ 50387938851SEderson de Souza #define IGC_TSAUXC_DISABLE0 BIT(31) /* Disable SYSTIM0 Count Operation. */ 50487938851SEderson de Souza 50587938851SEderson de Souza /* SDP Configuration Bits */ 50687938851SEderson de Souza #define IGC_AUX0_SEL_SDP0 (0u << 0) /* Assign SDP0 to auxiliary time stamp 0. */ 50787938851SEderson de Souza #define IGC_AUX0_SEL_SDP1 (1u << 0) /* Assign SDP1 to auxiliary time stamp 0. */ 50887938851SEderson de Souza #define IGC_AUX0_SEL_SDP2 (2u << 0) /* Assign SDP2 to auxiliary time stamp 0. */ 50987938851SEderson de Souza #define IGC_AUX0_SEL_SDP3 (3u << 0) /* Assign SDP3 to auxiliary time stamp 0. */ 51087938851SEderson de Souza #define IGC_AUX0_TS_SDP_EN (1u << 2) /* Enable auxiliary time stamp trigger 0. */ 51187938851SEderson de Souza #define IGC_AUX1_SEL_SDP0 (0u << 3) /* Assign SDP0 to auxiliary time stamp 1. */ 51287938851SEderson de Souza #define IGC_AUX1_SEL_SDP1 (1u << 3) /* Assign SDP1 to auxiliary time stamp 1. */ 51387938851SEderson de Souza #define IGC_AUX1_SEL_SDP2 (2u << 3) /* Assign SDP2 to auxiliary time stamp 1. */ 51487938851SEderson de Souza #define IGC_AUX1_SEL_SDP3 (3u << 3) /* Assign SDP3 to auxiliary time stamp 1. */ 51587938851SEderson de Souza #define IGC_AUX1_TS_SDP_EN (1u << 5) /* Enable auxiliary time stamp trigger 1. */ 51687938851SEderson de Souza #define IGC_TS_SDP0_SEL_TT0 (0u << 6) /* Target time 0 is output on SDP0. */ 51787938851SEderson de Souza #define IGC_TS_SDP0_SEL_TT1 (1u << 6) /* Target time 1 is output on SDP0. */ 51887938851SEderson de Souza #define IGC_TS_SDP0_SEL_FC0 (2u << 6) /* Freq clock 0 is output on SDP0. */ 51987938851SEderson de Souza #define IGC_TS_SDP0_SEL_FC1 (3u << 6) /* Freq clock 1 is output on SDP0. */ 52087938851SEderson de Souza #define IGC_TS_SDP0_EN (1u << 8) /* SDP0 is assigned to Tsync. */ 52187938851SEderson de Souza #define IGC_TS_SDP1_SEL_TT0 (0u << 9) /* Target time 0 is output on SDP1. */ 52287938851SEderson de Souza #define IGC_TS_SDP1_SEL_TT1 (1u << 9) /* Target time 1 is output on SDP1. */ 52387938851SEderson de Souza #define IGC_TS_SDP1_SEL_FC0 (2u << 9) /* Freq clock 0 is output on SDP1. */ 52487938851SEderson de Souza #define IGC_TS_SDP1_SEL_FC1 (3u << 9) /* Freq clock 1 is output on SDP1. */ 52587938851SEderson de Souza #define IGC_TS_SDP1_EN (1u << 11) /* SDP1 is assigned to Tsync. */ 52687938851SEderson de Souza #define IGC_TS_SDP2_SEL_TT0 (0u << 12) /* Target time 0 is output on SDP2. */ 52787938851SEderson de Souza #define IGC_TS_SDP2_SEL_TT1 (1u << 12) /* Target time 1 is output on SDP2. */ 52887938851SEderson de Souza #define IGC_TS_SDP2_SEL_FC0 (2u << 12) /* Freq clock 0 is output on SDP2. */ 52987938851SEderson de Souza #define IGC_TS_SDP2_SEL_FC1 (3u << 12) /* Freq clock 1 is output on SDP2. */ 53087938851SEderson de Souza #define IGC_TS_SDP2_EN (1u << 14) /* SDP2 is assigned to Tsync. */ 53187938851SEderson de Souza #define IGC_TS_SDP3_SEL_TT0 (0u << 15) /* Target time 0 is output on SDP3. */ 53287938851SEderson de Souza #define IGC_TS_SDP3_SEL_TT1 (1u << 15) /* Target time 1 is output on SDP3. */ 53387938851SEderson de Souza #define IGC_TS_SDP3_SEL_FC0 (2u << 15) /* Freq clock 0 is output on SDP3. */ 53487938851SEderson de Souza #define IGC_TS_SDP3_SEL_FC1 (3u << 15) /* Freq clock 1 is output on SDP3. */ 53587938851SEderson de Souza #define IGC_TS_SDP3_EN (1u << 17) /* SDP3 is assigned to Tsync. */ 53687938851SEderson de Souza 537ec50a9d4SVinicius Costa Gomes /* Transmit Scheduling */ 538ec50a9d4SVinicius Costa Gomes #define IGC_TQAVCTRL_TRANSMIT_MODE_TSN 0x00000001 539ec50a9d4SVinicius Costa Gomes #define IGC_TQAVCTRL_ENHANCED_QAV 0x00000008 540b8897dc5SMuhammad Husaini Zulkifli #define IGC_TQAVCTRL_FUTSCDDIS 0x00000080 541ec50a9d4SVinicius Costa Gomes 54282faa9b7SVinicius Costa Gomes #define IGC_TXQCTL_QUEUE_MODE_LAUNCHT 0x00000001 543ec50a9d4SVinicius Costa Gomes #define IGC_TXQCTL_STRICT_CYCLE 0x00000002 544ec50a9d4SVinicius Costa Gomes #define IGC_TXQCTL_STRICT_END 0x00000004 5451ab011b0SAravindhan Gunasekaran #define IGC_TXQCTL_QAV_SEL_MASK 0x000000C0 5461ab011b0SAravindhan Gunasekaran #define IGC_TXQCTL_QAV_SEL_CBS0 0x00000080 5471ab011b0SAravindhan Gunasekaran #define IGC_TXQCTL_QAV_SEL_CBS1 0x000000C0 5481ab011b0SAravindhan Gunasekaran 5491ab011b0SAravindhan Gunasekaran #define IGC_TQAVCC_IDLESLOPE_MASK 0xFFFF 5501ab011b0SAravindhan Gunasekaran #define IGC_TQAVCC_KEEP_CREDITS BIT(30) 5511ab011b0SAravindhan Gunasekaran 5521ab011b0SAravindhan Gunasekaran #define IGC_MAX_SR_QUEUES 2 553ec50a9d4SVinicius Costa Gomes 5542121c271SSasha Neftin /* Receive Checksum Control */ 5552121c271SSasha Neftin #define IGC_RXCSUM_CRCOFL 0x00000800 /* CRC32 offload enable */ 5562121c271SSasha Neftin #define IGC_RXCSUM_PCSD 0x00002000 /* packet checksum disabled */ 5572121c271SSasha Neftin 558a90ec848SVinicius Costa Gomes /* PCIe PTM Control */ 559a90ec848SVinicius Costa Gomes #define IGC_PTM_CTRL_START_NOW BIT(29) /* Start PTM Now */ 560a90ec848SVinicius Costa Gomes #define IGC_PTM_CTRL_EN BIT(30) /* Enable PTM */ 561a90ec848SVinicius Costa Gomes #define IGC_PTM_CTRL_TRIG BIT(31) /* PTM Cycle trigger */ 562de439757SSasha Neftin #define IGC_PTM_CTRL_SHRT_CYC(usec) (((usec) & 0x3f) << 2) 563a90ec848SVinicius Costa Gomes #define IGC_PTM_CTRL_PTM_TO(usec) (((usec) & 0xff) << 8) 564a90ec848SVinicius Costa Gomes 5656b8aa753SSasha Neftin #define IGC_PTM_SHORT_CYC_DEFAULT 1 /* Default short cycle interval */ 566a90ec848SVinicius Costa Gomes #define IGC_PTM_CYC_TIME_DEFAULT 5 /* Default PTM cycle time */ 567a90ec848SVinicius Costa Gomes #define IGC_PTM_TIMEOUT_DEFAULT 255 /* Default timeout for PTM errors */ 568a90ec848SVinicius Costa Gomes 569a90ec848SVinicius Costa Gomes /* PCIe Digital Delay */ 570a90ec848SVinicius Costa Gomes #define IGC_PCIE_DIG_DELAY_DEFAULT 0x01440000 571a90ec848SVinicius Costa Gomes 572a90ec848SVinicius Costa Gomes /* PCIe PHY Delay */ 573a90ec848SVinicius Costa Gomes #define IGC_PCIE_PHY_DELAY_DEFAULT 0x40900000 574a90ec848SVinicius Costa Gomes 575a90ec848SVinicius Costa Gomes #define IGC_TIMADJ_ADJUST_METH 0x40000000 576a90ec848SVinicius Costa Gomes 577a90ec848SVinicius Costa Gomes /* PCIe PTM Status */ 578a90ec848SVinicius Costa Gomes #define IGC_PTM_STAT_VALID BIT(0) /* PTM Status */ 579a90ec848SVinicius Costa Gomes #define IGC_PTM_STAT_RET_ERR BIT(1) /* Root port timeout */ 580a90ec848SVinicius Costa Gomes #define IGC_PTM_STAT_BAD_PTM_RES BIT(2) /* PTM Response msg instead of PTM Response Data */ 581a90ec848SVinicius Costa Gomes #define IGC_PTM_STAT_T4M1_OVFL BIT(3) /* T4 minus T1 overflow */ 582a90ec848SVinicius Costa Gomes #define IGC_PTM_STAT_ADJUST_1ST BIT(4) /* 1588 timer adjusted during 1st PTM cycle */ 583a90ec848SVinicius Costa Gomes #define IGC_PTM_STAT_ADJUST_CYC BIT(5) /* 1588 timer adjusted during non-1st PTM cycle */ 584a90ec848SVinicius Costa Gomes 585a90ec848SVinicius Costa Gomes /* PCIe PTM Cycle Control */ 586a90ec848SVinicius Costa Gomes #define IGC_PTM_CYCLE_CTRL_CYC_TIME(msec) ((msec) & 0x3ff) /* PTM Cycle Time (msec) */ 587a90ec848SVinicius Costa Gomes #define IGC_PTM_CYCLE_CTRL_AUTO_CYC_EN BIT(31) /* PTM Cycle Control */ 588a90ec848SVinicius Costa Gomes 5895586838fSSasha Neftin /* GPY211 - I225 defines */ 5905586838fSSasha Neftin #define GPY_MMD_MASK 0xFFFF0000 5915586838fSSasha Neftin #define GPY_MMD_SHIFT 16 5925586838fSSasha Neftin #define GPY_REG_MASK 0x0000FFFF 5935586838fSSasha Neftin 5945586838fSSasha Neftin #define IGC_MMDAC_FUNC_DATA 0x4000 /* Data, no post increment */ 5955586838fSSasha Neftin 5965586838fSSasha Neftin /* MAC definitions */ 5975586838fSSasha Neftin #define IGC_FACTPS_MNGCG 0x20000000 5985586838fSSasha Neftin #define IGC_FWSM_MODE_MASK 0xE 5995586838fSSasha Neftin #define IGC_FWSM_MODE_SHIFT 1 6005586838fSSasha Neftin 6015586838fSSasha Neftin /* Management Control */ 6025586838fSSasha Neftin #define IGC_MANC_SMBUS_EN 0x00000001 /* SMBus Enabled - RO */ 6035586838fSSasha Neftin #define IGC_MANC_ASF_EN 0x00000002 /* ASF Enabled - RO */ 6045586838fSSasha Neftin 6055586838fSSasha Neftin /* PHY */ 6065586838fSSasha Neftin #define PHY_REVISION_MASK 0xFFFFFFF0 6075586838fSSasha Neftin #define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */ 6085586838fSSasha Neftin #define IGC_GEN_POLL_TIMEOUT 1920 6095586838fSSasha Neftin 6105586838fSSasha Neftin /* PHY Control Register */ 6115586838fSSasha Neftin #define MII_CR_RESTART_AUTO_NEG 0x0200 /* Restart auto negotiation */ 6125586838fSSasha Neftin #define MII_CR_POWER_DOWN 0x0800 /* Power down */ 6135586838fSSasha Neftin #define MII_CR_AUTO_NEG_EN 0x1000 /* Auto Neg Enable */ 6145586838fSSasha Neftin 6155586838fSSasha Neftin /* PHY Status Register */ 6165586838fSSasha Neftin #define MII_SR_LINK_STATUS 0x0004 /* Link Status 1 = link */ 6175586838fSSasha Neftin #define MII_SR_AUTONEG_COMPLETE 0x0020 /* Auto Neg Complete */ 618bcb3244cSSasha Neftin #define IGC_PHY_RST_COMP 0x0100 /* Internal PHY reset completion */ 6195586838fSSasha Neftin 6205586838fSSasha Neftin /* PHY 1000 MII Register/Bit Definitions */ 6215586838fSSasha Neftin /* PHY Registers defined by IEEE */ 6225586838fSSasha Neftin #define PHY_CONTROL 0x00 /* Control Register */ 6235586838fSSasha Neftin #define PHY_STATUS 0x01 /* Status Register */ 6245586838fSSasha Neftin #define PHY_ID1 0x02 /* Phy Id Reg (word 1) */ 6255586838fSSasha Neftin #define PHY_ID2 0x03 /* Phy Id Reg (word 2) */ 6264eb80801SSasha Neftin #define PHY_AUTONEG_ADV 0x04 /* Autoneg Advertisement */ 6274eb80801SSasha Neftin #define PHY_LP_ABILITY 0x05 /* Link Partner Ability (Base Page) */ 6284eb80801SSasha Neftin #define PHY_1000T_CTRL 0x09 /* 1000Base-T Control Reg */ 6294eb80801SSasha Neftin #define PHY_1000T_STATUS 0x0A /* 1000Base-T Status Reg */ 6305586838fSSasha Neftin 6315586838fSSasha Neftin /* MDI Control */ 6325586838fSSasha Neftin #define IGC_MDIC_DATA_MASK 0x0000FFFF 6335586838fSSasha Neftin #define IGC_MDIC_REG_MASK 0x001F0000 6345586838fSSasha Neftin #define IGC_MDIC_REG_SHIFT 16 6355586838fSSasha Neftin #define IGC_MDIC_PHY_MASK 0x03E00000 6365586838fSSasha Neftin #define IGC_MDIC_PHY_SHIFT 21 6375586838fSSasha Neftin #define IGC_MDIC_OP_WRITE 0x04000000 6385586838fSSasha Neftin #define IGC_MDIC_OP_READ 0x08000000 6395586838fSSasha Neftin #define IGC_MDIC_READY 0x10000000 6405586838fSSasha Neftin #define IGC_MDIC_ERROR 0x40000000 6415586838fSSasha Neftin 6423df25e4cSSasha Neftin #define IGC_N0_QUEUE -1 6433df25e4cSSasha Neftin 64465cd3a72SSasha Neftin #define IGC_MAX_MAC_HDR_LEN 127 64565cd3a72SSasha Neftin #define IGC_MAX_NETWORK_HDR_LEN 511 64665cd3a72SSasha Neftin 647bbfaa141SAndre Guedes #define IGC_VLANPQF_QSEL(_n, q_idx) ((q_idx) << ((_n) * 4)) 648bbfaa141SAndre Guedes #define IGC_VLANPQF_VALID(_n) (0x1 << (3 + (_n) * 4)) 649bbfaa141SAndre Guedes #define IGC_VLANPQF_QUEUE_MASK 0x03 6506245c848SSasha Neftin 651d3ae3cfbSSasha Neftin #define IGC_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */ 652d3ae3cfbSSasha Neftin #define IGC_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type:1=IPv4 */ 653d3ae3cfbSSasha Neftin #define IGC_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet Type of TCP */ 654d3ae3cfbSSasha Neftin #define IGC_ADVTXD_TUCMD_L4T_SCTP 0x00001000 /* L4 packet TYPE of SCTP */ 655d3ae3cfbSSasha Neftin 6567f839684SSasha Neftin /* Maximum size of the MTA register table in all supported adapters */ 6577f839684SSasha Neftin #define MAX_MTA_REG 128 6587f839684SSasha Neftin 65993ec439aSSasha Neftin /* EEE defines */ 66093ec439aSSasha Neftin #define IGC_IPCNFG_EEE_2_5G_AN 0x00000010 /* IPCNFG EEE Ena 2.5G AN */ 66193ec439aSSasha Neftin #define IGC_IPCNFG_EEE_1G_AN 0x00000008 /* IPCNFG EEE Ena 1G AN */ 66293ec439aSSasha Neftin #define IGC_IPCNFG_EEE_100M_AN 0x00000004 /* IPCNFG EEE Ena 100M AN */ 66393ec439aSSasha Neftin #define IGC_EEER_EEE_NEG 0x20000000 /* EEE capability nego */ 66493ec439aSSasha Neftin #define IGC_EEER_TX_LPI_EN 0x00010000 /* EEER Tx LPI Enable */ 66593ec439aSSasha Neftin #define IGC_EEER_RX_LPI_EN 0x00020000 /* EEER Rx LPI Enable */ 66693ec439aSSasha Neftin #define IGC_EEER_LPI_FC 0x00040000 /* EEER Ena on Flow Cntrl */ 66793ec439aSSasha Neftin #define IGC_EEE_SU_LPI_CLK_STP 0x00800000 /* EEE LPI Clock Stop */ 66893ec439aSSasha Neftin 669707abf06SSasha Neftin /* LTR defines */ 670707abf06SSasha Neftin #define IGC_LTRC_EEEMS_EN 0x00000020 /* Enable EEE LTR max send */ 671707abf06SSasha Neftin #define IGC_RXPBS_SIZE_I225_MASK 0x0000003F /* Rx packet buffer size */ 672707abf06SSasha Neftin #define IGC_TW_SYSTEM_1000_MASK 0x000000FF 673707abf06SSasha Neftin /* Minimum time for 100BASE-T where no data will be transmit following move out 674707abf06SSasha Neftin * of EEE LPI Tx state 675707abf06SSasha Neftin */ 676707abf06SSasha Neftin #define IGC_TW_SYSTEM_100_MASK 0x0000FF00 677707abf06SSasha Neftin #define IGC_TW_SYSTEM_100_SHIFT 8 678707abf06SSasha Neftin /* Reg val to set scale to 1024 nsec */ 679707abf06SSasha Neftin #define IGC_LTRMINV_SCALE_1024 2 680707abf06SSasha Neftin /* Reg val to set scale to 32768 nsec */ 681707abf06SSasha Neftin #define IGC_LTRMINV_SCALE_32768 3 682707abf06SSasha Neftin /* Reg val to set scale to 1024 nsec */ 683707abf06SSasha Neftin #define IGC_LTRMAXV_SCALE_1024 2 684707abf06SSasha Neftin /* Reg val to set scale to 32768 nsec */ 685707abf06SSasha Neftin #define IGC_LTRMAXV_SCALE_32768 3 686707abf06SSasha Neftin #define IGC_LTRMINV_LTRV_MASK 0x000003FF /* LTR minimum value */ 687707abf06SSasha Neftin #define IGC_LTRMAXV_LTRV_MASK 0x000003FF /* LTR maximum value */ 688707abf06SSasha Neftin #define IGC_LTRMINV_LSNP_REQ 0x00008000 /* LTR Snoop Requirement */ 689707abf06SSasha Neftin #define IGC_LTRMINV_SCALE_SHIFT 10 690707abf06SSasha Neftin #define IGC_LTRMAXV_LSNP_REQ 0x00008000 /* LTR Snoop Requirement */ 691707abf06SSasha Neftin #define IGC_LTRMAXV_SCALE_SHIFT 10 692707abf06SSasha Neftin 693146740f9SSasha Neftin #endif /* _IGC_DEFINES_H_ */ 694