aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2009-01-20 22:29:19 -0500
committerEric Miao <eric.miao@marvell.com>2009-01-20 22:29:19 -0500
commit26a552264bc92d2ec4747b1babb7cb1264908018 (patch)
tree8eeec2279f53274757517c504736fed3bbd6c140
parentb6729deb26a131083add5b7238c7b7478ef6b502 (diff)
[ARM] pxa: stop and disable IRQ for each DMA channels at startup
Some broken bootloaders will leave the DMA channel state unclean, which we should really initialize correctly here. Signed-off-by: Eric Miao <eric.miao@marvell.com>
-rw-r--r--arch/arm/mach-pxa/dma.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/arm/mach-pxa/dma.c b/arch/arm/mach-pxa/dma.c
index b1514fb20d3a..7de17fc5d54b 100644
--- a/arch/arm/mach-pxa/dma.c
+++ b/arch/arm/mach-pxa/dma.c
@@ -121,20 +121,22 @@ int __init pxa_init_dma(int num_ch)
121 if (dma_channels == NULL) 121 if (dma_channels == NULL)
122 return -ENOMEM; 122 return -ENOMEM;
123 123
124 ret = request_irq(IRQ_DMA, dma_irq_handler, IRQF_DISABLED, "DMA", NULL);
125 if (ret) {
126 printk (KERN_CRIT "Wow! Can't register IRQ for DMA\n");
127 kfree(dma_channels);
128 return ret;
129 }
130
131 /* dma channel priorities on pxa2xx processors: 124 /* dma channel priorities on pxa2xx processors:
132 * ch 0 - 3, 16 - 19 <--> (0) DMA_PRIO_HIGH 125 * ch 0 - 3, 16 - 19 <--> (0) DMA_PRIO_HIGH
133 * ch 4 - 7, 20 - 23 <--> (1) DMA_PRIO_MEDIUM 126 * ch 4 - 7, 20 - 23 <--> (1) DMA_PRIO_MEDIUM
134 * ch 8 - 15, 24 - 31 <--> (2) DMA_PRIO_LOW 127 * ch 8 - 15, 24 - 31 <--> (2) DMA_PRIO_LOW
135 */ 128 */
136 for (i = 0; i < num_ch; i++) 129 for (i = 0; i < num_ch; i++) {
130 DCSR(i) = 0;
137 dma_channels[i].prio = min((i & 0xf) >> 2, DMA_PRIO_LOW); 131 dma_channels[i].prio = min((i & 0xf) >> 2, DMA_PRIO_LOW);
132 }
133
134 ret = request_irq(IRQ_DMA, dma_irq_handler, IRQF_DISABLED, "DMA", NULL);
135 if (ret) {
136 printk (KERN_CRIT "Wow! Can't register IRQ for DMA\n");
137 kfree(dma_channels);
138 return ret;
139 }
138 140
139 num_dma_channels = num_ch; 141 num_dma_channels = num_ch;
140 return 0; 142 return 0;