drivers: dma_qmsi: Wait few cycles to allow DMA controller changes

Add few nop instructions to allow the DMA controller settle,
It takes time after starting the transfer to access the DMA
controller registers, so a few cycles are added, the minimal number
of cycles needed has been calculated using tests results on c1000
development board.

Jira: ZEP-1803

Change-Id: I1f8e8478f0350e1b6e4dd596b783dc4babc2d02b
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
This commit is contained in:
Sergio Rodriguez 2017-03-07 14:38:37 -08:00 committed by Anas Nashif
parent 9e4772372f
commit 381df63fe8

View file

@ -17,6 +17,13 @@
#include "qm_isr.h"
#include "clk.h"
#define CYCLE_NOP \
__asm__ __volatile__ ("nop"); \
__asm__ __volatile__ ("nop"); \
__asm__ __volatile__ ("nop"); \
__asm__ __volatile__ ("nop")
struct dma_qmsi_config_info {
qm_dma_t instance; /* Controller instance. */
};
@ -254,16 +261,26 @@ static int dma_qmsi_chan_config(struct device *dev, uint32_t channel,
static int dma_qmsi_transfer_start(struct device *dev, uint32_t channel)
{
int ret;
const struct dma_qmsi_config_info *info = dev->config->config_info;
return qm_dma_transfer_start(info->instance, channel);
ret = qm_dma_transfer_start(info->instance, channel);
CYCLE_NOP;
return ret;
}
static int dma_qmsi_start(struct device *dev, uint32_t channel)
{
int ret;
const struct dma_qmsi_config_info *info = dev->config->config_info;
return qm_dma_transfer_start(info->instance, channel);
ret = qm_dma_transfer_start(info->instance, channel);
CYCLE_NOP;
return ret;
}
static int dma_qmsi_transfer_stop(struct device *dev, uint32_t channel)