dmaengine: dma-jz4780: Separate chan/ctrl registers
authorPaul Cercueil <paul@crapouillou.net>
Wed, 29 Aug 2018 21:32:46 +0000 (23:32 +0200)
committerVinod Koul <vkoul@kernel.org>
Tue, 11 Sep 2018 07:29:26 +0000 (12:59 +0530)
commit33633583a23aff572ff6b46a6bc57808b9c9872e
treeb7d808b1a66e4635ca16e2105a2400f7b009a23d
parent6147b032e544105cafaee25b416f7e919c3bb7d3
dmaengine: dma-jz4780: Separate chan/ctrl registers

The register area of the JZ4780 DMA core can be split into different
sections for different purposes:

* one set of registers is used to perform actions at the DMA core level,
that will generally affect all channels;

* one set of registers per DMA channel, to perform actions at the DMA
channel level, that will only affect the channel in question.

The problem rises when trying to support new versions of the JZ47xx
Ingenic SoC. For instance, the JZ4770 has two DMA cores, each one
with six DMA channels, and the register sets are interleaved:
<DMA0 chan regs> <DMA1 chan regs> <DMA0 ctrl regs> <DMA1 ctrl regs>

By using one memory resource for the channel-specific registers and
one memory resource for the core-specific registers, we can support
the JZ4770, by initializing the driver once per DMA core with different
addresses.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Tested-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dma-jz4780.c