Skip to content

Commit

Permalink
Disables the DMA controller and performs a reset during initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroInnovator committed Jan 4, 2025
1 parent 7ebb593 commit 5c8a478
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/dma/dma_sam0.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,12 @@ static int dma_sam0_init(const struct device *dev)
PM->APBBMASK.bit.DMAC_ = 1;
#endif

/* Reset the DMA controller */
DMAC->CTRL.bit.DMAENABLE = 0;
DMAC->CTRL.bit.CRCENABLE = 0;
DMAC->CTRL.bit.SWRST = 1;
while (DMAC->CTRL.bit.SWRST);

Check failure on line 420 in drivers/dma/dma_sam0.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_STATEMENTS

drivers/dma/dma_sam0.c:420 trailing statements should be on next line

Check warning on line 420 in drivers/dma/dma_sam0.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

BRACES

drivers/dma/dma_sam0.c:420 braces {} are required around if/while/for/else

Check failure on line 421 in drivers/dma/dma_sam0.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

drivers/dma/dma_sam0.c:421 trailing whitespace
/* Set up the descriptor and write back addresses */
DMA_REGS->BASEADDR.reg = (uintptr_t)&data->descriptors;
DMA_REGS->WRBADDR.reg = (uintptr_t)&data->descriptors_wb;
Expand Down

0 comments on commit 5c8a478

Please sign in to comment.