int bcom_fec_tx_reset(struct bcom_task *tsk) { struct bcom_fec_priv *priv = tsk->priv; struct bcom_fec_tx_var *var; struct bcom_fec_tx_inc *inc; /* Shutdown the task */ bcom_disable_task(tsk->tasknum); /* Reset the microcode */ var = (struct bcom_fec_tx_var *) bcom_task_var(tsk->tasknum); inc = (struct bcom_fec_tx_inc *) bcom_task_inc(tsk->tasknum); if (bcom_load_image(tsk->tasknum, bcom_fec_tx_task)) return -1; var->enable = bcom_eng->regs_base + offsetof(struct mpc52xx_sdma, tcr[tsk->tasknum]); var->fifo = (u32) priv->fifo; var->DRD = bcom_sram_va2pa(self_modified_drd(tsk->tasknum)); var->bd_base = tsk->bd_pa; var->bd_last = tsk->bd_pa + ((tsk->num_bd-1) * tsk->bd_size); var->bd_start = tsk->bd_pa; inc->incr_bytes = -(s16)sizeof(u32); /* These should be in the */ inc->incr_src = sizeof(u32); /* task image, but we stick */ inc->incr_src_ma= sizeof(u8); /* to the official ones */ /* Reset the BDs */ tsk->index = 0; tsk->outdex = 0; memset(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size); /* Configure some stuff */ bcom_set_task_pragma(tsk->tasknum, BCOM_FEC_TX_BD_PRAGMA); bcom_set_task_auto_start(tsk->tasknum, tsk->tasknum); out_8(&bcom_eng->regs->ipr[BCOM_INITIATOR_FEC_TX], BCOM_IPR_FEC_TX); out_be32(&bcom_eng->regs->IntPend, 1<<tsk->tasknum); /* Clear ints */ return 0; }
int bcom_gen_bd_tx_reset(struct bcom_task *tsk) { struct bcom_gen_bd_priv *priv = tsk->priv; struct bcom_gen_bd_tx_var *var; struct bcom_gen_bd_tx_inc *inc; /* Shutdown the task */ bcom_disable_task(tsk->tasknum); /* Reset the microcode */ var = (struct bcom_gen_bd_tx_var *) bcom_task_var(tsk->tasknum); inc = (struct bcom_gen_bd_tx_inc *) bcom_task_inc(tsk->tasknum); if (bcom_load_image(tsk->tasknum, bcom_gen_bd_tx_task)) return -1; var->enable = bcom_eng->regs_base + offsetof(struct mpc52xx_sdma, tcr[tsk->tasknum]); var->fifo = (u32) priv->fifo; var->bd_base = tsk->bd_pa; var->bd_last = tsk->bd_pa + ((tsk->num_bd-1) * tsk->bd_size); var->bd_start = tsk->bd_pa; inc->incr_bytes = -(s16)sizeof(u32); inc->incr_src = sizeof(u32); inc->incr_src_ma = sizeof(u8); /* Reset the BDs */ tsk->index = 0; tsk->outdex = 0; memset(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size); /* Configure some stuff */ bcom_set_task_pragma(tsk->tasknum, BCOM_GEN_TX_BD_PRAGMA); bcom_set_task_auto_start(tsk->tasknum, tsk->tasknum); out_8(&bcom_eng->regs->ipr[priv->initiator], priv->ipr); bcom_set_initiator(tsk->tasknum, priv->initiator); out_be32(&bcom_eng->regs->IntPend, 1<<tsk->tasknum); /* Clear ints */ return 0; }