]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/blackfin/kernel/bfin_dma_5xx.c
Merge branch 'linus' into tmp.x86.mpparse.new
[linux-2.6-omap-h63xx.git] / arch / blackfin / kernel / bfin_dma_5xx.c
index 5453bc3664fc40eb47474f8a2297c6ae7e0835ac..d54f19085f37a13d5b7798f387bd65aa83373ce0 100644 (file)
@@ -67,7 +67,7 @@ static int __init blackfin_dma_init(void)
 
        for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++) {
                dma_ch[i].chan_status = DMA_CHANNEL_FREE;
-               dma_ch[i].regs = base_addr[i];
+               dma_ch[i].regs = dma_io_base_addr[i];
                mutex_init(&(dma_ch[i].dmalock));
        }
        /* Mark MEMDMA Channel 0 as requested since we're using it internally */
@@ -90,6 +90,17 @@ int request_dma(unsigned int channel, char *device_id)
 {
 
        pr_debug("request_dma() : BEGIN \n");
+
+#if defined(CONFIG_BF561) && ANOMALY_05000182
+       if (channel >= CH_IMEM_STREAM0_DEST && channel <= CH_IMEM_STREAM1_DEST) {
+               if (get_cclk() > 500000000) {
+                       printk(KERN_WARNING
+                              "Request IMDMA failed due to ANOMALY 05000182\n");
+                       return -EFAULT;
+               }
+       }
+#endif
+
        mutex_lock(&(dma_ch[channel].dmalock));
 
        if ((dma_ch[channel].chan_status == DMA_CHANNEL_REQUESTED)
@@ -105,13 +116,17 @@ int request_dma(unsigned int channel, char *device_id)
        mutex_unlock(&(dma_ch[channel].dmalock));
 
 #ifdef CONFIG_BF54x
-       if (channel >= CH_UART2_RX && channel <= CH_UART3_TX &&
-               strncmp(device_id, "BFIN_UART", 9) == 0)
-               dma_ch[channel].regs->peripheral_map |=
-                       (channel - CH_UART2_RX + 0xC);
-       else
-               dma_ch[channel].regs->peripheral_map |=
-                       (channel - CH_UART2_RX + 0x6);
+       if (channel >= CH_UART2_RX && channel <= CH_UART3_TX) {
+               if (strncmp(device_id, "BFIN_UART", 9) == 0) {
+                       dma_ch[channel].regs->peripheral_map &= 0x0FFF;
+                       dma_ch[channel].regs->peripheral_map |=
+                               ((channel - CH_UART2_RX + 0xC)<<12);
+               } else {
+                       dma_ch[channel].regs->peripheral_map &= 0x0FFF;
+                       dma_ch[channel].regs->peripheral_map |=
+                               ((channel - CH_UART2_RX + 0x6)<<12);
+               }
+       }
 #endif
 
        dma_ch[channel].device_id = device_id;