Skip to content

Commit f02f5b8

Browse files
notropopcornmix
authored andcommitted
dmaengine: bcm2835: Add debug option for setting wait states
[by popcornmix, taken from bcm2708-dmaengine] Signed-off-by: Noralf Trønnes <[email protected]>
1 parent 7835fbd commit f02f5b8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/dma/bcm2835-dma.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646

4747
#include "virt-dma.h"
4848

49+
static unsigned dma_debug;
50+
module_param(dma_debug, uint, 0644);
51+
4952
struct bcm2835_dmadev {
5053
struct dma_device ddev;
5154
spinlock_t lock;
@@ -571,6 +574,7 @@ bcm2835_dma_prep_slave_sg(struct dma_chan *chan,
571574
unsigned int len = sg_dma_len(sgent);
572575

573576
for (j = 0; j < len; j += max_size) {
577+
u32 waits;
574578
struct bcm2835_dma_cb *control_block =
575579
&d->control_block_base[i + split_cnt];
576580

@@ -590,8 +594,10 @@ bcm2835_dma_prep_slave_sg(struct dma_chan *chan,
590594
}
591595

592596
/* Common part */
593-
control_block->info |=
594-
BCM2835_DMA_WAITS(BCM2835_DMA_WAIT_CYCLES);
597+
waits = BCM2835_DMA_WAIT_CYCLES;
598+
if ((dma_debug >> 0) & 0x1f)
599+
waits = (dma_debug >> 0) & 0x1f;
600+
control_block->info |= BCM2835_DMA_WAITS(waits);
595601
control_block->info |= BCM2835_DMA_WAIT_RESP;
596602

597603
/* Enable */
@@ -856,6 +862,7 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
856862
}
857863

858864
dev_dbg(&pdev->dev, "Load BCM2835 DMA engine driver\n");
865+
dev_info(&pdev->dev, "dma_debug:%x\n", dma_debug);
859866

860867
return 0;
861868

0 commit comments

Comments
 (0)