Lines Matching refs:engs
40 if (eng_grp->engs[i].type) { in get_cores_bmap()
42 eng_grp->engs[i].bmap, in get_cores_bmap()
169 struct otx2_cpt_engs_rsvd *engs; in cptx_set_ucode_base() local
181 engs = &eng_grp->engs[i]; in cptx_set_ucode_base()
182 if (!engs->type) in cptx_set_ucode_base()
185 dma_addr = engs->ucode->dma; in cptx_set_ucode_base()
191 for_each_set_bit(bit, engs->bmap, eng_grp->g->engs_num) in cptx_set_ucode_base()
486 if (!eng_grp->engs[i].type) in find_engines_by_type()
489 if (eng_grp->engs[i].type == eng_type) in find_engines_by_type()
490 return &eng_grp->engs[i]; in find_engines_by_type()
498 struct otx2_cpt_engs_rsvd *engs; in eng_grp_has_eng_type() local
500 engs = find_engines_by_type(eng_grp, eng_type); in eng_grp_has_eng_type()
502 return (engs != NULL ? 1 : 0); in eng_grp_has_eng_type()
507 struct otx2_cpt_engs_rsvd *engs, int val) in update_engines_avail_count() argument
509 switch (engs->type) { in update_engines_avail_count()
523 dev_err(dev, "Invalid engine type %d\n", engs->type); in update_engines_avail_count()
531 struct otx2_cpt_engs_rsvd *engs) in update_engines_offset() argument
533 switch (engs->type) { in update_engines_offset()
535 engs->offset = 0; in update_engines_offset()
539 engs->offset = avail->max_se_cnt; in update_engines_offset()
543 engs->offset = avail->max_se_cnt + avail->max_ie_cnt; in update_engines_offset()
547 dev_err(dev, "Invalid engine type %d\n", engs->type); in update_engines_offset()
559 if (!grp->engs[i].type) in release_engines()
562 if (grp->engs[i].count > 0) { in release_engines()
564 &grp->engs[i], in release_engines()
565 grp->engs[i].count); in release_engines()
570 grp->engs[i].type = 0; in release_engines()
571 grp->engs[i].count = 0; in release_engines()
572 grp->engs[i].offset = 0; in release_engines()
573 grp->engs[i].ucode = NULL; in release_engines()
574 bitmap_zero(grp->engs[i].bmap, grp->g->engs_num); in release_engines()
583 struct otx2_cpt_engs_rsvd *engs = NULL; in do_reserve_engines() local
587 if (!grp->engs[i].type) { in do_reserve_engines()
588 engs = &grp->engs[i]; in do_reserve_engines()
593 if (!engs) in do_reserve_engines()
596 engs->type = req_engs->type; in do_reserve_engines()
597 engs->count = req_engs->count; in do_reserve_engines()
599 ret = update_engines_offset(dev, &grp->g->avail, engs); in do_reserve_engines()
603 if (engs->count > 0) { in do_reserve_engines()
604 ret = update_engines_avail_count(dev, &grp->g->avail, engs, in do_reserve_engines()
605 -engs->count); in do_reserve_engines()
741 if (!eng_grp->engs[i].type) in disable_eng_grp()
744 eng_grp->engs[i].ucode = &eng_grp->ucode[0]; in disable_eng_grp()
783 struct otx2_cpt_engines *engs, int engs_cnt) in update_requested_engs() argument
790 engs[i].type); in update_requested_engs()
808 engs[i].count -= mirrored_engs->count; in update_requested_engs()
850 struct otx2_cpt_engs_rsvd *engs, *mirrored_engs; in eng_grp_update_masks() local
856 engs = &eng_grp->engs[i]; in eng_grp_update_masks()
857 if (!engs->type) in eng_grp_update_masks()
859 if (engs->count <= 0) in eng_grp_update_masks()
862 switch (engs->type) { in eng_grp_update_masks()
876 dev_err(dev, "Invalid engine type %d\n", engs->type); in eng_grp_update_masks()
880 cnt = engs->count; in eng_grp_update_masks()
881 WARN_ON(engs->offset + max_cnt > OTX2_CPT_MAX_ENGINES); in eng_grp_update_masks()
883 for (j = engs->offset; j < engs->offset + max_cnt; j++) { in eng_grp_update_masks()
895 bitmap_copy(engs->bmap, tmp_bmap.bits, eng_grp->g->engs_num); in eng_grp_update_masks()
902 engs = &eng_grp->engs[i]; in eng_grp_update_masks()
903 if (!engs->type) in eng_grp_update_masks()
908 engs->type); in eng_grp_update_masks()
909 WARN_ON(!mirrored_engs && engs->count <= 0); in eng_grp_update_masks()
915 if (engs->count < 0) { in eng_grp_update_masks()
918 bitmap_clear(tmp_bmap.bits, bit, -engs->count); in eng_grp_update_masks()
920 bitmap_or(engs->bmap, engs->bmap, tmp_bmap.bits, in eng_grp_update_masks()
963 WARN_ON(!eng_grp->engs[0].type); in update_ucode_ptrs()
964 eng_grp->engs[0].ucode = ucode; in update_ucode_ptrs()
966 if (eng_grp->engs[1].type) { in update_ucode_ptrs()
968 eng_grp->engs[1].ucode = &eng_grp->ucode[1]; in update_ucode_ptrs()
970 eng_grp->engs[1].ucode = ucode; in update_ucode_ptrs()
976 struct otx2_cpt_engines *engs, int ucodes_cnt, in create_engine_group() argument
1010 update_requested_engs(mirrored_eng_grp, engs, ucodes_cnt); in create_engine_group()
1012 ret = reserve_engines(dev, eng_grp, engs, ucodes_cnt); in create_engine_group()
1144 struct otx2_cpt_engines engs[OTX2_CPT_MAX_ETYPES_PER_GRP] = { {0} }; in otx2_cpt_create_eng_grps() local
1172 engs[0].type = OTX2_CPT_SE_TYPES; in otx2_cpt_create_eng_grps()
1173 engs[0].count = eng_grps->avail.max_se_cnt; in otx2_cpt_create_eng_grps()
1175 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in otx2_cpt_create_eng_grps()
1192 engs[0].type = OTX2_CPT_SE_TYPES; in otx2_cpt_create_eng_grps()
1193 engs[0].count = eng_grps->avail.max_se_cnt; in otx2_cpt_create_eng_grps()
1194 engs[1].type = OTX2_CPT_IE_TYPES; in otx2_cpt_create_eng_grps()
1195 engs[1].count = eng_grps->avail.max_ie_cnt; in otx2_cpt_create_eng_grps()
1197 ret = create_engine_group(&pdev->dev, eng_grps, engs, 2, in otx2_cpt_create_eng_grps()
1212 engs[0].type = OTX2_CPT_AE_TYPES; in otx2_cpt_create_eng_grps()
1213 engs[0].count = eng_grps->avail.max_ae_cnt; in otx2_cpt_create_eng_grps()
1215 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in otx2_cpt_create_eng_grps()
1354 kfree(grp->engs[j].bmap); in otx2_cpt_cleanup_eng_grps()
1355 grp->engs[j].bmap = NULL; in otx2_cpt_cleanup_eng_grps()
1390 grp->engs[j].bmap = in otx2_cpt_init_eng_grps()
1393 if (!grp->engs[j].bmap) { in otx2_cpt_init_eng_grps()
1410 struct otx2_cpt_engines engs[OTX2_CPT_MAX_ETYPES_PER_GRP] = { {0} }; in create_eng_caps_discovery_grps() local
1427 engs[0].type = OTX2_CPT_AE_TYPES; in create_eng_caps_discovery_grps()
1428 engs[0].count = 2; in create_eng_caps_discovery_grps()
1430 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in create_eng_caps_discovery_grps()
1441 engs[0].type = OTX2_CPT_SE_TYPES; in create_eng_caps_discovery_grps()
1442 engs[0].count = 2; in create_eng_caps_discovery_grps()
1444 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in create_eng_caps_discovery_grps()
1455 engs[0].type = OTX2_CPT_IE_TYPES; in create_eng_caps_discovery_grps()
1456 engs[0].count = 2; in create_eng_caps_discovery_grps()
1458 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in create_eng_caps_discovery_grps()
1573 struct otx2_cpt_engines engs[OTX2_CPT_MAX_ETYPES_PER_GRP] = { { 0 } }; in otx2_cpt_dl_custom_egrp_create() local
1614 if (kstrtoint(strim(val), 10, &engs[grp_idx].count)) in otx2_cpt_dl_custom_egrp_create()
1616 engs[grp_idx++].type = OTX2_CPT_SE_TYPES; in otx2_cpt_dl_custom_egrp_create()
1629 if (kstrtoint(strim(val), 10, &engs[grp_idx].count)) in otx2_cpt_dl_custom_egrp_create()
1631 engs[grp_idx++].type = OTX2_CPT_AE_TYPES; in otx2_cpt_dl_custom_egrp_create()
1644 if (kstrtoint(strim(val), 10, &engs[grp_idx].count)) in otx2_cpt_dl_custom_egrp_create()
1646 engs[grp_idx++].type = OTX2_CPT_IE_TYPES; in otx2_cpt_dl_custom_egrp_create()
1672 if ((engs[0].type + engs[1].type) != in otx2_cpt_dl_custom_egrp_create()
1678 if (engs[1].type == OTX2_CPT_SE_TYPES) in otx2_cpt_dl_custom_egrp_create()
1679 swap(engs[0], engs[1]); in otx2_cpt_dl_custom_egrp_create()
1702 uc_info[0] = get_ucode(&fw_info, engs[0].type); in otx2_cpt_dl_custom_egrp_create()
1705 get_eng_type_str(engs[0].type)); in otx2_cpt_dl_custom_egrp_create()
1710 uc_info[1] = get_ucode(&fw_info, engs[1].type); in otx2_cpt_dl_custom_egrp_create()
1713 get_eng_type_str(engs[1].type)); in otx2_cpt_dl_custom_egrp_create()
1718 ret = create_engine_group(dev, eng_grps, engs, grp_idx, in otx2_cpt_dl_custom_egrp_create()
1773 struct otx2_cpt_engs_rsvd *engs; in get_engs_info() local
1778 engs = &eng_grp->engs[i]; in get_engs_info()
1779 if (!engs->type) in get_engs_info()
1787 engs->type); in get_engs_info()
1795 mirrored_engs ? engs->count + mirrored_engs->count : in get_engs_info()
1796 engs->count, in get_engs_info()
1797 get_eng_type_str(engs->type)); in get_engs_info()
1802 engs->count <= 0 ? in get_engs_info()
1803 engs->count + mirrored_engs->count : in get_engs_info()
1816 struct otx2_cpt_engs_rsvd *engs; in otx2_cpt_print_uc_dbg_info() local
1846 engs = &grp->engs[j]; in otx2_cpt_print_uc_dbg_info()
1847 if (engs->type) { in otx2_cpt_print_uc_dbg_info()
1853 bitmap_to_arr32(mask, engs->bmap, in otx2_cpt_print_uc_dbg_info()