igc: Add initial LTR support
Subsystems (2)
PATCH 1/1 igc: Add initial LTR support
The LTR message on the PCIe inform the requested latency on which the PCIe must become active to the downstream PCIe port of the system.
This patch provide reccommended LTR parameters by i225 specification.
Signed-off-by Sasha Neftin <[email protected]>
--- drivers/net/ethernet/intel/igc/igc_defines.h | 27 ++++++++ drivers/net/ethernet/intel/igc/igc_i225.c | 100 +++++++++++++++++++++++++++ drivers/net/ethernet/intel/igc/igc_i225.h | 1 + drivers/net/ethernet/intel/igc/igc_mac.c | 5 ++ drivers/net/ethernet/intel/igc/igc_regs.h | 6 ++ 5 files changed, 139 insertions(+)
drivers/net/ethernet/intel/igc/igc_defines.h +27 -0
@@ -522,4 +522,31 @@#define IGC_EEER_LPI_FC 0x00040000/* EEER Ena on Flow Cntrl */ #define IGC_EEE_SU_LPI_CLK_STP 0x00800000/* EEE LPI Clock Stop */ +/* LTR defines */ +#define IGC_LTRC_EEEMS_EN 0x00000020/* Enable EEE LTR max send */ +#define IGC_RXPBS_SIZE_I225_MASK 0x0000003F/* Rx packet buffer size */ +#define IGC_TW_SYSTEM_1000_MASK 0x000000FF +/* Minimum time for 100BASE-T where no data will be transmit following move out +* of EEE LPI Tx state +*/ +#define IGC_TW_SYSTEM_100_MASK 0x0000FF00 +#define IGC_TW_SYSTEM_100_SHIFT 8 +#define IGC_DMACR_DMAC_EN 0x80000000/* Enable DMA Coalescing */ +#define IGC_DMACR_DMACTHR_MASK 0x00FF0000 +#define IGC_DMACR_DMACTHR_SHIFT 16 +/* Reg val to set scale to 1024 nsec */ +#define IGC_LTRMINV_SCALE_1024 2 +/* Reg val to set scale to 32768 nsec */ +#define IGC_LTRMINV_SCALE_32768 3 +/* Reg val to set scale to 1024 nsec */ +#define IGC_LTRMAXV_SCALE_1024 2 +/* Reg val to set scale to 32768 nsec */ +#define IGC_LTRMAXV_SCALE_32768 3 +#define IGC_LTRMINV_LTRV_MASK 0x000003FF/* LTR minimum value */ +#define IGC_LTRMAXV_LTRV_MASK 0x000003FF/* LTR maximum value */ +#define IGC_LTRMINV_LSNP_REQ 0x00008000/* LTR Snoop Requirement */ +#define IGC_LTRMINV_SCALE_SHIFT 10 +#define IGC_LTRMAXV_LSNP_REQ 0x00008000/* LTR Snoop Requirement */ +#define IGC_LTRMAXV_SCALE_SHIFT 10 +#endif /* _IGC_DEFINES_H_ */
drivers/net/ethernet/intel/igc/igc_i225.c +100 -0
103 lines not on this page · raw message
drivers/net/ethernet/intel/igc/igc_i225.h +1 -0
@@ -11,5 +11,6 @@ s32 igc_init_nvm_params_i225(struct igc_hw *hw);bool igc_get_flash_presence_i225 (struct igc_hw *hw);s32 igc_set_eee_i225 (struct igc_hw *hw,bool adv2p5G,bool adv1G,bool adv100M); +s32 igc_set_ltr_i225 (struct igc_hw *hw,bool link);#endif
drivers/net/ethernet/intel/igc/igc_mac.c +5 -0
@@ -417,6 +417,11 @@ s32 igc_check_for_copper_link(struct igc_hw *hw)hw_dbg ("Error configuring flow control\n" ); out: +/* Now that we are aware of our link settings, we can set the LTR +* thresholds. +*/ + ret_val =igc_set_ltr_i225 (hw, link); +return ret_val; }
drivers/net/ethernet/intel/igc/igc_regs.h +6 -0
@@ -253,6 +253,12 @@#define IGC_IPCNFG 0x0E38/* Internal PHY Configuration */ #define IGC_EEE_SU 0x0E34/* EEE Setup */ +/* LTR registers */ +#define IGC_LTRC 0x01A0/* Latency Tolerance Reporting Control */ +#define IGC_DMACR 0x02508/* DMA Coalescing Control Register */ +#define IGC_LTRMINV 0x5BB0/* LTR Minimum Value */ +#define IGC_LTRMAXV 0x5BB4/* LTR Maximum Value */ +/* forward declaration */ struct igc_hw ;u32 igc_rd32 (struct igc_hw *hw,u32 reg);
Signature · 1 line
2.11.0
Brown
PATCH 1/1 igc: Add initial LTR support
Quoted 13 lines
From: Intel-wired-lan <[email protected]> On Behalf Of Sasha Neftin
Sent: Tuesday, June 2, 2020 12:51 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH v1 1/1] igc: Add initial LTR supportThe LTR message on the PCIe inform the requested latency on which the PCIe must become active to the downstream PCIe port of the system.
This patch provide reccommended LTR parameters by i225 specification.Signed-off-by Sasha Neftin <[email protected]>
Quoted 9 lines
--- drivers/net/ethernet/intel/igc/igc_defines.h | 27 ++++++++ drivers/net/ethernet/intel/igc/igc_i225.c | 100 +++++++++++++++++++++++++++ drivers/net/ethernet/intel/igc/igc_i225.h | 1 + drivers/net/ethernet/intel/igc/igc_mac.c | 5 ++ drivers/net/ethernet/intel/igc/igc_regs.h | 6 ++ 5 files changed, 139 insertions(+)
Tested-by Aaron Brown <[email protected]>