Lines Matching refs:dma
189 static int bcm6348_iudma_disable(struct dma *dma) in bcm6348_iudma_disable() argument
191 struct bcm6348_iudma_priv *priv = dev_get_priv(dma->dev); in bcm6348_iudma_disable()
192 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_disable()
195 bcm6348_iudma_chan_stop(priv, dma->id); in bcm6348_iudma_disable()
198 if (bcm6348_iudma_chan_is_rx(dma->id)) in bcm6348_iudma_disable()
200 DMA_FLOWC_ALLOC_REG(dma->id)); in bcm6348_iudma_disable()
205 if (bcm6348_iudma_chan_is_rx(dma->id)) in bcm6348_iudma_disable()
213 static int bcm6348_iudma_enable(struct dma *dma) in bcm6348_iudma_enable() argument
215 const struct bcm6348_iudma_priv *priv = dev_get_priv(dma->dev); in bcm6348_iudma_enable()
216 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_enable()
222 if (bcm6348_iudma_chan_is_rx(dma->id)) { in bcm6348_iudma_enable()
245 writel_be(0, priv->sram + DMAS_STATE_DATA_REG(dma->id)); in bcm6348_iudma_enable()
246 writel_be(0, priv->sram + DMAS_DESC_LEN_STATUS_REG(dma->id)); in bcm6348_iudma_enable()
247 writel_be(0, priv->sram + DMAS_DESC_BASE_BUFPTR_REG(dma->id)); in bcm6348_iudma_enable()
251 priv->sram + DMAS_RSTART_REG(dma->id)); in bcm6348_iudma_enable()
254 if (bcm6348_iudma_chan_is_rx(dma->id)) { in bcm6348_iudma_enable()
258 DMA_CFG_FLOWC_ENABLE(dma->id)); in bcm6348_iudma_enable()
261 writel_be(val, priv->base + DMA_FLOWC_THR_LO_REG(dma->id)); in bcm6348_iudma_enable()
264 writel_be(val, priv->base + DMA_FLOWC_THR_HI_REG(dma->id)); in bcm6348_iudma_enable()
266 writel_be(0, priv->base + DMA_FLOWC_ALLOC_REG(dma->id)); in bcm6348_iudma_enable()
271 priv->chan + DMAC_BURST_REG(dma->id)); in bcm6348_iudma_enable()
274 if (bcm6348_iudma_chan_is_rx(dma->id)) in bcm6348_iudma_enable()
275 setbits_be32(priv->chan + DMAC_CFG_REG(dma->id), in bcm6348_iudma_enable()
284 static int bcm6348_iudma_request(struct dma *dma) in bcm6348_iudma_request() argument
286 const struct bcm6348_iudma_priv *priv = dev_get_priv(dma->dev); in bcm6348_iudma_request()
290 if (dma->id >= priv->n_channels) in bcm6348_iudma_request()
294 priv->ch_priv[dma->id] = calloc(1, sizeof(struct bcm6348_chan_priv)); in bcm6348_iudma_request()
295 if (!priv->ch_priv[dma->id]) in bcm6348_iudma_request()
297 ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_request()
300 if (bcm6348_iudma_chan_is_rx(dma->id)) in bcm6348_iudma_request()
314 if (bcm6348_iudma_chan_is_rx(dma->id)) { in bcm6348_iudma_request()
325 static int bcm6348_iudma_receive(struct dma *dma, void **dst, void *metadata) in bcm6348_iudma_receive() argument
327 const struct bcm6348_iudma_priv *priv = dev_get_priv(dma->dev); in bcm6348_iudma_receive()
329 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_receive()
351 dma->id, ch_priv->desc_id, dma_desc->status); in bcm6348_iudma_receive()
373 static int bcm6348_iudma_send(struct dma *dma, void *src, size_t len, in bcm6348_iudma_send() argument
376 const struct bcm6348_iudma_priv *priv = dev_get_priv(dma->dev); in bcm6348_iudma_send()
377 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_send()
408 setbits_be32(priv->chan + DMAC_CFG_REG(dma->id), DMAC_CFG_ENABLE_MASK); in bcm6348_iudma_send()
425 static int bcm6348_iudma_free_rcv_buf(struct dma *dma, void *dst, size_t size) in bcm6348_iudma_free_rcv_buf() argument
427 const struct bcm6348_iudma_priv *priv = dev_get_priv(dma->dev); in bcm6348_iudma_free_rcv_buf()
428 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_free_rcv_buf()
463 writel_be(1, DMA_FLOWC_ALLOC_REG(dma->id)); in bcm6348_iudma_free_rcv_buf()
470 cfg = readl_be(priv->chan + DMAC_CFG_REG(dma->id)); in bcm6348_iudma_free_rcv_buf()
472 setbits_be32(priv->chan + DMAC_CFG_REG(dma->id), in bcm6348_iudma_free_rcv_buf()
478 static int bcm6348_iudma_add_rcv_buf(struct dma *dma, void *dst, size_t size) in bcm6348_iudma_add_rcv_buf() argument
480 const struct bcm6348_iudma_priv *priv = dev_get_priv(dma->dev); in bcm6348_iudma_add_rcv_buf()
481 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_add_rcv_buf()
507 static int bcm6348_iudma_prepare_rcv_buf(struct dma *dma, void *dst, in bcm6348_iudma_prepare_rcv_buf() argument
510 const struct bcm6348_iudma_priv *priv = dev_get_priv(dma->dev); in bcm6348_iudma_prepare_rcv_buf()
511 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_prepare_rcv_buf()
515 return bcm6348_iudma_free_rcv_buf(dma, dst, size); in bcm6348_iudma_prepare_rcv_buf()
517 return bcm6348_iudma_add_rcv_buf(dma, dst, size); in bcm6348_iudma_prepare_rcv_buf()