diff options
Diffstat (limited to 'arch/arm/plat-omap/dma.c')
-rw-r--r-- | arch/arm/plat-omap/dma.c | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 7fe626761e53..c76ed8bff838 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -36,9 +36,8 @@ | |||
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | 38 | ||
39 | #include <mach/hardware.h> | 39 | #include <plat/cpu.h> |
40 | #include <plat/dma.h> | 40 | #include <plat/dma.h> |
41 | |||
42 | #include <plat/tc.h> | 41 | #include <plat/tc.h> |
43 | 42 | ||
44 | /* | 43 | /* |
@@ -969,8 +968,7 @@ void omap_stop_dma(int lch) | |||
969 | l = p->dma_read(CCR, lch); | 968 | l = p->dma_read(CCR, lch); |
970 | } | 969 | } |
971 | if (i >= 100) | 970 | if (i >= 100) |
972 | printk(KERN_ERR "DMA drain did not complete on " | 971 | pr_err("DMA drain did not complete on lch %d\n", lch); |
973 | "lch %d\n", lch); | ||
974 | /* Restore OCP_SYSCONFIG */ | 972 | /* Restore OCP_SYSCONFIG */ |
975 | p->dma_write(sys_cf, OCP_SYSCONFIG, lch); | 973 | p->dma_write(sys_cf, OCP_SYSCONFIG, lch); |
976 | } else { | 974 | } else { |
@@ -1154,8 +1152,7 @@ void omap_dma_link_lch(int lch_head, int lch_queue) | |||
1154 | 1152 | ||
1155 | if ((dma_chan[lch_head].dev_id == -1) || | 1153 | if ((dma_chan[lch_head].dev_id == -1) || |
1156 | (dma_chan[lch_queue].dev_id == -1)) { | 1154 | (dma_chan[lch_queue].dev_id == -1)) { |
1157 | printk(KERN_ERR "omap_dma: trying to link " | 1155 | pr_err("omap_dma: trying to link non requested channels\n"); |
1158 | "non requested channels\n"); | ||
1159 | dump_stack(); | 1156 | dump_stack(); |
1160 | } | 1157 | } |
1161 | 1158 | ||
@@ -1181,15 +1178,13 @@ void omap_dma_unlink_lch(int lch_head, int lch_queue) | |||
1181 | 1178 | ||
1182 | if (dma_chan[lch_head].next_lch != lch_queue || | 1179 | if (dma_chan[lch_head].next_lch != lch_queue || |
1183 | dma_chan[lch_head].next_lch == -1) { | 1180 | dma_chan[lch_head].next_lch == -1) { |
1184 | printk(KERN_ERR "omap_dma: trying to unlink " | 1181 | pr_err("omap_dma: trying to unlink non linked channels\n"); |
1185 | "non linked channels\n"); | ||
1186 | dump_stack(); | 1182 | dump_stack(); |
1187 | } | 1183 | } |
1188 | 1184 | ||
1189 | if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) || | 1185 | if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) || |
1190 | (dma_chan[lch_queue].flags & OMAP_DMA_ACTIVE)) { | 1186 | (dma_chan[lch_queue].flags & OMAP_DMA_ACTIVE)) { |
1191 | printk(KERN_ERR "omap_dma: You need to stop the DMA channels " | 1187 | pr_err("omap_dma: You need to stop the DMA channels before unlinking\n"); |
1192 | "before unlinking\n"); | ||
1193 | dump_stack(); | 1188 | dump_stack(); |
1194 | } | 1189 | } |
1195 | 1190 | ||
@@ -1831,16 +1826,15 @@ static int omap1_dma_handle_ch(int ch) | |||
1831 | if ((csr & 0x3f) == 0) | 1826 | if ((csr & 0x3f) == 0) |
1832 | return 0; | 1827 | return 0; |
1833 | if (unlikely(dma_chan[ch].dev_id == -1)) { | 1828 | if (unlikely(dma_chan[ch].dev_id == -1)) { |
1834 | printk(KERN_WARNING "Spurious interrupt from DMA channel " | 1829 | pr_warn("Spurious interrupt from DMA channel %d (CSR %04x)\n", |
1835 | "%d (CSR %04x)\n", ch, csr); | 1830 | ch, csr); |
1836 | return 0; | 1831 | return 0; |
1837 | } | 1832 | } |
1838 | if (unlikely(csr & OMAP1_DMA_TOUT_IRQ)) | 1833 | if (unlikely(csr & OMAP1_DMA_TOUT_IRQ)) |
1839 | printk(KERN_WARNING "DMA timeout with device %d\n", | 1834 | pr_warn("DMA timeout with device %d\n", dma_chan[ch].dev_id); |
1840 | dma_chan[ch].dev_id); | ||
1841 | if (unlikely(csr & OMAP_DMA_DROP_IRQ)) | 1835 | if (unlikely(csr & OMAP_DMA_DROP_IRQ)) |
1842 | printk(KERN_WARNING "DMA synchronization event drop occurred " | 1836 | pr_warn("DMA synchronization event drop occurred with device %d\n", |
1843 | "with device %d\n", dma_chan[ch].dev_id); | 1837 | dma_chan[ch].dev_id); |
1844 | if (likely(csr & OMAP_DMA_BLOCK_IRQ)) | 1838 | if (likely(csr & OMAP_DMA_BLOCK_IRQ)) |
1845 | dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE; | 1839 | dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE; |
1846 | if (likely(dma_chan[ch].callback != NULL)) | 1840 | if (likely(dma_chan[ch].callback != NULL)) |
@@ -1880,21 +1874,19 @@ static int omap2_dma_handle_ch(int ch) | |||
1880 | 1874 | ||
1881 | if (!status) { | 1875 | if (!status) { |
1882 | if (printk_ratelimit()) | 1876 | if (printk_ratelimit()) |
1883 | printk(KERN_WARNING "Spurious DMA IRQ for lch %d\n", | 1877 | pr_warn("Spurious DMA IRQ for lch %d\n", ch); |
1884 | ch); | ||
1885 | p->dma_write(1 << ch, IRQSTATUS_L0, ch); | 1878 | p->dma_write(1 << ch, IRQSTATUS_L0, ch); |
1886 | return 0; | 1879 | return 0; |
1887 | } | 1880 | } |
1888 | if (unlikely(dma_chan[ch].dev_id == -1)) { | 1881 | if (unlikely(dma_chan[ch].dev_id == -1)) { |
1889 | if (printk_ratelimit()) | 1882 | if (printk_ratelimit()) |
1890 | printk(KERN_WARNING "IRQ %04x for non-allocated DMA" | 1883 | pr_warn("IRQ %04x for non-allocated DMA channel %d\n", |
1891 | "channel %d\n", status, ch); | 1884 | status, ch); |
1892 | return 0; | 1885 | return 0; |
1893 | } | 1886 | } |
1894 | if (unlikely(status & OMAP_DMA_DROP_IRQ)) | 1887 | if (unlikely(status & OMAP_DMA_DROP_IRQ)) |
1895 | printk(KERN_INFO | 1888 | pr_info("DMA synchronization event drop occurred with device %d\n", |
1896 | "DMA synchronization event drop occurred with device " | 1889 | dma_chan[ch].dev_id); |
1897 | "%d\n", dma_chan[ch].dev_id); | ||
1898 | if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) { | 1890 | if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) { |
1899 | printk(KERN_INFO "DMA transaction error with device %d\n", | 1891 | printk(KERN_INFO "DMA transaction error with device %d\n", |
1900 | dma_chan[ch].dev_id); | 1892 | dma_chan[ch].dev_id); |
@@ -2014,8 +2006,9 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2014 | 2006 | ||
2015 | p = pdev->dev.platform_data; | 2007 | p = pdev->dev.platform_data; |
2016 | if (!p) { | 2008 | if (!p) { |
2017 | dev_err(&pdev->dev, "%s: System DMA initialized without" | 2009 | dev_err(&pdev->dev, |
2018 | "platform data\n", __func__); | 2010 | "%s: System DMA initialized without platform data\n", |
2011 | __func__); | ||
2019 | return -EINVAL; | 2012 | return -EINVAL; |
2020 | } | 2013 | } |
2021 | 2014 | ||
@@ -2090,8 +2083,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2090 | } | 2083 | } |
2091 | ret = setup_irq(dma_irq, &omap24xx_dma_irq); | 2084 | ret = setup_irq(dma_irq, &omap24xx_dma_irq); |
2092 | if (ret) { | 2085 | if (ret) { |
2093 | dev_err(&pdev->dev, "set_up failed for IRQ %d" | 2086 | dev_err(&pdev->dev, "set_up failed for IRQ %d for DMA (error %d)\n", |
2094 | "for DMA (error %d)\n", dma_irq, ret); | 2087 | dma_irq, ret); |
2095 | goto exit_dma_lch_fail; | 2088 | goto exit_dma_lch_fail; |
2096 | } | 2089 | } |
2097 | } | 2090 | } |
@@ -2099,8 +2092,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2099 | /* reserve dma channels 0 and 1 in high security devices */ | 2092 | /* reserve dma channels 0 and 1 in high security devices */ |
2100 | if (cpu_is_omap34xx() && | 2093 | if (cpu_is_omap34xx() && |
2101 | (omap_type() != OMAP2_DEVICE_TYPE_GP)) { | 2094 | (omap_type() != OMAP2_DEVICE_TYPE_GP)) { |
2102 | printk(KERN_INFO "Reserving DMA channels 0 and 1 for " | 2095 | pr_info("Reserving DMA channels 0 and 1 for HS ROM code\n"); |
2103 | "HS ROM code\n"); | ||
2104 | dma_chan[0].dev_id = 0; | 2096 | dma_chan[0].dev_id = 0; |
2105 | dma_chan[1].dev_id = 1; | 2097 | dma_chan[1].dev_id = 1; |
2106 | } | 2098 | } |
@@ -2108,8 +2100,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2108 | return 0; | 2100 | return 0; |
2109 | 2101 | ||
2110 | exit_dma_irq_fail: | 2102 | exit_dma_irq_fail: |
2111 | dev_err(&pdev->dev, "unable to request IRQ %d" | 2103 | dev_err(&pdev->dev, "unable to request IRQ %d for DMA (error %d)\n", |
2112 | "for DMA (error %d)\n", dma_irq, ret); | 2104 | dma_irq, ret); |
2113 | for (irq_rel = 0; irq_rel < ch; irq_rel++) { | 2105 | for (irq_rel = 0; irq_rel < ch; irq_rel++) { |
2114 | dma_irq = platform_get_irq(pdev, irq_rel); | 2106 | dma_irq = platform_get_irq(pdev, irq_rel); |
2115 | free_irq(dma_irq, (void *)(irq_rel + 1)); | 2107 | free_irq(dma_irq, (void *)(irq_rel + 1)); |