Lines Matching refs:blkaddr

29 		reg = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_STS(e)); \
44 int blkaddr = block->addr; in cpt_af_flt_intr_handler() local
49 reg = rvu_read64(rvu, blkaddr, CPT_AF_FLTX_INT(vec)); in cpt_af_flt_intr_handler()
65 grp = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_CTL2(eng)) & 0xFF; in cpt_af_flt_intr_handler()
67 rvu_write64(rvu, blkaddr, CPT_AF_EXEX_CTL2(eng), 0x0); in cpt_af_flt_intr_handler()
68 val = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_CTL(eng)); in cpt_af_flt_intr_handler()
69 rvu_write64(rvu, blkaddr, CPT_AF_EXEX_CTL(eng), val & ~1ULL); in cpt_af_flt_intr_handler()
71 rvu_write64(rvu, blkaddr, CPT_AF_EXEX_CTL2(eng), grp); in cpt_af_flt_intr_handler()
72 rvu_write64(rvu, blkaddr, CPT_AF_EXEX_CTL(eng), val | 1ULL); in cpt_af_flt_intr_handler()
76 val = rvu_read64(rvu, blkaddr, CPT_AF_EXEX_STS(eng)); in cpt_af_flt_intr_handler()
82 rvu_write64(rvu, blkaddr, CPT_AF_FLTX_INT(vec), reg); in cpt_af_flt_intr_handler()
106 int blkaddr = block->addr; in rvu_cpt_af_rvu_intr_handler() local
109 reg = rvu_read64(rvu, blkaddr, CPT_AF_RVU_INT); in rvu_cpt_af_rvu_intr_handler()
112 rvu_write64(rvu, blkaddr, CPT_AF_RVU_INT, reg); in rvu_cpt_af_rvu_intr_handler()
120 int blkaddr = block->addr; in rvu_cpt_af_ras_intr_handler() local
123 reg = rvu_read64(rvu, blkaddr, CPT_AF_RAS_INT); in rvu_cpt_af_ras_intr_handler()
126 rvu_write64(rvu, blkaddr, CPT_AF_RAS_INT, reg); in rvu_cpt_af_ras_intr_handler()
152 int blkaddr = block->addr; in cpt_10k_unregister_interrupts() local
156 rvu_write64(rvu, blkaddr, CPT_AF_FLTX_INT_ENA_W1C(0), ~0ULL); in cpt_10k_unregister_interrupts()
157 rvu_write64(rvu, blkaddr, CPT_AF_FLTX_INT_ENA_W1C(1), ~0ULL); in cpt_10k_unregister_interrupts()
158 rvu_write64(rvu, blkaddr, CPT_AF_FLTX_INT_ENA_W1C(2), 0xFFFF); in cpt_10k_unregister_interrupts()
160 rvu_write64(rvu, blkaddr, CPT_AF_RVU_INT_ENA_W1C, 0x1); in cpt_10k_unregister_interrupts()
161 rvu_write64(rvu, blkaddr, CPT_AF_RAS_INT_ENA_W1C, 0x1); in cpt_10k_unregister_interrupts()
170 static void cpt_unregister_interrupts(struct rvu *rvu, int blkaddr) in cpt_unregister_interrupts() argument
176 if (!is_block_implemented(rvu->hw, blkaddr)) in cpt_unregister_interrupts()
178 offs = rvu_read64(rvu, blkaddr, CPT_PRIV_AF_INT_CFG) & 0x7FF; in cpt_unregister_interrupts()
184 block = &hw->block[blkaddr]; in cpt_unregister_interrupts()
190 rvu_write64(rvu, blkaddr, CPT_AF_FLTX_INT_ENA_W1C(i), ~0ULL); in cpt_unregister_interrupts()
191 rvu_write64(rvu, blkaddr, CPT_AF_RVU_INT_ENA_W1C, 0x1); in cpt_unregister_interrupts()
192 rvu_write64(rvu, blkaddr, CPT_AF_RAS_INT_ENA_W1C, 0x1); in cpt_unregister_interrupts()
210 int blkaddr = block->addr; in cpt_10k_register_interrupts() local
233 rvu_write64(rvu, blkaddr, CPT_AF_FLTX_INT_ENA_W1S(i), 0xFFFF); in cpt_10k_register_interrupts()
235 rvu_write64(rvu, blkaddr, CPT_AF_FLTX_INT_ENA_W1S(i), ~0ULL); in cpt_10k_register_interrupts()
243 rvu_write64(rvu, blkaddr, CPT_AF_RVU_INT_ENA_W1S, 0x1); in cpt_10k_register_interrupts()
250 rvu_write64(rvu, blkaddr, CPT_AF_RAS_INT_ENA_W1S, 0x1); in cpt_10k_register_interrupts()
258 static int cpt_register_interrupts(struct rvu *rvu, int blkaddr) in cpt_register_interrupts() argument
265 if (!is_block_implemented(rvu->hw, blkaddr)) in cpt_register_interrupts()
268 block = &hw->block[blkaddr]; in cpt_register_interrupts()
269 offs = rvu_read64(rvu, blkaddr, CPT_PRIV_AF_INT_CFG) & 0x7FF; in cpt_register_interrupts()
293 rvu_write64(rvu, blkaddr, CPT_AF_FLTX_INT_ENA_W1S(i), ~0ULL); in cpt_register_interrupts()
301 rvu_write64(rvu, blkaddr, CPT_AF_RVU_INT_ENA_W1S, 0x1); in cpt_register_interrupts()
308 rvu_write64(rvu, blkaddr, CPT_AF_RAS_INT_ENA_W1S, 0x1); in cpt_register_interrupts()
375 int blkaddr; in validate_and_get_cpt_blkaddr() local
377 blkaddr = req_blkaddr ? req_blkaddr : BLKADDR_CPT0; in validate_and_get_cpt_blkaddr()
378 if (blkaddr != BLKADDR_CPT0 && blkaddr != BLKADDR_CPT1) in validate_and_get_cpt_blkaddr()
381 return blkaddr; in validate_and_get_cpt_blkaddr()
390 int cptlf, blkaddr; in rvu_mbox_handler_cpt_lf_alloc() local
394 blkaddr = validate_and_get_cpt_blkaddr(req->blkaddr); in rvu_mbox_handler_cpt_lf_alloc()
395 if (blkaddr < 0) in rvu_mbox_handler_cpt_lf_alloc()
396 return blkaddr; in rvu_mbox_handler_cpt_lf_alloc()
401 block = &rvu->hw->block[blkaddr]; in rvu_mbox_handler_cpt_lf_alloc()
439 rvu_write64(rvu, blkaddr, CPT_AF_LFX_CTL(cptlf), val); in rvu_mbox_handler_cpt_lf_alloc()
444 val = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL2(cptlf)); in rvu_mbox_handler_cpt_lf_alloc()
448 rvu_write64(rvu, blkaddr, CPT_AF_LFX_CTL2(cptlf), val); in rvu_mbox_handler_cpt_lf_alloc()
454 static int cpt_lf_free(struct rvu *rvu, struct msg_req *req, int blkaddr) in cpt_lf_free() argument
460 block = &rvu->hw->block[blkaddr]; in cpt_lf_free()
472 rvu_cpt_lf_teardown(rvu, pcifunc, blkaddr, cptlf, slot); in cpt_lf_free()
500 static int cpt_inline_ipsec_cfg_inbound(struct rvu *rvu, int blkaddr, u8 cptlf, in cpt_inline_ipsec_cfg_inbound() argument
507 val = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL(cptlf)); in cpt_inline_ipsec_cfg_inbound()
519 nix_sel = (blkaddr == BLKADDR_CPT1) ? 1 : 0; in cpt_inline_ipsec_cfg_inbound()
527 rvu_write64(rvu, blkaddr, CPT_AF_LFX_CTL(cptlf), val); in cpt_inline_ipsec_cfg_inbound()
531 val = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL2(cptlf)); in cpt_inline_ipsec_cfg_inbound()
534 rvu_write64(rvu, blkaddr, CPT_AF_LFX_CTL2(cptlf), val); in cpt_inline_ipsec_cfg_inbound()
538 rvu_write64(rvu, blkaddr, CPT_AF_ECO, 0x1); in cpt_inline_ipsec_cfg_inbound()
547 rvu_write64(rvu, blkaddr, CPT_AF_X2PX_LINK_CFG(0), val); in cpt_inline_ipsec_cfg_inbound()
548 rvu_write64(rvu, blkaddr, CPT_AF_X2PX_LINK_CFG(1), val); in cpt_inline_ipsec_cfg_inbound()
554 static int cpt_inline_ipsec_cfg_outbound(struct rvu *rvu, int blkaddr, u8 cptlf, in cpt_inline_ipsec_cfg_outbound() argument
562 val = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL(cptlf)); in cpt_inline_ipsec_cfg_outbound()
580 rvu_write64(rvu, blkaddr, CPT_AF_LFX_CTL(cptlf), val); in cpt_inline_ipsec_cfg_outbound()
584 val = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL2(cptlf)); in cpt_inline_ipsec_cfg_outbound()
586 rvu_write64(rvu, blkaddr, CPT_AF_LFX_CTL2(cptlf), val); in cpt_inline_ipsec_cfg_outbound()
591 val = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL(cptlf)); in cpt_inline_ipsec_cfg_outbound()
593 rvu_write64(rvu, blkaddr, CPT_AF_LFX_CTL(cptlf), val); in cpt_inline_ipsec_cfg_outbound()
605 int cptlf, blkaddr, ret; in rvu_mbox_handler_cpt_inline_ipsec_cfg() local
608 blkaddr = rvu_get_blkaddr_from_slot(rvu, BLKTYPE_CPT, pcifunc, in rvu_mbox_handler_cpt_inline_ipsec_cfg()
610 if (blkaddr < 0) in rvu_mbox_handler_cpt_inline_ipsec_cfg()
613 block = &rvu->hw->block[blkaddr]; in rvu_mbox_handler_cpt_inline_ipsec_cfg()
621 ret = cpt_inline_ipsec_cfg_inbound(rvu, blkaddr, cptlf, req); in rvu_mbox_handler_cpt_inline_ipsec_cfg()
625 ret = cpt_inline_ipsec_cfg_outbound(rvu, blkaddr, cptlf, req); in rvu_mbox_handler_cpt_inline_ipsec_cfg()
638 int blkaddr, num_lfs, lf; in is_valid_offset() local
642 blkaddr = validate_and_get_cpt_blkaddr(req->blkaddr); in is_valid_offset()
643 if (blkaddr < 0) in is_valid_offset()
653 block = &rvu->hw->block[blkaddr]; in is_valid_offset()
661 lf = rvu_get_lf(rvu, &rvu->hw->block[blkaddr], in is_valid_offset()
699 int blkaddr; in rvu_mbox_handler_cpt_rd_wr_register() local
701 blkaddr = validate_and_get_cpt_blkaddr(req->blkaddr); in rvu_mbox_handler_cpt_rd_wr_register()
702 if (blkaddr < 0) in rvu_mbox_handler_cpt_rd_wr_register()
703 return blkaddr; in rvu_mbox_handler_cpt_rd_wr_register()
718 rvu_write64(rvu, blkaddr, req->reg_offset, req->val); in rvu_mbox_handler_cpt_rd_wr_register()
720 rsp->val = rvu_read64(rvu, blkaddr, req->reg_offset); in rvu_mbox_handler_cpt_rd_wr_register()
725 static void get_ctx_pc(struct rvu *rvu, struct cpt_sts_rsp *rsp, int blkaddr) in get_ctx_pc() argument
730 rsp->ctx_mis_pc = rvu_read64(rvu, blkaddr, CPT_AF_CTX_MIS_PC); in get_ctx_pc()
731 rsp->ctx_hit_pc = rvu_read64(rvu, blkaddr, CPT_AF_CTX_HIT_PC); in get_ctx_pc()
732 rsp->ctx_aop_pc = rvu_read64(rvu, blkaddr, CPT_AF_CTX_AOP_PC); in get_ctx_pc()
733 rsp->ctx_aop_lat_pc = rvu_read64(rvu, blkaddr, in get_ctx_pc()
735 rsp->ctx_ifetch_pc = rvu_read64(rvu, blkaddr, CPT_AF_CTX_IFETCH_PC); in get_ctx_pc()
736 rsp->ctx_ifetch_lat_pc = rvu_read64(rvu, blkaddr, in get_ctx_pc()
738 rsp->ctx_ffetch_pc = rvu_read64(rvu, blkaddr, CPT_AF_CTX_FFETCH_PC); in get_ctx_pc()
739 rsp->ctx_ffetch_lat_pc = rvu_read64(rvu, blkaddr, in get_ctx_pc()
741 rsp->ctx_wback_pc = rvu_read64(rvu, blkaddr, CPT_AF_CTX_FFETCH_PC); in get_ctx_pc()
742 rsp->ctx_wback_lat_pc = rvu_read64(rvu, blkaddr, in get_ctx_pc()
744 rsp->ctx_psh_pc = rvu_read64(rvu, blkaddr, CPT_AF_CTX_FFETCH_PC); in get_ctx_pc()
745 rsp->ctx_psh_lat_pc = rvu_read64(rvu, blkaddr, in get_ctx_pc()
747 rsp->ctx_err = rvu_read64(rvu, blkaddr, CPT_AF_CTX_ERR); in get_ctx_pc()
748 rsp->ctx_enc_id = rvu_read64(rvu, blkaddr, CPT_AF_CTX_ENC_ID); in get_ctx_pc()
749 rsp->ctx_flush_timer = rvu_read64(rvu, blkaddr, CPT_AF_CTX_FLUSH_TIMER); in get_ctx_pc()
751 rsp->rxc_time = rvu_read64(rvu, blkaddr, CPT_AF_RXC_TIME); in get_ctx_pc()
752 rsp->rxc_time_cfg = rvu_read64(rvu, blkaddr, CPT_AF_RXC_TIME_CFG); in get_ctx_pc()
753 rsp->rxc_active_sts = rvu_read64(rvu, blkaddr, CPT_AF_RXC_ACTIVE_STS); in get_ctx_pc()
754 rsp->rxc_zombie_sts = rvu_read64(rvu, blkaddr, CPT_AF_RXC_ZOMBIE_STS); in get_ctx_pc()
755 rsp->rxc_dfrg = rvu_read64(rvu, blkaddr, CPT_AF_RXC_DFRG); in get_ctx_pc()
756 rsp->x2p_link_cfg0 = rvu_read64(rvu, blkaddr, CPT_AF_X2PX_LINK_CFG(0)); in get_ctx_pc()
757 rsp->x2p_link_cfg1 = rvu_read64(rvu, blkaddr, CPT_AF_X2PX_LINK_CFG(1)); in get_ctx_pc()
760 static void get_eng_sts(struct rvu *rvu, struct cpt_sts_rsp *rsp, int blkaddr) in get_eng_sts() argument
766 reg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS1); in get_eng_sts()
788 int blkaddr; in rvu_mbox_handler_cpt_sts() local
790 blkaddr = validate_and_get_cpt_blkaddr(req->blkaddr); in rvu_mbox_handler_cpt_sts()
791 if (blkaddr < 0) in rvu_mbox_handler_cpt_sts()
792 return blkaddr; in rvu_mbox_handler_cpt_sts()
799 get_ctx_pc(rvu, rsp, blkaddr); in rvu_mbox_handler_cpt_sts()
802 get_eng_sts(rvu, rsp, blkaddr); in rvu_mbox_handler_cpt_sts()
805 rsp->inst_req_pc = rvu_read64(rvu, blkaddr, CPT_AF_INST_REQ_PC); in rvu_mbox_handler_cpt_sts()
806 rsp->inst_lat_pc = rvu_read64(rvu, blkaddr, CPT_AF_INST_LATENCY_PC); in rvu_mbox_handler_cpt_sts()
807 rsp->rd_req_pc = rvu_read64(rvu, blkaddr, CPT_AF_RD_REQ_PC); in rvu_mbox_handler_cpt_sts()
808 rsp->rd_lat_pc = rvu_read64(rvu, blkaddr, CPT_AF_RD_LATENCY_PC); in rvu_mbox_handler_cpt_sts()
809 rsp->rd_uc_pc = rvu_read64(rvu, blkaddr, CPT_AF_RD_UC_PC); in rvu_mbox_handler_cpt_sts()
810 rsp->active_cycles_pc = rvu_read64(rvu, blkaddr, in rvu_mbox_handler_cpt_sts()
812 rsp->exe_err_info = rvu_read64(rvu, blkaddr, CPT_AF_EXE_ERR_INFO); in rvu_mbox_handler_cpt_sts()
813 rsp->cptclk_cnt = rvu_read64(rvu, blkaddr, CPT_AF_CPTCLK_CNT); in rvu_mbox_handler_cpt_sts()
814 rsp->diag = rvu_read64(rvu, blkaddr, CPT_AF_DIAG); in rvu_mbox_handler_cpt_sts()
827 int blkaddr, struct cpt_rxc_time_cfg_req *save) in cpt_rxc_time_cfg() argument
833 dfrg_reg = rvu_read64(rvu, blkaddr, CPT_AF_RXC_DFRG); in cpt_rxc_time_cfg()
839 save->step = rvu_read64(rvu, blkaddr, CPT_AF_RXC_TIME_CFG); in cpt_rxc_time_cfg()
847 rvu_write64(rvu, blkaddr, CPT_AF_RXC_TIME_CFG, req->step); in cpt_rxc_time_cfg()
848 rvu_write64(rvu, blkaddr, CPT_AF_RXC_DFRG, dfrg_reg); in cpt_rxc_time_cfg()
855 int blkaddr; in rvu_mbox_handler_cpt_rxc_time_cfg() local
857 blkaddr = validate_and_get_cpt_blkaddr(req->blkaddr); in rvu_mbox_handler_cpt_rxc_time_cfg()
858 if (blkaddr < 0) in rvu_mbox_handler_cpt_rxc_time_cfg()
859 return blkaddr; in rvu_mbox_handler_cpt_rxc_time_cfg()
866 cpt_rxc_time_cfg(rvu, req, blkaddr, NULL); in rvu_mbox_handler_cpt_rxc_time_cfg()
882 int cptlf, blkaddr, ret; in rvu_mbox_handler_cpt_lf_reset() local
886 blkaddr = rvu_get_blkaddr_from_slot(rvu, BLKTYPE_CPT, pcifunc, in rvu_mbox_handler_cpt_lf_reset()
888 if (blkaddr < 0) in rvu_mbox_handler_cpt_lf_reset()
891 block = &rvu->hw->block[blkaddr]; in rvu_mbox_handler_cpt_lf_reset()
896 ctl = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL(cptlf)); in rvu_mbox_handler_cpt_lf_reset()
897 ctl2 = rvu_read64(rvu, blkaddr, CPT_AF_LFX_CTL2(cptlf)); in rvu_mbox_handler_cpt_lf_reset()
904 rvu_write64(rvu, blkaddr, CPT_AF_LFX_CTL(cptlf), ctl); in rvu_mbox_handler_cpt_lf_reset()
905 rvu_write64(rvu, blkaddr, CPT_AF_LFX_CTL2(cptlf), ctl2); in rvu_mbox_handler_cpt_lf_reset()
915 int blkaddr, vec; in rvu_mbox_handler_cpt_flt_eng_info() local
917 blkaddr = validate_and_get_cpt_blkaddr(req->blkaddr); in rvu_mbox_handler_cpt_flt_eng_info()
918 if (blkaddr < 0) in rvu_mbox_handler_cpt_flt_eng_info()
919 return blkaddr; in rvu_mbox_handler_cpt_flt_eng_info()
921 block = &rvu->hw->block[blkaddr]; in rvu_mbox_handler_cpt_flt_eng_info()
935 static void cpt_rxc_teardown(struct rvu *rvu, int blkaddr) in cpt_rxc_teardown() argument
953 cpt_rxc_time_cfg(rvu, &req, blkaddr, &prev); in cpt_rxc_teardown()
956 reg = rvu_read64(rvu, blkaddr, CPT_AF_RXC_ACTIVE_STS); in cpt_rxc_teardown()
969 reg = rvu_read64(rvu, blkaddr, CPT_AF_RXC_ZOMBIE_STS); in cpt_rxc_teardown()
981 cpt_rxc_time_cfg(rvu, &prev, blkaddr, NULL); in cpt_rxc_teardown()
991 static void cpt_lf_disable_iqueue(struct rvu *rvu, int blkaddr, int slot) in cpt_lf_disable_iqueue() argument
999 rvu_write64(rvu, blkaddr, CPT_AF_BAR2_ALIASX(slot, CPT_LF_CTL), 0x0); in cpt_lf_disable_iqueue()
1001 inprog = rvu_read64(rvu, blkaddr, in cpt_lf_disable_iqueue()
1004 rvu_write64(rvu, blkaddr, in cpt_lf_disable_iqueue()
1007 qsize = rvu_read64(rvu, blkaddr, in cpt_lf_disable_iqueue()
1010 inst_ptr = rvu_read64(rvu, blkaddr, in cpt_lf_disable_iqueue()
1025 inprog = rvu_read64(rvu, blkaddr, in cpt_lf_disable_iqueue()
1043 int rvu_cpt_lf_teardown(struct rvu *rvu, u16 pcifunc, int blkaddr, int lf, int slot) in rvu_cpt_lf_teardown() argument
1048 cpt_rxc_teardown(rvu, blkaddr); in rvu_cpt_lf_teardown()
1053 rvu_bar2_sel_write64(rvu, blkaddr, CPT_AF_BAR2_SEL, reg); in rvu_cpt_lf_teardown()
1055 cpt_lf_disable_iqueue(rvu, blkaddr, slot); in rvu_cpt_lf_teardown()
1057 rvu_bar2_sel_write64(rvu, blkaddr, CPT_AF_BAR2_SEL, 0); in rvu_cpt_lf_teardown()
1066 static int cpt_inline_inb_lf_cmd_send(struct rvu *rvu, int blkaddr, in cpt_inline_inb_lf_cmd_send() argument
1120 cpt_idx = (blkaddr == BLKADDR_CPT0) ? 0 : 1; in cpt_inline_inb_lf_cmd_send()
1154 int nix_blkaddr, blkaddr; in rvu_cpt_ctx_flush() local
1167 blkaddr = (nix_blkaddr == BLKADDR_NIX1) ? BLKADDR_CPT1 : BLKADDR_CPT0; in rvu_cpt_ctx_flush()
1172 rc = cpt_inline_inb_lf_cmd_send(rvu, blkaddr, nix_blkaddr); in rvu_cpt_ctx_flush()
1177 cpt_rxc_teardown(rvu, blkaddr); in rvu_cpt_ctx_flush()
1179 reg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS0); in rvu_cpt_ctx_flush()
1185 blkaddr); in rvu_cpt_ctx_flush()
1193 rvu_bar2_sel_write64(rvu, blkaddr, CPT_AF_BAR2_SEL, reg); in rvu_cpt_ctx_flush()
1196 cam_data = rvu_read64(rvu, blkaddr, CPT_AF_CTX_CAM_DATA(i)); in rvu_cpt_ctx_flush()
1201 rvu_write64(rvu, blkaddr, in rvu_cpt_ctx_flush()
1206 rvu_bar2_sel_write64(rvu, blkaddr, CPT_AF_BAR2_SEL, 0); in rvu_cpt_ctx_flush()