static int s3c_dma_dostop(struct s3c2410_dma_chan *chan) { unsigned long tmp; unsigned long flags; pr_debug("%s: DMA Channel No : %d\n", __FUNCTION__, chan->number); dbg_showchan(chan); local_irq_save(flags); s3c_dma_flush_fifo(chan); s3c_dma_call_op(chan, S3C2410_DMAOP_STOP); tmp = dma_rdreg(chan, S3C_DMAC_CxCONFIGURATION); tmp &= ~S3C_DMACONFIG_CHANNEL_ENABLE; dma_wrreg(chan, S3C_DMAC_CxCONFIGURATION, tmp); pr_debug("%s: S3C_DMAC_CxCONFIGURATION : %08x\n", __FUNCTION__, tmp); chan->state = S3C_DMA_IDLE; chan->load_state = S3C_DMALOAD_NONE; local_irq_restore(flags); return 0; }
static int s3c_dma_dostop(struct s3c2410_dma_chan *chan) { unsigned long tmp; unsigned long flags; pr_debug("%s: DMA Channel No : %d\n", __FUNCTION__, chan->number); dbg_showchan(chan); local_irq_save(flags); //Commenting out this function call(as its causing freeze) and even without this it adheres to //ARM Primecell 080's disabling a DMA channel and losing data in the FIFO method //s3c_dma_flush_fifo(chan); s3c_dma_call_op(chan, S3C2410_DMAOP_STOP); tmp = dma_rdreg(chan, S3C_DMAC_CxCONFIGURATION); tmp &= ~S3C_DMACONFIG_CHANNEL_ENABLE; dma_wrreg(chan, S3C_DMAC_CxCONFIGURATION, tmp); pr_debug("%s: S3C_DMAC_CxCONFIGURATION : %08x\n", __FUNCTION__, tmp); chan->state = S3C_DMA_IDLE; chan->load_state = S3C_DMALOAD_NONE; local_irq_restore(flags); return 0; }
/* s3c_dma_start * * start a dma channel going */ static int s3c_dma_start(struct s3c2410_dma_chan *chan) { unsigned long flags; pr_debug("s3c_start_dma: channel number=%d, index=%d\n", chan->number, chan->index); local_irq_save(flags); if (chan->state == S3C_DMA_RUNNING) { pr_debug("s3c_start_dma: already running (%d)\n", chan->state); local_irq_restore(flags); return 0; } chan->state = S3C_DMA_RUNNING; /* check wether there is anything to load, and if not, see * if we can find anything to load */ if (chan->load_state == S3C_DMALOAD_NONE) { if (chan->next == NULL) { printk(KERN_ERR "dma%d: dcon_num has nothing loaded\n", chan->number); chan->state = S3C_DMA_IDLE; local_irq_restore(flags); return -EINVAL; } s3c_dma_loadbuffer(chan, chan->next); } dbg_showchan(chan); /* enable the channel */ if (!chan->irq_enabled) { enable_irq(chan->irq); chan->irq_enabled = 1; } /* Get the DMA channel started ...*/ dma_wrreg(chan, S3C_DMAC_CxCONFIGURATION, chan->config_flags); pr_debug("%s:wrote %08lx to S3C_DMAC_CxCONFIGURATION.\n",__FUNCTION__, chan->config_flags); /* Start the DMA operation on Peripheral */ s3c_dma_call_op(chan, S3C2410_DMAOP_START); dbg_showchan(chan); local_irq_restore(flags); return 0; }
/* s3c_dma_start * * start a dma channel going */ static int s3c_dma_start(struct s3c2410_dma_chan *chan) { unsigned long flags; pr_debug("s3c_start_dma: channel number=%d, index=%d\n", chan->number, chan->index); local_irq_save(flags); if (chan->state == S3C_DMA_RUNNING) { pr_debug("s3c_start_dma: already running (%d)\n", chan->state); local_irq_restore(flags); return 0; } chan->state = S3C_DMA_RUNNING; /* check wether there is anything to load, and if not, see * if we can find anything to load */ if (chan->load_state == S3C_DMALOAD_NONE) { if (chan->next == NULL) { printk(KERN_ERR "dma CH %d: dcon_num has nothing loaded\n", chan->number); chan->state = S3C_DMA_IDLE; local_irq_restore(flags); return -EINVAL; } s3c_dma_loadbuffer(chan, chan->next); } dbg_showchan(chan); /* enable the channel */ if (!chan->irq_enabled) { enable_irq(chan->irq); chan->irq_enabled = 1; } start_DMA_channel(dma_regaddr(chan->dma_con, S3C_DMAC_DBGSTATUS), chan->number, chan->curr->mcptr, PL330_NON_SECURE_DMA); /* Start the DMA operation on Peripheral */ s3c_dma_call_op(chan, S3C2410_DMAOP_START); dbg_showchan(chan); local_irq_restore(flags); return 0; }
static int s3c_dma_dostop(struct s3c2410_dma_chan *chan) { unsigned long flags; pr_debug("%s: DMA Channel No : %d\n", __FUNCTION__, chan->number); dbg_showchan(chan); local_irq_save(flags); s3c_dma_call_op(chan, S3C2410_DMAOP_STOP); stop_DMA_channel(dma_regaddr(chan->dma_con, S3C_DMAC_DBGSTATUS), chan->number); chan->state = S3C_DMA_IDLE; chan->load_state = S3C_DMALOAD_NONE; local_irq_restore(flags); return 0; }