Lines Matching refs:core_dev

170 	dev->pdr = dma_alloc_coherent(dev->core_dev->device,  in crypto4xx_build_pdr()
179 dma_free_coherent(dev->core_dev->device, in crypto4xx_build_pdr()
185 dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_pdr()
192 dev->shadow_sr_pool = dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_pdr()
219 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_pdr()
224 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_pdr()
229 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_pdr()
258 spin_lock_irqsave(&dev->core_dev->lock, flags); in crypto4xx_put_pd_to_pdr()
266 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_put_pd_to_pdr()
278 dev->gdr = dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_gdr()
290 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_gdr()
325 spin_lock_irqsave(&dev->core_dev->lock, flags); in crypto4xx_put_gd_to_gdr()
327 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_put_gd_to_gdr()
336 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_put_gd_to_gdr()
359 dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_sdr()
366 dev->sdr = dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_sdr()
383 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_sdr()
388 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_sdr()
424 spin_lock_irqsave(&dev->core_dev->lock, flags); in crypto4xx_put_sd_to_sdr()
426 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_put_sd_to_sdr()
433 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_put_sd_to_sdr()
533 dma_unmap_page(dev->core_dev->device, pd->dest, dst->length, in crypto4xx_cipher_done()
586 dma_unmap_page(dev->core_dev->device, pd->dest, dst->length, in crypto4xx_aead_done()
651 static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev) in crypto4xx_stop_all() argument
653 crypto4xx_destroy_pdr(core_dev->dev); in crypto4xx_stop_all()
654 crypto4xx_destroy_gdr(core_dev->dev); in crypto4xx_stop_all()
655 crypto4xx_destroy_sdr(core_dev->dev); in crypto4xx_stop_all()
656 iounmap(core_dev->dev->ce_base); in crypto4xx_stop_all()
657 kfree(core_dev->dev); in crypto4xx_stop_all()
658 kfree(core_dev); in crypto4xx_stop_all()
723 dev_err(dev->core_dev->device, "Invalid number of src SG.\n"); in crypto4xx_build_pd()
754 spin_lock_irqsave(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
775 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
783 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
792 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
802 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
805 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
844 gd->ptr = dma_map_page(dev->core_dev->device, in crypto4xx_build_pd()
858 pd->src = (u32)dma_map_page(dev->core_dev->device, sg_page(src), in crypto4xx_build_pd()
877 pd->dest = (u32)dma_map_page(dev->core_dev->device, in crypto4xx_build_pd()
1076 struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); in crypto4xx_bh_tasklet_cb() local
1079 u32 tail = core_dev->dev->pdr_tail; in crypto4xx_bh_tasklet_cb()
1080 u32 head = core_dev->dev->pdr_head; in crypto4xx_bh_tasklet_cb()
1083 pd_uinfo = &core_dev->dev->pdr_uinfo[tail]; in crypto4xx_bh_tasklet_cb()
1084 pd = &core_dev->dev->pdr[tail]; in crypto4xx_bh_tasklet_cb()
1089 crypto4xx_pd_done(core_dev->dev, tail); in crypto4xx_bh_tasklet_cb()
1090 tail = crypto4xx_put_pd_to_pdr(core_dev->dev, tail); in crypto4xx_bh_tasklet_cb()
1105 struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); in crypto4xx_interrupt_handler() local
1107 writel(clr_val, core_dev->dev->ce_base + CRYPTO4XX_INT_CLR); in crypto4xx_interrupt_handler()
1108 tasklet_schedule(&core_dev->tasklet); in crypto4xx_interrupt_handler()
1174 mutex_lock(&dev->core_dev->rng_lock); in crypto4xx_prng_generate()
1176 mutex_unlock(&dev->core_dev->rng_lock); in crypto4xx_prng_generate()
1338 struct crypto4xx_core_device *core_dev; in crypto4xx_probe() local
1377 core_dev = kzalloc(sizeof(struct crypto4xx_core_device), GFP_KERNEL); in crypto4xx_probe()
1378 if (!core_dev) in crypto4xx_probe()
1381 dev_set_drvdata(dev, core_dev); in crypto4xx_probe()
1382 core_dev->ofdev = ofdev; in crypto4xx_probe()
1383 core_dev->dev = kzalloc(sizeof(struct crypto4xx_device), GFP_KERNEL); in crypto4xx_probe()
1385 if (!core_dev->dev) in crypto4xx_probe()
1402 core_dev->dev->core_dev = core_dev; in crypto4xx_probe()
1403 core_dev->dev->is_revb = is_revb; in crypto4xx_probe()
1404 core_dev->device = dev; in crypto4xx_probe()
1405 mutex_init(&core_dev->rng_lock); in crypto4xx_probe()
1406 spin_lock_init(&core_dev->lock); in crypto4xx_probe()
1407 INIT_LIST_HEAD(&core_dev->dev->alg_list); in crypto4xx_probe()
1408 ratelimit_default_init(&core_dev->dev->aead_ratelimit); in crypto4xx_probe()
1409 rc = crypto4xx_build_sdr(core_dev->dev); in crypto4xx_probe()
1412 rc = crypto4xx_build_pdr(core_dev->dev); in crypto4xx_probe()
1416 rc = crypto4xx_build_gdr(core_dev->dev); in crypto4xx_probe()
1421 tasklet_init(&core_dev->tasklet, crypto4xx_bh_tasklet_cb, in crypto4xx_probe()
1424 core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0); in crypto4xx_probe()
1425 if (!core_dev->dev->ce_base) { in crypto4xx_probe()
1432 core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); in crypto4xx_probe()
1433 rc = request_irq(core_dev->irq, is_revb ? in crypto4xx_probe()
1441 crypto4xx_hw_init(core_dev->dev); in crypto4xx_probe()
1444 rc = crypto4xx_register_alg(core_dev->dev, crypto4xx_alg, in crypto4xx_probe()
1449 ppc4xx_trng_probe(core_dev); in crypto4xx_probe()
1453 free_irq(core_dev->irq, dev); in crypto4xx_probe()
1455 irq_dispose_mapping(core_dev->irq); in crypto4xx_probe()
1456 iounmap(core_dev->dev->ce_base); in crypto4xx_probe()
1458 tasklet_kill(&core_dev->tasklet); in crypto4xx_probe()
1460 crypto4xx_destroy_sdr(core_dev->dev); in crypto4xx_probe()
1461 crypto4xx_destroy_gdr(core_dev->dev); in crypto4xx_probe()
1462 crypto4xx_destroy_pdr(core_dev->dev); in crypto4xx_probe()
1463 kfree(core_dev->dev); in crypto4xx_probe()
1465 kfree(core_dev); in crypto4xx_probe()
1473 struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); in crypto4xx_remove() local
1475 ppc4xx_trng_remove(core_dev); in crypto4xx_remove()
1477 free_irq(core_dev->irq, dev); in crypto4xx_remove()
1478 irq_dispose_mapping(core_dev->irq); in crypto4xx_remove()
1480 tasklet_kill(&core_dev->tasklet); in crypto4xx_remove()
1482 crypto4xx_unregister_alg(core_dev->dev); in crypto4xx_remove()
1483 mutex_destroy(&core_dev->rng_lock); in crypto4xx_remove()
1485 crypto4xx_stop_all(core_dev); in crypto4xx_remove()