Lines Matching refs:engs
44 if (eng_grp->engs[i].type) { in get_cores_bmap()
46 eng_grp->engs[i].bmap, in get_cores_bmap()
171 struct otx2_cpt_engs_rsvd *engs; in cptx_set_ucode_base() local
183 engs = &eng_grp->engs[i]; in cptx_set_ucode_base()
184 if (!engs->type) in cptx_set_ucode_base()
187 dma_addr = engs->ucode->dma; in cptx_set_ucode_base()
193 for_each_set_bit(bit, engs->bmap, eng_grp->g->engs_num) in cptx_set_ucode_base()
490 if (!eng_grp->engs[i].type) in find_engines_by_type()
493 if (eng_grp->engs[i].type == eng_type) in find_engines_by_type()
494 return &eng_grp->engs[i]; in find_engines_by_type()
502 struct otx2_cpt_engs_rsvd *engs; in eng_grp_has_eng_type() local
504 engs = find_engines_by_type(eng_grp, eng_type); in eng_grp_has_eng_type()
506 return (engs != NULL ? 1 : 0); in eng_grp_has_eng_type()
511 struct otx2_cpt_engs_rsvd *engs, int val) in update_engines_avail_count() argument
513 switch (engs->type) { in update_engines_avail_count()
527 dev_err(dev, "Invalid engine type %d\n", engs->type); in update_engines_avail_count()
535 struct otx2_cpt_engs_rsvd *engs) in update_engines_offset() argument
537 switch (engs->type) { in update_engines_offset()
539 engs->offset = 0; in update_engines_offset()
543 engs->offset = avail->max_se_cnt; in update_engines_offset()
547 engs->offset = avail->max_se_cnt + avail->max_ie_cnt; in update_engines_offset()
551 dev_err(dev, "Invalid engine type %d\n", engs->type); in update_engines_offset()
563 if (!grp->engs[i].type) in release_engines()
566 if (grp->engs[i].count > 0) { in release_engines()
568 &grp->engs[i], in release_engines()
569 grp->engs[i].count); in release_engines()
574 grp->engs[i].type = 0; in release_engines()
575 grp->engs[i].count = 0; in release_engines()
576 grp->engs[i].offset = 0; in release_engines()
577 grp->engs[i].ucode = NULL; in release_engines()
578 bitmap_zero(grp->engs[i].bmap, grp->g->engs_num); in release_engines()
587 struct otx2_cpt_engs_rsvd *engs = NULL; in do_reserve_engines() local
591 if (!grp->engs[i].type) { in do_reserve_engines()
592 engs = &grp->engs[i]; in do_reserve_engines()
597 if (!engs) in do_reserve_engines()
600 engs->type = req_engs->type; in do_reserve_engines()
601 engs->count = req_engs->count; in do_reserve_engines()
603 ret = update_engines_offset(dev, &grp->g->avail, engs); in do_reserve_engines()
607 if (engs->count > 0) { in do_reserve_engines()
608 ret = update_engines_avail_count(dev, &grp->g->avail, engs, in do_reserve_engines()
609 -engs->count); in do_reserve_engines()
745 if (!eng_grp->engs[i].type) in disable_eng_grp()
748 eng_grp->engs[i].ucode = &eng_grp->ucode[0]; in disable_eng_grp()
787 struct otx2_cpt_engines *engs, int engs_cnt) in update_requested_engs() argument
794 engs[i].type); in update_requested_engs()
812 engs[i].count -= mirrored_engs->count; in update_requested_engs()
854 struct otx2_cpt_engs_rsvd *engs, *mirrored_engs; in eng_grp_update_masks() local
860 engs = &eng_grp->engs[i]; in eng_grp_update_masks()
861 if (!engs->type) in eng_grp_update_masks()
863 if (engs->count <= 0) in eng_grp_update_masks()
866 switch (engs->type) { in eng_grp_update_masks()
880 dev_err(dev, "Invalid engine type %d\n", engs->type); in eng_grp_update_masks()
884 cnt = engs->count; in eng_grp_update_masks()
885 WARN_ON(engs->offset + max_cnt > OTX2_CPT_MAX_ENGINES); in eng_grp_update_masks()
887 for (j = engs->offset; j < engs->offset + max_cnt; j++) { in eng_grp_update_masks()
899 bitmap_copy(engs->bmap, tmp_bmap.bits, eng_grp->g->engs_num); in eng_grp_update_masks()
906 engs = &eng_grp->engs[i]; in eng_grp_update_masks()
907 if (!engs->type) in eng_grp_update_masks()
912 engs->type); in eng_grp_update_masks()
913 WARN_ON(!mirrored_engs && engs->count <= 0); in eng_grp_update_masks()
919 if (engs->count < 0) { in eng_grp_update_masks()
922 bitmap_clear(tmp_bmap.bits, bit, -engs->count); in eng_grp_update_masks()
924 bitmap_or(engs->bmap, engs->bmap, tmp_bmap.bits, in eng_grp_update_masks()
967 WARN_ON(!eng_grp->engs[0].type); in update_ucode_ptrs()
968 eng_grp->engs[0].ucode = ucode; in update_ucode_ptrs()
970 if (eng_grp->engs[1].type) { in update_ucode_ptrs()
972 eng_grp->engs[1].ucode = &eng_grp->ucode[1]; in update_ucode_ptrs()
974 eng_grp->engs[1].ucode = ucode; in update_ucode_ptrs()
980 struct otx2_cpt_engines *engs, int ucodes_cnt, in create_engine_group() argument
1014 update_requested_engs(mirrored_eng_grp, engs, ucodes_cnt); in create_engine_group()
1016 ret = reserve_engines(dev, eng_grp, engs, ucodes_cnt); in create_engine_group()
1148 struct otx2_cpt_engines engs[OTX2_CPT_MAX_ETYPES_PER_GRP] = { {0} }; in otx2_cpt_create_eng_grps() local
1176 engs[0].type = OTX2_CPT_SE_TYPES; in otx2_cpt_create_eng_grps()
1177 engs[0].count = eng_grps->avail.max_se_cnt; in otx2_cpt_create_eng_grps()
1179 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in otx2_cpt_create_eng_grps()
1196 engs[0].type = OTX2_CPT_SE_TYPES; in otx2_cpt_create_eng_grps()
1197 engs[0].count = eng_grps->avail.max_se_cnt; in otx2_cpt_create_eng_grps()
1198 engs[1].type = OTX2_CPT_IE_TYPES; in otx2_cpt_create_eng_grps()
1199 engs[1].count = eng_grps->avail.max_ie_cnt; in otx2_cpt_create_eng_grps()
1201 ret = create_engine_group(&pdev->dev, eng_grps, engs, 2, in otx2_cpt_create_eng_grps()
1216 engs[0].type = OTX2_CPT_AE_TYPES; in otx2_cpt_create_eng_grps()
1217 engs[0].count = eng_grps->avail.max_ae_cnt; in otx2_cpt_create_eng_grps()
1219 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in otx2_cpt_create_eng_grps()
1362 kfree(grp->engs[j].bmap); in otx2_cpt_cleanup_eng_grps()
1363 grp->engs[j].bmap = NULL; in otx2_cpt_cleanup_eng_grps()
1398 grp->engs[j].bmap = in otx2_cpt_init_eng_grps()
1401 if (!grp->engs[j].bmap) { in otx2_cpt_init_eng_grps()
1418 struct otx2_cpt_engines engs[OTX2_CPT_MAX_ETYPES_PER_GRP] = { {0} }; in create_eng_caps_discovery_grps() local
1435 engs[0].type = OTX2_CPT_AE_TYPES; in create_eng_caps_discovery_grps()
1436 engs[0].count = 2; in create_eng_caps_discovery_grps()
1438 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in create_eng_caps_discovery_grps()
1449 engs[0].type = OTX2_CPT_SE_TYPES; in create_eng_caps_discovery_grps()
1450 engs[0].count = 2; in create_eng_caps_discovery_grps()
1452 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in create_eng_caps_discovery_grps()
1463 engs[0].type = OTX2_CPT_IE_TYPES; in create_eng_caps_discovery_grps()
1464 engs[0].count = 2; in create_eng_caps_discovery_grps()
1466 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in create_eng_caps_discovery_grps()
1581 struct otx2_cpt_engines engs[OTX2_CPT_MAX_ETYPES_PER_GRP] = { { 0 } }; in otx2_cpt_dl_custom_egrp_create() local
1622 if (kstrtoint(strim(val), 10, &engs[grp_idx].count)) in otx2_cpt_dl_custom_egrp_create()
1624 engs[grp_idx++].type = OTX2_CPT_SE_TYPES; in otx2_cpt_dl_custom_egrp_create()
1637 if (kstrtoint(strim(val), 10, &engs[grp_idx].count)) in otx2_cpt_dl_custom_egrp_create()
1639 engs[grp_idx++].type = OTX2_CPT_AE_TYPES; in otx2_cpt_dl_custom_egrp_create()
1652 if (kstrtoint(strim(val), 10, &engs[grp_idx].count)) in otx2_cpt_dl_custom_egrp_create()
1654 engs[grp_idx++].type = OTX2_CPT_IE_TYPES; in otx2_cpt_dl_custom_egrp_create()
1680 if ((engs[0].type + engs[1].type) != in otx2_cpt_dl_custom_egrp_create()
1686 if (engs[1].type == OTX2_CPT_SE_TYPES) in otx2_cpt_dl_custom_egrp_create()
1687 swap(engs[0], engs[1]); in otx2_cpt_dl_custom_egrp_create()
1711 uc_info[0] = get_ucode(&fw_info, engs[0].type); in otx2_cpt_dl_custom_egrp_create()
1714 get_eng_type_str(engs[0].type)); in otx2_cpt_dl_custom_egrp_create()
1719 uc_info[1] = get_ucode(&fw_info, engs[1].type); in otx2_cpt_dl_custom_egrp_create()
1722 get_eng_type_str(engs[1].type)); in otx2_cpt_dl_custom_egrp_create()
1727 ret = create_engine_group(dev, eng_grps, engs, grp_idx, in otx2_cpt_dl_custom_egrp_create()
1782 struct otx2_cpt_engs_rsvd *engs; in get_engs_info() local
1787 engs = &eng_grp->engs[i]; in get_engs_info()
1788 if (!engs->type) in get_engs_info()
1796 engs->type); in get_engs_info()
1804 mirrored_engs ? engs->count + mirrored_engs->count : in get_engs_info()
1805 engs->count, in get_engs_info()
1806 get_eng_type_str(engs->type)); in get_engs_info()
1811 engs->count <= 0 ? in get_engs_info()
1812 engs->count + mirrored_engs->count : in get_engs_info()
1825 struct otx2_cpt_engs_rsvd *engs; in otx2_cpt_print_uc_dbg_info() local
1855 engs = &grp->engs[j]; in otx2_cpt_print_uc_dbg_info()
1856 if (engs->type) { in otx2_cpt_print_uc_dbg_info()
1862 bitmap_to_arr32(mask, engs->bmap, in otx2_cpt_print_uc_dbg_info()