Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fsldma: Set correct dma_mask based on hw capability

The driver currently hardcodes DMA_BIT_MASK to 36-bits, which is only
correct on eloplus:

elo3 supports 40-bits
eloplus supports 36-bits
elo supports 32-bits

This is based on 0x08 cdar register documention in the respective
reference manuals. Set the dma mask accordingly.

Feedback from Arnd Bergmann:

- Use match data to set address bit mask

Signed-off-by: Ben Collins <bcollins@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: dmaengine@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/2025050513-complex-crane-2babb6@boujee-and-buff
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Ben Collins and committed by
Vinod Koul
00ff4d68 17502e7d

+17 -4
+16 -4
drivers/dma/fsldma.c
··· 1226 1226 1227 1227 fdev->dev = &op->dev; 1228 1228 INIT_LIST_HEAD(&fdev->common.channels); 1229 + /* The DMA address bits supported for this device. */ 1230 + fdev->addr_bits = (long)device_get_match_data(fdev->dev); 1229 1231 1230 1232 /* ioremap the registers for use */ 1231 1233 fdev->regs = of_iomap(op->dev.of_node, 0); ··· 1256 1254 fdev->common.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); 1257 1255 fdev->common.residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR; 1258 1256 1259 - dma_set_mask(&(op->dev), DMA_BIT_MASK(36)); 1257 + dma_set_mask(&(op->dev), DMA_BIT_MASK(fdev->addr_bits)); 1260 1258 1261 1259 platform_set_drvdata(op, fdev); 1262 1260 ··· 1389 1387 }; 1390 1388 #endif 1391 1389 1390 + /* The .data field is used for dma-bit-mask. */ 1392 1391 static const struct of_device_id fsldma_of_ids[] = { 1393 - { .compatible = "fsl,elo3-dma", }, 1394 - { .compatible = "fsl,eloplus-dma", }, 1395 - { .compatible = "fsl,elo-dma", }, 1392 + { 1393 + .compatible = "fsl,elo3-dma", 1394 + .data = (void *)40, 1395 + }, 1396 + { 1397 + .compatible = "fsl,eloplus-dma", 1398 + .data = (void *)36, 1399 + }, 1400 + { 1401 + .compatible = "fsl,elo-dma", 1402 + .data = (void *)32, 1403 + }, 1396 1404 {} 1397 1405 }; 1398 1406 MODULE_DEVICE_TABLE(of, fsldma_of_ids);
+1
drivers/dma/fsldma.h
··· 124 124 struct fsldma_chan *chan[FSL_DMA_MAX_CHANS_PER_DEVICE]; 125 125 u32 feature; /* The same as DMA channels */ 126 126 int irq; /* Channel IRQ */ 127 + int addr_bits; /* DMA addressing bits supported */ 127 128 }; 128 129 129 130 /* Define macros for fsldma_chan->feature property */