60 #if BITS_PER_LONG == 64
61 #define EFX_USE_QWORD_IO 1
64 #ifdef EFX_USE_QWORD_IO
70 static inline __le64 _efx_readq(
struct efx_nic *efx,
unsigned int reg)
76 static inline void _efx_writed(
struct efx_nic *efx,
__le32 value,
81 static inline __le32 _efx_readd(
struct efx_nic *efx,
unsigned int reg)
97 #ifdef EFX_USE_QWORD_IO
98 _efx_writeq(efx, value->
u64[0], reg + 0);
99 _efx_writeq(efx, value->
u64[1], reg + 8);
101 _efx_writed(efx, value->
u32[0], reg + 0);
102 _efx_writed(efx, value->
u32[1], reg + 4);
103 _efx_writed(efx, value->
u32[2], reg + 8);
104 _efx_writed(efx, value->
u32[3], reg + 12);
111 static inline void efx_sram_writeq(
struct efx_nic *efx,
void __iomem *membase,
114 unsigned int addr = index *
sizeof(*value);
122 #ifdef EFX_USE_QWORD_IO
141 _efx_writed(efx, value->
u32[0], reg);
151 value->
u32[0] = _efx_readd(efx, reg + 0);
152 value->
u32[1] = _efx_readd(efx, reg + 4);
153 value->
u32[2] = _efx_readd(efx, reg + 8);
154 value->
u32[3] = _efx_readd(efx, reg + 12);
163 static inline void efx_sram_readq(
struct efx_nic *efx,
void __iomem *membase,
166 unsigned int addr = index *
sizeof(*value);
170 #ifdef EFX_USE_QWORD_IO
187 value->
u32[0] = _efx_readd(efx, reg);
195 unsigned int reg,
unsigned int index)
197 efx_writeo(efx, value, reg + index *
sizeof(
efx_oword_t));
202 unsigned int reg,
unsigned int index)
204 efx_reado(efx, value, reg + index *
sizeof(
efx_oword_t));
209 unsigned int reg,
unsigned int index)
211 efx_writed(efx, value, reg + index *
sizeof(
efx_oword_t));
216 unsigned int reg,
unsigned int index)
218 efx_readd(efx, value, reg + index *
sizeof(
efx_dword_t));
222 #define EFX_PAGE_BLOCK_SIZE 0x2000
225 #define EFX_PAGED_REG(page, reg) \
226 ((page) * EFX_PAGE_BLOCK_SIZE + (reg))
230 unsigned int reg,
unsigned int page)
238 #ifdef EFX_USE_QWORD_IO
239 _efx_writeq(efx, value->
u64[0], reg + 0);
240 _efx_writeq(efx, value->
u64[1], reg + 8);
242 _efx_writed(efx, value->
u32[0], reg + 0);
243 _efx_writed(efx, value->
u32[1], reg + 4);
244 _efx_writed(efx, value->
u32[2], reg + 8);
245 _efx_writed(efx, value->
u32[3], reg + 12);
248 #define efx_writeo_page(efx, value, reg, page) \
249 _efx_writeo_page(efx, value, \
251 BUILD_BUG_ON_ZERO((reg) != 0x830 && (reg) != 0xa10), \
258 unsigned int reg,
unsigned int page)
262 #define efx_writed_page(efx, value, reg, page) \
263 _efx_writed_page(efx, value, \
265 BUILD_BUG_ON_ZERO((reg) != 0x400 && (reg) != 0x83c \
266 && (reg) != 0xa1c), \
273 static inline void _efx_writed_page_locked(
struct efx_nic *efx,
288 #define efx_writed_page_locked(efx, value, reg, page) \
289 _efx_writed_page_locked(efx, value, \
290 reg + BUILD_BUG_ON_ZERO((reg) != 0x420), \