SAMA5 HSMCI DMA clean-up. There are still some issues

This commit is contained in:
Gregory Nutt 2013-09-23 11:25:39 -06:00
parent 306a8743e0
commit d167a09c74
3 changed files with 8 additions and 7 deletions

View File

@ -192,10 +192,11 @@ static const uint32_t g_fifocfg[3] =
* before each DMA transfer in order to map the peripheral IDs to the
* correct channel. This must be done because the channel can change with
* the direction of the transfer.
*
* DMA controller 0, RX DMA:
*/
#ifdef CONFIG_SAMA5_DMAC0
/* DMA controller 0, RX DMA: */
static const struct sam_pidmap_s g_dmac0_rxchan[] =
{
{ SAM_PID_HSMCI0, DMAC0_CH_HSMCI0 }, /* HSMCI0 Receive/transmit */
@ -210,7 +211,6 @@ static const struct sam_pidmap_s g_dmac0_rxchan[] =
};
#define NDMAC0_RXCHANNELS (sizeof(g_dmac0_rxchan) / sizeof(struct sam_pidmap_s))
#ifdef CONFIG_SAMA5_DMAC0
/* DMA controller 0, TX DMA: */
static const struct sam_pidmap_s g_dmac0_txchan[] =

View File

@ -131,6 +131,8 @@
* REVISIT: Is memory always on IF0?
*/
#define HSMCI_DMA_CHKSIZE HSMCI_DMA_CHKSIZE_1
#define DMA_FLAGS(pid) \
(((pid) << DMACH_FLAG_PERIPHPID_SHIFT) | DMACH_FLAG_PERIPHAHB_AHB_IF2 | \
DMACH_FLAG_PERIPHH2SEL | DMACH_FLAG_PERIPHISPERIPH | \
@ -1279,7 +1281,6 @@ static void sam_notransfer(struct sam_dev_s *priv)
/* Clear the block size and count */
sam_putreg(priv, 0, SAM_HSMCI_BLKR_OFFSET);
}
/****************************************************************************
@ -2555,7 +2556,7 @@ static int sam_dmarecvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer,
/* Enable DMA handshaking */
sam_putreg(priv, HSMCI_DMA_DMAEN, SAM_HSMCI_DMA_OFFSET);
sam_putreg(priv, HSMCI_DMA_DMAEN | HSMCI_DMA_CHKSIZE, SAM_HSMCI_DMA_OFFSET);
sam_xfrsample(priv, SAMPLENDX_BEFORE_ENABLE);
/* Start the DMA */
@ -2618,7 +2619,7 @@ static int sam_dmasendsetup(FAR struct sdio_dev_s *dev,
/* Enable DMA handshaking */
sam_putreg(priv, HSMCI_DMA_DMAEN, SAM_HSMCI_DMA_OFFSET);
sam_putreg(priv, HSMCI_DMA_DMAEN | HSMCI_DMA_CHKSIZE, SAM_HSMCI_DMA_OFFSET);
sam_xfrsample(priv, SAMPLENDX_BEFORE_ENABLE);
/* Start the DMA */

View File

@ -3683,7 +3683,7 @@ static int sam_ep_stall(struct usbdev_ep_s *ep, bool resume)
/* Check that endpoint is in Idle state */
privep = (struct sam_ep_s *)ep;
DEBUGASSERT(privep->epstate == UDPHS_EPSTATE_IDLE && privep->dev);
DEBUGASSERT(/* privep->epstate == UDPHS_EPSTATE_IDLE && */ privep->dev);
priv = (struct sam_usbdev_s *)privep->dev;
epno = USB_EPNO(ep->eplog);