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