Lines Matching refs:bcom_eng
37 struct bcom_engine *bcom_eng = NULL; variable
38 EXPORT_SYMBOL_GPL(bcom_eng); /* needed for inline functions */
53 if (!bcom_eng) in bcom_task_alloc()
57 spin_lock(&bcom_eng->lock); in bcom_task_alloc()
60 if (!bcom_eng->tdt[i].stop) { /* we use stop as a marker */ in bcom_task_alloc()
61 bcom_eng->tdt[i].stop = 0xfffffffful; /* dummy addr */ in bcom_task_alloc()
66 spin_unlock(&bcom_eng->lock); in bcom_task_alloc()
81 tsk->irq = irq_of_parse_and_map(bcom_eng->ofnode, tsk->tasknum); in bcom_task_alloc()
112 bcom_eng->tdt[tasknum].stop = 0; in bcom_task_alloc()
125 bcom_eng->tdt[tsk->tasknum].start = 0; in bcom_task_free()
126 bcom_eng->tdt[tsk->tasknum].stop = 0; in bcom_task_free()
158 tdt = &bcom_eng->tdt[task]; in bcom_load_image()
286 bcom_eng->tdt = bcom_sram_alloc(tdt_size, sizeof(u32), &tdt_pa); in bcom_engine_init()
287 bcom_eng->ctx = bcom_sram_alloc(ctx_size, BCOM_CTX_ALIGN, &ctx_pa); in bcom_engine_init()
288 bcom_eng->var = bcom_sram_alloc(var_size, BCOM_VAR_ALIGN, &var_pa); in bcom_engine_init()
289 bcom_eng->fdt = bcom_sram_alloc(fdt_size, BCOM_FDT_ALIGN, &fdt_pa); in bcom_engine_init()
291 if (!bcom_eng->tdt || !bcom_eng->ctx || !bcom_eng->var || !bcom_eng->fdt) { in bcom_engine_init()
294 bcom_sram_free(bcom_eng->tdt); in bcom_engine_init()
295 bcom_sram_free(bcom_eng->ctx); in bcom_engine_init()
296 bcom_sram_free(bcom_eng->var); in bcom_engine_init()
297 bcom_sram_free(bcom_eng->fdt); in bcom_engine_init()
302 memset_io(bcom_eng->tdt, 0x00, tdt_size); in bcom_engine_init()
303 memset_io(bcom_eng->ctx, 0x00, ctx_size); in bcom_engine_init()
304 memset_io(bcom_eng->var, 0x00, var_size); in bcom_engine_init()
305 memset_io(bcom_eng->fdt, 0x00, fdt_size); in bcom_engine_init()
308 memcpy_toio(&bcom_eng->fdt[48], fdt_ops, sizeof(fdt_ops)); in bcom_engine_init()
313 out_be16(&bcom_eng->regs->tcr[task], 0); in bcom_engine_init()
314 out_8(&bcom_eng->regs->ipr[task], 0); in bcom_engine_init()
316 bcom_eng->tdt[task].context = ctx_pa; in bcom_engine_init()
317 bcom_eng->tdt[task].var = var_pa; in bcom_engine_init()
318 bcom_eng->tdt[task].fdt = fdt_pa; in bcom_engine_init()
324 out_be32(&bcom_eng->regs->taskBar, tdt_pa); in bcom_engine_init()
327 out_8(&bcom_eng->regs->ipr[BCOM_INITIATOR_ALWAYS], BCOM_IPR_ALWAYS); in bcom_engine_init()
334 spin_lock_init(&bcom_eng->lock); in bcom_engine_init()
347 out_be16(&bcom_eng->regs->tcr[task], 0); in bcom_engine_cleanup()
348 out_8(&bcom_eng->regs->ipr[task], 0); in bcom_engine_cleanup()
351 out_be32(&bcom_eng->regs->taskBar, 0ul); in bcom_engine_cleanup()
354 bcom_sram_free(bcom_eng->tdt); in bcom_engine_cleanup()
355 bcom_sram_free(bcom_eng->ctx); in bcom_engine_cleanup()
356 bcom_sram_free(bcom_eng->var); in bcom_engine_cleanup()
357 bcom_sram_free(bcom_eng->fdt); in bcom_engine_cleanup()
396 bcom_eng = kzalloc(sizeof(struct bcom_engine), GFP_KERNEL); in mpc52xx_bcom_probe()
397 if (!bcom_eng) { in mpc52xx_bcom_probe()
403 bcom_eng->ofnode = op->dev.of_node; in mpc52xx_bcom_probe()
421 bcom_eng->regs_base = res_bcom.start; in mpc52xx_bcom_probe()
422 bcom_eng->regs = ioremap(res_bcom.start, sizeof(struct mpc52xx_sdma)); in mpc52xx_bcom_probe()
423 if (!bcom_eng->regs) { in mpc52xx_bcom_probe()
437 (long)bcom_eng->regs_base); in mpc52xx_bcom_probe()
443 iounmap(bcom_eng->regs); in mpc52xx_bcom_probe()
447 kfree(bcom_eng); in mpc52xx_bcom_probe()
467 iounmap(bcom_eng->regs); in mpc52xx_bcom_remove()
468 release_mem_region(bcom_eng->regs_base, sizeof(struct mpc52xx_sdma)); in mpc52xx_bcom_remove()
471 of_node_put(bcom_eng->ofnode); in mpc52xx_bcom_remove()
474 kfree(bcom_eng); in mpc52xx_bcom_remove()
475 bcom_eng = NULL; in mpc52xx_bcom_remove()