Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sfc_ef100: register accesses on EF100

EF100 adds a few new valid addresses for efx_writed_page(), as well as
a Function Control Window in the BAR whose location is variable.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Edward Cree and committed by
David S. Miller
61060c5d adf72ee3

+15 -3
+13 -3
drivers/net/ethernet/sfc/io.h
··· 75 75 #endif 76 76 #endif 77 77 78 + static inline u32 efx_reg(struct efx_nic *efx, unsigned int reg) 79 + { 80 + return efx->reg_base + reg; 81 + } 82 + 78 83 #ifdef EFX_USE_QWORD_IO 79 84 static inline void _efx_writeq(struct efx_nic *efx, __le64 value, 80 85 unsigned int reg) ··· 222 217 efx_reado(efx, value, reg + index * sizeof(efx_oword_t)); 223 218 } 224 219 225 - /* default VI stride (step between per-VI registers) is 8K */ 226 - #define EFX_DEFAULT_VI_STRIDE 0x2000 220 + /* default VI stride (step between per-VI registers) is 8K on EF10 and 221 + * 64K on EF100 222 + */ 223 + #define EFX_DEFAULT_VI_STRIDE 0x2000 224 + #define EF100_DEFAULT_VI_STRIDE 0x10000 227 225 228 226 /* Calculate offset to page-mapped register */ 229 227 static inline unsigned int efx_paged_reg(struct efx_nic *efx, unsigned int page, ··· 273 265 #define efx_writed_page(efx, value, reg, page) \ 274 266 _efx_writed_page(efx, value, \ 275 267 reg + \ 276 - BUILD_BUG_ON_ZERO((reg) != 0x400 && \ 268 + BUILD_BUG_ON_ZERO((reg) != 0x180 && \ 269 + (reg) != 0x200 && \ 270 + (reg) != 0x400 && \ 277 271 (reg) != 0x420 && \ 278 272 (reg) != 0x830 && \ 279 273 (reg) != 0x83c && \
+2
drivers/net/ethernet/sfc/net_driver.h
··· 964 964 * @xdp_rxq_info_failed: Have any of the rx queues failed to initialise their 965 965 * xdp_rxq_info structures? 966 966 * @mem_bar: The BAR that is mapped into membase. 967 + * @reg_base: Offset from the start of the bar to the function control window. 967 968 * @monitor_work: Hardware monitor workitem 968 969 * @biu_lock: BIU (bus interface unit) lock 969 970 * @last_irq_cpu: Last CPU to handle a possible test interrupt. This ··· 1143 1142 bool xdp_rxq_info_failed; 1144 1143 1145 1144 unsigned int mem_bar; 1145 + u32 reg_base; 1146 1146 1147 1147 /* The following fields may be written more often */ 1148 1148