| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /**************************************************************************** |
|---|
| 2 | 3 | * Driver for Solarflare network controllers and boards |
|---|
| 3 | 4 | * Copyright 2005-2006 Fen Systems Ltd. |
|---|
| 4 | 5 | * Copyright 2006-2013 Solarflare Communications Inc. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | | - * under the terms of the GNU General Public License version 2 as published |
|---|
| 8 | | - * by the Free Software Foundation, incorporated herein by reference. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | |
|---|
| 11 | 8 | #ifndef EFX_IO_H |
|---|
| .. | .. |
|---|
| 78 | 75 | #endif |
|---|
| 79 | 76 | #endif |
|---|
| 80 | 77 | |
|---|
| 78 | +static inline u32 efx_reg(struct efx_nic *efx, unsigned int reg) |
|---|
| 79 | +{ |
|---|
| 80 | + return efx->reg_base + reg; |
|---|
| 81 | +} |
|---|
| 82 | + |
|---|
| 81 | 83 | #ifdef EFX_USE_QWORD_IO |
|---|
| 82 | 84 | static inline void _efx_writeq(struct efx_nic *efx, __le64 value, |
|---|
| 83 | 85 | unsigned int reg) |
|---|
| .. | .. |
|---|
| 120 | 122 | _efx_writed(efx, value->u32[2], reg + 8); |
|---|
| 121 | 123 | _efx_writed(efx, value->u32[3], reg + 12); |
|---|
| 122 | 124 | #endif |
|---|
| 123 | | - mmiowb(); |
|---|
| 124 | 125 | spin_unlock_irqrestore(&efx->biu_lock, flags); |
|---|
| 125 | 126 | } |
|---|
| 126 | 127 | |
|---|
| .. | .. |
|---|
| 142 | 143 | __raw_writel((__force u32)value->u32[0], membase + addr); |
|---|
| 143 | 144 | __raw_writel((__force u32)value->u32[1], membase + addr + 4); |
|---|
| 144 | 145 | #endif |
|---|
| 145 | | - mmiowb(); |
|---|
| 146 | 146 | spin_unlock_irqrestore(&efx->biu_lock, flags); |
|---|
| 147 | 147 | } |
|---|
| 148 | 148 | |
|---|
| .. | .. |
|---|
| 222 | 222 | efx_reado(efx, value, reg + index * sizeof(efx_oword_t)); |
|---|
| 223 | 223 | } |
|---|
| 224 | 224 | |
|---|
| 225 | | -/* default VI stride (step between per-VI registers) is 8K */ |
|---|
| 226 | | -#define EFX_DEFAULT_VI_STRIDE 0x2000 |
|---|
| 225 | +/* default VI stride (step between per-VI registers) is 8K on EF10 and |
|---|
| 226 | + * 64K on EF100 |
|---|
| 227 | + */ |
|---|
| 228 | +#define EFX_DEFAULT_VI_STRIDE 0x2000 |
|---|
| 229 | +#define EF100_DEFAULT_VI_STRIDE 0x10000 |
|---|
| 227 | 230 | |
|---|
| 228 | 231 | /* Calculate offset to page-mapped register */ |
|---|
| 229 | 232 | static inline unsigned int efx_paged_reg(struct efx_nic *efx, unsigned int page, |
|---|
| .. | .. |
|---|
| 270 | 273 | #define efx_writed_page(efx, value, reg, page) \ |
|---|
| 271 | 274 | _efx_writed_page(efx, value, \ |
|---|
| 272 | 275 | reg + \ |
|---|
| 273 | | - BUILD_BUG_ON_ZERO((reg) != 0x400 && \ |
|---|
| 276 | + BUILD_BUG_ON_ZERO((reg) != 0x180 && \ |
|---|
| 277 | + (reg) != 0x200 && \ |
|---|
| 278 | + (reg) != 0x400 && \ |
|---|
| 274 | 279 | (reg) != 0x420 && \ |
|---|
| 275 | 280 | (reg) != 0x830 && \ |
|---|
| 276 | 281 | (reg) != 0x83c && \ |
|---|