Skip to content

Commit

Permalink
Blackfin: add SSYNC to set_dma_sg() for descriptor fetching
Browse files Browse the repository at this point in the history
Make sure the internal core buffers are flushed before telling the DMA
engine to fetch the descriptor structure so that it gets the right values.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Sonic Zhang authored and Mike Frysinger committed Jun 12, 2009
1 parent 9b9bfde commit ea8538a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arch/blackfin/include/asm/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,16 @@ static inline unsigned long get_dma_curr_addr(unsigned int channel)

static inline void set_dma_sg(unsigned int channel, struct dmasg *sg, int ndsize)
{
/* Make sure the internal data buffers in the core are drained
* so that the DMA descriptors are completely written when the
* DMA engine goes to fetch them below.
*/
SSYNC();

dma_ch[channel].regs->next_desc_ptr = sg;
dma_ch[channel].regs->cfg =
(dma_ch[channel].regs->cfg & ~(0xf << 8)) |
((ndsize & 0xf) << 8);
dma_ch[channel].regs->next_desc_ptr = sg;
}

static inline int dma_channel_active(unsigned int channel)
Expand Down

0 comments on commit ea8538a

Please sign in to comment.