Lines Matching refs:core_dev

123 	ctx->sa_in = dma_alloc_coherent(ctx->dev->core_dev->device, size * 4,  in crypto4xx_alloc_sa()
128 ctx->sa_out = dma_alloc_coherent(ctx->dev->core_dev->device, size * 4, in crypto4xx_alloc_sa()
131 dma_free_coherent(ctx->dev->core_dev->device, in crypto4xx_alloc_sa()
147 dma_free_coherent(ctx->dev->core_dev->device, ctx->sa_len * 4, in crypto4xx_free_sa()
150 dma_free_coherent(ctx->dev->core_dev->device, ctx->sa_len * 4, in crypto4xx_free_sa()
160 ctx->state_record = dma_alloc_coherent(ctx->dev->core_dev->device, in crypto4xx_alloc_state_record()
173 dma_free_coherent(ctx->dev->core_dev->device, in crypto4xx_free_state_record()
189 dev->pdr = dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_pdr()
198 dma_free_coherent(dev->core_dev->device, in crypto4xx_build_pdr()
205 dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_pdr()
212 dev->shadow_sr_pool = dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_pdr()
238 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_pdr()
242 dma_free_coherent(dev->core_dev->device, 256 * PPC4XX_NUM_PD, in crypto4xx_destroy_pdr()
245 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_pdr()
275 spin_lock_irqsave(&dev->core_dev->lock, flags); in crypto4xx_put_pd_to_pdr()
281 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_put_pd_to_pdr()
301 dev->gdr = dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_gdr()
314 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_gdr()
348 spin_lock_irqsave(&dev->core_dev->lock, flags); in crypto4xx_put_gd_to_gdr()
350 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_put_gd_to_gdr()
359 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_put_gd_to_gdr()
383 dev->sdr = dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_sdr()
391 dma_alloc_coherent(dev->core_dev->device, in crypto4xx_build_sdr()
395 dma_free_coherent(dev->core_dev->device, in crypto4xx_build_sdr()
414 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_sdr()
419 dma_free_coherent(dev->core_dev->device, in crypto4xx_destroy_sdr()
455 spin_lock_irqsave(&dev->core_dev->lock, flags); in crypto4xx_put_sd_to_sdr()
457 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_put_sd_to_sdr()
464 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_put_sd_to_sdr()
554 addr = dma_map_page(dev->core_dev->device, sg_page(sg), in crypto4xx_copy_pkt_to_dst()
637 addr = dma_map_page(dev->core_dev->device, sg_page(dst), in crypto4xx_ablkcipher_done()
716 static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev) in crypto4xx_stop_all() argument
718 crypto4xx_destroy_pdr(core_dev->dev); in crypto4xx_stop_all()
719 crypto4xx_destroy_gdr(core_dev->dev); in crypto4xx_stop_all()
720 crypto4xx_destroy_sdr(core_dev->dev); in crypto4xx_stop_all()
721 dev_set_drvdata(core_dev->device, NULL); in crypto4xx_stop_all()
722 iounmap(core_dev->dev->ce_base); in crypto4xx_stop_all()
723 kfree(core_dev->dev); in crypto4xx_stop_all()
724 kfree(core_dev); in crypto4xx_stop_all()
821 spin_lock_irqsave(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
825 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
834 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
844 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
847 spin_unlock_irqrestore(&dev->core_dev->lock, flags); in crypto4xx_build_pd()
894 addr = dma_map_page(dev->core_dev->device, sg_page(sg), in crypto4xx_build_pd()
908 pd->src = (u32)dma_map_page(dev->core_dev->device, sg_page(src), in crypto4xx_build_pd()
934 pd->dest = (u32)dma_map_page(dev->core_dev->device, in crypto4xx_build_pd()
1079 struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); in crypto4xx_bh_tasklet_cb() local
1084 while (core_dev->dev->pdr_head != core_dev->dev->pdr_tail) { in crypto4xx_bh_tasklet_cb()
1085 tail = core_dev->dev->pdr_tail; in crypto4xx_bh_tasklet_cb()
1086 pd_uinfo = core_dev->dev->pdr_uinfo + in crypto4xx_bh_tasklet_cb()
1088 pd = core_dev->dev->pdr + sizeof(struct ce_pd) * tail; in crypto4xx_bh_tasklet_cb()
1093 crypto4xx_pd_done(core_dev->dev, tail); in crypto4xx_bh_tasklet_cb()
1094 crypto4xx_put_pd_to_pdr(core_dev->dev, tail); in crypto4xx_bh_tasklet_cb()
1109 struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); in crypto4xx_ce_interrupt_handler() local
1111 if (core_dev->dev->ce_base == 0) in crypto4xx_ce_interrupt_handler()
1115 core_dev->dev->ce_base + CRYPTO4XX_INT_CLR); in crypto4xx_ce_interrupt_handler()
1116 tasklet_schedule(&core_dev->tasklet); in crypto4xx_ce_interrupt_handler()
1158 struct crypto4xx_core_device *core_dev; in crypto4xx_probe() local
1186 core_dev = kzalloc(sizeof(struct crypto4xx_core_device), GFP_KERNEL); in crypto4xx_probe()
1187 if (!core_dev) in crypto4xx_probe()
1190 dev_set_drvdata(dev, core_dev); in crypto4xx_probe()
1191 core_dev->ofdev = ofdev; in crypto4xx_probe()
1192 core_dev->dev = kzalloc(sizeof(struct crypto4xx_device), GFP_KERNEL); in crypto4xx_probe()
1193 if (!core_dev->dev) in crypto4xx_probe()
1196 core_dev->dev->core_dev = core_dev; in crypto4xx_probe()
1197 core_dev->device = dev; in crypto4xx_probe()
1198 spin_lock_init(&core_dev->lock); in crypto4xx_probe()
1199 INIT_LIST_HEAD(&core_dev->dev->alg_list); in crypto4xx_probe()
1200 rc = crypto4xx_build_pdr(core_dev->dev); in crypto4xx_probe()
1204 rc = crypto4xx_build_gdr(core_dev->dev); in crypto4xx_probe()
1208 rc = crypto4xx_build_sdr(core_dev->dev); in crypto4xx_probe()
1213 tasklet_init(&core_dev->tasklet, crypto4xx_bh_tasklet_cb, in crypto4xx_probe()
1217 core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); in crypto4xx_probe()
1218 rc = request_irq(core_dev->irq, crypto4xx_ce_interrupt_handler, 0, in crypto4xx_probe()
1219 core_dev->dev->name, dev); in crypto4xx_probe()
1223 core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0); in crypto4xx_probe()
1224 if (!core_dev->dev->ce_base) { in crypto4xx_probe()
1230 crypto4xx_hw_init(core_dev->dev); in crypto4xx_probe()
1233 rc = crypto4xx_register_alg(core_dev->dev, crypto4xx_alg, in crypto4xx_probe()
1241 iounmap(core_dev->dev->ce_base); in crypto4xx_probe()
1243 free_irq(core_dev->irq, dev); in crypto4xx_probe()
1244 irq_dispose_mapping(core_dev->irq); in crypto4xx_probe()
1245 tasklet_kill(&core_dev->tasklet); in crypto4xx_probe()
1247 crypto4xx_destroy_sdr(core_dev->dev); in crypto4xx_probe()
1249 crypto4xx_destroy_gdr(core_dev->dev); in crypto4xx_probe()
1251 crypto4xx_destroy_pdr(core_dev->dev); in crypto4xx_probe()
1253 kfree(core_dev->dev); in crypto4xx_probe()
1255 kfree(core_dev); in crypto4xx_probe()
1263 struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); in crypto4xx_remove() local
1265 free_irq(core_dev->irq, dev); in crypto4xx_remove()
1266 irq_dispose_mapping(core_dev->irq); in crypto4xx_remove()
1268 tasklet_kill(&core_dev->tasklet); in crypto4xx_remove()
1270 crypto4xx_unregister_alg(core_dev->dev); in crypto4xx_remove()
1272 crypto4xx_stop_all(core_dev); in crypto4xx_remove()