at91: add kernel support for sama7g5 soc
[openwrt/staging/dedeckeh.git] / target / linux / at91 / patches-5.10 / 132-dmaengine-at_xdmac-adapt-perid-for-mem2mem-operation.patch
1 From 1dccaa4c1e99cd8bd27684a2c87ec806d426c088 Mon Sep 17 00:00:00 2001
2 From: Eugen Hristev <eugen.hristev@microchip.com>
3 Date: Fri, 16 Oct 2020 12:37:25 +0300
4 Subject: [PATCH 132/247] dmaengine: at_xdmac: adapt perid for mem2mem
5 operations
6
7 The PERID in the CC register for mem2mem operations must match an unused
8 PERID.
9 The PERID field is 7 bits, but the selected value is 0x3f.
10 On later products we can have more reserved PERIDs for actual peripherals,
11 thus this needs to be increased to maximum size.
12 Changing the value to 0x7f, which is the maximum for 7 bits field.
13
14 Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
15 Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
16 Link: https://lore.kernel.org/r/20201016093725.289880-1-eugen.hristev@microchip.com
17 Signed-off-by: Vinod Koul <vkoul@kernel.org>
18 ---
19 drivers/dma/at_xdmac.c | 6 +++---
20 1 file changed, 3 insertions(+), 3 deletions(-)
21
22 diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
23 index 90afba0b36fe..85fe260ccd07 100644
24 --- a/drivers/dma/at_xdmac.c
25 +++ b/drivers/dma/at_xdmac.c
26 @@ -865,7 +865,7 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan,
27 * match the one of another channel. If not, it could lead to spurious
28 * flag status.
29 */
30 - u32 chan_cc = AT_XDMAC_CC_PERID(0x3f)
31 + u32 chan_cc = AT_XDMAC_CC_PERID(0x7f)
32 | AT_XDMAC_CC_DIF(0)
33 | AT_XDMAC_CC_SIF(0)
34 | AT_XDMAC_CC_MBSIZE_SIXTEEN
35 @@ -1047,7 +1047,7 @@ at_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
36 * match the one of another channel. If not, it could lead to spurious
37 * flag status.
38 */
39 - u32 chan_cc = AT_XDMAC_CC_PERID(0x3f)
40 + u32 chan_cc = AT_XDMAC_CC_PERID(0x7f)
41 | AT_XDMAC_CC_DAM_INCREMENTED_AM
42 | AT_XDMAC_CC_SAM_INCREMENTED_AM
43 | AT_XDMAC_CC_DIF(0)
44 @@ -1153,7 +1153,7 @@ static struct at_xdmac_desc *at_xdmac_memset_create_desc(struct dma_chan *chan,
45 * match the one of another channel. If not, it could lead to spurious
46 * flag status.
47 */
48 - u32 chan_cc = AT_XDMAC_CC_PERID(0x3f)
49 + u32 chan_cc = AT_XDMAC_CC_PERID(0x7f)
50 | AT_XDMAC_CC_DAM_UBS_AM
51 | AT_XDMAC_CC_SAM_INCREMENTED_AM
52 | AT_XDMAC_CC_DIF(0)
53 --
54 2.32.0
55