Re: [PATCH v10 03/11] dmaengine: dw: override LLP support if asked in platform data
From: Eugeniy Paltsev
Date: Tue Aug 16 2016 - 09:21:17 EST
On Fri, 2016-08-12 at 19:01 +0300, Andy Shevchenko wrote:
> There are at least two known devices, e.g. DMA controller found on
> ARC AXS101
> SDP board, that have LLP register and no multi block transfer support
> at the
> same time.
>
> Override autodetection by user provided data.
>
> Reported-by: Eugeniy Paltsev <Eugeniy.Paltsev@xxxxxxxxxxxx>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
> Âdrivers/dma/dw/core.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 6 +-----
> Âinclude/linux/platform_data/dma-dw.h | 2 ++
> Â2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
> index 80e7421..da18b18 100644
> --- a/drivers/dma/dw/core.c
> +++ b/drivers/dma/dw/core.c
> @@ -1571,11 +1571,7 @@ int dw_dma_probe(struct dw_dma_chip *chip)
> Â (dwc_params >> DWC_PARAMS_MBLK_EN &
> 0x1) == 0;
> Â } else {
> Â dwc->block_size = pdata->block_size;
> -
> - /* Check if channel supports multi block
> transfer */
> - channel_writel(dwc, LLP,
> DWC_LLP_LOC(0xffffffff));
> - dwc->nollp = DWC_LLP_LOC(channel_readl(dwc,
> LLP)) == 0;
> - channel_writel(dwc, LLP, 0);
> + dwc->nollp = pdata->is_nollp;
> Â }
> Â }
> Â
> diff --git a/include/linux/platform_data/dma-dw.h
> b/include/linux/platform_data/dma-dw.h
> index 4636c93..5f0e11e 100644
> --- a/include/linux/platform_data/dma-dw.h
> +++ b/include/linux/platform_data/dma-dw.h
> @@ -40,6 +40,7 @@ struct dw_dma_slave {
> Â * @is_private: The device channels should be marked as private and
> not for
> Â * by the general purpose DMA channel allocator.
> Â * @is_memcpy: The device channels do support memory-to-memory
> transfers.
> + * @is_nollp: The device channels does not support multi block
> transfers.
> Â * @chan_allocation_order: Allocate channels starting from 0 or 7
> Â * @chan_priority: Set channel priority increasing from 0 to 7 or 7
> to 0.
> Â * @block_size: Maximum block size supported by the controller
> @@ -51,6 +52,7 @@ struct dw_dma_platform_data {
> Â unsigned int nr_channels;
> Â bool is_private;
> Â bool is_memcpy;
> + bool is_nollp;
> Â#define CHAN_ALLOCATION_ASCENDING 0 /* zero to seven
> */
> Â#define CHAN_ALLOCATION_DESCENDING 1 /* seven to zero
> */
> Â unsigned char chan_allocation_order;
Looks good to me.
Reviewed-by: Eugeniy Platsev <Eugeniy.Paltsev@xxxxxxxxxxxx>