dmaengine: tegra210-adma: Override ADMA FIFO size
authorSameer Pujar <spujar@nvidia.com>
Wed, 15 Sep 2021 16:07:05 +0000 (21:37 +0530)
committerVinod Koul <vkoul@kernel.org>
Mon, 18 Oct 2021 04:02:15 +0000 (09:32 +0530)
commit32de4745e20a639376735f198cccd0477f9aa396
tree8066603d08080ef2c47706076b43bb3efe76a74e
parentc7f9c67ffb7be8aeafae7a4faee6738ac38a64bb
dmaengine: tegra210-adma: Override ADMA FIFO size

ADMAIF FIFO uses a ring buffer and it is divided amongst the available
channels. The default FIFO size (in multiples of 16 words) of ADMAIF TX/RX
channels is as below:
 * On Tegra210,
     channel 1 to 2 : size = 3
     channel 3 to 10: size = 2
 * On Tegra186 and later,
     channel 1 to 4 : size = 3
     channel 5 to 20: size = 2

As per recommendation from HW, FIFO size of ADMA channel should be same as
the corresponding ADMAIF channel it maps to. FIFO corruption is observed if
the sizes do not match. We are using the default FIFO sizes for ADMAIF and
there is no plan to support any custom values.

Thus at runtime, override the ADMA channel FIFO size value depending on the
corresponding ADMAIF channel.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/1631722025-19873-4-git-send-email-spujar@nvidia.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/tegra210-adma.c