summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-12-20 08:49:32 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-12-20 08:49:32 +0100
commit71f29c1206633447da18eaff4293f856aaca640d (patch)
tree26ef74f6c6b96390c46f2e564d7145cc990fb9ba
parentab834d65e4a96bb59901f4349857ffe3e57a3f54 (diff)
downloadrtems-71f29c1206633447da18eaff4293f856aaca640d.tar.bz2
bsp/atsam: Use standard XDMA throughout
-rw-r--r--c/src/lib/libbsp/arm/atsam/libraries/libchip/include/xdmad.h5
-rw-r--r--c/src/lib/libbsp/arm/atsam/libraries/libchip/source/afe_dma.c4
-rw-r--r--c/src/lib/libbsp/arm/atsam/libraries/libchip/source/dac_dma.c4
-rw-r--r--c/src/lib/libbsp/arm/atsam/libraries/libchip/source/spi_dma.c4
-rw-r--r--c/src/lib/libbsp/arm/atsam/libraries/libchip/source/twid.c11
-rw-r--r--c/src/lib/libbsp/arm/atsam/libraries/libchip/source/uart_dma.c3
-rw-r--r--c/src/lib/libbsp/arm/atsam/libraries/libchip/source/usart_dma.c4
-rw-r--r--c/src/lib/libbsp/arm/atsam/libraries/libchip/source/xdmad.c3
8 files changed, 6 insertions, 32 deletions
diff --git a/c/src/lib/libbsp/arm/atsam/libraries/libchip/include/xdmad.h b/c/src/lib/libbsp/arm/atsam/libraries/libchip/include/xdmad.h
index 20def44dbb..3b5e0838c2 100644
--- a/c/src/lib/libbsp/arm/atsam/libraries/libchip/include/xdmad.h
+++ b/c/src/lib/libbsp/arm/atsam/libraries/libchip/include/xdmad.h
@@ -222,11 +222,6 @@ extern sXdmad XDMAD_Instance;
*----------------------------------------------------------------------------*/
/** \addtogroup dmad_functions DMA Driver Functions
@{*/
-extern void XDMAD_Initialize(sXdmad *pXdmad,
- uint8_t bPollingMode);
-
-extern void XDMAD_Handler(void *arg);
-
extern uint32_t XDMAD_AllocateChannel(sXdmad *pXdmad,
uint8_t bSrcID, uint8_t bDstID);
extern eXdmadRC XDMAD_FreeChannel(sXdmad *pXdmad, uint32_t dwChannel);
diff --git a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/afe_dma.c b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/afe_dma.c
index b137d0194d..e47055ccde 100644
--- a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/afe_dma.c
+++ b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/afe_dma.c
@@ -103,8 +103,6 @@ static uint8_t _AfeConfigureDmaChannels(AfeDma *pAfed)
{
/* Driver initialize */
- XDMAD_Initialize(pAfed->pXdmad, 0);
-
XDMAD_FreeChannel(pAfed->pXdmad, afeDmaRxChannel);
/* Allocate a DMA channel for AFE0/1 RX. */
@@ -207,7 +205,7 @@ uint32_t Afe_ConfigureDma(AfeDma *pAfed ,
pAfed->afeId = AfeId;
pAfed->semaphore = 1;
pAfed->pCurrentCommand = 0;
- pAfed->pXdmad = pXdmad;
+ assert(pXdmad == &XDMAD_Instance);
return 0;
}
diff --git a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/dac_dma.c b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/dac_dma.c
index 912c4ef43b..e18dbb4b14 100644
--- a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/dac_dma.c
+++ b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/dac_dma.c
@@ -96,8 +96,6 @@ static uint8_t _DacConfigureDmaChannels(DacDma *pDacd)
{
/* Driver initialize */
- XDMAD_Initialize(pDacd->pXdmad, 0);
-
XDMAD_FreeChannel(pDacd->pXdmad, dacDmaTxChannel);
/* Allocate a DMA channel for DAC0/1 TX. */
@@ -195,7 +193,7 @@ uint32_t Dac_ConfigureDma(DacDma *pDacd ,
pDacd->dacId = DacId;
pDacd->semaphore = 1;
pDacd->pCurrentCommand = 0;
- pDacd->pXdmad = pXdmad;
+ assert(pXdmad == &XDMAD_Instance);
return 0;
}
diff --git a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/spi_dma.c b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/spi_dma.c
index 1ce3fcd764..5f039589d3 100644
--- a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/spi_dma.c
+++ b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/spi_dma.c
@@ -139,8 +139,6 @@ static void SPID_Rx_Cb(uint32_t channel, Spid *pArg)
static uint8_t _spid_configureDmaChannels(Spid *pSpid)
{
/* Driver initialize */
- XDMAD_Initialize(pSpid->pXdmad, 0);
-
XDMAD_FreeChannel(pSpid->pXdmad, spiDmaTxChannel);
XDMAD_FreeChannel(pSpid->pXdmad, spiDmaRxChannel);
@@ -290,7 +288,7 @@ uint32_t SPID_Configure(Spid *pSpid ,
pSpid->spiId = spiId;
pSpid->semaphore = 1;
pSpid->pCurrentCommand = 0;
- pSpid->pXdmad = pXdmad;
+ assert(pXdmad == &XDMAD_Instance);
/* Enable the SPI Peripheral ,Execute a software reset of the SPI,
Configure SPI in Master Mode*/
diff --git a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/twid.c b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/twid.c
index 91196dfcef..4f770691c5 100644
--- a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/twid.c
+++ b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/twid.c
@@ -508,16 +508,7 @@ void TWID_DmaInitialize(TwihsDma *pTwidma, Twihs *pTwi, uint8_t bPolling)
pTwidma->pTwid->pTwi = pTwi;
pTwidma->pTwid->pTransfer = 0;
- if (!bPolling) {
- /* Enable XDMA interrupt and give it priority over any other peripheral
- interrupt */
- NVIC_ClearPendingIRQ(XDMAC_IRQn);
- NVIC_SetPriority(XDMAC_IRQn, 1);
- NVIC_EnableIRQ(XDMAC_IRQn);
- }
-
- /* Initialize XDMA driver instance with polling mode */
- XDMAD_Initialize(pTwidma->pTwiDma, bPolling);
+ assert(!bPolling);
}
/**
diff --git a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/uart_dma.c b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/uart_dma.c
index 7406b718bf..606dc83d79 100644
--- a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/uart_dma.c
+++ b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/uart_dma.c
@@ -390,9 +390,6 @@ uint32_t UARTD_Configure(UartDma *pUartd ,
Configure UART in Master Mode*/
UART_Configure (pUartd->pUartHw, uartMode, baud, clk);
- /* Driver initialize */
- XDMAD_Initialize(pUartd->pXdmad, 0);
-
/* Check if DMA IRQ is enable; if not clear pending IRQs in init it */
if (!(NVIC_GetActive(XDMAC_IRQn)))
NVIC_ClearPendingIRQ(XDMAC_IRQn);
diff --git a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/usart_dma.c b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/usart_dma.c
index 62755d93d9..51488e6bce 100644
--- a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/usart_dma.c
+++ b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/usart_dma.c
@@ -369,14 +369,10 @@ uint32_t USARTD_Configure(UsartDma *pUsartd ,
pUsartd->pUsartHw = USART2;
- pUsartd->pXdmad->pXdmacs = XDMAC;
/* Enable the USART Peripheral ,Execute a software reset of the USART,
Configure USART in Master Mode*/
USART_Configure (pUsartd->pUsartHw, UsartMode, BaudRate, UsartClk);
- /* Driver initialize */
- XDMAD_Initialize(pUsartd->pXdmad, 0);
-
/* Check if DMA IRQ is enable; if not clear pending IRQs in init it */
if (!(NVIC_GetActive(XDMAC_IRQn)))
NVIC_ClearPendingIRQ(XDMAC_IRQn);
diff --git a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/xdmad.c b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/xdmad.c
index 36f9e2768c..0be891d2e9 100644
--- a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/xdmad.c
+++ b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/xdmad.c
@@ -73,6 +73,7 @@
/*----------------------------------------------------------------------------
* Local functions
*----------------------------------------------------------------------------*/
+static void XDMAD_Handler(void *arg);
/**
* \brief Try to allocate a DMA channel for on given controller.
* \param pDmad Pointer to DMA driver instance.
@@ -302,7 +303,7 @@ eXdmadRC XDMAD_PrepareChannel(sXdmad *pXdmad, uint32_t dwChannel)
* \brief xDMA interrupt handler
* \param arg Pointer to DMA driver instance.
*/
-void XDMAD_Handler(void *arg)
+static void XDMAD_Handler(void *arg)
{
sXdmad *pDmad;
Xdmac *pXdmac;