Lines Matching refs:bcom_eng
38 struct bcom_engine *bcom_eng = NULL; variable
39 EXPORT_SYMBOL_GPL(bcom_eng); /* needed for inline functions */
54 if (!bcom_eng) in bcom_task_alloc()
58 spin_lock(&bcom_eng->lock); in bcom_task_alloc()
61 if (!bcom_eng->tdt[i].stop) { /* we use stop as a marker */ in bcom_task_alloc()
62 bcom_eng->tdt[i].stop = 0xfffffffful; /* dummy addr */ in bcom_task_alloc()
67 spin_unlock(&bcom_eng->lock); in bcom_task_alloc()
82 tsk->irq = irq_of_parse_and_map(bcom_eng->ofnode, tsk->tasknum); in bcom_task_alloc()
113 bcom_eng->tdt[tasknum].stop = 0; in bcom_task_alloc()
126 bcom_eng->tdt[tsk->tasknum].start = 0; in bcom_task_free()
127 bcom_eng->tdt[tsk->tasknum].stop = 0; in bcom_task_free()
159 tdt = &bcom_eng->tdt[task]; in bcom_load_image()
287 bcom_eng->tdt = bcom_sram_alloc(tdt_size, sizeof(u32), &tdt_pa); in bcom_engine_init()
288 bcom_eng->ctx = bcom_sram_alloc(ctx_size, BCOM_CTX_ALIGN, &ctx_pa); in bcom_engine_init()
289 bcom_eng->var = bcom_sram_alloc(var_size, BCOM_VAR_ALIGN, &var_pa); in bcom_engine_init()
290 bcom_eng->fdt = bcom_sram_alloc(fdt_size, BCOM_FDT_ALIGN, &fdt_pa); in bcom_engine_init()
292 if (!bcom_eng->tdt || !bcom_eng->ctx || !bcom_eng->var || !bcom_eng->fdt) { in bcom_engine_init()
295 bcom_sram_free(bcom_eng->tdt); in bcom_engine_init()
296 bcom_sram_free(bcom_eng->ctx); in bcom_engine_init()
297 bcom_sram_free(bcom_eng->var); in bcom_engine_init()
298 bcom_sram_free(bcom_eng->fdt); in bcom_engine_init()
303 memset_io(bcom_eng->tdt, 0x00, tdt_size); in bcom_engine_init()
304 memset_io(bcom_eng->ctx, 0x00, ctx_size); in bcom_engine_init()
305 memset_io(bcom_eng->var, 0x00, var_size); in bcom_engine_init()
306 memset_io(bcom_eng->fdt, 0x00, fdt_size); in bcom_engine_init()
309 memcpy_toio(&bcom_eng->fdt[48], fdt_ops, sizeof(fdt_ops)); in bcom_engine_init()
314 out_be16(&bcom_eng->regs->tcr[task], 0); in bcom_engine_init()
315 out_8(&bcom_eng->regs->ipr[task], 0); in bcom_engine_init()
317 bcom_eng->tdt[task].context = ctx_pa; in bcom_engine_init()
318 bcom_eng->tdt[task].var = var_pa; in bcom_engine_init()
319 bcom_eng->tdt[task].fdt = fdt_pa; in bcom_engine_init()
325 out_be32(&bcom_eng->regs->taskBar, tdt_pa); in bcom_engine_init()
328 out_8(&bcom_eng->regs->ipr[BCOM_INITIATOR_ALWAYS], BCOM_IPR_ALWAYS); in bcom_engine_init()
335 spin_lock_init(&bcom_eng->lock); in bcom_engine_init()
348 out_be16(&bcom_eng->regs->tcr[task], 0); in bcom_engine_cleanup()
349 out_8(&bcom_eng->regs->ipr[task], 0); in bcom_engine_cleanup()
352 out_be32(&bcom_eng->regs->taskBar, 0ul); in bcom_engine_cleanup()
355 bcom_sram_free(bcom_eng->tdt); in bcom_engine_cleanup()
356 bcom_sram_free(bcom_eng->ctx); in bcom_engine_cleanup()
357 bcom_sram_free(bcom_eng->var); in bcom_engine_cleanup()
358 bcom_sram_free(bcom_eng->fdt); in bcom_engine_cleanup()
397 bcom_eng = kzalloc(sizeof(struct bcom_engine), GFP_KERNEL); in mpc52xx_bcom_probe()
398 if (!bcom_eng) { in mpc52xx_bcom_probe()
404 bcom_eng->ofnode = op->dev.of_node; in mpc52xx_bcom_probe()
422 bcom_eng->regs_base = res_bcom.start; in mpc52xx_bcom_probe()
423 bcom_eng->regs = ioremap(res_bcom.start, sizeof(struct mpc52xx_sdma)); in mpc52xx_bcom_probe()
424 if (!bcom_eng->regs) { in mpc52xx_bcom_probe()
438 (long)bcom_eng->regs_base); in mpc52xx_bcom_probe()
444 iounmap(bcom_eng->regs); in mpc52xx_bcom_probe()
448 kfree(bcom_eng); in mpc52xx_bcom_probe()
468 iounmap(bcom_eng->regs); in mpc52xx_bcom_remove()
469 release_mem_region(bcom_eng->regs_base, sizeof(struct mpc52xx_sdma)); in mpc52xx_bcom_remove()
472 of_node_put(bcom_eng->ofnode); in mpc52xx_bcom_remove()
475 kfree(bcom_eng); in mpc52xx_bcom_remove()
476 bcom_eng = NULL; in mpc52xx_bcom_remove()