2 * File: arch/blackfin/kernel/bfin_dma_5xx.c
7 * Description: This file contains the simple DMA Implementation for Blackfin
10 * Copyright 2004-2006 Analog Devices Inc.
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 #include <linux/errno.h>
31 #include <linux/module.h>
32 #include <linux/sched.h>
33 #include <linux/interrupt.h>
34 #include <linux/kernel.h>
35 #include <linux/param.h>
38 #include <asm/cacheflush.h>
40 /* Remove unused code not exported by symbol or internally called */
41 #define REMOVE_DEAD_CODE
43 /**************************************************************************
45 ***************************************************************************/
47 static struct dma_channel dma_ch[MAX_BLACKFIN_DMA_CHANNEL];
48 #if defined (CONFIG_BF561)
49 static struct dma_register *base_addr[MAX_BLACKFIN_DMA_CHANNEL] = {
50 (struct dma_register *) DMA1_0_NEXT_DESC_PTR,
51 (struct dma_register *) DMA1_1_NEXT_DESC_PTR,
52 (struct dma_register *) DMA1_2_NEXT_DESC_PTR,
53 (struct dma_register *) DMA1_3_NEXT_DESC_PTR,
54 (struct dma_register *) DMA1_4_NEXT_DESC_PTR,
55 (struct dma_register *) DMA1_5_NEXT_DESC_PTR,
56 (struct dma_register *) DMA1_6_NEXT_DESC_PTR,
57 (struct dma_register *) DMA1_7_NEXT_DESC_PTR,
58 (struct dma_register *) DMA1_8_NEXT_DESC_PTR,
59 (struct dma_register *) DMA1_9_NEXT_DESC_PTR,
60 (struct dma_register *) DMA1_10_NEXT_DESC_PTR,
61 (struct dma_register *) DMA1_11_NEXT_DESC_PTR,
62 (struct dma_register *) DMA2_0_NEXT_DESC_PTR,
63 (struct dma_register *) DMA2_1_NEXT_DESC_PTR,
64 (struct dma_register *) DMA2_2_NEXT_DESC_PTR,
65 (struct dma_register *) DMA2_3_NEXT_DESC_PTR,
66 (struct dma_register *) DMA2_4_NEXT_DESC_PTR,
67 (struct dma_register *) DMA2_5_NEXT_DESC_PTR,
68 (struct dma_register *) DMA2_6_NEXT_DESC_PTR,
69 (struct dma_register *) DMA2_7_NEXT_DESC_PTR,
70 (struct dma_register *) DMA2_8_NEXT_DESC_PTR,
71 (struct dma_register *) DMA2_9_NEXT_DESC_PTR,
72 (struct dma_register *) DMA2_10_NEXT_DESC_PTR,
73 (struct dma_register *) DMA2_11_NEXT_DESC_PTR,
74 (struct dma_register *) MDMA1_D0_NEXT_DESC_PTR,
75 (struct dma_register *) MDMA1_S0_NEXT_DESC_PTR,
76 (struct dma_register *) MDMA1_D1_NEXT_DESC_PTR,
77 (struct dma_register *) MDMA1_S1_NEXT_DESC_PTR,
78 (struct dma_register *) MDMA2_D0_NEXT_DESC_PTR,
79 (struct dma_register *) MDMA2_S0_NEXT_DESC_PTR,
80 (struct dma_register *) MDMA2_D1_NEXT_DESC_PTR,
81 (struct dma_register *) MDMA2_S1_NEXT_DESC_PTR,
82 (struct dma_register *) IMDMA_D0_NEXT_DESC_PTR,
83 (struct dma_register *) IMDMA_S0_NEXT_DESC_PTR,
84 (struct dma_register *) IMDMA_D1_NEXT_DESC_PTR,
85 (struct dma_register *) IMDMA_S1_NEXT_DESC_PTR,
88 static struct dma_register *base_addr[MAX_BLACKFIN_DMA_CHANNEL] = {
89 (struct dma_register *) DMA0_NEXT_DESC_PTR,
90 (struct dma_register *) DMA1_NEXT_DESC_PTR,
91 (struct dma_register *) DMA2_NEXT_DESC_PTR,
92 (struct dma_register *) DMA3_NEXT_DESC_PTR,
93 (struct dma_register *) DMA4_NEXT_DESC_PTR,
94 (struct dma_register *) DMA5_NEXT_DESC_PTR,
95 (struct dma_register *) DMA6_NEXT_DESC_PTR,
96 (struct dma_register *) DMA7_NEXT_DESC_PTR,
97 #if (defined(CONFIG_BF537) || defined(CONFIG_BF534) || defined(CONFIG_BF536))
98 (struct dma_register *) DMA8_NEXT_DESC_PTR,
99 (struct dma_register *) DMA9_NEXT_DESC_PTR,
100 (struct dma_register *) DMA10_NEXT_DESC_PTR,
101 (struct dma_register *) DMA11_NEXT_DESC_PTR,
103 (struct dma_register *) MDMA_D0_NEXT_DESC_PTR,
104 (struct dma_register *) MDMA_S0_NEXT_DESC_PTR,
105 (struct dma_register *) MDMA_D1_NEXT_DESC_PTR,
106 (struct dma_register *) MDMA_S1_NEXT_DESC_PTR,
110 /*------------------------------------------------------------------------------
111 * Set the Buffer Clear bit in the Configuration register of specific DMA
112 * channel. This will stop the descriptor based DMA operation.
113 *-----------------------------------------------------------------------------*/
114 static void clear_dma_buffer(unsigned int channel)
116 dma_ch[channel].regs->cfg |= RESTART;
118 dma_ch[channel].regs->cfg &= ~RESTART;
122 int __init blackfin_dma_init(void)
126 printk(KERN_INFO "Blackfin DMA Controller\n");
128 for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++) {
129 dma_ch[i].chan_status = DMA_CHANNEL_FREE;
130 dma_ch[i].regs = base_addr[i];
131 mutex_init(&(dma_ch[i].dmalock));
137 arch_initcall(blackfin_dma_init);
140 * Form the channel find the irq number for that channel.
142 #if !defined(CONFIG_BF561)
144 static int bf533_channel2irq(unsigned int channel)
153 #if (defined(CONFIG_BF537) || defined(CONFIG_BF534) || defined(CONFIG_BF536))
155 ret_irq = IRQ_MAC_RX;
159 ret_irq = IRQ_MAC_TX;
163 ret_irq = IRQ_UART1_RX;
167 ret_irq = IRQ_UART1_TX;
172 ret_irq = IRQ_SPORT0_RX;
176 ret_irq = IRQ_SPORT0_TX;
180 ret_irq = IRQ_SPORT1_RX;
184 ret_irq = IRQ_SPORT1_TX;
192 ret_irq = IRQ_UART_RX;
196 ret_irq = IRQ_UART_TX;
199 case CH_MEM_STREAM0_SRC:
200 case CH_MEM_STREAM0_DEST:
201 ret_irq = IRQ_MEM_DMA0;
204 case CH_MEM_STREAM1_SRC:
205 case CH_MEM_STREAM1_DEST:
206 ret_irq = IRQ_MEM_DMA1;
212 # define channel2irq(channel) bf533_channel2irq(channel)
216 static int bf561_channel2irq(unsigned int channel)
228 ret_irq = IRQ_SPORT0_RX;
231 ret_irq = IRQ_SPORT0_TX;
234 ret_irq = IRQ_SPORT1_RX;
237 ret_irq = IRQ_SPORT1_TX;
243 ret_irq = IRQ_UART_RX;
246 ret_irq = IRQ_UART_TX;
249 case CH_MEM_STREAM0_SRC:
250 case CH_MEM_STREAM0_DEST:
251 ret_irq = IRQ_MEM_DMA0;
253 case CH_MEM_STREAM1_SRC:
254 case CH_MEM_STREAM1_DEST:
255 ret_irq = IRQ_MEM_DMA1;
257 case CH_MEM_STREAM2_SRC:
258 case CH_MEM_STREAM2_DEST:
259 ret_irq = IRQ_MEM_DMA2;
261 case CH_MEM_STREAM3_SRC:
262 case CH_MEM_STREAM3_DEST:
263 ret_irq = IRQ_MEM_DMA3;
266 case CH_IMEM_STREAM0_SRC:
267 case CH_IMEM_STREAM0_DEST:
268 ret_irq = IRQ_IMEM_DMA0;
270 case CH_IMEM_STREAM1_SRC:
271 case CH_IMEM_STREAM1_DEST:
272 ret_irq = IRQ_IMEM_DMA1;
278 # define channel2irq(channel) bf561_channel2irq(channel)
282 /*------------------------------------------------------------------------------
283 * Request the specific DMA channel from the system.
284 *-----------------------------------------------------------------------------*/
285 int request_dma(unsigned int channel, char *device_id)
288 pr_debug("request_dma() : BEGIN \n");
289 mutex_lock(&(dma_ch[channel].dmalock));
291 if ((dma_ch[channel].chan_status == DMA_CHANNEL_REQUESTED)
292 || (dma_ch[channel].chan_status == DMA_CHANNEL_ENABLED)) {
293 mutex_unlock(&(dma_ch[channel].dmalock));
294 pr_debug("DMA CHANNEL IN USE \n");
297 dma_ch[channel].chan_status = DMA_CHANNEL_REQUESTED;
298 pr_debug("DMA CHANNEL IS ALLOCATED \n");
301 mutex_unlock(&(dma_ch[channel].dmalock));
303 dma_ch[channel].device_id = device_id;
304 dma_ch[channel].irq_callback = NULL;
306 /* This is to be enabled by putting a restriction -
307 * you have to request DMA, before doing any operations on
310 pr_debug("request_dma() : END \n");
313 EXPORT_SYMBOL(request_dma);
315 int set_dma_callback(unsigned int channel, dma_interrupt_t callback, void *data)
319 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
320 && channel < MAX_BLACKFIN_DMA_CHANNEL));
322 if (callback != NULL) {
324 ret_irq = channel2irq(channel);
326 dma_ch[channel].data = data;
329 request_irq(ret_irq, (void *)callback, IRQF_DISABLED,
330 dma_ch[channel].device_id, data);
333 "Request irq in DMA engine failed.\n");
336 dma_ch[channel].irq_callback = callback;
340 EXPORT_SYMBOL(set_dma_callback);
342 void free_dma(unsigned int channel)
346 pr_debug("freedma() : BEGIN \n");
347 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
348 && channel < MAX_BLACKFIN_DMA_CHANNEL));
351 disable_dma(channel);
352 clear_dma_buffer(channel);
354 if (dma_ch[channel].irq_callback != NULL) {
355 ret_irq = channel2irq(channel);
356 free_irq(ret_irq, dma_ch[channel].data);
359 /* Clear the DMA Variable in the Channel */
360 mutex_lock(&(dma_ch[channel].dmalock));
361 dma_ch[channel].chan_status = DMA_CHANNEL_FREE;
362 mutex_unlock(&(dma_ch[channel].dmalock));
364 pr_debug("freedma() : END \n");
366 EXPORT_SYMBOL(free_dma);
368 void dma_enable_irq(unsigned int channel)
372 pr_debug("dma_enable_irq() : BEGIN \n");
373 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
374 && channel < MAX_BLACKFIN_DMA_CHANNEL));
376 ret_irq = channel2irq(channel);
379 EXPORT_SYMBOL(dma_enable_irq);
381 void dma_disable_irq(unsigned int channel)
385 pr_debug("dma_disable_irq() : BEGIN \n");
386 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
387 && channel < MAX_BLACKFIN_DMA_CHANNEL));
389 ret_irq = channel2irq(channel);
390 disable_irq(ret_irq);
392 EXPORT_SYMBOL(dma_disable_irq);
394 int dma_channel_active(unsigned int channel)
396 if (dma_ch[channel].chan_status == DMA_CHANNEL_FREE) {
402 EXPORT_SYMBOL(dma_channel_active);
404 /*------------------------------------------------------------------------------
405 * stop the specific DMA channel.
406 *-----------------------------------------------------------------------------*/
407 void disable_dma(unsigned int channel)
409 pr_debug("stop_dma() : BEGIN \n");
411 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
412 && channel < MAX_BLACKFIN_DMA_CHANNEL));
414 dma_ch[channel].regs->cfg &= ~DMAEN; /* Clean the enable bit */
416 dma_ch[channel].chan_status = DMA_CHANNEL_REQUESTED;
417 /* Needs to be enabled Later */
418 pr_debug("stop_dma() : END \n");
421 EXPORT_SYMBOL(disable_dma);
423 void enable_dma(unsigned int channel)
425 pr_debug("enable_dma() : BEGIN \n");
427 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
428 && channel < MAX_BLACKFIN_DMA_CHANNEL));
430 dma_ch[channel].chan_status = DMA_CHANNEL_ENABLED;
431 dma_ch[channel].regs->curr_x_count = 0;
432 dma_ch[channel].regs->curr_y_count = 0;
434 dma_ch[channel].regs->cfg |= DMAEN; /* Set the enable bit */
436 pr_debug("enable_dma() : END \n");
439 EXPORT_SYMBOL(enable_dma);
441 /*------------------------------------------------------------------------------
442 * Set the Start Address register for the specific DMA channel
443 * This function can be used for register based DMA,
444 * to setup the start address
445 * addr: Starting address of the DMA Data to be transferred.
446 *-----------------------------------------------------------------------------*/
447 void set_dma_start_addr(unsigned int channel, unsigned long addr)
449 pr_debug("set_dma_start_addr() : BEGIN \n");
451 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
452 && channel < MAX_BLACKFIN_DMA_CHANNEL));
454 dma_ch[channel].regs->start_addr = addr;
456 pr_debug("set_dma_start_addr() : END\n");
458 EXPORT_SYMBOL(set_dma_start_addr);
460 void set_dma_next_desc_addr(unsigned int channel, unsigned long addr)
462 pr_debug("set_dma_next_desc_addr() : BEGIN \n");
464 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
465 && channel < MAX_BLACKFIN_DMA_CHANNEL));
467 dma_ch[channel].regs->next_desc_ptr = addr;
469 pr_debug("set_dma_start_addr() : END\n");
471 EXPORT_SYMBOL(set_dma_next_desc_addr);
473 void set_dma_x_count(unsigned int channel, unsigned short x_count)
475 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
476 && channel < MAX_BLACKFIN_DMA_CHANNEL));
478 dma_ch[channel].regs->x_count = x_count;
481 EXPORT_SYMBOL(set_dma_x_count);
483 void set_dma_y_count(unsigned int channel, unsigned short y_count)
485 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
486 && channel < MAX_BLACKFIN_DMA_CHANNEL));
488 dma_ch[channel].regs->y_count = y_count;
491 EXPORT_SYMBOL(set_dma_y_count);
493 void set_dma_x_modify(unsigned int channel, short x_modify)
495 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
496 && channel < MAX_BLACKFIN_DMA_CHANNEL));
498 dma_ch[channel].regs->x_modify = x_modify;
501 EXPORT_SYMBOL(set_dma_x_modify);
503 void set_dma_y_modify(unsigned int channel, short y_modify)
505 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
506 && channel < MAX_BLACKFIN_DMA_CHANNEL));
508 dma_ch[channel].regs->y_modify = y_modify;
511 EXPORT_SYMBOL(set_dma_y_modify);
513 void set_dma_config(unsigned int channel, unsigned short config)
515 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
516 && channel < MAX_BLACKFIN_DMA_CHANNEL));
518 dma_ch[channel].regs->cfg = config;
521 EXPORT_SYMBOL(set_dma_config);
524 set_bfin_dma_config(char direction, char flow_mode,
525 char intr_mode, char dma_mode, char width)
527 unsigned short config;
530 ((direction << 1) | (width << 2) | (dma_mode << 4) |
531 (intr_mode << 6) | (flow_mode << 12) | RESTART);
534 EXPORT_SYMBOL(set_bfin_dma_config);
536 void set_dma_sg(unsigned int channel, struct dmasg * sg, int nr_sg)
538 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
539 && channel < MAX_BLACKFIN_DMA_CHANNEL));
541 dma_ch[channel].regs->cfg |= ((nr_sg & 0x0F) << 8);
543 dma_ch[channel].regs->next_desc_ptr = (unsigned int)sg;
547 EXPORT_SYMBOL(set_dma_sg);
549 /*------------------------------------------------------------------------------
550 * Get the DMA status of a specific DMA channel from the system.
551 *-----------------------------------------------------------------------------*/
552 unsigned short get_dma_curr_irqstat(unsigned int channel)
554 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
555 && channel < MAX_BLACKFIN_DMA_CHANNEL));
557 return dma_ch[channel].regs->irq_status;
559 EXPORT_SYMBOL(get_dma_curr_irqstat);
561 /*------------------------------------------------------------------------------
562 * Clear the DMA_DONE bit in DMA status. Stop the DMA completion interrupt.
563 *-----------------------------------------------------------------------------*/
564 void clear_dma_irqstat(unsigned int channel)
566 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
567 && channel < MAX_BLACKFIN_DMA_CHANNEL));
568 dma_ch[channel].regs->irq_status |= 3;
570 EXPORT_SYMBOL(clear_dma_irqstat);
572 /*------------------------------------------------------------------------------
573 * Get current DMA xcount of a specific DMA channel from the system.
574 *-----------------------------------------------------------------------------*/
575 unsigned short get_dma_curr_xcount(unsigned int channel)
577 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
578 && channel < MAX_BLACKFIN_DMA_CHANNEL));
580 return dma_ch[channel].regs->curr_x_count;
582 EXPORT_SYMBOL(get_dma_curr_xcount);
584 /*------------------------------------------------------------------------------
585 * Get current DMA ycount of a specific DMA channel from the system.
586 *-----------------------------------------------------------------------------*/
587 unsigned short get_dma_curr_ycount(unsigned int channel)
589 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
590 && channel < MAX_BLACKFIN_DMA_CHANNEL));
592 return dma_ch[channel].regs->curr_y_count;
594 EXPORT_SYMBOL(get_dma_curr_ycount);
596 void *dma_memcpy(void *dest, const void *src, size_t size)
598 int direction; /* 1 - address decrease, 0 - address increase */
599 int flag_align; /* 1 - address aligned, 0 - address unaligned */
600 int flag_2D; /* 1 - 2D DMA needed, 0 - 1D DMA needed */
605 if ((unsigned long)src < memory_end)
606 blackfin_dcache_flush_range((unsigned int)src,
607 (unsigned int)(src + size));
609 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
611 if ((unsigned long)src < (unsigned long)dest)
616 if ((((unsigned long)dest % 2) == 0) && (((unsigned long)src % 2) == 0)
617 && ((size % 2) == 0))
622 if (size > 0x10000) /* size > 64K */
627 /* Setup destination and source start address */
630 bfin_write_MDMA_D0_START_ADDR(dest + size - 2);
631 bfin_write_MDMA_S0_START_ADDR(src + size - 2);
633 bfin_write_MDMA_D0_START_ADDR(dest + size - 1);
634 bfin_write_MDMA_S0_START_ADDR(src + size - 1);
637 bfin_write_MDMA_D0_START_ADDR(dest);
638 bfin_write_MDMA_S0_START_ADDR(src);
641 /* Setup destination and source xcount */
644 bfin_write_MDMA_D0_X_COUNT(1024 / 2);
645 bfin_write_MDMA_S0_X_COUNT(1024 / 2);
647 bfin_write_MDMA_D0_X_COUNT(1024);
648 bfin_write_MDMA_S0_X_COUNT(1024);
650 bfin_write_MDMA_D0_Y_COUNT(size >> 10);
651 bfin_write_MDMA_S0_Y_COUNT(size >> 10);
654 bfin_write_MDMA_D0_X_COUNT(size / 2);
655 bfin_write_MDMA_S0_X_COUNT(size / 2);
657 bfin_write_MDMA_D0_X_COUNT(size);
658 bfin_write_MDMA_S0_X_COUNT(size);
662 /* Setup destination and source xmodify and ymodify */
665 bfin_write_MDMA_D0_X_MODIFY(-2);
666 bfin_write_MDMA_S0_X_MODIFY(-2);
668 bfin_write_MDMA_D0_Y_MODIFY(-2);
669 bfin_write_MDMA_S0_Y_MODIFY(-2);
672 bfin_write_MDMA_D0_X_MODIFY(-1);
673 bfin_write_MDMA_S0_X_MODIFY(-1);
675 bfin_write_MDMA_D0_Y_MODIFY(-1);
676 bfin_write_MDMA_S0_Y_MODIFY(-1);
681 bfin_write_MDMA_D0_X_MODIFY(2);
682 bfin_write_MDMA_S0_X_MODIFY(2);
684 bfin_write_MDMA_D0_Y_MODIFY(2);
685 bfin_write_MDMA_S0_Y_MODIFY(2);
688 bfin_write_MDMA_D0_X_MODIFY(1);
689 bfin_write_MDMA_S0_X_MODIFY(1);
691 bfin_write_MDMA_D0_Y_MODIFY(1);
692 bfin_write_MDMA_S0_Y_MODIFY(1);
697 /* Enable source DMA */
700 bfin_write_MDMA_S0_CONFIG(DMAEN | DMA2D | WDSIZE_16);
701 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | DMA2D | WDSIZE_16);
703 bfin_write_MDMA_S0_CONFIG(DMAEN | DMA2D);
704 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | DMA2D);
708 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16);
709 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16);
711 bfin_write_MDMA_S0_CONFIG(DMAEN);
712 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN);
716 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE))
719 bfin_write_MDMA_D0_IRQ_STATUS(bfin_read_MDMA_D0_IRQ_STATUS() |
720 (DMA_DONE | DMA_ERR));
722 bfin_write_MDMA_S0_CONFIG(0);
723 bfin_write_MDMA_D0_CONFIG(0);
725 if ((unsigned long)dest < memory_end)
726 blackfin_dcache_invalidate_range((unsigned int)dest,
727 (unsigned int)(dest + size));
731 EXPORT_SYMBOL(dma_memcpy);
733 void *safe_dma_memcpy(void *dest, const void *src, size_t size)
737 local_irq_save(flags);
738 addr = dma_memcpy(dest, src, size);
739 local_irq_restore(flags);
742 EXPORT_SYMBOL(safe_dma_memcpy);