aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/bfin_dma_5xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/kernel/bfin_dma_5xx.c')
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 9f9b82816652..384868dedac3 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -19,6 +19,7 @@
19#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
20#include <asm/dma.h> 20#include <asm/dma.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/early_printk.h>
22 23
23/* 24/*
24 * To make sure we work around 05000119 - we always check DMA_DONE bit, 25 * To make sure we work around 05000119 - we always check DMA_DONE bit,
@@ -146,8 +147,8 @@ EXPORT_SYMBOL(request_dma);
146 147
147int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data) 148int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data)
148{ 149{
149 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE 150 BUG_ON(channel >= MAX_DMA_CHANNELS ||
150 && channel < MAX_DMA_CHANNELS)); 151 dma_ch[channel].chan_status == DMA_CHANNEL_FREE);
151 152
152 if (callback != NULL) { 153 if (callback != NULL) {
153 int ret; 154 int ret;
@@ -181,8 +182,8 @@ static void clear_dma_buffer(unsigned int channel)
181void free_dma(unsigned int channel) 182void free_dma(unsigned int channel)
182{ 183{
183 pr_debug("freedma() : BEGIN \n"); 184 pr_debug("freedma() : BEGIN \n");
184 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE 185 BUG_ON(channel >= MAX_DMA_CHANNELS ||
185 && channel < MAX_DMA_CHANNELS)); 186 dma_ch[channel].chan_status == DMA_CHANNEL_FREE);
186 187
187 /* Halt the DMA */ 188 /* Halt the DMA */
188 disable_dma(channel); 189 disable_dma(channel);
@@ -236,6 +237,7 @@ void blackfin_dma_resume(void)
236 */ 237 */
237void __init blackfin_dma_early_init(void) 238void __init blackfin_dma_early_init(void)
238{ 239{
240 early_shadow_stamp();
239 bfin_write_MDMA_S0_CONFIG(0); 241 bfin_write_MDMA_S0_CONFIG(0);
240 bfin_write_MDMA_S1_CONFIG(0); 242 bfin_write_MDMA_S1_CONFIG(0);
241} 243}
@@ -246,6 +248,8 @@ void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size)
246 unsigned long src = (unsigned long)psrc; 248 unsigned long src = (unsigned long)psrc;
247 struct dma_register *dst_ch, *src_ch; 249 struct dma_register *dst_ch, *src_ch;
248 250
251 early_shadow_stamp();
252
249 /* We assume that everything is 4 byte aligned, so include 253 /* We assume that everything is 4 byte aligned, so include
250 * a basic sanity check 254 * a basic sanity check
251 */ 255 */
@@ -300,6 +304,8 @@ void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size)
300 304
301void __init early_dma_memcpy_done(void) 305void __init early_dma_memcpy_done(void)
302{ 306{
307 early_shadow_stamp();
308
303 while ((bfin_read_MDMA_S0_CONFIG() && !(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)) || 309 while ((bfin_read_MDMA_S0_CONFIG() && !(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)) ||
304 (bfin_read_MDMA_S1_CONFIG() && !(bfin_read_MDMA_D1_IRQ_STATUS() & DMA_DONE))) 310 (bfin_read_MDMA_S1_CONFIG() && !(bfin_read_MDMA_D1_IRQ_STATUS() & DMA_DONE)))
305 continue; 311 continue;