Lines Matching defs:portal
33 #define IRQNAME "BMan portal %d"
34 #define MAX_IRQNAME 16 /* big enough for "BMan portal %d" */
84 * Enum values use 3 letter codes. First letter matches the portal mode,
86 * ci == cache-inhibited portal register
87 * ce == cache-enabled portal register
249 struct bman_portal *portal;
258 struct bm_portal *portal = &p->p;
260 u32 is = bm_in(portal, BM_REG_ISR) & p->irq_sources;
266 bm_out(portal, BM_REG_ISR, clear);
304 static int bm_rcr_get_avail(struct bm_portal *portal)
306 struct bm_rcr *rcr = &portal->rcr;
311 static int bm_rcr_get_fill(struct bm_portal *portal)
313 struct bm_rcr *rcr = &portal->rcr;
318 static void bm_rcr_set_ithresh(struct bm_portal *portal, u8 ithresh)
320 struct bm_rcr *rcr = &portal->rcr;
323 bm_out(portal, BM_REG_RCR_ITR, ithresh);
326 static void bm_rcr_cce_prefetch(struct bm_portal *portal)
328 __maybe_unused struct bm_rcr *rcr = &portal->rcr;
331 bm_cl_touch_ro(portal, BM_CL_RCR_CI_CENA);
334 static u8 bm_rcr_cce_update(struct bm_portal *portal)
336 struct bm_rcr *rcr = &portal->rcr;
340 rcr->ci = bm_ce_in(portal, BM_CL_RCR_CI_CENA) & (BM_RCR_SIZE - 1);
341 bm_cl_invalidate(portal, BM_CL_RCR_CI_CENA);
347 static inline struct bm_rcr_entry *bm_rcr_start(struct bm_portal *portal)
349 struct bm_rcr *rcr = &portal->rcr;
361 static inline void bm_rcr_pvb_commit(struct bm_portal *portal, u8 myverb)
363 struct bm_rcr *rcr = &portal->rcr;
380 static int bm_rcr_init(struct bm_portal *portal, enum bm_rcr_pmode pmode,
383 struct bm_rcr *rcr = &portal->rcr;
387 rcr->ring = portal->addr.ce + BM_CL_RCR;
388 rcr->ci = bm_in(portal, BM_REG_RCR_CI_CINH) & (BM_RCR_SIZE - 1);
389 pi = bm_in(portal, BM_REG_RCR_PI_CINH) & (BM_RCR_SIZE - 1);
391 rcr->vbit = (bm_in(portal, BM_REG_RCR_PI_CINH) & BM_RCR_SIZE) ?
395 rcr->ithresh = bm_in(portal, BM_REG_RCR_ITR);
401 cfg = (bm_in(portal, BM_REG_CFG) & 0xffffffe0)
403 bm_out(portal, BM_REG_CFG, cfg);
407 static void bm_rcr_finish(struct bm_portal *portal)
410 struct bm_rcr *rcr = &portal->rcr;
415 i = bm_in(portal, BM_REG_RCR_PI_CINH) & (BM_RCR_SIZE - 1);
419 i = bm_in(portal, BM_REG_RCR_CI_CINH) & (BM_RCR_SIZE - 1);
428 static int bm_mc_init(struct bm_portal *portal)
430 struct bm_mc *mc = &portal->mc;
432 mc->cr = portal->addr.ce + BM_CL_CR;
433 mc->rr = portal->addr.ce + BM_CL_RR0;
443 static void bm_mc_finish(struct bm_portal *portal)
446 struct bm_mc *mc = &portal->mc;
454 static inline struct bm_mc_command *bm_mc_start(struct bm_portal *portal)
456 struct bm_mc *mc = &portal->mc;
466 static inline void bm_mc_commit(struct bm_portal *portal, u8 myverb)
468 struct bm_mc *mc = &portal->mc;
481 static inline union bm_mc_result *bm_mc_result(struct bm_portal *portal)
483 struct bm_mc *mc = &portal->mc;
504 static inline int bm_mc_result_timeout(struct bm_portal *portal,
510 *mcr = bm_mc_result(portal);
519 /* Disable all BSCN interrupts for the portal */
520 static void bm_isr_bscn_disable(struct bm_portal *portal)
522 bm_out(portal, BM_REG_SCN(0), 0);
523 bm_out(portal, BM_REG_SCN(1), 0);
526 static int bman_create_portal(struct bman_portal *portal,
532 p = &portal->p;
534 * prep the low-level portal struct with the mapped addresses from the
557 portal->irq_sources = 0;
560 snprintf(portal->irqname, MAX_IRQNAME, IRQNAME, c->cpu);
561 if (request_irq(c->irq, portal_isr, 0, portal->irqname, portal)) {
576 portal->config = c;
585 free_irq(c->irq, portal);
596 struct bman_portal *portal;
599 portal = &per_cpu(bman_affine_portal, c->cpu);
600 err = bman_create_portal(portal, c);
608 return portal;
816 bman_get_bm_portal_config(const struct bman_portal *portal)
818 return portal->config;