Lines Matching refs:oct

37 static void cn93_dump_regs(struct octep_device *oct, int qno)  in cn93_dump_regs()  argument
39 struct device *dev = &oct->pdev->dev; in cn93_dump_regs()
44 octep_read_csr64(oct, CN93_SDP_R_IN_INSTR_DBELL(qno))); in cn93_dump_regs()
47 octep_read_csr64(oct, CN93_SDP_R_IN_CONTROL(qno))); in cn93_dump_regs()
50 octep_read_csr64(oct, CN93_SDP_R_IN_ENABLE(qno))); in cn93_dump_regs()
53 octep_read_csr64(oct, CN93_SDP_R_IN_INSTR_BADDR(qno))); in cn93_dump_regs()
56 octep_read_csr64(oct, CN93_SDP_R_IN_INSTR_RSIZE(qno))); in cn93_dump_regs()
59 octep_read_csr64(oct, CN93_SDP_R_IN_CNTS(qno))); in cn93_dump_regs()
62 octep_read_csr64(oct, CN93_SDP_R_IN_INT_LEVELS(qno))); in cn93_dump_regs()
65 octep_read_csr64(oct, CN93_SDP_R_IN_PKT_CNT(qno))); in cn93_dump_regs()
68 octep_read_csr64(oct, CN93_SDP_R_IN_BYTE_CNT(qno))); in cn93_dump_regs()
73 octep_read_csr64(oct, CN93_SDP_R_OUT_SLIST_DBELL(qno))); in cn93_dump_regs()
76 octep_read_csr64(oct, CN93_SDP_R_OUT_CONTROL(qno))); in cn93_dump_regs()
79 octep_read_csr64(oct, CN93_SDP_R_OUT_ENABLE(qno))); in cn93_dump_regs()
82 octep_read_csr64(oct, CN93_SDP_R_OUT_SLIST_BADDR(qno))); in cn93_dump_regs()
85 octep_read_csr64(oct, CN93_SDP_R_OUT_SLIST_RSIZE(qno))); in cn93_dump_regs()
88 octep_read_csr64(oct, CN93_SDP_R_OUT_CNTS(qno))); in cn93_dump_regs()
91 octep_read_csr64(oct, CN93_SDP_R_OUT_INT_LEVELS(qno))); in cn93_dump_regs()
94 octep_read_csr64(oct, CN93_SDP_R_OUT_PKT_CNT(qno))); in cn93_dump_regs()
97 octep_read_csr64(oct, CN93_SDP_R_OUT_BYTE_CNT(qno))); in cn93_dump_regs()
100 octep_read_csr64(oct, CN93_SDP_R_ERR_TYPE(qno))); in cn93_dump_regs()
104 static int cn93_reset_iq(struct octep_device *oct, int q_no) in cn93_reset_iq() argument
106 struct octep_config *conf = oct->conf; in cn93_reset_iq()
109 dev_dbg(&oct->pdev->dev, "Reset PF IQ-%d\n", q_no); in cn93_reset_iq()
115 octep_write_csr64(oct, CN93_SDP_R_IN_ENABLE(q_no), val); in cn93_reset_iq()
118 octep_write_csr64(oct, CN93_SDP_R_IN_CNTS(q_no), val); in cn93_reset_iq()
119 octep_write_csr64(oct, CN93_SDP_R_IN_INT_LEVELS(q_no), val); in cn93_reset_iq()
120 octep_write_csr64(oct, CN93_SDP_R_IN_PKT_CNT(q_no), val); in cn93_reset_iq()
121 octep_write_csr64(oct, CN93_SDP_R_IN_BYTE_CNT(q_no), val); in cn93_reset_iq()
122 octep_write_csr64(oct, CN93_SDP_R_IN_INSTR_BADDR(q_no), val); in cn93_reset_iq()
123 octep_write_csr64(oct, CN93_SDP_R_IN_INSTR_RSIZE(q_no), val); in cn93_reset_iq()
126 octep_write_csr64(oct, CN93_SDP_R_IN_INSTR_DBELL(q_no), val); in cn93_reset_iq()
132 static void cn93_reset_oq(struct octep_device *oct, int q_no) in cn93_reset_oq() argument
136 q_no += CFG_GET_PORTS_PF_SRN(oct->conf); in cn93_reset_oq()
139 octep_write_csr64(oct, CN93_SDP_R_OUT_ENABLE(q_no), val); in cn93_reset_oq()
142 val = octep_read_csr(oct, CN93_SDP_R_OUT_CNTS(q_no)); in cn93_reset_oq()
143 octep_write_csr(oct, CN93_SDP_R_OUT_CNTS(q_no), val); in cn93_reset_oq()
145 octep_write_csr64(oct, CN93_SDP_R_OUT_PKT_CNT(q_no), 0xFFFFFFFFFULL); in cn93_reset_oq()
146 octep_write_csr64(oct, CN93_SDP_R_OUT_SLIST_DBELL(q_no), 0xFFFFFFFF); in cn93_reset_oq()
150 static void octep_reset_io_queues_cn93_pf(struct octep_device *oct) in octep_reset_io_queues_cn93_pf() argument
152 struct pci_dev *pdev = oct->pdev; in octep_reset_io_queues_cn93_pf()
157 for (q = 0; q < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); q++) { in octep_reset_io_queues_cn93_pf()
158 cn93_reset_iq(oct, q); in octep_reset_io_queues_cn93_pf()
159 cn93_reset_oq(oct, q); in octep_reset_io_queues_cn93_pf()
164 static void octep_setup_pci_window_regs_cn93_pf(struct octep_device *oct) in octep_setup_pci_window_regs_cn93_pf() argument
166 u8 __iomem *bar0_pciaddr = oct->mmio[0].hw_addr; in octep_setup_pci_window_regs_cn93_pf()
168 oct->pci_win_regs.pci_win_wr_addr = (u8 __iomem *)(bar0_pciaddr + CN93_SDP_WIN_WR_ADDR64); in octep_setup_pci_window_regs_cn93_pf()
169 oct->pci_win_regs.pci_win_rd_addr = (u8 __iomem *)(bar0_pciaddr + CN93_SDP_WIN_RD_ADDR64); in octep_setup_pci_window_regs_cn93_pf()
170 oct->pci_win_regs.pci_win_wr_data = (u8 __iomem *)(bar0_pciaddr + CN93_SDP_WIN_WR_DATA64); in octep_setup_pci_window_regs_cn93_pf()
171 oct->pci_win_regs.pci_win_rd_data = (u8 __iomem *)(bar0_pciaddr + CN93_SDP_WIN_RD_DATA64); in octep_setup_pci_window_regs_cn93_pf()
175 static void octep_configure_ring_mapping_cn93_pf(struct octep_device *oct) in octep_configure_ring_mapping_cn93_pf() argument
177 struct octep_config *conf = oct->conf; in octep_configure_ring_mapping_cn93_pf()
178 struct pci_dev *pdev = oct->pdev; in octep_configure_ring_mapping_cn93_pf()
179 u64 pf_srn = CFG_GET_PORTS_PF_SRN(oct->conf); in octep_configure_ring_mapping_cn93_pf()
185 if (oct->pcie_port) in octep_configure_ring_mapping_cn93_pf()
188 octep_write_csr64(oct, CN93_SDP_EPVF_RING(pf_srn + q), regval); in octep_configure_ring_mapping_cn93_pf()
190 regval = octep_read_csr64(oct, CN93_SDP_EPVF_RING(pf_srn + q)); in octep_configure_ring_mapping_cn93_pf()
197 static void octep_init_config_cn93_pf(struct octep_device *oct) in octep_init_config_cn93_pf() argument
199 struct octep_config *conf = oct->conf; in octep_init_config_cn93_pf()
200 struct pci_dev *pdev = oct->pdev; in octep_init_config_cn93_pf()
206 val = octep_read_csr64(oct, CN93_SDP_EPF_RINFO); in octep_init_config_cn93_pf()
213 val = octep_read_csr64(oct, CN93_SDP_MAC_PF_RING_CTL(oct->pcie_port)); in octep_init_config_cn93_pf()
237 conf->ctrl_mbox_cfg.barmem_addr = (void __iomem *)oct->mmio[2].hw_addr + (0x400000ull * 7); in octep_init_config_cn93_pf()
241 static void octep_setup_iq_regs_cn93_pf(struct octep_device *oct, int iq_no) in octep_setup_iq_regs_cn93_pf() argument
243 struct octep_iq *iq = oct->iq[iq_no]; in octep_setup_iq_regs_cn93_pf()
247 iq_no += CFG_GET_PORTS_PF_SRN(oct->conf); in octep_setup_iq_regs_cn93_pf()
248 reg_val = octep_read_csr64(oct, CN93_SDP_R_IN_CONTROL(iq_no)); in octep_setup_iq_regs_cn93_pf()
253 reg_val = octep_read_csr64(oct, CN93_SDP_R_IN_CONTROL(iq_no)); in octep_setup_iq_regs_cn93_pf()
260 octep_write_csr64(oct, CN93_SDP_R_IN_CONTROL(iq_no), reg_val); in octep_setup_iq_regs_cn93_pf()
263 octep_write_csr64(oct, CN93_SDP_R_IN_INSTR_BADDR(iq_no), in octep_setup_iq_regs_cn93_pf()
265 octep_write_csr64(oct, CN93_SDP_R_IN_INSTR_RSIZE(iq_no), in octep_setup_iq_regs_cn93_pf()
271 iq->doorbell_reg = oct->mmio[0].hw_addr + in octep_setup_iq_regs_cn93_pf()
273 iq->inst_cnt_reg = oct->mmio[0].hw_addr + in octep_setup_iq_regs_cn93_pf()
275 iq->intr_lvl_reg = oct->mmio[0].hw_addr + in octep_setup_iq_regs_cn93_pf()
283 reg_val = CFG_GET_IQ_INTR_THRESHOLD(oct->conf) & 0xffffffff; in octep_setup_iq_regs_cn93_pf()
284 octep_write_csr64(oct, CN93_SDP_R_IN_INT_LEVELS(iq_no), reg_val); in octep_setup_iq_regs_cn93_pf()
288 static void octep_setup_oq_regs_cn93_pf(struct octep_device *oct, int oq_no) in octep_setup_oq_regs_cn93_pf() argument
293 struct octep_oq *oq = oct->oq[oq_no]; in octep_setup_oq_regs_cn93_pf()
295 oq_no += CFG_GET_PORTS_PF_SRN(oct->conf); in octep_setup_oq_regs_cn93_pf()
296 reg_val = octep_read_csr64(oct, CN93_SDP_R_OUT_CONTROL(oq_no)); in octep_setup_oq_regs_cn93_pf()
301 reg_val = octep_read_csr64(oct, CN93_SDP_R_OUT_CONTROL(oq_no)); in octep_setup_oq_regs_cn93_pf()
316 octep_write_csr64(oct, CN93_SDP_R_OUT_CONTROL(oq_no), reg_val); in octep_setup_oq_regs_cn93_pf()
317 octep_write_csr64(oct, CN93_SDP_R_OUT_SLIST_BADDR(oq_no), in octep_setup_oq_regs_cn93_pf()
319 octep_write_csr64(oct, CN93_SDP_R_OUT_SLIST_RSIZE(oq_no), in octep_setup_oq_regs_cn93_pf()
322 oq_ctl = octep_read_csr64(oct, CN93_SDP_R_OUT_CONTROL(oq_no)); in octep_setup_oq_regs_cn93_pf()
325 octep_write_csr64(oct, CN93_SDP_R_OUT_CONTROL(oq_no), oq_ctl); in octep_setup_oq_regs_cn93_pf()
328 oq->pkts_sent_reg = oct->mmio[0].hw_addr + CN93_SDP_R_OUT_CNTS(oq_no); in octep_setup_oq_regs_cn93_pf()
329 oq->pkts_credit_reg = oct->mmio[0].hw_addr + in octep_setup_oq_regs_cn93_pf()
332 time_threshold = CFG_GET_OQ_INTR_TIME(oct->conf); in octep_setup_oq_regs_cn93_pf()
334 CFG_GET_OQ_INTR_PKT(oct->conf); in octep_setup_oq_regs_cn93_pf()
335 octep_write_csr64(oct, CN93_SDP_R_OUT_INT_LEVELS(oq_no), reg_val); in octep_setup_oq_regs_cn93_pf()
339 static void octep_setup_mbox_regs_cn93_pf(struct octep_device *oct, int q_no) in octep_setup_mbox_regs_cn93_pf() argument
341 struct octep_mbox *mbox = oct->mbox[q_no]; in octep_setup_mbox_regs_cn93_pf()
346 mbox->mbox_int_reg = oct->mmio[0].hw_addr + CN93_SDP_EPF_MBOX_RINT(0); in octep_setup_mbox_regs_cn93_pf()
349 mbox->mbox_write_reg = oct->mmio[0].hw_addr + CN93_SDP_R_MBOX_PF_VF_DATA(q_no); in octep_setup_mbox_regs_cn93_pf()
352 mbox->mbox_read_reg = oct->mmio[0].hw_addr + CN93_SDP_R_MBOX_VF_PF_DATA(q_no); in octep_setup_mbox_regs_cn93_pf()
356 static void cn93_handle_pf_mbox_intr(struct octep_device *oct) in cn93_handle_pf_mbox_intr() argument
360 mbox_int_val = readq(oct->mbox[0]->mbox_int_reg); in cn93_handle_pf_mbox_intr()
362 val = readq(oct->mbox[qno]->mbox_read_reg); in cn93_handle_pf_mbox_intr()
363 dev_dbg(&oct->pdev->dev, in cn93_handle_pf_mbox_intr()
367 writeq(mbox_int_val, oct->mbox[0]->mbox_int_reg); in cn93_handle_pf_mbox_intr()
373 struct octep_device *oct = (struct octep_device *)dev; in octep_non_ioq_intr_handler_cn93_pf() local
374 struct pci_dev *pdev = oct->pdev; in octep_non_ioq_intr_handler_cn93_pf()
379 reg_val = octep_read_csr64(oct, CN93_SDP_EPF_IRERR_RINT); in octep_non_ioq_intr_handler_cn93_pf()
383 octep_write_csr64(oct, CN93_SDP_EPF_IRERR_RINT, reg_val); in octep_non_ioq_intr_handler_cn93_pf()
385 for (i = 0; i < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); i++) { in octep_non_ioq_intr_handler_cn93_pf()
386 reg_val = octep_read_csr64(oct, in octep_non_ioq_intr_handler_cn93_pf()
392 octep_write_csr64(oct, CN93_SDP_R_ERR_TYPE(i), in octep_non_ioq_intr_handler_cn93_pf()
400 reg_val = octep_read_csr64(oct, CN93_SDP_EPF_ORERR_RINT); in octep_non_ioq_intr_handler_cn93_pf()
404 octep_write_csr64(oct, CN93_SDP_EPF_ORERR_RINT, reg_val); in octep_non_ioq_intr_handler_cn93_pf()
405 for (i = 0; i < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); i++) { in octep_non_ioq_intr_handler_cn93_pf()
406 reg_val = octep_read_csr64(oct, CN93_SDP_R_ERR_TYPE(i)); in octep_non_ioq_intr_handler_cn93_pf()
411 octep_write_csr64(oct, CN93_SDP_R_ERR_TYPE(i), in octep_non_ioq_intr_handler_cn93_pf()
420 reg_val = octep_read_csr64(oct, CN93_SDP_EPF_VFIRE_RINT(0)); in octep_non_ioq_intr_handler_cn93_pf()
424 octep_write_csr64(oct, CN93_SDP_EPF_VFIRE_RINT(0), reg_val); in octep_non_ioq_intr_handler_cn93_pf()
429 reg_val = octep_read_csr64(oct, CN93_SDP_EPF_VFORE_RINT(0)); in octep_non_ioq_intr_handler_cn93_pf()
433 octep_write_csr64(oct, CN93_SDP_EPF_VFORE_RINT(0), reg_val); in octep_non_ioq_intr_handler_cn93_pf()
438 reg_val = octep_read_csr64(oct, CN93_SDP_EPF_MBOX_RINT(0)); in octep_non_ioq_intr_handler_cn93_pf()
442 cn93_handle_pf_mbox_intr(oct); in octep_non_ioq_intr_handler_cn93_pf()
447 reg_val = octep_read_csr64(oct, CN93_SDP_EPF_OEI_RINT); in octep_non_ioq_intr_handler_cn93_pf()
451 octep_write_csr64(oct, CN93_SDP_EPF_OEI_RINT, reg_val); in octep_non_ioq_intr_handler_cn93_pf()
452 queue_work(octep_wq, &oct->ctrl_mbox_task); in octep_non_ioq_intr_handler_cn93_pf()
457 reg_val = octep_read_csr64(oct, CN93_SDP_EPF_DMA_RINT); in octep_non_ioq_intr_handler_cn93_pf()
459 octep_write_csr64(oct, CN93_SDP_EPF_DMA_RINT, reg_val); in octep_non_ioq_intr_handler_cn93_pf()
464 reg_val = octep_read_csr64(oct, CN93_SDP_EPF_DMA_VF_RINT(0)); in octep_non_ioq_intr_handler_cn93_pf()
468 octep_write_csr64(oct, CN93_SDP_EPF_DMA_VF_RINT(0), reg_val); in octep_non_ioq_intr_handler_cn93_pf()
473 reg_val = octep_read_csr64(oct, CN93_SDP_EPF_PP_VF_RINT(0)); in octep_non_ioq_intr_handler_cn93_pf()
477 octep_write_csr64(oct, CN93_SDP_EPF_PP_VF_RINT(0), reg_val); in octep_non_ioq_intr_handler_cn93_pf()
482 reg_val = octep_read_csr64(oct, CN93_SDP_EPF_MISC_RINT); in octep_non_ioq_intr_handler_cn93_pf()
486 octep_write_csr64(oct, CN93_SDP_EPF_MISC_RINT, reg_val); in octep_non_ioq_intr_handler_cn93_pf()
506 static int octep_soft_reset_cn93_pf(struct octep_device *oct) in octep_soft_reset_cn93_pf() argument
508 dev_info(&oct->pdev->dev, "CN93XX: Doing soft reset\n"); in octep_soft_reset_cn93_pf()
510 octep_write_csr64(oct, CN93_SDP_WIN_WR_MASK_REG, 0xFF); in octep_soft_reset_cn93_pf()
513 OCTEP_PCI_WIN_WRITE(oct, CN93_RST_CORE_DOMAIN_W1S, 1); in octep_soft_reset_cn93_pf()
517 OCTEP_PCI_WIN_WRITE(oct, CN93_RST_CORE_DOMAIN_W1C, 1); in octep_soft_reset_cn93_pf()
523 static void octep_reinit_regs_cn93_pf(struct octep_device *oct) in octep_reinit_regs_cn93_pf() argument
527 for (i = 0; i < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); i++) in octep_reinit_regs_cn93_pf()
528 oct->hw_ops.setup_iq_regs(oct, i); in octep_reinit_regs_cn93_pf()
530 for (i = 0; i < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); i++) in octep_reinit_regs_cn93_pf()
531 oct->hw_ops.setup_oq_regs(oct, i); in octep_reinit_regs_cn93_pf()
533 oct->hw_ops.enable_interrupts(oct); in octep_reinit_regs_cn93_pf()
534 oct->hw_ops.enable_io_queues(oct); in octep_reinit_regs_cn93_pf()
536 for (i = 0; i < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); i++) in octep_reinit_regs_cn93_pf()
537 writel(oct->oq[i]->max_count, oct->oq[i]->pkts_credit_reg); in octep_reinit_regs_cn93_pf()
541 static void octep_enable_interrupts_cn93_pf(struct octep_device *oct) in octep_enable_interrupts_cn93_pf() argument
546 srn = CFG_GET_PORTS_PF_SRN(oct->conf); in octep_enable_interrupts_cn93_pf()
547 num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); in octep_enable_interrupts_cn93_pf()
552 octep_write_csr64(oct, CN93_SDP_EPF_IRERR_RINT_ENA_W1S, intr_mask); in octep_enable_interrupts_cn93_pf()
553 octep_write_csr64(oct, CN93_SDP_EPF_ORERR_RINT_ENA_W1S, intr_mask); in octep_enable_interrupts_cn93_pf()
554 octep_write_csr64(oct, CN93_SDP_EPF_OEI_RINT_ENA_W1S, -1ULL); in octep_enable_interrupts_cn93_pf()
555 octep_write_csr64(oct, CN93_SDP_EPF_MISC_RINT_ENA_W1S, intr_mask); in octep_enable_interrupts_cn93_pf()
556 octep_write_csr64(oct, CN93_SDP_EPF_DMA_RINT_ENA_W1S, intr_mask); in octep_enable_interrupts_cn93_pf()
560 static void octep_disable_interrupts_cn93_pf(struct octep_device *oct) in octep_disable_interrupts_cn93_pf() argument
565 srn = CFG_GET_PORTS_PF_SRN(oct->conf); in octep_disable_interrupts_cn93_pf()
566 num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); in octep_disable_interrupts_cn93_pf()
571 octep_write_csr64(oct, CN93_SDP_EPF_IRERR_RINT_ENA_W1C, intr_mask); in octep_disable_interrupts_cn93_pf()
572 octep_write_csr64(oct, CN93_SDP_EPF_ORERR_RINT_ENA_W1C, intr_mask); in octep_disable_interrupts_cn93_pf()
573 octep_write_csr64(oct, CN93_SDP_EPF_OEI_RINT_ENA_W1C, -1ULL); in octep_disable_interrupts_cn93_pf()
574 octep_write_csr64(oct, CN93_SDP_EPF_MISC_RINT_ENA_W1C, intr_mask); in octep_disable_interrupts_cn93_pf()
575 octep_write_csr64(oct, CN93_SDP_EPF_DMA_RINT_ENA_W1C, intr_mask); in octep_disable_interrupts_cn93_pf()
593 static void octep_enable_iq_cn93_pf(struct octep_device *oct, int iq_no) in octep_enable_iq_cn93_pf() argument
598 iq_no += CFG_GET_PORTS_PF_SRN(oct->conf); in octep_enable_iq_cn93_pf()
600 octep_write_csr64(oct, CN93_SDP_R_IN_INSTR_DBELL(iq_no), 0xFFFFFFFF); in octep_enable_iq_cn93_pf()
602 while (octep_read_csr64(oct, CN93_SDP_R_IN_INSTR_DBELL(iq_no)) && in octep_enable_iq_cn93_pf()
607 reg_val = octep_read_csr64(oct, CN93_SDP_R_IN_INT_LEVELS(iq_no)); in octep_enable_iq_cn93_pf()
609 octep_write_csr64(oct, CN93_SDP_R_IN_INT_LEVELS(iq_no), reg_val); in octep_enable_iq_cn93_pf()
611 reg_val = octep_read_csr64(oct, CN93_SDP_R_IN_ENABLE(iq_no)); in octep_enable_iq_cn93_pf()
613 octep_write_csr64(oct, CN93_SDP_R_IN_ENABLE(iq_no), reg_val); in octep_enable_iq_cn93_pf()
617 static void octep_enable_oq_cn93_pf(struct octep_device *oct, int oq_no) in octep_enable_oq_cn93_pf() argument
621 oq_no += CFG_GET_PORTS_PF_SRN(oct->conf); in octep_enable_oq_cn93_pf()
623 reg_val = octep_read_csr64(oct, CN93_SDP_R_OUT_INT_LEVELS(oq_no)); in octep_enable_oq_cn93_pf()
625 octep_write_csr64(oct, CN93_SDP_R_OUT_INT_LEVELS(oq_no), reg_val); in octep_enable_oq_cn93_pf()
627 octep_write_csr64(oct, CN93_SDP_R_OUT_SLIST_DBELL(oq_no), 0xFFFFFFFF); in octep_enable_oq_cn93_pf()
629 reg_val = octep_read_csr64(oct, CN93_SDP_R_OUT_ENABLE(oq_no)); in octep_enable_oq_cn93_pf()
631 octep_write_csr64(oct, CN93_SDP_R_OUT_ENABLE(oq_no), reg_val); in octep_enable_oq_cn93_pf()
635 static void octep_enable_io_queues_cn93_pf(struct octep_device *oct) in octep_enable_io_queues_cn93_pf() argument
639 for (q = 0; q < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); q++) { in octep_enable_io_queues_cn93_pf()
640 octep_enable_iq_cn93_pf(oct, q); in octep_enable_io_queues_cn93_pf()
641 octep_enable_oq_cn93_pf(oct, q); in octep_enable_io_queues_cn93_pf()
646 static void octep_disable_iq_cn93_pf(struct octep_device *oct, int iq_no) in octep_disable_iq_cn93_pf() argument
650 iq_no += CFG_GET_PORTS_PF_SRN(oct->conf); in octep_disable_iq_cn93_pf()
652 reg_val = octep_read_csr64(oct, CN93_SDP_R_IN_ENABLE(iq_no)); in octep_disable_iq_cn93_pf()
654 octep_write_csr64(oct, CN93_SDP_R_IN_ENABLE(iq_no), reg_val); in octep_disable_iq_cn93_pf()
658 static void octep_disable_oq_cn93_pf(struct octep_device *oct, int oq_no) in octep_disable_oq_cn93_pf() argument
662 oq_no += CFG_GET_PORTS_PF_SRN(oct->conf); in octep_disable_oq_cn93_pf()
663 reg_val = octep_read_csr64(oct, CN93_SDP_R_OUT_ENABLE(oq_no)); in octep_disable_oq_cn93_pf()
665 octep_write_csr64(oct, CN93_SDP_R_OUT_ENABLE(oq_no), reg_val); in octep_disable_oq_cn93_pf()
669 static void octep_disable_io_queues_cn93_pf(struct octep_device *oct) in octep_disable_io_queues_cn93_pf() argument
673 for (q = 0; q < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); q++) { in octep_disable_io_queues_cn93_pf()
674 octep_disable_iq_cn93_pf(oct, q); in octep_disable_io_queues_cn93_pf()
675 octep_disable_oq_cn93_pf(oct, q); in octep_disable_io_queues_cn93_pf()
680 static void octep_dump_registers_cn93_pf(struct octep_device *oct) in octep_dump_registers_cn93_pf() argument
684 srn = CFG_GET_PORTS_PF_SRN(oct->conf); in octep_dump_registers_cn93_pf()
685 num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); in octep_dump_registers_cn93_pf()
688 cn93_dump_regs(oct, q); in octep_dump_registers_cn93_pf()
702 void octep_device_setup_cn93_pf(struct octep_device *oct) in octep_device_setup_cn93_pf() argument
704 oct->hw_ops.setup_iq_regs = octep_setup_iq_regs_cn93_pf; in octep_device_setup_cn93_pf()
705 oct->hw_ops.setup_oq_regs = octep_setup_oq_regs_cn93_pf; in octep_device_setup_cn93_pf()
706 oct->hw_ops.setup_mbox_regs = octep_setup_mbox_regs_cn93_pf; in octep_device_setup_cn93_pf()
708 oct->hw_ops.non_ioq_intr_handler = octep_non_ioq_intr_handler_cn93_pf; in octep_device_setup_cn93_pf()
709 oct->hw_ops.ioq_intr_handler = octep_ioq_intr_handler_cn93_pf; in octep_device_setup_cn93_pf()
710 oct->hw_ops.soft_reset = octep_soft_reset_cn93_pf; in octep_device_setup_cn93_pf()
711 oct->hw_ops.reinit_regs = octep_reinit_regs_cn93_pf; in octep_device_setup_cn93_pf()
713 oct->hw_ops.enable_interrupts = octep_enable_interrupts_cn93_pf; in octep_device_setup_cn93_pf()
714 oct->hw_ops.disable_interrupts = octep_disable_interrupts_cn93_pf; in octep_device_setup_cn93_pf()
716 oct->hw_ops.update_iq_read_idx = octep_update_iq_read_index_cn93_pf; in octep_device_setup_cn93_pf()
718 oct->hw_ops.enable_iq = octep_enable_iq_cn93_pf; in octep_device_setup_cn93_pf()
719 oct->hw_ops.enable_oq = octep_enable_oq_cn93_pf; in octep_device_setup_cn93_pf()
720 oct->hw_ops.enable_io_queues = octep_enable_io_queues_cn93_pf; in octep_device_setup_cn93_pf()
722 oct->hw_ops.disable_iq = octep_disable_iq_cn93_pf; in octep_device_setup_cn93_pf()
723 oct->hw_ops.disable_oq = octep_disable_oq_cn93_pf; in octep_device_setup_cn93_pf()
724 oct->hw_ops.disable_io_queues = octep_disable_io_queues_cn93_pf; in octep_device_setup_cn93_pf()
725 oct->hw_ops.reset_io_queues = octep_reset_io_queues_cn93_pf; in octep_device_setup_cn93_pf()
727 oct->hw_ops.dump_registers = octep_dump_registers_cn93_pf; in octep_device_setup_cn93_pf()
729 octep_setup_pci_window_regs_cn93_pf(oct); in octep_device_setup_cn93_pf()
731 oct->pcie_port = octep_read_csr64(oct, CN93_SDP_MAC_NUMBER) & 0xff; in octep_device_setup_cn93_pf()
732 dev_info(&oct->pdev->dev, in octep_device_setup_cn93_pf()
733 "Octeon device using PCIE Port %d\n", oct->pcie_port); in octep_device_setup_cn93_pf()
735 octep_init_config_cn93_pf(oct); in octep_device_setup_cn93_pf()
736 octep_configure_ring_mapping_cn93_pf(oct); in octep_device_setup_cn93_pf()