Lines Matching refs:blkaddr
255 int devnum, blkaddr = -ENODEV; in rvu_get_blkaddr() local
261 blkaddr = BLKADDR_NPC; in rvu_get_blkaddr()
264 blkaddr = BLKADDR_NPA; in rvu_get_blkaddr()
269 blkaddr = BLKADDR_NIX0; in rvu_get_blkaddr()
274 blkaddr = BLKADDR_SSO; in rvu_get_blkaddr()
277 blkaddr = BLKADDR_SSOW; in rvu_get_blkaddr()
280 blkaddr = BLKADDR_TIM; in rvu_get_blkaddr()
285 blkaddr = BLKADDR_CPT0; in rvu_get_blkaddr()
308 blkaddr = BLKADDR_NIX0; in rvu_get_blkaddr()
316 blkaddr = BLKADDR_NIX1; in rvu_get_blkaddr()
324 blkaddr = BLKADDR_CPT0; in rvu_get_blkaddr()
332 blkaddr = BLKADDR_CPT1; in rvu_get_blkaddr()
336 if (is_block_implemented(rvu->hw, blkaddr)) in rvu_get_blkaddr()
337 return blkaddr; in rvu_get_blkaddr()
465 bool is_block_implemented(struct rvu_hwinfo *hw, int blkaddr) in is_block_implemented() argument
469 if (blkaddr < BLKADDR_RVUM || blkaddr >= BLK_COUNT) in is_block_implemented()
472 block = &hw->block[blkaddr]; in is_block_implemented()
518 static void rvu_block_reset(struct rvu *rvu, int blkaddr, u64 rst_reg) in rvu_block_reset() argument
520 struct rvu_block *block = &rvu->hw->block[blkaddr]; in rvu_block_reset()
526 rvu_write64(rvu, blkaddr, rst_reg, BIT_ULL(0)); in rvu_block_reset()
527 err = rvu_poll_reg(rvu, blkaddr, rst_reg, BIT_ULL(63), true); in rvu_block_reset()
529 dev_err(rvu->dev, "HW block:%d reset timeout retrying again\n", blkaddr); in rvu_block_reset()
530 while (rvu_poll_reg(rvu, blkaddr, rst_reg, BIT_ULL(63), true) == -EBUSY) in rvu_block_reset()
842 static int rvu_setup_nix_hw_resource(struct rvu *rvu, int blkaddr) in rvu_setup_nix_hw_resource() argument
850 block = &hw->block[blkaddr]; in rvu_setup_nix_hw_resource()
853 blkid = (blkaddr == BLKADDR_NIX0) ? 0 : 1; in rvu_setup_nix_hw_resource()
854 cfg = rvu_read64(rvu, blkaddr, NIX_AF_CONST2); in rvu_setup_nix_hw_resource()
856 block->addr = blkaddr; in rvu_setup_nix_hw_resource()
867 rvu->nix_blkaddr[blkid] = blkaddr; in rvu_setup_nix_hw_resource()
871 static int rvu_setup_cpt_hw_resource(struct rvu *rvu, int blkaddr) in rvu_setup_cpt_hw_resource() argument
879 block = &hw->block[blkaddr]; in rvu_setup_cpt_hw_resource()
882 blkid = (blkaddr == BLKADDR_CPT0) ? 0 : 1; in rvu_setup_cpt_hw_resource()
883 cfg = rvu_read64(rvu, blkaddr, CPT_AF_CONSTANTS0); in rvu_setup_cpt_hw_resource()
885 block->addr = blkaddr; in rvu_setup_cpt_hw_resource()
1245 u16 rvu_get_rsrc_mapcount(struct rvu_pfvf *pfvf, int blkaddr) in rvu_get_rsrc_mapcount() argument
1247 switch (blkaddr) { in rvu_get_rsrc_mapcount()
1332 int blkaddr; in rvu_get_blkaddr_from_slot() local
1341 for (blkaddr = BLKADDR_RVUM; blkaddr < BLK_COUNT; blkaddr++) { in rvu_get_blkaddr_from_slot()
1342 block = &rvu->hw->block[blkaddr]; in rvu_get_blkaddr_from_slot()
1345 if (!is_block_implemented(rvu->hw, blkaddr)) in rvu_get_blkaddr_from_slot()
1348 numlfs = rvu_get_rsrc_mapcount(pfvf, blkaddr); in rvu_get_blkaddr_from_slot()
1351 num_blkaddr[nr_blocks] = blkaddr; in rvu_get_blkaddr_from_slot()
1364 blkaddr = -ENODEV; in rvu_get_blkaddr_from_slot()
1369 blkaddr = num_blkaddr[i]; in rvu_get_blkaddr_from_slot()
1376 return blkaddr; in rvu_get_blkaddr_from_slot()
1385 int blkaddr; in rvu_detach_block() local
1387 blkaddr = rvu_get_blkaddr(rvu, blktype, pcifunc); in rvu_detach_block()
1388 if (blkaddr < 0) in rvu_detach_block()
1394 block = &hw->block[blkaddr]; in rvu_detach_block()
1406 rvu_write64(rvu, blkaddr, block->lfcfg_reg | in rvu_detach_block()
1477 int blkaddr = BLKADDR_NIX0, vf; in rvu_get_nix_blkaddr() local
1484 blkaddr = pf->nix_blkaddr; in rvu_get_nix_blkaddr()
1490 blkaddr = (vf & 1) ? BLKADDR_NIX1 : BLKADDR_NIX0; in rvu_get_nix_blkaddr()
1493 blkaddr = BLKADDR_NIX0; in rvu_get_nix_blkaddr()
1498 blkaddr = BLKADDR_NIX1; in rvu_get_nix_blkaddr()
1500 switch (blkaddr) { in rvu_get_nix_blkaddr()
1520 int blkaddr; in rvu_get_attach_blkaddr() local
1524 blkaddr = rvu_get_nix_blkaddr(rvu, pcifunc); in rvu_get_attach_blkaddr()
1529 blkaddr = attach->cpt_blkaddr ? attach->cpt_blkaddr : in rvu_get_attach_blkaddr()
1531 if (blkaddr != BLKADDR_CPT0 && blkaddr != BLKADDR_CPT1) in rvu_get_attach_blkaddr()
1538 if (is_block_implemented(rvu->hw, blkaddr)) in rvu_get_attach_blkaddr()
1539 return blkaddr; in rvu_get_attach_blkaddr()
1551 int blkaddr; in rvu_attach_block() local
1557 blkaddr = rvu_get_attach_blkaddr(rvu, blktype, pcifunc, attach); in rvu_attach_block()
1558 if (blkaddr < 0) in rvu_attach_block()
1561 block = &hw->block[blkaddr]; in rvu_attach_block()
1572 rvu_write64(rvu, blkaddr, block->lfcfg_reg | in rvu_attach_block()
1586 int free_lfs, mappedlfs, blkaddr; in rvu_check_rsrc_availability() local
1605 blkaddr = rvu_get_attach_blkaddr(rvu, BLKTYPE_NIX, in rvu_check_rsrc_availability()
1607 if (blkaddr < 0) in rvu_check_rsrc_availability()
1608 return blkaddr; in rvu_check_rsrc_availability()
1609 block = &hw->block[blkaddr]; in rvu_check_rsrc_availability()
1668 blkaddr = rvu_get_attach_blkaddr(rvu, BLKTYPE_CPT, in rvu_check_rsrc_availability()
1670 if (blkaddr < 0) in rvu_check_rsrc_availability()
1671 return blkaddr; in rvu_check_rsrc_availability()
1672 block = &hw->block[blkaddr]; in rvu_check_rsrc_availability()
1696 int blkaddr, num_lfs; in rvu_attach_from_same_block() local
1698 blkaddr = rvu_get_attach_blkaddr(rvu, blktype, in rvu_attach_from_same_block()
1700 if (blkaddr < 0) in rvu_attach_from_same_block()
1704 blkaddr); in rvu_attach_from_same_block()
1774 int blkaddr, int lf) in rvu_get_msix_offset() argument
1782 if (pfvf->msix_lfmap[vec] == MSIX_BLKLF(blkaddr, lf)) in rvu_get_msix_offset()
1843 int lf, slot, blkaddr; in rvu_mbox_handler_msix_offset() local
1854 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NIX, pcifunc); in rvu_mbox_handler_msix_offset()
1855 if (blkaddr < 0) { in rvu_mbox_handler_msix_offset()
1858 lf = rvu_get_lf(rvu, &hw->block[blkaddr], pcifunc, 0); in rvu_mbox_handler_msix_offset()
1859 rsp->nix_msixoff = rvu_get_msix_offset(rvu, pfvf, blkaddr, lf); in rvu_mbox_handler_msix_offset()
2031 int blkaddr, nixlf; in rvu_mbox_handler_set_vf_perm() local
2048 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NIX, target); in rvu_mbox_handler_set_vf_perm()
2049 if (blkaddr < 0) in rvu_mbox_handler_set_vf_perm()
2051 nixlf = rvu_get_lf(rvu, &hw->block[blkaddr], in rvu_mbox_handler_set_vf_perm()
2592 static void rvu_blklf_teardown(struct rvu *rvu, u16 pcifunc, u8 blkaddr) in rvu_blklf_teardown() argument
2598 block = &rvu->hw->block[blkaddr]; in rvu_blklf_teardown()