Lines Matching refs:portal
402 static inline int qm_eqcr_init(struct qm_portal *portal, in qm_eqcr_init() argument
407 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_init()
411 eqcr->ring = portal->addr.ce + QM_CL_EQCR; in qm_eqcr_init()
412 eqcr->ci = qm_in(portal, QM_REG_EQCR_CI_CINH) & (QM_EQCR_SIZE - 1); in qm_eqcr_init()
413 qm_cl_invalidate(portal, QM_CL_EQCR_CI_CENA); in qm_eqcr_init()
414 pi = qm_in(portal, QM_REG_EQCR_PI_CINH) & (QM_EQCR_SIZE - 1); in qm_eqcr_init()
416 eqcr->vbit = (qm_in(portal, QM_REG_EQCR_PI_CINH) & QM_EQCR_SIZE) ? in qm_eqcr_init()
420 eqcr->ithresh = qm_in(portal, QM_REG_EQCR_ITR); in qm_eqcr_init()
425 cfg = (qm_in(portal, QM_REG_CFG) & 0x00ffffff) | in qm_eqcr_init()
429 qm_out(portal, QM_REG_CFG, cfg); in qm_eqcr_init()
433 static inline unsigned int qm_eqcr_get_ci_stashing(struct qm_portal *portal) in qm_eqcr_get_ci_stashing() argument
435 return (qm_in(portal, QM_REG_CFG) >> 28) & 0x7; in qm_eqcr_get_ci_stashing()
438 static inline void qm_eqcr_finish(struct qm_portal *portal) in qm_eqcr_finish() argument
440 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_finish()
441 u8 pi = qm_in(portal, QM_REG_EQCR_PI_CINH) & (QM_EQCR_SIZE - 1); in qm_eqcr_finish()
442 u8 ci = qm_in(portal, QM_REG_EQCR_CI_CINH) & (QM_EQCR_SIZE - 1); in qm_eqcr_finish()
454 *portal) in qm_eqcr_start_no_stash()
456 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_start_no_stash()
470 *portal) in qm_eqcr_start_stash()
472 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_start_stash()
478 eqcr->ci = qm_ce_in(portal, QM_CL_EQCR_CI_CENA) & in qm_eqcr_start_stash()
500 static inline void qm_eqcr_pvb_commit(struct qm_portal *portal, u8 myverb) in qm_eqcr_pvb_commit() argument
502 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_pvb_commit()
518 static inline void qm_eqcr_cce_prefetch(struct qm_portal *portal) in qm_eqcr_cce_prefetch() argument
520 qm_cl_touch_ro(portal, QM_CL_EQCR_CI_CENA); in qm_eqcr_cce_prefetch()
523 static inline u8 qm_eqcr_cce_update(struct qm_portal *portal) in qm_eqcr_cce_update() argument
525 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_cce_update()
528 eqcr->ci = qm_ce_in(portal, QM_CL_EQCR_CI_CENA) & (QM_EQCR_SIZE - 1); in qm_eqcr_cce_update()
529 qm_cl_invalidate(portal, QM_CL_EQCR_CI_CENA); in qm_eqcr_cce_update()
535 static inline void qm_eqcr_set_ithresh(struct qm_portal *portal, u8 ithresh) in qm_eqcr_set_ithresh() argument
537 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_set_ithresh()
540 qm_out(portal, QM_REG_EQCR_ITR, ithresh); in qm_eqcr_set_ithresh()
543 static inline u8 qm_eqcr_get_avail(struct qm_portal *portal) in qm_eqcr_get_avail() argument
545 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_get_avail()
550 static inline u8 qm_eqcr_get_fill(struct qm_portal *portal) in qm_eqcr_get_fill() argument
552 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_get_fill()
582 static inline void qm_dqrr_set_maxfill(struct qm_portal *portal, u8 mf) in qm_dqrr_set_maxfill() argument
584 qm_out(portal, QM_REG_CFG, (qm_in(portal, QM_REG_CFG) & 0xff0fffff) | in qm_dqrr_set_maxfill()
588 static inline int qm_dqrr_init(struct qm_portal *portal, in qm_dqrr_init() argument
594 struct qm_dqrr *dqrr = &portal->dqrr; in qm_dqrr_init()
598 qm_out(portal, QM_REG_DQRR_SDQCR, 0); in qm_dqrr_init()
599 qm_out(portal, QM_REG_DQRR_VDQCR, 0); in qm_dqrr_init()
600 qm_out(portal, QM_REG_DQRR_PDQCR, 0); in qm_dqrr_init()
601 dqrr->ring = portal->addr.ce + QM_CL_DQRR; in qm_dqrr_init()
602 dqrr->pi = qm_in(portal, QM_REG_DQRR_PI_CINH) & (QM_DQRR_SIZE - 1); in qm_dqrr_init()
603 dqrr->ci = qm_in(portal, QM_REG_DQRR_CI_CINH) & (QM_DQRR_SIZE - 1); in qm_dqrr_init()
606 dqrr->vbit = (qm_in(portal, QM_REG_DQRR_PI_CINH) & QM_DQRR_SIZE) ? in qm_dqrr_init()
608 dqrr->ithresh = qm_in(portal, QM_REG_DQRR_ITR); in qm_dqrr_init()
617 cfg = (qm_in(portal, QM_REG_CFG) & 0xff000f00) | in qm_dqrr_init()
624 qm_out(portal, QM_REG_CFG, cfg); in qm_dqrr_init()
625 qm_dqrr_set_maxfill(portal, max_fill); in qm_dqrr_init()
629 static inline void qm_dqrr_finish(struct qm_portal *portal) in qm_dqrr_finish() argument
632 struct qm_dqrr *dqrr = &portal->dqrr; in qm_dqrr_finish()
641 struct qm_portal *portal) in qm_dqrr_current() argument
643 struct qm_dqrr *dqrr = &portal->dqrr; in qm_dqrr_current()
650 static inline u8 qm_dqrr_next(struct qm_portal *portal) in qm_dqrr_next() argument
652 struct qm_dqrr *dqrr = &portal->dqrr; in qm_dqrr_next()
659 static inline void qm_dqrr_pvb_update(struct qm_portal *portal) in qm_dqrr_pvb_update() argument
661 struct qm_dqrr *dqrr = &portal->dqrr; in qm_dqrr_pvb_update()
684 static inline void qm_dqrr_cdc_consume_1ptr(struct qm_portal *portal, in qm_dqrr_cdc_consume_1ptr() argument
688 __maybe_unused struct qm_dqrr *dqrr = &portal->dqrr; in qm_dqrr_cdc_consume_1ptr()
694 qm_out(portal, QM_REG_DQRR_DCAP, (0 << 8) | /* DQRR_DCAP::S */ in qm_dqrr_cdc_consume_1ptr()
699 static inline void qm_dqrr_cdc_consume_n(struct qm_portal *portal, u32 bitmask) in qm_dqrr_cdc_consume_n() argument
701 __maybe_unused struct qm_dqrr *dqrr = &portal->dqrr; in qm_dqrr_cdc_consume_n()
704 qm_out(portal, QM_REG_DQRR_DCAP, (1 << 8) | /* DQRR_DCAP::S */ in qm_dqrr_cdc_consume_n()
708 static inline void qm_dqrr_sdqcr_set(struct qm_portal *portal, u32 sdqcr) in qm_dqrr_sdqcr_set() argument
710 qm_out(portal, QM_REG_DQRR_SDQCR, sdqcr); in qm_dqrr_sdqcr_set()
713 static inline void qm_dqrr_vdqcr_set(struct qm_portal *portal, u32 vdqcr) in qm_dqrr_vdqcr_set() argument
715 qm_out(portal, QM_REG_DQRR_VDQCR, vdqcr); in qm_dqrr_vdqcr_set()
718 static inline void qm_dqrr_set_ithresh(struct qm_portal *portal, u8 ithresh) in qm_dqrr_set_ithresh() argument
720 qm_out(portal, QM_REG_DQRR_ITR, ithresh); in qm_dqrr_set_ithresh()
747 static inline int qm_mr_init(struct qm_portal *portal, enum qm_mr_pmode pmode, in qm_mr_init() argument
750 struct qm_mr *mr = &portal->mr; in qm_mr_init()
753 mr->ring = portal->addr.ce + QM_CL_MR; in qm_mr_init()
754 mr->pi = qm_in(portal, QM_REG_MR_PI_CINH) & (QM_MR_SIZE - 1); in qm_mr_init()
755 mr->ci = qm_in(portal, QM_REG_MR_CI_CINH) & (QM_MR_SIZE - 1); in qm_mr_init()
758 mr->vbit = (qm_in(portal, QM_REG_MR_PI_CINH) & QM_MR_SIZE) in qm_mr_init()
760 mr->ithresh = qm_in(portal, QM_REG_MR_ITR); in qm_mr_init()
765 cfg = (qm_in(portal, QM_REG_CFG) & 0xfffff0ff) | in qm_mr_init()
767 qm_out(portal, QM_REG_CFG, cfg); in qm_mr_init()
771 static inline void qm_mr_finish(struct qm_portal *portal) in qm_mr_finish() argument
773 struct qm_mr *mr = &portal->mr; in qm_mr_finish()
779 static inline const union qm_mr_entry *qm_mr_current(struct qm_portal *portal) in qm_mr_current() argument
781 struct qm_mr *mr = &portal->mr; in qm_mr_current()
788 static inline int qm_mr_next(struct qm_portal *portal) in qm_mr_next() argument
790 struct qm_mr *mr = &portal->mr; in qm_mr_next()
797 static inline void qm_mr_pvb_update(struct qm_portal *portal) in qm_mr_pvb_update() argument
799 struct qm_mr *mr = &portal->mr; in qm_mr_pvb_update()
817 static inline void qm_mr_cci_consume(struct qm_portal *portal, u8 num) in qm_mr_cci_consume() argument
819 struct qm_mr *mr = &portal->mr; in qm_mr_cci_consume()
823 qm_out(portal, QM_REG_MR_CI_CINH, mr->ci); in qm_mr_cci_consume()
826 static inline void qm_mr_cci_consume_to_current(struct qm_portal *portal) in qm_mr_cci_consume_to_current() argument
828 struct qm_mr *mr = &portal->mr; in qm_mr_cci_consume_to_current()
832 qm_out(portal, QM_REG_MR_CI_CINH, mr->ci); in qm_mr_cci_consume_to_current()
835 static inline void qm_mr_set_ithresh(struct qm_portal *portal, u8 ithresh) in qm_mr_set_ithresh() argument
837 qm_out(portal, QM_REG_MR_ITR, ithresh); in qm_mr_set_ithresh()
842 static inline int qm_mc_init(struct qm_portal *portal) in qm_mc_init() argument
844 struct qm_mc *mc = &portal->mc; in qm_mc_init()
846 mc->cr = portal->addr.ce + QM_CL_CR; in qm_mc_init()
847 mc->rr = portal->addr.ce + QM_CL_RR0; in qm_mc_init()
857 static inline void qm_mc_finish(struct qm_portal *portal) in qm_mc_finish() argument
860 struct qm_mc *mc = &portal->mc; in qm_mc_finish()
868 static inline union qm_mc_command *qm_mc_start(struct qm_portal *portal) in qm_mc_start() argument
870 struct qm_mc *mc = &portal->mc; in qm_mc_start()
880 static inline void qm_mc_commit(struct qm_portal *portal, u8 myverb) in qm_mc_commit() argument
882 struct qm_mc *mc = &portal->mc; in qm_mc_commit()
895 static inline union qm_mc_result *qm_mc_result(struct qm_portal *portal) in qm_mc_result() argument
897 struct qm_mc *mc = &portal->mc; in qm_mc_result()
918 static inline int qm_mc_result_timeout(struct qm_portal *portal, in qm_mc_result_timeout() argument
924 *mcr = qm_mc_result(portal); in qm_mc_result_timeout()
1131 static int qman_create_portal(struct qman_portal *portal, in qman_create_portal() argument
1140 p = &portal->p; in qman_create_portal()
1144 portal->use_eqcr_ci_stashing = ((qman_ip_rev >= QMAN_REV30) ? 1 : 0); in qman_create_portal()
1146 portal->use_eqcr_ci_stashing = 0; in qman_create_portal()
1160 portal->use_eqcr_ci_stashing ? 3 : 0, 1)) { in qman_create_portal()
1181 portal->cgrs = kmalloc(2 * sizeof(*cgrs), GFP_KERNEL); in qman_create_portal()
1182 if (!portal->cgrs) in qman_create_portal()
1185 qman_cgrs_init(&portal->cgrs[1]); in qman_create_portal()
1187 portal->cgrs[0] = *cgrs; in qman_create_portal()
1190 qman_cgrs_fill(&portal->cgrs[0]); in qman_create_portal()
1191 INIT_LIST_HEAD(&portal->cgr_cbs); in qman_create_portal()
1192 spin_lock_init(&portal->cgr_lock); in qman_create_portal()
1193 INIT_WORK(&portal->congestion_work, qm_congestion_task); in qman_create_portal()
1194 INIT_WORK(&portal->mr_work, qm_mr_process_task); in qman_create_portal()
1195 portal->bits = 0; in qman_create_portal()
1196 portal->sdqcr = QM_SDQCR_SOURCE_CHANNELS | QM_SDQCR_COUNT_UPTO3 | in qman_create_portal()
1200 portal->pdev = platform_device_alloc(buf, -1); in qman_create_portal()
1201 if (!portal->pdev) in qman_create_portal()
1203 if (dma_set_mask(&portal->pdev->dev, DMA_BIT_MASK(40))) in qman_create_portal()
1205 ret = platform_device_add(portal->pdev); in qman_create_portal()
1210 portal->irq_sources = 0; in qman_create_portal()
1213 snprintf(portal->irqname, MAX_IRQNAME, IRQNAME, c->cpu); in qman_create_portal()
1214 if (request_irq(c->irq, portal_isr, 0, portal->irqname, portal)) { in qman_create_portal()
1247 portal->config = c; in qman_create_portal()
1251 qm_dqrr_sdqcr_set(p, portal->sdqcr); in qman_create_portal()
1257 free_irq(c->irq, portal); in qman_create_portal()
1259 platform_device_del(portal->pdev); in qman_create_portal()
1261 platform_device_put(portal->pdev); in qman_create_portal()
1263 kfree(portal->cgrs); in qman_create_portal()
1279 struct qman_portal *portal; in qman_create_affine_portal() local
1282 portal = &per_cpu(qman_affine_portal, c->cpu); in qman_create_affine_portal()
1283 err = qman_create_portal(portal, c, cgrs); in qman_create_affine_portal()
1290 affine_portals[c->cpu] = portal; in qman_create_affine_portal()
1293 return portal; in qman_create_affine_portal()
1650 struct qman_portal *portal = get_affine_portal(); in qman_affine_channel() local
1652 cpu = portal->config->cpu; in qman_affine_channel()
2703 struct qman_portal *portal) in qman_get_qm_portal_config() argument
2705 return portal->config; in qman_get_qm_portal_config()