SAMA5: Fix a bug in SAMA5 HSMCI. The bitfield mask and shift values were reversed resulting in a trashed value for the number of blocks in the BLOCKR register. This was sufficient to prevent DMA writes from working.

This commit is contained in:
Gregory Nutt 2015-03-15 09:35:48 -06:00
parent c638c67ad4
commit db2d9abcfa
2 changed files with 4 additions and 2 deletions

View File

@ -3010,8 +3010,9 @@ static int sam_dmasendsetup(FAR struct sdio_dev_s *dev,
*/
regval = sam_getreg(priv, SAM_HSMCI_BLKR_OFFSET);
nblocks = ((regval & HSMCI_BLKR_BCNT_SHIFT) >> HSMCI_BLKR_BCNT_SHIFT);
nblocks = ((regval & HSMCI_BLKR_BCNT_MASK) >> HSMCI_BLKR_BCNT_SHIFT);
blocksize = ((regval & HSMCI_BLKR_BLKLEN_MASK) >> HSMCI_BLKR_BLKLEN_SHIFT);
DEBUGASSERT(nblocks > 0 && blocksize > 0 && (blocksize & 3) == 0);
/* Physical address of the HSCMI source register, either the TDR (for

View File

@ -2935,8 +2935,9 @@ static int sam_dmasendsetup(FAR struct sdio_dev_s *dev,
*/
regval = sam_getreg(priv, SAM_HSMCI_BLKR_OFFSET);
nblocks = ((regval & HSMCI_BLKR_BCNT_SHIFT) >> HSMCI_BLKR_BCNT_SHIFT);
nblocks = ((regval & HSMCI_BLKR_BCNT_MASK) >> HSMCI_BLKR_BCNT_SHIFT);
blocksize = ((regval & HSMCI_BLKR_BLKLEN_MASK) >> HSMCI_BLKR_BLKLEN_SHIFT);
DEBUGASSERT(nblocks > 0 && blocksize > 0 && (blocksize & 3) == 0);
/* Physical address of the HSCMI source register, either the TDR (for