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_domain_alloc(&platform_bus_type); in portal_set_cpu()
52 if (!pcfg->iommu_domain) { in portal_set_cpu()
56 ret = fsl_pamu_configure_l1_stash(pcfg->iommu_domain, cpu); in portal_set_cpu()
62 ret = iommu_attach_device(pcfg->iommu_domain, dev); in portal_set_cpu()
71 qman_set_sdest(pcfg->channel, cpu); in portal_set_cpu()
77 iommu_domain_free(pcfg->iommu_domain); in portal_set_cpu()
78 pcfg->iommu_domain = NULL; in portal_set_cpu()
82 static struct qman_portal *init_pcfg(struct qm_portal_config *pcfg) in init_pcfg() argument
88 qman_liodn_fixup(pcfg->channel); in init_pcfg()
90 pcfg->iommu_domain = NULL; in init_pcfg()
91 portal_set_cpu(pcfg, pcfg->cpu); in init_pcfg()
93 p = qman_create_affine_portal(pcfg, NULL); in init_pcfg()
95 dev_crit(pcfg->dev, "%s: Portal failure on cpu %d\n", in init_pcfg()
96 __func__, pcfg->cpu); in init_pcfg()
121 dev_info(pcfg->dev, "Portal initialised, cpu %d\n", pcfg->cpu); in init_pcfg()
126 static void qman_portal_update_sdest(const struct qm_portal_config *pcfg, in qman_portal_update_sdest() argument
130 if (pcfg->iommu_domain) { in qman_portal_update_sdest()
131 if (fsl_pamu_configure_l1_stash(pcfg->iommu_domain, cpu) < 0) { in qman_portal_update_sdest()
132 dev_err(pcfg->dev, in qman_portal_update_sdest()
138 qman_set_sdest(pcfg->channel, cpu); in qman_portal_update_sdest()
144 const struct qm_portal_config *pcfg; in qman_offline_cpu() local
148 pcfg = qman_get_qm_portal_config(p); in qman_offline_cpu()
149 if (pcfg) { in qman_offline_cpu()
152 irq_set_affinity(pcfg->irq, cpumask_of(cpu)); in qman_offline_cpu()
153 qman_portal_update_sdest(pcfg, cpu); in qman_offline_cpu()
162 const struct qm_portal_config *pcfg; in qman_online_cpu() local
166 pcfg = qman_get_qm_portal_config(p); in qman_online_cpu()
167 if (pcfg) { in qman_online_cpu()
168 irq_set_affinity(pcfg->irq, cpumask_of(cpu)); in qman_online_cpu()
169 qman_portal_update_sdest(pcfg, cpu); in qman_online_cpu()
185 struct qm_portal_config *pcfg; in qman_portal_probe() local
198 pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL); in qman_portal_probe()
199 if (!pcfg) { in qman_portal_probe()
204 pcfg->dev = dev; in qman_portal_probe()
226 pcfg->channel = val; in qman_portal_probe()
227 pcfg->cpu = -1; in qman_portal_probe()
231 pcfg->irq = irq; in qman_portal_probe()
233 pcfg->addr_virt_ce = memremap(addr_phys[0]->start, in qman_portal_probe()
236 if (!pcfg->addr_virt_ce) { in qman_portal_probe()
241 pcfg->addr_virt_ci = ioremap(addr_phys[1]->start, in qman_portal_probe()
243 if (!pcfg->addr_virt_ci) { in qman_portal_probe()
248 pcfg->pools = qm_get_pools_sdqcr(); in qman_portal_probe()
261 pcfg->cpu = cpu; in qman_portal_probe()
268 if (!init_pcfg(pcfg)) { in qman_portal_probe()
297 iounmap(pcfg->addr_virt_ci); in qman_portal_probe()
299 memunmap(pcfg->addr_virt_ce); in qman_portal_probe()