Lines Matching refs:pcfg
45 static void portal_set_cpu(struct qm_portal_config *pcfg, int cpu) in portal_set_cpu() argument
48 struct device *dev = pcfg->dev; in portal_set_cpu()
51 pcfg->iommu_domain = iommu_paging_domain_alloc(dev); in portal_set_cpu()
52 if (IS_ERR(pcfg->iommu_domain)) { in portal_set_cpu()
54 pcfg->iommu_domain = NULL; in portal_set_cpu()
57 ret = fsl_pamu_configure_l1_stash(pcfg->iommu_domain, cpu); in portal_set_cpu()
63 ret = iommu_attach_device(pcfg->iommu_domain, dev); in portal_set_cpu()
72 qman_set_sdest(pcfg->channel, cpu); in portal_set_cpu()
78 iommu_domain_free(pcfg->iommu_domain); in portal_set_cpu()
79 pcfg->iommu_domain = NULL; in portal_set_cpu()
83 static struct qman_portal *init_pcfg(struct qm_portal_config *pcfg) in init_pcfg() argument
89 qman_liodn_fixup(pcfg->channel); in init_pcfg()
91 pcfg->iommu_domain = NULL; in init_pcfg()
92 portal_set_cpu(pcfg, pcfg->cpu); in init_pcfg()
94 p = qman_create_affine_portal(pcfg, NULL); in init_pcfg()
96 dev_crit(pcfg->dev, "%s: Portal failure on cpu %d\n", in init_pcfg()
97 __func__, pcfg->cpu); in init_pcfg()
122 dev_info(pcfg->dev, "Portal initialised, cpu %d\n", pcfg->cpu); in init_pcfg()
127 static void qman_portal_update_sdest(const struct qm_portal_config *pcfg, in qman_portal_update_sdest() argument
131 if (pcfg->iommu_domain) { in qman_portal_update_sdest()
132 if (fsl_pamu_configure_l1_stash(pcfg->iommu_domain, cpu) < 0) { in qman_portal_update_sdest()
133 dev_err(pcfg->dev, in qman_portal_update_sdest()
139 qman_set_sdest(pcfg->channel, cpu); in qman_portal_update_sdest()
145 const struct qm_portal_config *pcfg; in qman_offline_cpu() local
149 pcfg = qman_get_qm_portal_config(p); in qman_offline_cpu()
150 if (pcfg) { in qman_offline_cpu()
153 irq_set_affinity(pcfg->irq, cpumask_of(cpu)); in qman_offline_cpu()
154 qman_portal_update_sdest(pcfg, cpu); in qman_offline_cpu()
163 const struct qm_portal_config *pcfg; in qman_online_cpu() local
167 pcfg = qman_get_qm_portal_config(p); in qman_online_cpu()
168 if (pcfg) { in qman_online_cpu()
169 irq_set_affinity(pcfg->irq, cpumask_of(cpu)); in qman_online_cpu()
170 qman_portal_update_sdest(pcfg, cpu); in qman_online_cpu()
186 struct qm_portal_config *pcfg; in qman_portal_probe() local
199 pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL); in qman_portal_probe()
200 if (!pcfg) { in qman_portal_probe()
205 pcfg->dev = dev; in qman_portal_probe()
227 pcfg->channel = val; in qman_portal_probe()
228 pcfg->cpu = -1; in qman_portal_probe()
232 pcfg->irq = irq; in qman_portal_probe()
234 pcfg->addr_virt_ce = memremap(addr_phys[0]->start, in qman_portal_probe()
237 if (!pcfg->addr_virt_ce) { in qman_portal_probe()
242 pcfg->addr_virt_ci = ioremap(addr_phys[1]->start, in qman_portal_probe()
244 if (!pcfg->addr_virt_ci) { in qman_portal_probe()
249 pcfg->pools = qm_get_pools_sdqcr(); in qman_portal_probe()
262 pcfg->cpu = cpu; in qman_portal_probe()
269 if (!init_pcfg(pcfg)) { in qman_portal_probe()
298 iounmap(pcfg->addr_virt_ci); in qman_portal_probe()
300 memunmap(pcfg->addr_virt_ce); in qman_portal_probe()