Lines Matching refs:rcr
186 struct bm_rcr rcr; member
294 static inline void rcr_inc(struct bm_rcr *rcr) in rcr_inc() argument
297 struct bm_rcr_entry *partial = rcr->cursor + 1; in rcr_inc()
299 rcr->cursor = rcr_carryclear(partial); in rcr_inc()
300 if (partial != rcr->cursor) in rcr_inc()
301 rcr->vbit ^= BM_RCR_VERB_VBIT; in rcr_inc()
306 struct bm_rcr *rcr = &portal->rcr; in bm_rcr_get_avail() local
308 return rcr->available; in bm_rcr_get_avail()
313 struct bm_rcr *rcr = &portal->rcr; in bm_rcr_get_fill() local
315 return BM_RCR_SIZE - 1 - rcr->available; in bm_rcr_get_fill()
320 struct bm_rcr *rcr = &portal->rcr; in bm_rcr_set_ithresh() local
322 rcr->ithresh = ithresh; in bm_rcr_set_ithresh()
328 __maybe_unused struct bm_rcr *rcr = &portal->rcr; in bm_rcr_cce_prefetch() local
330 DPAA_ASSERT(rcr->cmode == bm_rcr_cce); in bm_rcr_cce_prefetch()
336 struct bm_rcr *rcr = &portal->rcr; in bm_rcr_cce_update() local
337 u8 diff, old_ci = rcr->ci; in bm_rcr_cce_update()
339 DPAA_ASSERT(rcr->cmode == bm_rcr_cce); in bm_rcr_cce_update()
340 rcr->ci = bm_ce_in(portal, BM_CL_RCR_CI_CENA) & (BM_RCR_SIZE - 1); in bm_rcr_cce_update()
342 diff = dpaa_cyc_diff(BM_RCR_SIZE, old_ci, rcr->ci); in bm_rcr_cce_update()
343 rcr->available += diff; in bm_rcr_cce_update()
349 struct bm_rcr *rcr = &portal->rcr; in bm_rcr_start() local
351 DPAA_ASSERT(!rcr->busy); in bm_rcr_start()
352 if (!rcr->available) in bm_rcr_start()
355 rcr->busy = 1; in bm_rcr_start()
357 dpaa_zero(rcr->cursor); in bm_rcr_start()
358 return rcr->cursor; in bm_rcr_start()
363 struct bm_rcr *rcr = &portal->rcr; in bm_rcr_pvb_commit() local
366 DPAA_ASSERT(rcr->busy); in bm_rcr_pvb_commit()
367 DPAA_ASSERT(rcr->pmode == bm_rcr_pvb); in bm_rcr_pvb_commit()
368 DPAA_ASSERT(rcr->available >= 1); in bm_rcr_pvb_commit()
370 rcursor = rcr->cursor; in bm_rcr_pvb_commit()
371 rcursor->_ncw_verb = myverb | rcr->vbit; in bm_rcr_pvb_commit()
373 rcr_inc(rcr); in bm_rcr_pvb_commit()
374 rcr->available--; in bm_rcr_pvb_commit()
376 rcr->busy = 0; in bm_rcr_pvb_commit()
383 struct bm_rcr *rcr = &portal->rcr; in bm_rcr_init() local
387 rcr->ring = portal->addr.ce + BM_CL_RCR; in bm_rcr_init()
388 rcr->ci = bm_in(portal, BM_REG_RCR_CI_CINH) & (BM_RCR_SIZE - 1); in bm_rcr_init()
390 rcr->cursor = rcr->ring + pi; in bm_rcr_init()
391 rcr->vbit = (bm_in(portal, BM_REG_RCR_PI_CINH) & BM_RCR_SIZE) ? in bm_rcr_init()
393 rcr->available = BM_RCR_SIZE - 1 in bm_rcr_init()
394 - dpaa_cyc_diff(BM_RCR_SIZE, rcr->ci, pi); in bm_rcr_init()
395 rcr->ithresh = bm_in(portal, BM_REG_RCR_ITR); in bm_rcr_init()
397 rcr->busy = 0; in bm_rcr_init()
398 rcr->pmode = pmode; in bm_rcr_init()
399 rcr->cmode = cmode; in bm_rcr_init()
410 struct bm_rcr *rcr = &portal->rcr; in bm_rcr_finish() local
413 DPAA_ASSERT(!rcr->busy); in bm_rcr_finish()
416 if (i != rcr_ptr2idx(rcr->cursor)) in bm_rcr_finish()
420 if (i != rcr->ci) in bm_rcr_finish()
422 if (rcr->ci != rcr_ptr2idx(rcr->cursor)) in bm_rcr_finish()