aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/falcon.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-23 04:30:46 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-24 07:27:04 -0400
commit12d00cadcc45382fc127712aa35bd0c96cbf81d9 (patch)
tree96239fbc49d4907fd1677b9d9a2558525673c11e /drivers/net/sfc/falcon.c
parent3e6c4538542ab2103ab7c01f4458bc2e21b672a1 (diff)
sfc: Rename register I/O header and functions used by both Falcon and Siena
While we're at it, use type suffixes of 'd', 'q' and 'o', consistent with register type names. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/falcon.c')
-rw-r--r--drivers/net/sfc/falcon.c249
1 files changed, 128 insertions, 121 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index b35e01031e23..759f55ae4b83 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -23,7 +23,7 @@
23#include "spi.h" 23#include "spi.h"
24#include "falcon.h" 24#include "falcon.h"
25#include "regs.h" 25#include "regs.h"
26#include "falcon_io.h" 26#include "io.h"
27#include "mdio_10g.h" 27#include "mdio_10g.h"
28#include "phy.h" 28#include "phy.h"
29#include "workarounds.h" 29#include "workarounds.h"
@@ -163,6 +163,13 @@ MODULE_PARM_DESC(rx_xon_thresh_bytes, "RX fifo XON threshold");
163 * 163 *
164 **************************************************************************/ 164 **************************************************************************/
165 165
166static inline void falcon_write_buf_tbl(struct efx_nic *efx, efx_qword_t *value,
167 unsigned int index)
168{
169 efx_sram_writeq(efx, efx->membase + efx->type->buf_tbl_base,
170 value, index);
171}
172
166/* Read the current event from the event queue */ 173/* Read the current event from the event queue */
167static inline efx_qword_t *falcon_event(struct efx_channel *channel, 174static inline efx_qword_t *falcon_event(struct efx_channel *channel,
168 unsigned int index) 175 unsigned int index)
@@ -199,9 +206,9 @@ static void falcon_setsda(void *data, int state)
199 struct efx_nic *efx = (struct efx_nic *)data; 206 struct efx_nic *efx = (struct efx_nic *)data;
200 efx_oword_t reg; 207 efx_oword_t reg;
201 208
202 falcon_read(efx, &reg, FR_AB_GPIO_CTL); 209 efx_reado(efx, &reg, FR_AB_GPIO_CTL);
203 EFX_SET_OWORD_FIELD(reg, FRF_AB_GPIO3_OEN, !state); 210 EFX_SET_OWORD_FIELD(reg, FRF_AB_GPIO3_OEN, !state);
204 falcon_write(efx, &reg, FR_AB_GPIO_CTL); 211 efx_writeo(efx, &reg, FR_AB_GPIO_CTL);
205} 212}
206 213
207static void falcon_setscl(void *data, int state) 214static void falcon_setscl(void *data, int state)
@@ -209,9 +216,9 @@ static void falcon_setscl(void *data, int state)
209 struct efx_nic *efx = (struct efx_nic *)data; 216 struct efx_nic *efx = (struct efx_nic *)data;
210 efx_oword_t reg; 217 efx_oword_t reg;
211 218
212 falcon_read(efx, &reg, FR_AB_GPIO_CTL); 219 efx_reado(efx, &reg, FR_AB_GPIO_CTL);
213 EFX_SET_OWORD_FIELD(reg, FRF_AB_GPIO0_OEN, !state); 220 EFX_SET_OWORD_FIELD(reg, FRF_AB_GPIO0_OEN, !state);
214 falcon_write(efx, &reg, FR_AB_GPIO_CTL); 221 efx_writeo(efx, &reg, FR_AB_GPIO_CTL);
215} 222}
216 223
217static int falcon_getsda(void *data) 224static int falcon_getsda(void *data)
@@ -219,7 +226,7 @@ static int falcon_getsda(void *data)
219 struct efx_nic *efx = (struct efx_nic *)data; 226 struct efx_nic *efx = (struct efx_nic *)data;
220 efx_oword_t reg; 227 efx_oword_t reg;
221 228
222 falcon_read(efx, &reg, FR_AB_GPIO_CTL); 229 efx_reado(efx, &reg, FR_AB_GPIO_CTL);
223 return EFX_OWORD_FIELD(reg, FRF_AB_GPIO3_IN); 230 return EFX_OWORD_FIELD(reg, FRF_AB_GPIO3_IN);
224} 231}
225 232
@@ -228,7 +235,7 @@ static int falcon_getscl(void *data)
228 struct efx_nic *efx = (struct efx_nic *)data; 235 struct efx_nic *efx = (struct efx_nic *)data;
229 efx_oword_t reg; 236 efx_oword_t reg;
230 237
231 falcon_read(efx, &reg, FR_AB_GPIO_CTL); 238 efx_reado(efx, &reg, FR_AB_GPIO_CTL);
232 return EFX_OWORD_FIELD(reg, FRF_AB_GPIO0_IN); 239 return EFX_OWORD_FIELD(reg, FRF_AB_GPIO0_IN);
233} 240}
234 241
@@ -278,7 +285,7 @@ falcon_init_special_buffer(struct efx_nic *efx,
278 FRF_AZ_BUF_ADR_REGION, 0, 285 FRF_AZ_BUF_ADR_REGION, 0,
279 FRF_AZ_BUF_ADR_FBUF, dma_addr >> 12, 286 FRF_AZ_BUF_ADR_FBUF, dma_addr >> 12,
280 FRF_AZ_BUF_OWNER_ID_FBUF, 0); 287 FRF_AZ_BUF_OWNER_ID_FBUF, 0);
281 falcon_write_sram(efx, &buf_desc, index); 288 falcon_write_buf_tbl(efx, &buf_desc, index);
282 } 289 }
283} 290}
284 291
@@ -302,7 +309,7 @@ falcon_fini_special_buffer(struct efx_nic *efx,
302 FRF_AZ_BUF_CLR_CMD, 1, 309 FRF_AZ_BUF_CLR_CMD, 1,
303 FRF_AZ_BUF_CLR_END_ID, end, 310 FRF_AZ_BUF_CLR_END_ID, end,
304 FRF_AZ_BUF_CLR_START_ID, start); 311 FRF_AZ_BUF_CLR_START_ID, start);
305 falcon_write(efx, &buf_tbl_upd, FR_AZ_BUF_TBL_UPD); 312 efx_writeo(efx, &buf_tbl_upd, FR_AZ_BUF_TBL_UPD);
306} 313}
307 314
308/* 315/*
@@ -415,8 +422,8 @@ static inline void falcon_notify_tx_desc(struct efx_tx_queue *tx_queue)
415 422
416 write_ptr = tx_queue->write_count & FALCON_TXD_RING_MASK; 423 write_ptr = tx_queue->write_count & FALCON_TXD_RING_MASK;
417 EFX_POPULATE_DWORD_1(reg, FRF_AZ_TX_DESC_WPTR_DWORD, write_ptr); 424 EFX_POPULATE_DWORD_1(reg, FRF_AZ_TX_DESC_WPTR_DWORD, write_ptr);
418 falcon_writel_page(tx_queue->efx, &reg, 425 efx_writed_page(tx_queue->efx, &reg,
419 FR_AZ_TX_DESC_UPD_DWORD_P0, tx_queue->queue); 426 FR_AZ_TX_DESC_UPD_DWORD_P0, tx_queue->queue);
420} 427}
421 428
422 429
@@ -491,8 +498,8 @@ void falcon_init_tx(struct efx_tx_queue *tx_queue)
491 !csum); 498 !csum);
492 } 499 }
493 500
494 falcon_write_table(efx, &tx_desc_ptr, efx->type->txd_ptr_tbl_base, 501 efx_writeo_table(efx, &tx_desc_ptr, efx->type->txd_ptr_tbl_base,
495 tx_queue->queue); 502 tx_queue->queue);
496 503
497 if (falcon_rev(efx) < FALCON_REV_B0) { 504 if (falcon_rev(efx) < FALCON_REV_B0) {
498 efx_oword_t reg; 505 efx_oword_t reg;
@@ -500,12 +507,12 @@ void falcon_init_tx(struct efx_tx_queue *tx_queue)
500 /* Only 128 bits in this register */ 507 /* Only 128 bits in this register */
501 BUILD_BUG_ON(EFX_TX_QUEUE_COUNT >= 128); 508 BUILD_BUG_ON(EFX_TX_QUEUE_COUNT >= 128);
502 509
503 falcon_read(efx, &reg, FR_AA_TX_CHKSM_CFG); 510 efx_reado(efx, &reg, FR_AA_TX_CHKSM_CFG);
504 if (tx_queue->queue == EFX_TX_QUEUE_OFFLOAD_CSUM) 511 if (tx_queue->queue == EFX_TX_QUEUE_OFFLOAD_CSUM)
505 clear_bit_le(tx_queue->queue, (void *)&reg); 512 clear_bit_le(tx_queue->queue, (void *)&reg);
506 else 513 else
507 set_bit_le(tx_queue->queue, (void *)&reg); 514 set_bit_le(tx_queue->queue, (void *)&reg);
508 falcon_write(efx, &reg, FR_AA_TX_CHKSM_CFG); 515 efx_writeo(efx, &reg, FR_AA_TX_CHKSM_CFG);
509 } 516 }
510} 517}
511 518
@@ -518,7 +525,7 @@ static void falcon_flush_tx_queue(struct efx_tx_queue *tx_queue)
518 EFX_POPULATE_OWORD_2(tx_flush_descq, 525 EFX_POPULATE_OWORD_2(tx_flush_descq,
519 FRF_AZ_TX_FLUSH_DESCQ_CMD, 1, 526 FRF_AZ_TX_FLUSH_DESCQ_CMD, 1,
520 FRF_AZ_TX_FLUSH_DESCQ, tx_queue->queue); 527 FRF_AZ_TX_FLUSH_DESCQ, tx_queue->queue);
521 falcon_write(efx, &tx_flush_descq, FR_AZ_TX_FLUSH_DESCQ); 528 efx_writeo(efx, &tx_flush_descq, FR_AZ_TX_FLUSH_DESCQ);
522} 529}
523 530
524void falcon_fini_tx(struct efx_tx_queue *tx_queue) 531void falcon_fini_tx(struct efx_tx_queue *tx_queue)
@@ -531,8 +538,8 @@ void falcon_fini_tx(struct efx_tx_queue *tx_queue)
531 538
532 /* Remove TX descriptor ring from card */ 539 /* Remove TX descriptor ring from card */
533 EFX_ZERO_OWORD(tx_desc_ptr); 540 EFX_ZERO_OWORD(tx_desc_ptr);
534 falcon_write_table(efx, &tx_desc_ptr, efx->type->txd_ptr_tbl_base, 541 efx_writeo_table(efx, &tx_desc_ptr, efx->type->txd_ptr_tbl_base,
535 tx_queue->queue); 542 tx_queue->queue);
536 543
537 /* Unpin TX descriptor ring */ 544 /* Unpin TX descriptor ring */
538 falcon_fini_special_buffer(efx, &tx_queue->txd); 545 falcon_fini_special_buffer(efx, &tx_queue->txd);
@@ -592,8 +599,8 @@ void falcon_notify_rx_desc(struct efx_rx_queue *rx_queue)
592 wmb(); 599 wmb();
593 write_ptr = rx_queue->added_count & FALCON_RXD_RING_MASK; 600 write_ptr = rx_queue->added_count & FALCON_RXD_RING_MASK;
594 EFX_POPULATE_DWORD_1(reg, FRF_AZ_RX_DESC_WPTR_DWORD, write_ptr); 601 EFX_POPULATE_DWORD_1(reg, FRF_AZ_RX_DESC_WPTR_DWORD, write_ptr);
595 falcon_writel_page(rx_queue->efx, &reg, 602 efx_writed_page(rx_queue->efx, &reg,
596 FR_AZ_RX_DESC_UPD_DWORD_P0, rx_queue->queue); 603 FR_AZ_RX_DESC_UPD_DWORD_P0, rx_queue->queue);
597} 604}
598 605
599int falcon_probe_rx(struct efx_rx_queue *rx_queue) 606int falcon_probe_rx(struct efx_rx_queue *rx_queue)
@@ -634,8 +641,8 @@ void falcon_init_rx(struct efx_rx_queue *rx_queue)
634 /* For >=B0 this is scatter so disable */ 641 /* For >=B0 this is scatter so disable */
635 FRF_AZ_RX_DESCQ_JUMBO, !is_b0, 642 FRF_AZ_RX_DESCQ_JUMBO, !is_b0,
636 FRF_AZ_RX_DESCQ_EN, 1); 643 FRF_AZ_RX_DESCQ_EN, 1);
637 falcon_write_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base, 644 efx_writeo_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base,
638 rx_queue->queue); 645 rx_queue->queue);
639} 646}
640 647
641static void falcon_flush_rx_queue(struct efx_rx_queue *rx_queue) 648static void falcon_flush_rx_queue(struct efx_rx_queue *rx_queue)
@@ -647,7 +654,7 @@ static void falcon_flush_rx_queue(struct efx_rx_queue *rx_queue)
647 EFX_POPULATE_OWORD_2(rx_flush_descq, 654 EFX_POPULATE_OWORD_2(rx_flush_descq,
648 FRF_AZ_RX_FLUSH_DESCQ_CMD, 1, 655 FRF_AZ_RX_FLUSH_DESCQ_CMD, 1,
649 FRF_AZ_RX_FLUSH_DESCQ, rx_queue->queue); 656 FRF_AZ_RX_FLUSH_DESCQ, rx_queue->queue);
650 falcon_write(efx, &rx_flush_descq, FR_AZ_RX_FLUSH_DESCQ); 657 efx_writeo(efx, &rx_flush_descq, FR_AZ_RX_FLUSH_DESCQ);
651} 658}
652 659
653void falcon_fini_rx(struct efx_rx_queue *rx_queue) 660void falcon_fini_rx(struct efx_rx_queue *rx_queue)
@@ -660,8 +667,8 @@ void falcon_fini_rx(struct efx_rx_queue *rx_queue)
660 667
661 /* Remove RX descriptor ring from card */ 668 /* Remove RX descriptor ring from card */
662 EFX_ZERO_OWORD(rx_desc_ptr); 669 EFX_ZERO_OWORD(rx_desc_ptr);
663 falcon_write_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base, 670 efx_writeo_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base,
664 rx_queue->queue); 671 rx_queue->queue);
665 672
666 /* Unpin RX descriptor ring */ 673 /* Unpin RX descriptor ring */
667 falcon_fini_special_buffer(efx, &rx_queue->rxd); 674 falcon_fini_special_buffer(efx, &rx_queue->rxd);
@@ -695,7 +702,7 @@ void falcon_eventq_read_ack(struct efx_channel *channel)
695 struct efx_nic *efx = channel->efx; 702 struct efx_nic *efx = channel->efx;
696 703
697 EFX_POPULATE_DWORD_1(reg, FRF_AZ_EVQ_RPTR, channel->eventq_read_ptr); 704 EFX_POPULATE_DWORD_1(reg, FRF_AZ_EVQ_RPTR, channel->eventq_read_ptr);
698 falcon_writel_table(efx, &reg, efx->type->evq_rptr_tbl_base, 705 efx_writed_table(efx, &reg, efx->type->evq_rptr_tbl_base,
699 channel->channel); 706 channel->channel);
700} 707}
701 708
@@ -711,7 +718,7 @@ void falcon_generate_event(struct efx_channel *channel, efx_qword_t *event)
711 drv_ev_reg.u32[2] = 0; 718 drv_ev_reg.u32[2] = 0;
712 drv_ev_reg.u32[3] = 0; 719 drv_ev_reg.u32[3] = 0;
713 EFX_SET_OWORD_FIELD(drv_ev_reg, FRF_AZ_DRV_EV_QID, channel->channel); 720 EFX_SET_OWORD_FIELD(drv_ev_reg, FRF_AZ_DRV_EV_QID, channel->channel);
714 falcon_write(channel->efx, &drv_ev_reg, FR_AZ_DRV_EV); 721 efx_writeo(channel->efx, &drv_ev_reg, FR_AZ_DRV_EV);
715} 722}
716 723
717/* Handle a transmit completion event 724/* Handle a transmit completion event
@@ -1104,8 +1111,8 @@ void falcon_set_int_moderation(struct efx_channel *channel)
1104 FRF_AB_TC_TIMER_VAL, 0); 1111 FRF_AB_TC_TIMER_VAL, 0);
1105 } 1112 }
1106 BUILD_BUG_ON(FR_AA_TIMER_COMMAND_KER != FR_BZ_TIMER_COMMAND_P0); 1113 BUILD_BUG_ON(FR_AA_TIMER_COMMAND_KER != FR_BZ_TIMER_COMMAND_P0);
1107 falcon_writel_page_locked(efx, &timer_cmd, FR_BZ_TIMER_COMMAND_P0, 1114 efx_writed_page_locked(efx, &timer_cmd, FR_BZ_TIMER_COMMAND_P0,
1108 channel->channel); 1115 channel->channel);
1109 1116
1110} 1117}
1111 1118
@@ -1139,8 +1146,8 @@ void falcon_init_eventq(struct efx_channel *channel)
1139 FRF_AZ_EVQ_EN, 1, 1146 FRF_AZ_EVQ_EN, 1,
1140 FRF_AZ_EVQ_SIZE, FALCON_EVQ_ORDER, 1147 FRF_AZ_EVQ_SIZE, FALCON_EVQ_ORDER,
1141 FRF_AZ_EVQ_BUF_BASE_ID, channel->eventq.index); 1148 FRF_AZ_EVQ_BUF_BASE_ID, channel->eventq.index);
1142 falcon_write_table(efx, &evq_ptr, efx->type->evq_ptr_tbl_base, 1149 efx_writeo_table(efx, &evq_ptr, efx->type->evq_ptr_tbl_base,
1143 channel->channel); 1150 channel->channel);
1144 1151
1145 falcon_set_int_moderation(channel); 1152 falcon_set_int_moderation(channel);
1146} 1153}
@@ -1152,8 +1159,8 @@ void falcon_fini_eventq(struct efx_channel *channel)
1152 1159
1153 /* Remove event queue from card */ 1160 /* Remove event queue from card */
1154 EFX_ZERO_OWORD(eventq_ptr); 1161 EFX_ZERO_OWORD(eventq_ptr);
1155 falcon_write_table(efx, &eventq_ptr, efx->type->evq_ptr_tbl_base, 1162 efx_writeo_table(efx, &eventq_ptr, efx->type->evq_ptr_tbl_base,
1156 channel->channel); 1163 channel->channel);
1157 1164
1158 /* Unpin event queue */ 1165 /* Unpin event queue */
1159 falcon_fini_special_buffer(efx, &channel->eventq); 1166 falcon_fini_special_buffer(efx, &channel->eventq);
@@ -1325,7 +1332,7 @@ static inline void falcon_interrupts(struct efx_nic *efx, int enabled,
1325 EFX_POPULATE_OWORD_2(int_en_reg_ker, 1332 EFX_POPULATE_OWORD_2(int_en_reg_ker,
1326 FRF_AZ_KER_INT_KER, force, 1333 FRF_AZ_KER_INT_KER, force,
1327 FRF_AZ_DRV_INT_EN_KER, enabled); 1334 FRF_AZ_DRV_INT_EN_KER, enabled);
1328 falcon_write(efx, &int_en_reg_ker, FR_AZ_INT_EN_KER); 1335 efx_writeo(efx, &int_en_reg_ker, FR_AZ_INT_EN_KER);
1329} 1336}
1330 1337
1331void falcon_enable_interrupts(struct efx_nic *efx) 1338void falcon_enable_interrupts(struct efx_nic *efx)
@@ -1341,7 +1348,7 @@ void falcon_enable_interrupts(struct efx_nic *efx)
1341 FRF_AZ_NORM_INT_VEC_DIS_KER, 1348 FRF_AZ_NORM_INT_VEC_DIS_KER,
1342 EFX_INT_MODE_USE_MSI(efx), 1349 EFX_INT_MODE_USE_MSI(efx),
1343 FRF_AZ_INT_ADR_KER, efx->irq_status.dma_addr); 1350 FRF_AZ_INT_ADR_KER, efx->irq_status.dma_addr);
1344 falcon_write(efx, &int_adr_reg_ker, FR_AZ_INT_ADR_KER); 1351 efx_writeo(efx, &int_adr_reg_ker, FR_AZ_INT_ADR_KER);
1345 1352
1346 /* Enable interrupts */ 1353 /* Enable interrupts */
1347 falcon_interrupts(efx, 1, 0); 1354 falcon_interrupts(efx, 1, 0);
@@ -1382,8 +1389,8 @@ static inline void falcon_irq_ack_a1(struct efx_nic *efx)
1382 efx_dword_t reg; 1389 efx_dword_t reg;
1383 1390
1384 EFX_POPULATE_DWORD_1(reg, FRF_AA_INT_ACK_KER_FIELD, 0xb7eb7e); 1391 EFX_POPULATE_DWORD_1(reg, FRF_AA_INT_ACK_KER_FIELD, 0xb7eb7e);
1385 falcon_writel(efx, &reg, FR_AA_INT_ACK_KER); 1392 efx_writed(efx, &reg, FR_AA_INT_ACK_KER);
1386 falcon_readl(efx, &reg, FR_AA_WORK_AROUND_BROKEN_PCI_READS); 1393 efx_readd(efx, &reg, FR_AA_WORK_AROUND_BROKEN_PCI_READS);
1387} 1394}
1388 1395
1389/* Process a fatal interrupt 1396/* Process a fatal interrupt
@@ -1396,7 +1403,7 @@ static irqreturn_t falcon_fatal_interrupt(struct efx_nic *efx)
1396 efx_oword_t fatal_intr; 1403 efx_oword_t fatal_intr;
1397 int error, mem_perr; 1404 int error, mem_perr;
1398 1405
1399 falcon_read(efx, &fatal_intr, FR_AZ_FATAL_INTR_KER); 1406 efx_reado(efx, &fatal_intr, FR_AZ_FATAL_INTR_KER);
1400 error = EFX_OWORD_FIELD(fatal_intr, FRF_AZ_FATAL_INTR); 1407 error = EFX_OWORD_FIELD(fatal_intr, FRF_AZ_FATAL_INTR);
1401 1408
1402 EFX_ERR(efx, "SYSTEM ERROR " EFX_OWORD_FMT " status " 1409 EFX_ERR(efx, "SYSTEM ERROR " EFX_OWORD_FMT " status "
@@ -1410,7 +1417,7 @@ static irqreturn_t falcon_fatal_interrupt(struct efx_nic *efx)
1410 mem_perr = EFX_OWORD_FIELD(fatal_intr, FRF_AZ_MEM_PERR_INT_KER); 1417 mem_perr = EFX_OWORD_FIELD(fatal_intr, FRF_AZ_MEM_PERR_INT_KER);
1411 if (mem_perr) { 1418 if (mem_perr) {
1412 efx_oword_t reg; 1419 efx_oword_t reg;
1413 falcon_read(efx, &reg, FR_AZ_MEM_STAT); 1420 efx_reado(efx, &reg, FR_AZ_MEM_STAT);
1414 EFX_ERR(efx, "SYSTEM ERROR: memory parity error " 1421 EFX_ERR(efx, "SYSTEM ERROR: memory parity error "
1415 EFX_OWORD_FMT "\n", EFX_OWORD_VAL(reg)); 1422 EFX_OWORD_FMT "\n", EFX_OWORD_VAL(reg));
1416 } 1423 }
@@ -1454,7 +1461,7 @@ static irqreturn_t falcon_legacy_interrupt_b0(int irq, void *dev_id)
1454 int syserr; 1461 int syserr;
1455 1462
1456 /* Read the ISR which also ACKs the interrupts */ 1463 /* Read the ISR which also ACKs the interrupts */
1457 falcon_readl(efx, &reg, FR_BZ_INT_ISR0); 1464 efx_readd(efx, &reg, FR_BZ_INT_ISR0);
1458 queues = EFX_EXTRACT_DWORD(reg, 0, 31); 1465 queues = EFX_EXTRACT_DWORD(reg, 0, 31);
1459 1466
1460 /* Check to see if we have a serious error condition */ 1467 /* Check to see if we have a serious error condition */
@@ -1576,7 +1583,7 @@ static void falcon_setup_rss_indir_table(struct efx_nic *efx)
1576 offset += 0x10) { 1583 offset += 0x10) {
1577 EFX_POPULATE_DWORD_1(dword, FRF_BZ_IT_QUEUE, 1584 EFX_POPULATE_DWORD_1(dword, FRF_BZ_IT_QUEUE,
1578 i % efx->n_rx_queues); 1585 i % efx->n_rx_queues);
1579 falcon_writel(efx, &dword, offset); 1586 efx_writed(efx, &dword, offset);
1580 i++; 1587 i++;
1581 } 1588 }
1582} 1589}
@@ -1639,7 +1646,7 @@ void falcon_fini_interrupt(struct efx_nic *efx)
1639 1646
1640 /* ACK legacy interrupt */ 1647 /* ACK legacy interrupt */
1641 if (falcon_rev(efx) >= FALCON_REV_B0) 1648 if (falcon_rev(efx) >= FALCON_REV_B0)
1642 falcon_read(efx, &reg, FR_BZ_INT_ISR0); 1649 efx_reado(efx, &reg, FR_BZ_INT_ISR0);
1643 else 1650 else
1644 falcon_irq_ack_a1(efx); 1651 falcon_irq_ack_a1(efx);
1645 1652
@@ -1660,7 +1667,7 @@ void falcon_fini_interrupt(struct efx_nic *efx)
1660static int falcon_spi_poll(struct efx_nic *efx) 1667static int falcon_spi_poll(struct efx_nic *efx)
1661{ 1668{
1662 efx_oword_t reg; 1669 efx_oword_t reg;
1663 falcon_read(efx, &reg, FR_AB_EE_SPI_HCMD); 1670 efx_reado(efx, &reg, FR_AB_EE_SPI_HCMD);
1664 return EFX_OWORD_FIELD(reg, FRF_AB_EE_SPI_HCMD_CMD_EN) ? -EBUSY : 0; 1671 return EFX_OWORD_FIELD(reg, FRF_AB_EE_SPI_HCMD_CMD_EN) ? -EBUSY : 0;
1665} 1672}
1666 1673
@@ -1714,13 +1721,13 @@ int falcon_spi_cmd(const struct efx_spi_device *spi,
1714 /* Program address register, if we have an address */ 1721 /* Program address register, if we have an address */
1715 if (addressed) { 1722 if (addressed) {
1716 EFX_POPULATE_OWORD_1(reg, FRF_AB_EE_SPI_HADR_ADR, address); 1723 EFX_POPULATE_OWORD_1(reg, FRF_AB_EE_SPI_HADR_ADR, address);
1717 falcon_write(efx, &reg, FR_AB_EE_SPI_HADR); 1724 efx_writeo(efx, &reg, FR_AB_EE_SPI_HADR);
1718 } 1725 }
1719 1726
1720 /* Program data register, if we have data */ 1727 /* Program data register, if we have data */
1721 if (in != NULL) { 1728 if (in != NULL) {
1722 memcpy(&reg, in, len); 1729 memcpy(&reg, in, len);
1723 falcon_write(efx, &reg, FR_AB_EE_SPI_HDATA); 1730 efx_writeo(efx, &reg, FR_AB_EE_SPI_HDATA);
1724 } 1731 }
1725 1732
1726 /* Issue read/write command */ 1733 /* Issue read/write command */
@@ -1733,7 +1740,7 @@ int falcon_spi_cmd(const struct efx_spi_device *spi,
1733 FRF_AB_EE_SPI_HCMD_ADBCNT, 1740 FRF_AB_EE_SPI_HCMD_ADBCNT,
1734 (addressed ? spi->addr_len : 0), 1741 (addressed ? spi->addr_len : 0),
1735 FRF_AB_EE_SPI_HCMD_ENC, command); 1742 FRF_AB_EE_SPI_HCMD_ENC, command);
1736 falcon_write(efx, &reg, FR_AB_EE_SPI_HCMD); 1743 efx_writeo(efx, &reg, FR_AB_EE_SPI_HCMD);
1737 1744
1738 /* Wait for read/write to complete */ 1745 /* Wait for read/write to complete */
1739 rc = falcon_spi_wait(efx); 1746 rc = falcon_spi_wait(efx);
@@ -1742,7 +1749,7 @@ int falcon_spi_cmd(const struct efx_spi_device *spi,
1742 1749
1743 /* Read data */ 1750 /* Read data */
1744 if (out != NULL) { 1751 if (out != NULL) {
1745 falcon_read(efx, &reg, FR_AB_EE_SPI_HDATA); 1752 efx_reado(efx, &reg, FR_AB_EE_SPI_HDATA);
1746 memcpy(out, &reg, len); 1753 memcpy(out, &reg, len);
1747 } 1754 }
1748 1755
@@ -1884,19 +1891,19 @@ static int falcon_reset_macs(struct efx_nic *efx)
1884 */ 1891 */
1885 if (!EFX_IS10G(efx)) { 1892 if (!EFX_IS10G(efx)) {
1886 EFX_POPULATE_OWORD_1(reg, FRF_AB_GM_SW_RST, 1); 1893 EFX_POPULATE_OWORD_1(reg, FRF_AB_GM_SW_RST, 1);
1887 falcon_write(efx, &reg, FR_AB_GM_CFG1); 1894 efx_writeo(efx, &reg, FR_AB_GM_CFG1);
1888 udelay(1000); 1895 udelay(1000);
1889 1896
1890 EFX_POPULATE_OWORD_1(reg, FRF_AB_GM_SW_RST, 0); 1897 EFX_POPULATE_OWORD_1(reg, FRF_AB_GM_SW_RST, 0);
1891 falcon_write(efx, &reg, FR_AB_GM_CFG1); 1898 efx_writeo(efx, &reg, FR_AB_GM_CFG1);
1892 udelay(1000); 1899 udelay(1000);
1893 return 0; 1900 return 0;
1894 } else { 1901 } else {
1895 EFX_POPULATE_OWORD_1(reg, FRF_AB_XM_CORE_RST, 1); 1902 EFX_POPULATE_OWORD_1(reg, FRF_AB_XM_CORE_RST, 1);
1896 falcon_write(efx, &reg, FR_AB_XM_GLB_CFG); 1903 efx_writeo(efx, &reg, FR_AB_XM_GLB_CFG);
1897 1904
1898 for (count = 0; count < 10000; count++) { 1905 for (count = 0; count < 10000; count++) {
1899 falcon_read(efx, &reg, FR_AB_XM_GLB_CFG); 1906 efx_reado(efx, &reg, FR_AB_XM_GLB_CFG);
1900 if (EFX_OWORD_FIELD(reg, FRF_AB_XM_CORE_RST) == 1907 if (EFX_OWORD_FIELD(reg, FRF_AB_XM_CORE_RST) ==
1901 0) 1908 0)
1902 return 0; 1909 return 0;
@@ -1912,19 +1919,19 @@ static int falcon_reset_macs(struct efx_nic *efx)
1912 * the drain sequence with the statistics fetch */ 1919 * the drain sequence with the statistics fetch */
1913 efx_stats_disable(efx); 1920 efx_stats_disable(efx);
1914 1921
1915 falcon_read(efx, &reg, FR_AB_MAC_CTRL); 1922 efx_reado(efx, &reg, FR_AB_MAC_CTRL);
1916 EFX_SET_OWORD_FIELD(reg, FRF_BB_TXFIFO_DRAIN_EN, 1); 1923 EFX_SET_OWORD_FIELD(reg, FRF_BB_TXFIFO_DRAIN_EN, 1);
1917 falcon_write(efx, &reg, FR_AB_MAC_CTRL); 1924 efx_writeo(efx, &reg, FR_AB_MAC_CTRL);
1918 1925
1919 falcon_read(efx, &reg, FR_AB_GLB_CTL); 1926 efx_reado(efx, &reg, FR_AB_GLB_CTL);
1920 EFX_SET_OWORD_FIELD(reg, FRF_AB_RST_XGTX, 1); 1927 EFX_SET_OWORD_FIELD(reg, FRF_AB_RST_XGTX, 1);
1921 EFX_SET_OWORD_FIELD(reg, FRF_AB_RST_XGRX, 1); 1928 EFX_SET_OWORD_FIELD(reg, FRF_AB_RST_XGRX, 1);
1922 EFX_SET_OWORD_FIELD(reg, FRF_AB_RST_EM, 1); 1929 EFX_SET_OWORD_FIELD(reg, FRF_AB_RST_EM, 1);
1923 falcon_write(efx, &reg, FR_AB_GLB_CTL); 1930 efx_writeo(efx, &reg, FR_AB_GLB_CTL);
1924 1931
1925 count = 0; 1932 count = 0;
1926 while (1) { 1933 while (1) {
1927 falcon_read(efx, &reg, FR_AB_GLB_CTL); 1934 efx_reado(efx, &reg, FR_AB_GLB_CTL);
1928 if (!EFX_OWORD_FIELD(reg, FRF_AB_RST_XGTX) && 1935 if (!EFX_OWORD_FIELD(reg, FRF_AB_RST_XGTX) &&
1929 !EFX_OWORD_FIELD(reg, FRF_AB_RST_XGRX) && 1936 !EFX_OWORD_FIELD(reg, FRF_AB_RST_XGRX) &&
1930 !EFX_OWORD_FIELD(reg, FRF_AB_RST_EM)) { 1937 !EFX_OWORD_FIELD(reg, FRF_AB_RST_EM)) {
@@ -1958,7 +1965,7 @@ void falcon_drain_tx_fifo(struct efx_nic *efx)
1958 (efx->loopback_mode != LOOPBACK_NONE)) 1965 (efx->loopback_mode != LOOPBACK_NONE))
1959 return; 1966 return;
1960 1967
1961 falcon_read(efx, &reg, FR_AB_MAC_CTRL); 1968 efx_reado(efx, &reg, FR_AB_MAC_CTRL);
1962 /* There is no point in draining more than once */ 1969 /* There is no point in draining more than once */
1963 if (EFX_OWORD_FIELD(reg, FRF_BB_TXFIFO_DRAIN_EN)) 1970 if (EFX_OWORD_FIELD(reg, FRF_BB_TXFIFO_DRAIN_EN))
1964 return; 1971 return;
@@ -1974,9 +1981,9 @@ void falcon_deconfigure_mac_wrapper(struct efx_nic *efx)
1974 return; 1981 return;
1975 1982
1976 /* Isolate the MAC -> RX */ 1983 /* Isolate the MAC -> RX */
1977 falcon_read(efx, &reg, FR_AZ_RX_CFG); 1984 efx_reado(efx, &reg, FR_AZ_RX_CFG);
1978 EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 0); 1985 EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 0);
1979 falcon_write(efx, &reg, FR_AZ_RX_CFG); 1986 efx_writeo(efx, &reg, FR_AZ_RX_CFG);
1980 1987
1981 if (!efx->link_up) 1988 if (!efx->link_up)
1982 falcon_drain_tx_fifo(efx); 1989 falcon_drain_tx_fifo(efx);
@@ -2011,7 +2018,7 @@ void falcon_reconfigure_mac_wrapper(struct efx_nic *efx)
2011 !efx->link_up); 2018 !efx->link_up);
2012 } 2019 }
2013 2020
2014 falcon_write(efx, &reg, FR_AB_MAC_CTRL); 2021 efx_writeo(efx, &reg, FR_AB_MAC_CTRL);
2015 2022
2016 /* Restore the multicast hash registers. */ 2023 /* Restore the multicast hash registers. */
2017 falcon_set_multicast_hash(efx); 2024 falcon_set_multicast_hash(efx);
@@ -2020,13 +2027,13 @@ void falcon_reconfigure_mac_wrapper(struct efx_nic *efx)
2020 * covered by RX_XOFF_MAC_EN and XM_TX_CFG_REG:XM_FCNTL. 2027 * covered by RX_XOFF_MAC_EN and XM_TX_CFG_REG:XM_FCNTL.
2021 * Action on receipt of pause frames is controller by XM_DIS_FCNTL */ 2028 * Action on receipt of pause frames is controller by XM_DIS_FCNTL */
2022 tx_fc = !!(efx->link_fc & EFX_FC_TX); 2029 tx_fc = !!(efx->link_fc & EFX_FC_TX);
2023 falcon_read(efx, &reg, FR_AZ_RX_CFG); 2030 efx_reado(efx, &reg, FR_AZ_RX_CFG);
2024 EFX_SET_OWORD_FIELD(reg, FRF_AZ_RX_XOFF_MAC_EN, tx_fc); 2031 EFX_SET_OWORD_FIELD(reg, FRF_AZ_RX_XOFF_MAC_EN, tx_fc);
2025 2032
2026 /* Unisolate the MAC -> RX */ 2033 /* Unisolate the MAC -> RX */
2027 if (falcon_rev(efx) >= FALCON_REV_B0) 2034 if (falcon_rev(efx) >= FALCON_REV_B0)
2028 EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1); 2035 EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1);
2029 falcon_write(efx, &reg, FR_AZ_RX_CFG); 2036 efx_writeo(efx, &reg, FR_AZ_RX_CFG);
2030} 2037}
2031 2038
2032int falcon_dma_stats(struct efx_nic *efx, unsigned int done_offset) 2039int falcon_dma_stats(struct efx_nic *efx, unsigned int done_offset)
@@ -2041,7 +2048,7 @@ int falcon_dma_stats(struct efx_nic *efx, unsigned int done_offset)
2041 /* Statistics fetch will fail if the MAC is in TX drain */ 2048 /* Statistics fetch will fail if the MAC is in TX drain */
2042 if (falcon_rev(efx) >= FALCON_REV_B0) { 2049 if (falcon_rev(efx) >= FALCON_REV_B0) {
2043 efx_oword_t temp; 2050 efx_oword_t temp;
2044 falcon_read(efx, &temp, FR_AB_MAC_CTRL); 2051 efx_reado(efx, &temp, FR_AB_MAC_CTRL);
2045 if (EFX_OWORD_FIELD(temp, FRF_BB_TXFIFO_DRAIN_EN)) 2052 if (EFX_OWORD_FIELD(temp, FRF_BB_TXFIFO_DRAIN_EN))
2046 return 0; 2053 return 0;
2047 } 2054 }
@@ -2055,7 +2062,7 @@ int falcon_dma_stats(struct efx_nic *efx, unsigned int done_offset)
2055 FRF_AB_MAC_STAT_DMA_CMD, 1, 2062 FRF_AB_MAC_STAT_DMA_CMD, 1,
2056 FRF_AB_MAC_STAT_DMA_ADR, 2063 FRF_AB_MAC_STAT_DMA_ADR,
2057 efx->stats_buffer.dma_addr); 2064 efx->stats_buffer.dma_addr);
2058 falcon_write(efx, &reg, FR_AB_MAC_STAT_DMA); 2065 efx_writeo(efx, &reg, FR_AB_MAC_STAT_DMA);
2059 2066
2060 /* Wait for transfer to complete */ 2067 /* Wait for transfer to complete */
2061 for (i = 0; i < 400; i++) { 2068 for (i = 0; i < 400; i++) {
@@ -2085,7 +2092,7 @@ static int falcon_gmii_wait(struct efx_nic *efx)
2085 2092
2086 /* wait upto 50ms - taken max from datasheet */ 2093 /* wait upto 50ms - taken max from datasheet */
2087 for (count = 0; count < 5000; count++) { 2094 for (count = 0; count < 5000; count++) {
2088 falcon_readl(efx, &md_stat, FR_AB_MD_STAT); 2095 efx_readd(efx, &md_stat, FR_AB_MD_STAT);
2089 if (EFX_DWORD_FIELD(md_stat, FRF_AB_MD_BSY) == 0) { 2096 if (EFX_DWORD_FIELD(md_stat, FRF_AB_MD_BSY) == 0) {
2090 if (EFX_DWORD_FIELD(md_stat, FRF_AB_MD_LNFL) != 0 || 2097 if (EFX_DWORD_FIELD(md_stat, FRF_AB_MD_LNFL) != 0 ||
2091 EFX_DWORD_FIELD(md_stat, FRF_AB_MD_BSERR) != 0) { 2098 EFX_DWORD_FIELD(md_stat, FRF_AB_MD_BSERR) != 0) {
@@ -2122,20 +2129,20 @@ static int falcon_mdio_write(struct net_device *net_dev,
2122 2129
2123 /* Write the address/ID register */ 2130 /* Write the address/ID register */
2124 EFX_POPULATE_OWORD_1(reg, FRF_AB_MD_PHY_ADR, addr); 2131 EFX_POPULATE_OWORD_1(reg, FRF_AB_MD_PHY_ADR, addr);
2125 falcon_write(efx, &reg, FR_AB_MD_PHY_ADR); 2132 efx_writeo(efx, &reg, FR_AB_MD_PHY_ADR);
2126 2133
2127 EFX_POPULATE_OWORD_2(reg, FRF_AB_MD_PRT_ADR, prtad, 2134 EFX_POPULATE_OWORD_2(reg, FRF_AB_MD_PRT_ADR, prtad,
2128 FRF_AB_MD_DEV_ADR, devad); 2135 FRF_AB_MD_DEV_ADR, devad);
2129 falcon_write(efx, &reg, FR_AB_MD_ID); 2136 efx_writeo(efx, &reg, FR_AB_MD_ID);
2130 2137
2131 /* Write data */ 2138 /* Write data */
2132 EFX_POPULATE_OWORD_1(reg, FRF_AB_MD_TXD, value); 2139 EFX_POPULATE_OWORD_1(reg, FRF_AB_MD_TXD, value);
2133 falcon_write(efx, &reg, FR_AB_MD_TXD); 2140 efx_writeo(efx, &reg, FR_AB_MD_TXD);
2134 2141
2135 EFX_POPULATE_OWORD_2(reg, 2142 EFX_POPULATE_OWORD_2(reg,
2136 FRF_AB_MD_WRC, 1, 2143 FRF_AB_MD_WRC, 1,
2137 FRF_AB_MD_GC, 0); 2144 FRF_AB_MD_GC, 0);
2138 falcon_write(efx, &reg, FR_AB_MD_CS); 2145 efx_writeo(efx, &reg, FR_AB_MD_CS);
2139 2146
2140 /* Wait for data to be written */ 2147 /* Wait for data to be written */
2141 rc = falcon_gmii_wait(efx); 2148 rc = falcon_gmii_wait(efx);
@@ -2144,7 +2151,7 @@ static int falcon_mdio_write(struct net_device *net_dev,
2144 EFX_POPULATE_OWORD_2(reg, 2151 EFX_POPULATE_OWORD_2(reg,
2145 FRF_AB_MD_WRC, 0, 2152 FRF_AB_MD_WRC, 0,
2146 FRF_AB_MD_GC, 1); 2153 FRF_AB_MD_GC, 1);
2147 falcon_write(efx, &reg, FR_AB_MD_CS); 2154 efx_writeo(efx, &reg, FR_AB_MD_CS);
2148 udelay(10); 2155 udelay(10);
2149 } 2156 }
2150 2157
@@ -2169,20 +2176,20 @@ static int falcon_mdio_read(struct net_device *net_dev,
2169 goto out; 2176 goto out;
2170 2177
2171 EFX_POPULATE_OWORD_1(reg, FRF_AB_MD_PHY_ADR, addr); 2178 EFX_POPULATE_OWORD_1(reg, FRF_AB_MD_PHY_ADR, addr);
2172 falcon_write(efx, &reg, FR_AB_MD_PHY_ADR); 2179 efx_writeo(efx, &reg, FR_AB_MD_PHY_ADR);
2173 2180
2174 EFX_POPULATE_OWORD_2(reg, FRF_AB_MD_PRT_ADR, prtad, 2181 EFX_POPULATE_OWORD_2(reg, FRF_AB_MD_PRT_ADR, prtad,
2175 FRF_AB_MD_DEV_ADR, devad); 2182 FRF_AB_MD_DEV_ADR, devad);
2176 falcon_write(efx, &reg, FR_AB_MD_ID); 2183 efx_writeo(efx, &reg, FR_AB_MD_ID);
2177 2184
2178 /* Request data to be read */ 2185 /* Request data to be read */
2179 EFX_POPULATE_OWORD_2(reg, FRF_AB_MD_RDC, 1, FRF_AB_MD_GC, 0); 2186 EFX_POPULATE_OWORD_2(reg, FRF_AB_MD_RDC, 1, FRF_AB_MD_GC, 0);
2180 falcon_write(efx, &reg, FR_AB_MD_CS); 2187 efx_writeo(efx, &reg, FR_AB_MD_CS);
2181 2188
2182 /* Wait for data to become available */ 2189 /* Wait for data to become available */
2183 rc = falcon_gmii_wait(efx); 2190 rc = falcon_gmii_wait(efx);
2184 if (rc == 0) { 2191 if (rc == 0) {
2185 falcon_read(efx, &reg, FR_AB_MD_RXD); 2192 efx_reado(efx, &reg, FR_AB_MD_RXD);
2186 rc = EFX_OWORD_FIELD(reg, FRF_AB_MD_RXD); 2193 rc = EFX_OWORD_FIELD(reg, FRF_AB_MD_RXD);
2187 EFX_REGDUMP(efx, "read from MDIO %d register %d.%d, got %04x\n", 2194 EFX_REGDUMP(efx, "read from MDIO %d register %d.%d, got %04x\n",
2188 prtad, devad, addr, rc); 2195 prtad, devad, addr, rc);
@@ -2191,7 +2198,7 @@ static int falcon_mdio_read(struct net_device *net_dev,
2191 EFX_POPULATE_OWORD_2(reg, 2198 EFX_POPULATE_OWORD_2(reg,
2192 FRF_AB_MD_RIC, 0, 2199 FRF_AB_MD_RIC, 0,
2193 FRF_AB_MD_GC, 1); 2200 FRF_AB_MD_GC, 1);
2194 falcon_write(efx, &reg, FR_AB_MD_CS); 2201 efx_writeo(efx, &reg, FR_AB_MD_CS);
2195 2202
2196 EFX_LOG(efx, "read from MDIO %d register %d.%d, got error %d\n", 2203 EFX_LOG(efx, "read from MDIO %d register %d.%d, got error %d\n",
2197 prtad, devad, addr, rc); 2204 prtad, devad, addr, rc);
@@ -2258,12 +2265,12 @@ int falcon_switch_mac(struct efx_nic *efx)
2258 2265
2259 /* Always push the NIC_STAT_REG setting even if the mac hasn't 2266 /* Always push the NIC_STAT_REG setting even if the mac hasn't
2260 * changed, because this function is run post online reset */ 2267 * changed, because this function is run post online reset */
2261 falcon_read(efx, &nic_stat, FR_AB_NIC_STAT); 2268 efx_reado(efx, &nic_stat, FR_AB_NIC_STAT);
2262 strap_val = EFX_IS10G(efx) ? 5 : 3; 2269 strap_val = EFX_IS10G(efx) ? 5 : 3;
2263 if (falcon_rev(efx) >= FALCON_REV_B0) { 2270 if (falcon_rev(efx) >= FALCON_REV_B0) {
2264 EFX_SET_OWORD_FIELD(nic_stat, FRF_BB_EE_STRAP_EN, 1); 2271 EFX_SET_OWORD_FIELD(nic_stat, FRF_BB_EE_STRAP_EN, 1);
2265 EFX_SET_OWORD_FIELD(nic_stat, FRF_BB_EE_STRAP, strap_val); 2272 EFX_SET_OWORD_FIELD(nic_stat, FRF_BB_EE_STRAP, strap_val);
2266 falcon_write(efx, &nic_stat, FR_AB_NIC_STAT); 2273 efx_writeo(efx, &nic_stat, FR_AB_NIC_STAT);
2267 } else { 2274 } else {
2268 /* Falcon A1 does not support 1G/10G speed switching 2275 /* Falcon A1 does not support 1G/10G speed switching
2269 * and must not be used with a PHY that does. */ 2276 * and must not be used with a PHY that does. */
@@ -2341,8 +2348,8 @@ void falcon_set_multicast_hash(struct efx_nic *efx)
2341 */ 2348 */
2342 set_bit_le(0xff, mc_hash->byte); 2349 set_bit_le(0xff, mc_hash->byte);
2343 2350
2344 falcon_write(efx, &mc_hash->oword[0], FR_AB_MAC_MC_HASH_REG0); 2351 efx_writeo(efx, &mc_hash->oword[0], FR_AB_MAC_MC_HASH_REG0);
2345 falcon_write(efx, &mc_hash->oword[1], FR_AB_MAC_MC_HASH_REG1); 2352 efx_writeo(efx, &mc_hash->oword[1], FR_AB_MAC_MC_HASH_REG1);
2346} 2353}
2347 2354
2348 2355
@@ -2478,7 +2485,7 @@ int falcon_test_registers(struct efx_nic *efx)
2478 mask = imask = efx_test_registers[i].mask; 2485 mask = imask = efx_test_registers[i].mask;
2479 EFX_INVERT_OWORD(imask); 2486 EFX_INVERT_OWORD(imask);
2480 2487
2481 falcon_read(efx, &original, address); 2488 efx_reado(efx, &original, address);
2482 2489
2483 /* bit sweep on and off */ 2490 /* bit sweep on and off */
2484 for (j = 0; j < 128; j++) { 2491 for (j = 0; j < 128; j++) {
@@ -2489,8 +2496,8 @@ int falcon_test_registers(struct efx_nic *efx)
2489 EFX_AND_OWORD(reg, original, mask); 2496 EFX_AND_OWORD(reg, original, mask);
2490 EFX_SET_OWORD32(reg, j, j, 1); 2497 EFX_SET_OWORD32(reg, j, j, 1);
2491 2498
2492 falcon_write(efx, &reg, address); 2499 efx_writeo(efx, &reg, address);
2493 falcon_read(efx, &buf, address); 2500 efx_reado(efx, &buf, address);
2494 2501
2495 if (efx_masked_compare_oword(&reg, &buf, &mask)) 2502 if (efx_masked_compare_oword(&reg, &buf, &mask))
2496 goto fail; 2503 goto fail;
@@ -2499,14 +2506,14 @@ int falcon_test_registers(struct efx_nic *efx)
2499 EFX_OR_OWORD(reg, original, mask); 2506 EFX_OR_OWORD(reg, original, mask);
2500 EFX_SET_OWORD32(reg, j, j, 0); 2507 EFX_SET_OWORD32(reg, j, j, 0);
2501 2508
2502 falcon_write(efx, &reg, address); 2509 efx_writeo(efx, &reg, address);
2503 falcon_read(efx, &buf, address); 2510 efx_reado(efx, &buf, address);
2504 2511
2505 if (efx_masked_compare_oword(&reg, &buf, &mask)) 2512 if (efx_masked_compare_oword(&reg, &buf, &mask))
2506 goto fail; 2513 goto fail;
2507 } 2514 }
2508 2515
2509 falcon_write(efx, &original, address); 2516 efx_writeo(efx, &original, address);
2510 } 2517 }
2511 2518
2512 return 0; 2519 return 0;
@@ -2571,7 +2578,7 @@ int falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
2571 FFE_AB_EXT_PHY_RST_DUR_10240US, 2578 FFE_AB_EXT_PHY_RST_DUR_10240US,
2572 FRF_AB_SWRST, 1); 2579 FRF_AB_SWRST, 1);
2573 } 2580 }
2574 falcon_write(efx, &glb_ctl_reg_ker, FR_AB_GLB_CTL); 2581 efx_writeo(efx, &glb_ctl_reg_ker, FR_AB_GLB_CTL);
2575 2582
2576 EFX_LOG(efx, "waiting for hardware reset\n"); 2583 EFX_LOG(efx, "waiting for hardware reset\n");
2577 schedule_timeout_uninterruptible(HZ / 20); 2584 schedule_timeout_uninterruptible(HZ / 20);
@@ -2596,7 +2603,7 @@ int falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
2596 } 2603 }
2597 2604
2598 /* Assert that reset complete */ 2605 /* Assert that reset complete */
2599 falcon_read(efx, &glb_ctl_reg_ker, FR_AB_GLB_CTL); 2606 efx_reado(efx, &glb_ctl_reg_ker, FR_AB_GLB_CTL);
2600 if (EFX_OWORD_FIELD(glb_ctl_reg_ker, FRF_AB_SWRST) != 0) { 2607 if (EFX_OWORD_FIELD(glb_ctl_reg_ker, FRF_AB_SWRST) != 0) {
2601 rc = -ETIMEDOUT; 2608 rc = -ETIMEDOUT;
2602 EFX_ERR(efx, "timed out waiting for hardware reset\n"); 2609 EFX_ERR(efx, "timed out waiting for hardware reset\n");
@@ -2625,16 +2632,16 @@ static int falcon_reset_sram(struct efx_nic *efx)
2625 int count; 2632 int count;
2626 2633
2627 /* Set the SRAM wake/sleep GPIO appropriately. */ 2634 /* Set the SRAM wake/sleep GPIO appropriately. */
2628 falcon_read(efx, &gpio_cfg_reg_ker, FR_AB_GPIO_CTL); 2635 efx_reado(efx, &gpio_cfg_reg_ker, FR_AB_GPIO_CTL);
2629 EFX_SET_OWORD_FIELD(gpio_cfg_reg_ker, FRF_AB_GPIO1_OEN, 1); 2636 EFX_SET_OWORD_FIELD(gpio_cfg_reg_ker, FRF_AB_GPIO1_OEN, 1);
2630 EFX_SET_OWORD_FIELD(gpio_cfg_reg_ker, FRF_AB_GPIO1_OUT, 1); 2637 EFX_SET_OWORD_FIELD(gpio_cfg_reg_ker, FRF_AB_GPIO1_OUT, 1);
2631 falcon_write(efx, &gpio_cfg_reg_ker, FR_AB_GPIO_CTL); 2638 efx_writeo(efx, &gpio_cfg_reg_ker, FR_AB_GPIO_CTL);
2632 2639
2633 /* Initiate SRAM reset */ 2640 /* Initiate SRAM reset */
2634 EFX_POPULATE_OWORD_2(srm_cfg_reg_ker, 2641 EFX_POPULATE_OWORD_2(srm_cfg_reg_ker,
2635 FRF_AZ_SRM_INIT_EN, 1, 2642 FRF_AZ_SRM_INIT_EN, 1,
2636 FRF_AZ_SRM_NB_SZ, 0); 2643 FRF_AZ_SRM_NB_SZ, 0);
2637 falcon_write(efx, &srm_cfg_reg_ker, FR_AZ_SRM_CFG); 2644 efx_writeo(efx, &srm_cfg_reg_ker, FR_AZ_SRM_CFG);
2638 2645
2639 /* Wait for SRAM reset to complete */ 2646 /* Wait for SRAM reset to complete */
2640 count = 0; 2647 count = 0;
@@ -2645,7 +2652,7 @@ static int falcon_reset_sram(struct efx_nic *efx)
2645 schedule_timeout_uninterruptible(HZ / 50); 2652 schedule_timeout_uninterruptible(HZ / 50);
2646 2653
2647 /* Check for reset complete */ 2654 /* Check for reset complete */
2648 falcon_read(efx, &srm_cfg_reg_ker, FR_AZ_SRM_CFG); 2655 efx_reado(efx, &srm_cfg_reg_ker, FR_AZ_SRM_CFG);
2649 if (!EFX_OWORD_FIELD(srm_cfg_reg_ker, FRF_AZ_SRM_INIT_EN)) { 2656 if (!EFX_OWORD_FIELD(srm_cfg_reg_ker, FRF_AZ_SRM_INIT_EN)) {
2650 EFX_LOG(efx, "SRAM reset complete\n"); 2657 EFX_LOG(efx, "SRAM reset complete\n");
2651 2658
@@ -2771,13 +2778,13 @@ static int falcon_probe_nic_variant(struct efx_nic *efx)
2771 efx_oword_t altera_build; 2778 efx_oword_t altera_build;
2772 efx_oword_t nic_stat; 2779 efx_oword_t nic_stat;
2773 2780
2774 falcon_read(efx, &altera_build, FR_AZ_ALTERA_BUILD); 2781 efx_reado(efx, &altera_build, FR_AZ_ALTERA_BUILD);
2775 if (EFX_OWORD_FIELD(altera_build, FRF_AZ_ALTERA_BUILD_VER)) { 2782 if (EFX_OWORD_FIELD(altera_build, FRF_AZ_ALTERA_BUILD_VER)) {
2776 EFX_ERR(efx, "Falcon FPGA not supported\n"); 2783 EFX_ERR(efx, "Falcon FPGA not supported\n");
2777 return -ENODEV; 2784 return -ENODEV;
2778 } 2785 }
2779 2786
2780 falcon_read(efx, &nic_stat, FR_AB_NIC_STAT); 2787 efx_reado(efx, &nic_stat, FR_AB_NIC_STAT);
2781 2788
2782 switch (falcon_rev(efx)) { 2789 switch (falcon_rev(efx)) {
2783 case FALCON_REV_A0: 2790 case FALCON_REV_A0:
@@ -2812,9 +2819,9 @@ static void falcon_probe_spi_devices(struct efx_nic *efx)
2812 efx_oword_t nic_stat, gpio_ctl, ee_vpd_cfg; 2819 efx_oword_t nic_stat, gpio_ctl, ee_vpd_cfg;
2813 int boot_dev; 2820 int boot_dev;
2814 2821
2815 falcon_read(efx, &gpio_ctl, FR_AB_GPIO_CTL); 2822 efx_reado(efx, &gpio_ctl, FR_AB_GPIO_CTL);
2816 falcon_read(efx, &nic_stat, FR_AB_NIC_STAT); 2823 efx_reado(efx, &nic_stat, FR_AB_NIC_STAT);
2817 falcon_read(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0); 2824 efx_reado(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0);
2818 2825
2819 if (EFX_OWORD_FIELD(gpio_ctl, FRF_AB_GPIO3_PWRUP_VALUE)) { 2826 if (EFX_OWORD_FIELD(gpio_ctl, FRF_AB_GPIO3_PWRUP_VALUE)) {
2820 boot_dev = (EFX_OWORD_FIELD(nic_stat, FRF_AB_SF_PRST) ? 2827 boot_dev = (EFX_OWORD_FIELD(nic_stat, FRF_AB_SF_PRST) ?
@@ -2832,7 +2839,7 @@ static void falcon_probe_spi_devices(struct efx_nic *efx)
2832 FRF_AB_EE_SF_CLOCK_DIV, 7, 2839 FRF_AB_EE_SF_CLOCK_DIV, 7,
2833 /* 125 MHz / 63 ~= 2 MHz */ 2840 /* 125 MHz / 63 ~= 2 MHz */
2834 FRF_AB_EE_EE_CLOCK_DIV, 63); 2841 FRF_AB_EE_EE_CLOCK_DIV, 63);
2835 falcon_write(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0); 2842 efx_writeo(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0);
2836 } 2843 }
2837 2844
2838 if (boot_dev == FFE_AB_SPI_DEVICE_FLASH) 2845 if (boot_dev == FFE_AB_SPI_DEVICE_FLASH)
@@ -2946,7 +2953,7 @@ static void falcon_init_rx_cfg(struct efx_nic *efx)
2946 int data_xoff_thr = rx_xoff_thresh_bytes >> 8; 2953 int data_xoff_thr = rx_xoff_thresh_bytes >> 8;
2947 efx_oword_t reg; 2954 efx_oword_t reg;
2948 2955
2949 falcon_read(efx, &reg, FR_AZ_RX_CFG); 2956 efx_reado(efx, &reg, FR_AZ_RX_CFG);
2950 if (falcon_rev(efx) <= FALCON_REV_A1) { 2957 if (falcon_rev(efx) <= FALCON_REV_A1) {
2951 /* Data FIFO size is 5.5K */ 2958 /* Data FIFO size is 5.5K */
2952 if (data_xon_thr < 0) 2959 if (data_xon_thr < 0)
@@ -2975,7 +2982,7 @@ static void falcon_init_rx_cfg(struct efx_nic *efx)
2975 EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr); 2982 EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr);
2976 EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1); 2983 EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1);
2977 } 2984 }
2978 falcon_write(efx, &reg, FR_AZ_RX_CFG); 2985 efx_writeo(efx, &reg, FR_AZ_RX_CFG);
2979} 2986}
2980 2987
2981/* This call performs hardware-specific global initialisation, such as 2988/* This call performs hardware-specific global initialisation, such as
@@ -2988,15 +2995,15 @@ int falcon_init_nic(struct efx_nic *efx)
2988 int rc; 2995 int rc;
2989 2996
2990 /* Use on-chip SRAM */ 2997 /* Use on-chip SRAM */
2991 falcon_read(efx, &temp, FR_AB_NIC_STAT); 2998 efx_reado(efx, &temp, FR_AB_NIC_STAT);
2992 EFX_SET_OWORD_FIELD(temp, FRF_AB_ONCHIP_SRAM, 1); 2999 EFX_SET_OWORD_FIELD(temp, FRF_AB_ONCHIP_SRAM, 1);
2993 falcon_write(efx, &temp, FR_AB_NIC_STAT); 3000 efx_writeo(efx, &temp, FR_AB_NIC_STAT);
2994 3001
2995 /* Set the source of the GMAC clock */ 3002 /* Set the source of the GMAC clock */
2996 if (falcon_rev(efx) == FALCON_REV_B0) { 3003 if (falcon_rev(efx) == FALCON_REV_B0) {
2997 falcon_read(efx, &temp, FR_AB_GPIO_CTL); 3004 efx_reado(efx, &temp, FR_AB_GPIO_CTL);
2998 EFX_SET_OWORD_FIELD(temp, FRF_AB_USE_NIC_CLK, true); 3005 EFX_SET_OWORD_FIELD(temp, FRF_AB_USE_NIC_CLK, true);
2999 falcon_write(efx, &temp, FR_AB_GPIO_CTL); 3006 efx_writeo(efx, &temp, FR_AB_GPIO_CTL);
3000 } 3007 }
3001 3008
3002 rc = falcon_reset_sram(efx); 3009 rc = falcon_reset_sram(efx);
@@ -3005,31 +3012,31 @@ int falcon_init_nic(struct efx_nic *efx)
3005 3012
3006 /* Set positions of descriptor caches in SRAM. */ 3013 /* Set positions of descriptor caches in SRAM. */
3007 EFX_POPULATE_OWORD_1(temp, FRF_AZ_SRM_TX_DC_BASE_ADR, TX_DC_BASE / 8); 3014 EFX_POPULATE_OWORD_1(temp, FRF_AZ_SRM_TX_DC_BASE_ADR, TX_DC_BASE / 8);
3008 falcon_write(efx, &temp, FR_AZ_SRM_TX_DC_CFG); 3015 efx_writeo(efx, &temp, FR_AZ_SRM_TX_DC_CFG);
3009 EFX_POPULATE_OWORD_1(temp, FRF_AZ_SRM_RX_DC_BASE_ADR, RX_DC_BASE / 8); 3016 EFX_POPULATE_OWORD_1(temp, FRF_AZ_SRM_RX_DC_BASE_ADR, RX_DC_BASE / 8);
3010 falcon_write(efx, &temp, FR_AZ_SRM_RX_DC_CFG); 3017 efx_writeo(efx, &temp, FR_AZ_SRM_RX_DC_CFG);
3011 3018
3012 /* Set TX descriptor cache size. */ 3019 /* Set TX descriptor cache size. */
3013 BUILD_BUG_ON(TX_DC_ENTRIES != (16 << TX_DC_ENTRIES_ORDER)); 3020 BUILD_BUG_ON(TX_DC_ENTRIES != (16 << TX_DC_ENTRIES_ORDER));
3014 EFX_POPULATE_OWORD_1(temp, FRF_AZ_TX_DC_SIZE, TX_DC_ENTRIES_ORDER); 3021 EFX_POPULATE_OWORD_1(temp, FRF_AZ_TX_DC_SIZE, TX_DC_ENTRIES_ORDER);
3015 falcon_write(efx, &temp, FR_AZ_TX_DC_CFG); 3022 efx_writeo(efx, &temp, FR_AZ_TX_DC_CFG);
3016 3023
3017 /* Set RX descriptor cache size. Set low watermark to size-8, as 3024 /* Set RX descriptor cache size. Set low watermark to size-8, as
3018 * this allows most efficient prefetching. 3025 * this allows most efficient prefetching.
3019 */ 3026 */
3020 BUILD_BUG_ON(RX_DC_ENTRIES != (16 << RX_DC_ENTRIES_ORDER)); 3027 BUILD_BUG_ON(RX_DC_ENTRIES != (16 << RX_DC_ENTRIES_ORDER));
3021 EFX_POPULATE_OWORD_1(temp, FRF_AZ_RX_DC_SIZE, RX_DC_ENTRIES_ORDER); 3028 EFX_POPULATE_OWORD_1(temp, FRF_AZ_RX_DC_SIZE, RX_DC_ENTRIES_ORDER);
3022 falcon_write(efx, &temp, FR_AZ_RX_DC_CFG); 3029 efx_writeo(efx, &temp, FR_AZ_RX_DC_CFG);
3023 EFX_POPULATE_OWORD_1(temp, FRF_AZ_RX_DC_PF_LWM, RX_DC_ENTRIES - 8); 3030 EFX_POPULATE_OWORD_1(temp, FRF_AZ_RX_DC_PF_LWM, RX_DC_ENTRIES - 8);
3024 falcon_write(efx, &temp, FR_AZ_RX_DC_PF_WM); 3031 efx_writeo(efx, &temp, FR_AZ_RX_DC_PF_WM);
3025 3032
3026 /* Clear the parity enables on the TX data fifos as 3033 /* Clear the parity enables on the TX data fifos as
3027 * they produce false parity errors because of timing issues 3034 * they produce false parity errors because of timing issues
3028 */ 3035 */
3029 if (EFX_WORKAROUND_5129(efx)) { 3036 if (EFX_WORKAROUND_5129(efx)) {
3030 falcon_read(efx, &temp, FR_AZ_CSR_SPARE); 3037 efx_reado(efx, &temp, FR_AZ_CSR_SPARE);
3031 EFX_SET_OWORD_FIELD(temp, FRF_AB_MEM_PERR_EN_TX_DATA, 0); 3038 EFX_SET_OWORD_FIELD(temp, FRF_AB_MEM_PERR_EN_TX_DATA, 0);
3032 falcon_write(efx, &temp, FR_AZ_CSR_SPARE); 3039 efx_writeo(efx, &temp, FR_AZ_CSR_SPARE);
3033 } 3040 }
3034 3041
3035 /* Enable all the genuinely fatal interrupts. (They are still 3042 /* Enable all the genuinely fatal interrupts. (They are still
@@ -3043,15 +3050,15 @@ int falcon_init_nic(struct efx_nic *efx)
3043 FRF_AZ_RBUF_OWN_INT_KER_EN, 1, 3050 FRF_AZ_RBUF_OWN_INT_KER_EN, 1,
3044 FRF_AZ_TBUF_OWN_INT_KER_EN, 1); 3051 FRF_AZ_TBUF_OWN_INT_KER_EN, 1);
3045 EFX_INVERT_OWORD(temp); 3052 EFX_INVERT_OWORD(temp);
3046 falcon_write(efx, &temp, FR_AZ_FATAL_INTR_KER); 3053 efx_writeo(efx, &temp, FR_AZ_FATAL_INTR_KER);
3047 3054
3048 if (EFX_WORKAROUND_7244(efx)) { 3055 if (EFX_WORKAROUND_7244(efx)) {
3049 falcon_read(efx, &temp, FR_BZ_RX_FILTER_CTL); 3056 efx_reado(efx, &temp, FR_BZ_RX_FILTER_CTL);
3050 EFX_SET_OWORD_FIELD(temp, FRF_BZ_UDP_FULL_SRCH_LIMIT, 8); 3057 EFX_SET_OWORD_FIELD(temp, FRF_BZ_UDP_FULL_SRCH_LIMIT, 8);
3051 EFX_SET_OWORD_FIELD(temp, FRF_BZ_UDP_WILD_SRCH_LIMIT, 8); 3058 EFX_SET_OWORD_FIELD(temp, FRF_BZ_UDP_WILD_SRCH_LIMIT, 8);
3052 EFX_SET_OWORD_FIELD(temp, FRF_BZ_TCP_FULL_SRCH_LIMIT, 8); 3059 EFX_SET_OWORD_FIELD(temp, FRF_BZ_TCP_FULL_SRCH_LIMIT, 8);
3053 EFX_SET_OWORD_FIELD(temp, FRF_BZ_TCP_WILD_SRCH_LIMIT, 8); 3060 EFX_SET_OWORD_FIELD(temp, FRF_BZ_TCP_WILD_SRCH_LIMIT, 8);
3054 falcon_write(efx, &temp, FR_BZ_RX_FILTER_CTL); 3061 efx_writeo(efx, &temp, FR_BZ_RX_FILTER_CTL);
3055 } 3062 }
3056 3063
3057 falcon_setup_rss_indir_table(efx); 3064 falcon_setup_rss_indir_table(efx);
@@ -3060,17 +3067,17 @@ int falcon_init_nic(struct efx_nic *efx)
3060 /* Setup RX. Wait for descriptor is broken and must 3067 /* Setup RX. Wait for descriptor is broken and must
3061 * be disabled. RXDP recovery shouldn't be needed, but is. 3068 * be disabled. RXDP recovery shouldn't be needed, but is.
3062 */ 3069 */
3063 falcon_read(efx, &temp, FR_AA_RX_SELF_RST); 3070 efx_reado(efx, &temp, FR_AA_RX_SELF_RST);
3064 EFX_SET_OWORD_FIELD(temp, FRF_AA_RX_NODESC_WAIT_DIS, 1); 3071 EFX_SET_OWORD_FIELD(temp, FRF_AA_RX_NODESC_WAIT_DIS, 1);
3065 EFX_SET_OWORD_FIELD(temp, FRF_AA_RX_SELF_RST_EN, 1); 3072 EFX_SET_OWORD_FIELD(temp, FRF_AA_RX_SELF_RST_EN, 1);
3066 if (EFX_WORKAROUND_5583(efx)) 3073 if (EFX_WORKAROUND_5583(efx))
3067 EFX_SET_OWORD_FIELD(temp, FRF_AA_RX_ISCSI_DIS, 1); 3074 EFX_SET_OWORD_FIELD(temp, FRF_AA_RX_ISCSI_DIS, 1);
3068 falcon_write(efx, &temp, FR_AA_RX_SELF_RST); 3075 efx_writeo(efx, &temp, FR_AA_RX_SELF_RST);
3069 3076
3070 /* Disable the ugly timer-based TX DMA backoff and allow TX DMA to be 3077 /* Disable the ugly timer-based TX DMA backoff and allow TX DMA to be
3071 * controlled by the RX FIFO fill level. Set arbitration to one pkt/Q. 3078 * controlled by the RX FIFO fill level. Set arbitration to one pkt/Q.
3072 */ 3079 */
3073 falcon_read(efx, &temp, FR_AZ_TX_RESERVED); 3080 efx_reado(efx, &temp, FR_AZ_TX_RESERVED);
3074 EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_RX_SPACER, 0xfe); 3081 EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_RX_SPACER, 0xfe);
3075 EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_RX_SPACER_EN, 1); 3082 EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_RX_SPACER_EN, 1);
3076 EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_ONE_PKT_PER_Q, 1); 3083 EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_ONE_PKT_PER_Q, 1);
@@ -3083,21 +3090,21 @@ int falcon_init_nic(struct efx_nic *efx)
3083 /* Squash TX of packets of 16 bytes or less */ 3090 /* Squash TX of packets of 16 bytes or less */
3084 if (falcon_rev(efx) >= FALCON_REV_B0 && EFX_WORKAROUND_9141(efx)) 3091 if (falcon_rev(efx) >= FALCON_REV_B0 && EFX_WORKAROUND_9141(efx))
3085 EFX_SET_OWORD_FIELD(temp, FRF_BZ_TX_FLUSH_MIN_LEN_EN, 1); 3092 EFX_SET_OWORD_FIELD(temp, FRF_BZ_TX_FLUSH_MIN_LEN_EN, 1);
3086 falcon_write(efx, &temp, FR_AZ_TX_RESERVED); 3093 efx_writeo(efx, &temp, FR_AZ_TX_RESERVED);
3087 3094
3088 /* Do not enable TX_NO_EOP_DISC_EN, since it limits packets to 16 3095 /* Do not enable TX_NO_EOP_DISC_EN, since it limits packets to 16
3089 * descriptors (which is bad). 3096 * descriptors (which is bad).
3090 */ 3097 */
3091 falcon_read(efx, &temp, FR_AZ_TX_CFG); 3098 efx_reado(efx, &temp, FR_AZ_TX_CFG);
3092 EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_NO_EOP_DISC_EN, 0); 3099 EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_NO_EOP_DISC_EN, 0);
3093 falcon_write(efx, &temp, FR_AZ_TX_CFG); 3100 efx_writeo(efx, &temp, FR_AZ_TX_CFG);
3094 3101
3095 falcon_init_rx_cfg(efx); 3102 falcon_init_rx_cfg(efx);
3096 3103
3097 /* Set destination of both TX and RX Flush events */ 3104 /* Set destination of both TX and RX Flush events */
3098 if (falcon_rev(efx) >= FALCON_REV_B0) { 3105 if (falcon_rev(efx) >= FALCON_REV_B0) {
3099 EFX_POPULATE_OWORD_1(temp, FRF_BZ_FLS_EVQ_ID, 0); 3106 EFX_POPULATE_OWORD_1(temp, FRF_BZ_FLS_EVQ_ID, 0);
3100 falcon_write(efx, &temp, FR_BZ_DP_CTRL); 3107 efx_writeo(efx, &temp, FR_BZ_DP_CTRL);
3101 } 3108 }
3102 3109
3103 return 0; 3110 return 0;
@@ -3133,7 +3140,7 @@ void falcon_update_nic_stats(struct efx_nic *efx)
3133{ 3140{
3134 efx_oword_t cnt; 3141 efx_oword_t cnt;
3135 3142
3136 falcon_read(efx, &cnt, FR_AZ_RX_NODESC_DROP); 3143 efx_reado(efx, &cnt, FR_AZ_RX_NODESC_DROP);
3137 efx->n_rx_nodesc_drop_cnt += 3144 efx->n_rx_nodesc_drop_cnt +=
3138 EFX_OWORD_FIELD(cnt, FRF_AB_RX_NODESC_DROP_CNT); 3145 EFX_OWORD_FIELD(cnt, FRF_AB_RX_NODESC_DROP_CNT);
3139} 3146}