Lines Matching +full:hw +full:- +full:channels
1 // SPDX-License-Identifier: GPL-2.0
30 dev_err(rvu->dev, "Failed to setup lmt map table mapping!!\n"); in lmtst_map_table_ops()
31 return -ENOMEM; in lmtst_map_table_ops()
55 return ((rvu_get_pf(pcifunc) * rvu->hw->total_vfs) + in rvu_get_lmtst_tbl_index()
66 dev_err(rvu->dev, "%s Requested Null address for transulation\n", __func__); in rvu_get_lmtaddr()
67 return -EINVAL; in rvu_get_lmtaddr()
70 mutex_lock(&rvu->rsrc_lock); in rvu_get_lmtaddr()
79 dev_err(rvu->dev, "%s LMTLINE iova transulation failed\n", __func__); in rvu_get_lmtaddr()
84 dev_err(rvu->dev, "%s LMTLINE iova transulation failed err:%llx\n", __func__, val); in rvu_get_lmtaddr()
85 err = -EIO; in rvu_get_lmtaddr()
95 mutex_unlock(&rvu->rsrc_lock); in rvu_get_lmtaddr()
110 dev_err(rvu->dev, in rvu_update_lmtaddr()
120 if (!pfvf->lmt_base_addr) in rvu_update_lmtaddr()
121 pfvf->lmt_base_addr = val; in rvu_update_lmtaddr()
126 dev_err(rvu->dev, in rvu_update_lmtaddr()
138 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in rvu_mbox_handler_lmtst_tbl_setup()
148 if (req->use_local_lmt_region) { in rvu_mbox_handler_lmtst_tbl_setup()
149 err = rvu_get_lmtaddr(rvu, req->hdr.pcifunc, in rvu_mbox_handler_lmtst_tbl_setup()
150 req->lmt_iova, &lmt_addr); in rvu_mbox_handler_lmtst_tbl_setup()
155 err = rvu_update_lmtaddr(rvu, req->hdr.pcifunc, lmt_addr); in rvu_mbox_handler_lmtst_tbl_setup()
166 if (req->base_pcifunc) { in rvu_mbox_handler_lmtst_tbl_setup()
170 pri_tbl_idx = rvu_get_lmtst_tbl_index(rvu, req->base_pcifunc); in rvu_mbox_handler_lmtst_tbl_setup()
176 dev_err(rvu->dev, in rvu_mbox_handler_lmtst_tbl_setup()
185 err = rvu_update_lmtaddr(rvu, req->hdr.pcifunc, val); in rvu_mbox_handler_lmtst_tbl_setup()
194 if (req->sch_ena || req->dis_sched_early_comp || req->dis_line_pref) { in rvu_mbox_handler_lmtst_tbl_setup()
195 tbl_idx = rvu_get_lmtst_tbl_index(rvu, req->hdr.pcifunc); in rvu_mbox_handler_lmtst_tbl_setup()
199 dev_err(rvu->dev, in rvu_mbox_handler_lmtst_tbl_setup()
209 if (!pfvf->lmt_map_ent_w1) in rvu_mbox_handler_lmtst_tbl_setup()
210 pfvf->lmt_map_ent_w1 = val; in rvu_mbox_handler_lmtst_tbl_setup()
213 if (req->dis_sched_early_comp) in rvu_mbox_handler_lmtst_tbl_setup()
214 val |= (req->dis_sched_early_comp << in rvu_mbox_handler_lmtst_tbl_setup()
217 if (req->sch_ena) in rvu_mbox_handler_lmtst_tbl_setup()
218 val |= (req->sch_ena << APR_LMT_MAP_ENT_SCH_ENA_SHIFT) | in rvu_mbox_handler_lmtst_tbl_setup()
219 req->ssow_pf_func; in rvu_mbox_handler_lmtst_tbl_setup()
221 if (req->dis_line_pref) in rvu_mbox_handler_lmtst_tbl_setup()
222 val |= (req->dis_line_pref << in rvu_mbox_handler_lmtst_tbl_setup()
228 dev_err(rvu->dev, in rvu_mbox_handler_lmtst_tbl_setup()
249 if (pfvf->lmt_base_addr || pfvf->lmt_map_ent_w1) { in rvu_reset_lmt_map_tbl()
255 if (pfvf->lmt_base_addr) { in rvu_reset_lmt_map_tbl()
257 &pfvf->lmt_base_addr, in rvu_reset_lmt_map_tbl()
260 dev_err(rvu->dev, in rvu_reset_lmt_map_tbl()
263 pfvf->lmt_base_addr = 0; in rvu_reset_lmt_map_tbl()
268 if (pfvf->lmt_map_ent_w1) { in rvu_reset_lmt_map_tbl()
271 &pfvf->lmt_map_ent_w1, in rvu_reset_lmt_map_tbl()
274 dev_err(rvu->dev, in rvu_reset_lmt_map_tbl()
277 pfvf->lmt_map_ent_w1 = 0; in rvu_reset_lmt_map_tbl()
286 struct rvu_hwinfo *hw = rvu->hw; in rvu_set_channels_base() local
297 hw->cgx = (nix_const >> 12) & 0xFULL; in rvu_set_channels_base()
298 hw->lmac_per_cgx = (nix_const >> 8) & 0xFULL; in rvu_set_channels_base()
299 hw->cgx_links = hw->cgx * hw->lmac_per_cgx; in rvu_set_channels_base()
300 hw->lbk_links = (nix_const >> 24) & 0xFULL; in rvu_set_channels_base()
301 hw->cpt_links = (nix_const >> 44) & 0xFULL; in rvu_set_channels_base()
302 hw->sdp_links = 1; in rvu_set_channels_base()
304 hw->cgx_chan_base = NIX_CHAN_CGX_LMAC_CHX(0, 0, 0); in rvu_set_channels_base()
305 hw->lbk_chan_base = NIX_CHAN_LBK_CHX(0, 0); in rvu_set_channels_base()
306 hw->sdp_chan_base = NIX_CHAN_SDP_CH_START; in rvu_set_channels_base()
308 /* No Programmable channels */ in rvu_set_channels_base()
312 hw->cap.programmable_chans = true; in rvu_set_channels_base()
314 /* If programmable channels are present then configure in rvu_set_channels_base()
315 * channels such that all channel numbers are contiguous in rvu_set_channels_base()
316 * leaving no holes. This way the new CPT channels can be in rvu_set_channels_base()
319 * of a block must be multiple of number of channels in rvu_set_channels_base()
327 sdp_chan_base = hw->lbk_chan_base + hw->lbk_links * nr_lbk_chans; in rvu_set_channels_base()
328 /* Round up base channel to multiple of number of channels */ in rvu_set_channels_base()
329 hw->sdp_chan_base = ALIGN(sdp_chan_base, nr_sdp_chans); in rvu_set_channels_base()
331 cgx_chan_base = hw->sdp_chan_base + hw->sdp_links * nr_sdp_chans; in rvu_set_channels_base()
332 hw->cgx_chan_base = ALIGN(cgx_chan_base, nr_cgx_chans); in rvu_set_channels_base()
334 cpt_chan_base = hw->cgx_chan_base + hw->cgx_links * nr_cgx_chans; in rvu_set_channels_base()
335 hw->cpt_chan_base = ALIGN(cpt_chan_base, nr_cpt_chans); in rvu_set_channels_base()
337 /* Out of 4096 channels start CPT from 2048 so in rvu_set_channels_base()
338 * that MSB for CPT channels is always set in rvu_set_channels_base()
341 hw->cpt_chan_base = NIX_CHAN_CPT_CH_START; in rvu_set_channels_base()
343 dev_err(rvu->dev, in rvu_set_channels_base()
344 "CPT channels could not fit in the range 2048-4095\n"); in rvu_set_channels_base()
345 return -EINVAL; in rvu_set_channels_base()
356 struct rvu_hwinfo *hw = rvu->hw; in __rvu_lbk_set_chans() local
364 cfg |= FIELD_PREP(LBK_LINK_CFG_BASE_MASK, hw->lbk_chan_base); in __rvu_lbk_set_chans()
381 * LBK0 - source NIX0 and destination NIX1 in rvu_lbk_set_channels()
382 * LBK1 - source NIX0 and destination NIX1 in rvu_lbk_set_channels()
383 * LBK2 - source NIX1 and destination NIX0 in rvu_lbk_set_channels()
384 * LBK3 - source NIX1 and destination NIX1 in rvu_lbk_set_channels()
442 struct rvu_hwinfo *hw = rvu->hw; in __rvu_nix_set_channels() local
452 start = hw->cgx_chan_base; in __rvu_nix_set_channels()
453 for (link = 0; link < hw->cgx_links; link++, nix_link++) { in __rvu_nix_set_channels()
462 start = hw->lbk_chan_base; in __rvu_nix_set_channels()
463 for (link = 0; link < hw->lbk_links; link++, nix_link++) { in __rvu_nix_set_channels()
472 start = hw->sdp_chan_base; in __rvu_nix_set_channels()
473 for (link = 0; link < hw->sdp_links; link++, nix_link++) { in __rvu_nix_set_channels()
482 start = hw->cpt_chan_base; in __rvu_nix_set_channels()
483 for (link = 0; link < hw->cpt_links; link++, nix_link++) { in __rvu_nix_set_channels()
511 /* There is no read-only constant register to read in __rvu_rpm_set_channels()
512 * the number of channels for LMAC and it is always 16. in __rvu_rpm_set_channels()
521 struct rvu_hwinfo *hw = rvu->hw; in rvu_rpm_set_channels() local
522 u16 base = hw->cgx_chan_base; in rvu_rpm_set_channels()
525 for (cgx = 0; cgx < rvu->cgx_cnt_max; cgx++) { in rvu_rpm_set_channels()
526 for (lmac = 0; lmac < hw->lmac_per_cgx; lmac++) { in rvu_rpm_set_channels()
535 struct rvu_hwinfo *hw = rvu->hw; in rvu_program_channels() local
537 if (!hw->cap.programmable_chans) in rvu_program_channels()
547 int blkaddr = nix_hw->blkaddr; in rvu_nix_block_cn10k_init()