Skip to content

Commit e446c88

Browse files
Samin Guoesmil
authored andcommitted
dmaengine: dw-axi-dmac: Add StarFive JH7100 support
Signed-off-by: Samin Guo <samin.guo@starfivetech.com> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
1 parent e2e30cb commit e446c88

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,13 @@ static int dw_axi_dma_set_hw_desc(struct axi_dma_chan *chan,
722722

723723
hw_desc->lli->block_ts_lo = cpu_to_le32(block_ts - 1);
724724

725+
#ifdef CONFIG_SOC_STARFIVE
726+
ctllo |= DWAXIDMAC_BURST_TRANS_LEN_16 << CH_CTL_L_DST_MSIZE_POS |
727+
DWAXIDMAC_BURST_TRANS_LEN_16 << CH_CTL_L_SRC_MSIZE_POS;
728+
#else
725729
ctllo |= DWAXIDMAC_BURST_TRANS_LEN_4 << CH_CTL_L_DST_MSIZE_POS |
726730
DWAXIDMAC_BURST_TRANS_LEN_4 << CH_CTL_L_SRC_MSIZE_POS;
731+
#endif
727732
hw_desc->lli->ctl_lo = cpu_to_le32(ctllo);
728733

729734
set_desc_src_master(hw_desc);
@@ -1578,7 +1583,11 @@ static int dw_probe(struct platform_device *pdev)
15781583
* Therefore, set constraint to 1024 * 4.
15791584
*/
15801585
dw->dma.dev->dma_parms = &dw->dma_parms;
1586+
#ifdef CONFIG_SOC_STARFIVE
1587+
dma_set_max_seg_size(&pdev->dev, DMAC_MAX_BLK_SIZE);
1588+
#else
15811589
dma_set_max_seg_size(&pdev->dev, MAX_BLOCK_SIZE);
1590+
#endif
15821591
platform_set_drvdata(pdev, chip);
15831592

15841593
pm_runtime_enable(chip->dev);
@@ -1660,6 +1669,9 @@ static const struct of_device_id dw_dma_of_id_table[] = {
16601669
}, {
16611670
.compatible = "intel,kmb-axi-dma",
16621671
.data = (void *)AXI_DMA_FLAG_HAS_APB_REGS,
1672+
}, {
1673+
.compatible = "starfive,jh7100-axi-dma",
1674+
.data = (void *)(AXI_DMA_FLAG_HAS_RESETS | AXI_DMA_FLAG_USE_CFG2),
16631675
}, {
16641676
.compatible = "starfive,jh7110-axi-dma",
16651677
.data = (void *)(AXI_DMA_FLAG_HAS_RESETS | AXI_DMA_FLAG_USE_CFG2),

drivers/dma/dw-axi-dmac/dw-axi-dmac.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,11 @@ enum {
287287
#define CH_CTL_L_SRC_MAST BIT(0)
288288

289289
/* CH_CFG_H */
290+
#ifdef CONFIG_SOC_STARFIVE
291+
#define CH_CFG_H_PRIORITY_POS 15
292+
#else
290293
#define CH_CFG_H_PRIORITY_POS 17
294+
#endif
291295
#define CH_CFG_H_DST_PER_POS 12
292296
#define CH_CFG_H_SRC_PER_POS 7
293297
#define CH_CFG_H_HS_SEL_DST_POS 4

0 commit comments

Comments
 (0)