Skip to content

Commit eb092d9

Browse files
popcornmixpelwell
authored andcommitted
bcm2835-dma: Add bcm2835-dma: Add DMA_WIDE_SOURCE and DMA_WIDE_DEST flags
Use bits 28 and 29 of the dreq value (the second cell of the DT DMA descriptor) to request that wide source reads or wide dest writes are required Signed-off-by: Dom Cobley <[email protected]>
1 parent 5837bdb commit eb092d9

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

drivers/dma/bcm2835-dma.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ struct bcm2835_desc {
171171
#define WAIT_RESP(x) ((x & BCM2835_DMA_NO_WAIT_RESP) ? \
172172
0 : BCM2835_DMA_WAIT_RESP)
173173

174+
/* A fake bit to request that the driver requires wide reads */
175+
#define BCM2835_DMA_WIDE_SOURCE BIT(28)
176+
#define WIDE_SOURCE(x) ((x & BCM2835_DMA_WIDE_SOURCE) ? \
177+
BCM2835_DMA_S_WIDTH : 0)
178+
179+
/* A fake bit to request that the driver requires wide writes */
180+
#define BCM2835_DMA_WIDE_DEST BIT(29)
181+
#define WIDE_DEST(x) ((x & BCM2835_DMA_WIDE_DEST) ? \
182+
BCM2835_DMA_D_WIDTH : 0)
183+
184+
174185
/* debug register bits */
175186
#define BCM2835_DMA_DEBUG_LAST_NOT_SET_ERR BIT(0)
176187
#define BCM2835_DMA_DEBUG_FIFO_ERR BIT(1)
@@ -850,8 +861,9 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_memcpy(
850861
{
851862
struct bcm2835_chan *c = to_bcm2835_dma_chan(chan);
852863
struct bcm2835_desc *d;
853-
u32 info = BCM2835_DMA_D_INC | BCM2835_DMA_S_INC;
854-
u32 extra = BCM2835_DMA_INT_EN | WAIT_RESP(c->dreq);
864+
u32 info = BCM2835_DMA_D_INC | BCM2835_DMA_S_INC | WAIT_RESP(c->dreq) |
865+
WIDE_SOURCE(c->dreq) | WIDE_DEST(c->dreq);
866+
u32 extra = BCM2835_DMA_INT_EN;
855867
size_t max_len = bcm2835_dma_max_frame_length(c);
856868
size_t frames;
857869

@@ -881,7 +893,8 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg(
881893
struct bcm2835_chan *c = to_bcm2835_dma_chan(chan);
882894
struct bcm2835_desc *d;
883895
dma_addr_t src = 0, dst = 0;
884-
u32 info = WAIT_RESP(c->dreq);
896+
u32 info = WAIT_RESP(c->dreq) |
897+
WIDE_SOURCE(c->dreq) | WIDE_DEST(c->dreq);
885898
u32 extra = BCM2835_DMA_INT_EN;
886899
size_t frames;
887900

@@ -943,7 +956,7 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_cyclic(
943956
struct bcm2835_chan *c = to_bcm2835_dma_chan(chan);
944957
struct bcm2835_desc *d;
945958
dma_addr_t src, dst;
946-
u32 info = WAIT_RESP(c->dreq);
959+
u32 info = WAIT_RESP(c->dreq) | WIDE_SOURCE(c->dreq) | WIDE_DEST(c->dreq);
947960
u32 extra = 0;
948961
size_t max_len = bcm2835_dma_max_frame_length(c);
949962
size_t frames;

0 commit comments

Comments
 (0)