hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/ethernet/sfc/io.h
....@@ -1,11 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /****************************************************************************
23 * Driver for Solarflare network controllers and boards
34 * Copyright 2005-2006 Fen Systems Ltd.
45 * 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.
96 */
107
118 #ifndef EFX_IO_H
....@@ -78,6 +75,11 @@
7875 #endif
7976 #endif
8077
78
+static inline u32 efx_reg(struct efx_nic *efx, unsigned int reg)
79
+{
80
+ return efx->reg_base + reg;
81
+}
82
+
8183 #ifdef EFX_USE_QWORD_IO
8284 static inline void _efx_writeq(struct efx_nic *efx, __le64 value,
8385 unsigned int reg)
....@@ -120,7 +122,6 @@
120122 _efx_writed(efx, value->u32[2], reg + 8);
121123 _efx_writed(efx, value->u32[3], reg + 12);
122124 #endif
123
- mmiowb();
124125 spin_unlock_irqrestore(&efx->biu_lock, flags);
125126 }
126127
....@@ -142,7 +143,6 @@
142143 __raw_writel((__force u32)value->u32[0], membase + addr);
143144 __raw_writel((__force u32)value->u32[1], membase + addr + 4);
144145 #endif
145
- mmiowb();
146146 spin_unlock_irqrestore(&efx->biu_lock, flags);
147147 }
148148
....@@ -222,8 +222,11 @@
222222 efx_reado(efx, value, reg + index * sizeof(efx_oword_t));
223223 }
224224
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
227230
228231 /* Calculate offset to page-mapped register */
229232 static inline unsigned int efx_paged_reg(struct efx_nic *efx, unsigned int page,
....@@ -270,7 +273,9 @@
270273 #define efx_writed_page(efx, value, reg, page) \
271274 _efx_writed_page(efx, value, \
272275 reg + \
273
- BUILD_BUG_ON_ZERO((reg) != 0x400 && \
276
+ BUILD_BUG_ON_ZERO((reg) != 0x180 && \
277
+ (reg) != 0x200 && \
278
+ (reg) != 0x400 && \
274279 (reg) != 0x420 && \
275280 (reg) != 0x830 && \
276281 (reg) != 0x83c && \