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()
1236 u16 rvu_get_rsrc_mapcount(struct rvu_pfvf *pfvf, int blkaddr) in rvu_get_rsrc_mapcount() argument
1238 switch (blkaddr) { in rvu_get_rsrc_mapcount()
1323 int blkaddr; in rvu_get_blkaddr_from_slot() local
1332 for (blkaddr = BLKADDR_RVUM; blkaddr < BLK_COUNT; blkaddr++) { in rvu_get_blkaddr_from_slot()
1333 block = &rvu->hw->block[blkaddr]; in rvu_get_blkaddr_from_slot()
1336 if (!is_block_implemented(rvu->hw, blkaddr)) in rvu_get_blkaddr_from_slot()
1339 numlfs = rvu_get_rsrc_mapcount(pfvf, blkaddr); in rvu_get_blkaddr_from_slot()
1342 num_blkaddr[nr_blocks] = blkaddr; in rvu_get_blkaddr_from_slot()
1355 blkaddr = -ENODEV; in rvu_get_blkaddr_from_slot()
1360 blkaddr = num_blkaddr[i]; in rvu_get_blkaddr_from_slot()
1367 return blkaddr; in rvu_get_blkaddr_from_slot()
1376 int blkaddr; in rvu_detach_block() local
1378 blkaddr = rvu_get_blkaddr(rvu, blktype, pcifunc); in rvu_detach_block()
1379 if (blkaddr < 0) in rvu_detach_block()
1385 block = &hw->block[blkaddr]; in rvu_detach_block()
1397 rvu_write64(rvu, blkaddr, block->lfcfg_reg | in rvu_detach_block()
1468 int blkaddr = BLKADDR_NIX0, vf; in rvu_get_nix_blkaddr() local
1475 blkaddr = pf->nix_blkaddr; in rvu_get_nix_blkaddr()
1481 blkaddr = (vf & 1) ? BLKADDR_NIX1 : BLKADDR_NIX0; in rvu_get_nix_blkaddr()
1484 blkaddr = BLKADDR_NIX0; in rvu_get_nix_blkaddr()
1489 blkaddr = BLKADDR_NIX1; in rvu_get_nix_blkaddr()
1491 switch (blkaddr) { in rvu_get_nix_blkaddr()
1511 int blkaddr; in rvu_get_attach_blkaddr() local
1515 blkaddr = rvu_get_nix_blkaddr(rvu, pcifunc); in rvu_get_attach_blkaddr()
1520 blkaddr = attach->cpt_blkaddr ? attach->cpt_blkaddr : in rvu_get_attach_blkaddr()
1522 if (blkaddr != BLKADDR_CPT0 && blkaddr != BLKADDR_CPT1) in rvu_get_attach_blkaddr()
1529 if (is_block_implemented(rvu->hw, blkaddr)) in rvu_get_attach_blkaddr()
1530 return blkaddr; in rvu_get_attach_blkaddr()
1542 int blkaddr; in rvu_attach_block() local
1548 blkaddr = rvu_get_attach_blkaddr(rvu, blktype, pcifunc, attach); in rvu_attach_block()
1549 if (blkaddr < 0) in rvu_attach_block()
1552 block = &hw->block[blkaddr]; in rvu_attach_block()
1563 rvu_write64(rvu, blkaddr, block->lfcfg_reg | in rvu_attach_block()
1577 int free_lfs, mappedlfs, blkaddr; in rvu_check_rsrc_availability() local
1596 blkaddr = rvu_get_attach_blkaddr(rvu, BLKTYPE_NIX, in rvu_check_rsrc_availability()
1598 if (blkaddr < 0) in rvu_check_rsrc_availability()
1599 return blkaddr; in rvu_check_rsrc_availability()
1600 block = &hw->block[blkaddr]; in rvu_check_rsrc_availability()
1659 blkaddr = rvu_get_attach_blkaddr(rvu, BLKTYPE_CPT, in rvu_check_rsrc_availability()
1661 if (blkaddr < 0) in rvu_check_rsrc_availability()
1662 return blkaddr; in rvu_check_rsrc_availability()
1663 block = &hw->block[blkaddr]; in rvu_check_rsrc_availability()
1687 int blkaddr, num_lfs; in rvu_attach_from_same_block() local
1689 blkaddr = rvu_get_attach_blkaddr(rvu, blktype, in rvu_attach_from_same_block()
1691 if (blkaddr < 0) in rvu_attach_from_same_block()
1695 blkaddr); in rvu_attach_from_same_block()
1765 int blkaddr, int lf) in rvu_get_msix_offset() argument
1773 if (pfvf->msix_lfmap[vec] == MSIX_BLKLF(blkaddr, lf)) in rvu_get_msix_offset()
1834 int lf, slot, blkaddr; in rvu_mbox_handler_msix_offset() local
1845 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NIX, pcifunc); in rvu_mbox_handler_msix_offset()
1846 if (blkaddr < 0) { in rvu_mbox_handler_msix_offset()
1849 lf = rvu_get_lf(rvu, &hw->block[blkaddr], pcifunc, 0); in rvu_mbox_handler_msix_offset()
1850 rsp->nix_msixoff = rvu_get_msix_offset(rvu, pfvf, blkaddr, lf); in rvu_mbox_handler_msix_offset()
2022 int blkaddr, nixlf; in rvu_mbox_handler_set_vf_perm() local
2039 blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NIX, target); in rvu_mbox_handler_set_vf_perm()
2040 if (blkaddr < 0) in rvu_mbox_handler_set_vf_perm()
2042 nixlf = rvu_get_lf(rvu, &hw->block[blkaddr], in rvu_mbox_handler_set_vf_perm()
2533 static void rvu_blklf_teardown(struct rvu *rvu, u16 pcifunc, u8 blkaddr) in rvu_blklf_teardown() argument
2539 block = &rvu->hw->block[blkaddr]; in rvu_blklf_teardown()