[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>
This commit is contained in:
parent
b6729deb26
commit
26a552264b
1 changed files with 10 additions and 8 deletions
|
@ -121,6 +121,16 @@ int __init pxa_init_dma(int num_ch)
|
||||||
if (dma_channels == NULL)
|
if (dma_channels == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
/* dma channel priorities on pxa2xx processors:
|
||||||
|
* ch 0 - 3, 16 - 19 <--> (0) DMA_PRIO_HIGH
|
||||||
|
* ch 4 - 7, 20 - 23 <--> (1) DMA_PRIO_MEDIUM
|
||||||
|
* ch 8 - 15, 24 - 31 <--> (2) DMA_PRIO_LOW
|
||||||
|
*/
|
||||||
|
for (i = 0; i < num_ch; i++) {
|
||||||
|
DCSR(i) = 0;
|
||||||
|
dma_channels[i].prio = min((i & 0xf) >> 2, DMA_PRIO_LOW);
|
||||||
|
}
|
||||||
|
|
||||||
ret = request_irq(IRQ_DMA, dma_irq_handler, IRQF_DISABLED, "DMA", NULL);
|
ret = request_irq(IRQ_DMA, dma_irq_handler, IRQF_DISABLED, "DMA", NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printk (KERN_CRIT "Wow! Can't register IRQ for DMA\n");
|
printk (KERN_CRIT "Wow! Can't register IRQ for DMA\n");
|
||||||
|
@ -128,14 +138,6 @@ int __init pxa_init_dma(int num_ch)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dma channel priorities on pxa2xx processors:
|
|
||||||
* ch 0 - 3, 16 - 19 <--> (0) DMA_PRIO_HIGH
|
|
||||||
* ch 4 - 7, 20 - 23 <--> (1) DMA_PRIO_MEDIUM
|
|
||||||
* ch 8 - 15, 24 - 31 <--> (2) DMA_PRIO_LOW
|
|
||||||
*/
|
|
||||||
for (i = 0; i < num_ch; i++)
|
|
||||||
dma_channels[i].prio = min((i & 0xf) >> 2, DMA_PRIO_LOW);
|
|
||||||
|
|
||||||
num_dma_channels = num_ch;
|
num_dma_channels = num_ch;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue