Skip to content

Commit

Permalink
Reset DMA channel correctly. (google#196)
Browse files Browse the repository at this point in the history
- If we clear dmaInterrupt, the cs will be non-zero state
  (DreqStopsDMA|Paused|End) and IsAvaiable() returns false.
- nextCB is not supposed to be written directly.
  p.40, 4.2.1 DMA Channel Register Address Map
Only three registers in each channels register set are directly
writeable (CS, CONBLK_AD and DEBUG). The other registers
(TI, SOURCE_AD, DEST_AD, TXFR_LEN, STRIDE & NEXTCONBK),
are automatically loaded from a Control Block data structure held
in external memory.
  • Loading branch information
simokawa authored and maruel committed Dec 19, 2017
1 parent dd39190 commit fcbb4af
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions host/bcm283x/dma.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,7 @@ func (d *dmaChannel) isAvailable() bool {
// It doesn't clear the local controlBlock cached values.
func (d *dmaChannel) reset() {
d.cs = dmaReset
// Clear bits if needed.
// TODO(simokawa): Test if it works as expected.
d.cs = dmaInterrupt
d.cbAddr = 0
d.nextCB = 0
}

// startIO initializes the DMA channel to start a transmission.
Expand Down

0 comments on commit fcbb4af

Please sign in to comment.