Skip to content

Commit 0b90730

Browse files
committed
Merge tag 'dmaengine-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
Pull dmaengine updates from Vinod Koul: "New support: - TI J721S2 CSI BCDMA support Updates: - Native HDMI support for dw edma driver - ste dma40 updates for supporting proper SRAM handle in DT - removal of dma device chancnt setting in drivers" * tag 'dmaengine-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (28 commits) dmaengine: sprd: Don't set chancnt dmaengine: hidma: Don't set chancnt dmaengine: plx_dma: Don't set chancnt dmaengine: axi-dmac: Don't set chancnt dmaengine: dw-axi-dmac: Don't set chancnt dmaengine: qcom: bam_dma: allow omitting num-{channels,ees} dmaengine: dw-edma: Add HDMA DebugFS support dmaengine: dw-edma: Add support for native HDMA dmaengine: dw-edma: Create a new dw_edma_core_ops structure to abstract controller operation dmaengine: dw-edma: Rename dw_edma_core_ops structure to dw_edma_plat_ops dmaengine: ste_dma40: use proper format string for resource_size_t dmaengine: make QCOM_HIDMA depend on HAS_IOMEM dmaengine: ste_dma40: fix typo in enum documentation dmaengine: ste_dma40: use correct print specfier for resource_size_t MAINTAINERS: Add myself as the DW eDMA driver reviewer MAINTAINERS: Add Manivannan to DW eDMA driver maintainers list MAINTAINERS: Demote Gustavo Pimentel to DW EDMA driver reviewer dmaengine: ti: k3-udma: Add support for J721S2 CSI BCDMA instance dt-bindings: dma: ti: Add J721S2 BCDMA dmaengine: ti: k3-psil-j721s2: Add PSI-L thread map for main CPSW2G ...
2 parents c91e587 + 907514a commit 0b90730

30 files changed

Lines changed: 1075 additions & 402 deletions

Documentation/devicetree/bindings/dma/stericsson,dma40.yaml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,39 @@ properties:
112112
- const: stericsson,dma40
113113

114114
reg:
115-
items:
116-
- description: DMA40 memory base
117-
- description: LCPA memory base
115+
oneOf:
116+
- items:
117+
- description: DMA40 memory base
118+
- items:
119+
- description: DMA40 memory base
120+
- description: LCPA memory base, deprecated, use eSRAM pool instead
121+
deprecated: true
122+
118123

119124
reg-names:
120-
items:
121-
- const: base
122-
- const: lcpa
125+
oneOf:
126+
- items:
127+
- const: base
128+
- items:
129+
- const: base
130+
- const: lcpa
131+
deprecated: true
123132

124133
interrupts:
125134
maxItems: 1
126135

127136
clocks:
128137
maxItems: 1
129138

139+
sram:
140+
$ref: /schemas/types.yaml#/definitions/phandle-array
141+
description: A phandle array with inner size 1 (no arg cells).
142+
First phandle is the LCPA (Logical Channel Parameter Address) memory.
143+
Second phandle is the LCLA (Logical Channel Link base Address) memory.
144+
maxItems: 2
145+
items:
146+
maxItems: 1
147+
130148
memcpy-channels:
131149
$ref: /schemas/types.yaml#/definitions/uint32-array
132150
description: Array of u32 elements indicating which channels on the DMA
@@ -138,6 +156,7 @@ required:
138156
- reg
139157
- interrupts
140158
- clocks
159+
- sram
141160
- memcpy-channels
142161

143162
additionalProperties: false
@@ -149,8 +168,9 @@ examples:
149168
#include <dt-bindings/mfd/dbx500-prcmu.h>
150169
dma-controller@801c0000 {
151170
compatible = "stericsson,db8500-dma40", "stericsson,dma40";
152-
reg = <0x801c0000 0x1000>, <0x40010000 0x800>;
153-
reg-names = "base", "lcpa";
171+
reg = <0x801c0000 0x1000>;
172+
reg-names = "base";
173+
sram = <&lcpa>, <&lcla>;
154174
interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
155175
#dma-cells = <3>;
156176
memcpy-channels = <56 57 58 59 60>;

Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ properties:
3333
enum:
3434
- ti,am62a-dmss-bcdma-csirx
3535
- ti,am64-dmss-bcdma
36+
- ti,j721s2-dmss-bcdma-csi
3637

3738
reg:
3839
minItems: 3
@@ -151,7 +152,12 @@ allOf:
151152
required:
152153
- power-domains
153154

154-
else:
155+
- if:
156+
properties:
157+
compatible:
158+
contains:
159+
const: ti,am64-dmss-bcdma
160+
then:
155161
properties:
156162
reg:
157163
minItems: 5
@@ -168,6 +174,28 @@ allOf:
168174
- ti,sci-rm-range-bchan
169175
- ti,sci-rm-range-tchan
170176

177+
- if:
178+
properties:
179+
compatible:
180+
contains:
181+
const: ti,j721s2-dmss-bcdma-csi
182+
then:
183+
properties:
184+
ti,sci-rm-range-bchan: false
185+
186+
reg:
187+
maxItems: 4
188+
189+
reg-names:
190+
items:
191+
- const: gcfg
192+
- const: rchanrt
193+
- const: tchanrt
194+
- const: ringrt
195+
196+
required:
197+
- ti,sci-rm-range-tchan
198+
171199
unevaluatedProperties: false
172200

173201
examples:

Documentation/devicetree/bindings/dma/xilinx/xlnx,zynqmp-dpdma.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,24 @@ properties:
4141
clock-names:
4242
const: axi_clk
4343

44+
power-domains:
45+
maxItems: 1
46+
4447
required:
4548
- "#dma-cells"
4649
- compatible
4750
- reg
4851
- interrupts
4952
- clocks
5053
- clock-names
54+
- power-domains
5155

5256
additionalProperties: false
5357

5458
examples:
5559
- |
5660
#include <dt-bindings/interrupt-controller/arm-gic.h>
61+
#include <dt-bindings/power/xlnx-zynqmp-power.h>
5762
5863
dma: dma-controller@fd4c0000 {
5964
compatible = "xlnx,zynqmp-dpdma";
@@ -63,6 +68,7 @@ examples:
6368
clocks = <&dpdma_clk>;
6469
clock-names = "axi_clk";
6570
#dma-cells = <1>;
71+
power-domains = <&zynqmp_firmware PD_DP>;
6672
};
6773
6874
...

MAINTAINERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5932,7 +5932,9 @@ S: Orphan
59325932
F: drivers/mtd/nand/raw/denali*
59335933

59345934
DESIGNWARE EDMA CORE IP DRIVER
5935-
M: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
5935+
M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
5936+
R: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
5937+
R: Serge Semin <fancer.lancer@gmail.com>
59365938
L: dmaengine@vger.kernel.org
59375939
S: Maintained
59385940
F: drivers/dma/dw-edma/

drivers/dma/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ config STE_DMA40
553553
bool "ST-Ericsson DMA40 support"
554554
depends on ARCH_U8500
555555
select DMA_ENGINE
556+
select SRAM
556557
help
557558
Support for ST-Ericsson DMA40 controller
558559

drivers/dma/dma-axi-dmac.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,6 @@ static int axi_dmac_probe(struct platform_device *pdev)
963963
dma_dev->device_terminate_all = axi_dmac_terminate_all;
964964
dma_dev->device_synchronize = axi_dmac_synchronize;
965965
dma_dev->dev = &pdev->dev;
966-
dma_dev->chancnt = 1;
967966
dma_dev->src_addr_widths = BIT(dmac->chan.src_width);
968967
dma_dev->dst_addr_widths = BIT(dmac->chan.dest_width);
969968
dma_dev->directions = BIT(dmac->chan.direction);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,6 @@ static int dw_probe(struct platform_device *pdev)
14661466
dma_cap_set(DMA_CYCLIC, dw->dma.cap_mask);
14671467

14681468
/* DMA capabilities */
1469-
dw->dma.chancnt = hdata->nr_channels;
14701469
dw->dma.max_burst = hdata->axi_rw_burst_len;
14711470
dw->dma.src_addr_widths = AXI_DMA_BUSWIDTHS;
14721471
dw->dma.dst_addr_widths = AXI_DMA_BUSWIDTHS;

drivers/dma/dw-edma/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# SPDX-License-Identifier: GPL-2.0
22

33
obj-$(CONFIG_DW_EDMA) += dw-edma.o
4-
dw-edma-$(CONFIG_DEBUG_FS) := dw-edma-v0-debugfs.o
5-
dw-edma-objs := dw-edma-core.o \
6-
dw-edma-v0-core.o $(dw-edma-y)
4+
dw-edma-$(CONFIG_DEBUG_FS) := dw-edma-v0-debugfs.o \
5+
dw-hdma-v0-debugfs.o
6+
dw-edma-objs := dw-edma-core.o \
7+
dw-edma-v0-core.o \
8+
dw-hdma-v0-core.o $(dw-edma-y)
79
obj-$(CONFIG_DW_EDMA_PCIE) += dw-edma-pcie.o

drivers/dma/dw-edma/dw-edma-core.c

Lines changed: 29 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "dw-edma-core.h"
2020
#include "dw-edma-v0-core.h"
21+
#include "dw-hdma-v0-core.h"
2122
#include "../dmaengine.h"
2223
#include "../virt-dma.h"
2324

@@ -183,6 +184,7 @@ static void vchan_free_desc(struct virt_dma_desc *vdesc)
183184

184185
static int dw_edma_start_transfer(struct dw_edma_chan *chan)
185186
{
187+
struct dw_edma *dw = chan->dw;
186188
struct dw_edma_chunk *child;
187189
struct dw_edma_desc *desc;
188190
struct virt_dma_desc *vd;
@@ -200,7 +202,7 @@ static int dw_edma_start_transfer(struct dw_edma_chan *chan)
200202
if (!child)
201203
return 0;
202204

203-
dw_edma_v0_core_start(child, !desc->xfer_sz);
205+
dw_edma_core_start(dw, child, !desc->xfer_sz);
204206
desc->xfer_sz += child->ll_region.sz;
205207
dw_edma_free_burst(child);
206208
list_del(&child->list);
@@ -287,7 +289,7 @@ static int dw_edma_device_terminate_all(struct dma_chan *dchan)
287289
chan->configured = false;
288290
} else if (chan->status == EDMA_ST_IDLE) {
289291
chan->configured = false;
290-
} else if (dw_edma_v0_core_ch_status(chan) == DMA_COMPLETE) {
292+
} else if (dw_edma_core_ch_status(chan) == DMA_COMPLETE) {
291293
/*
292294
* The channel is in a false BUSY state, probably didn't
293295
* receive or lost an interrupt
@@ -599,8 +601,6 @@ static void dw_edma_done_interrupt(struct dw_edma_chan *chan)
599601
struct virt_dma_desc *vd;
600602
unsigned long flags;
601603

602-
dw_edma_v0_core_clear_done_int(chan);
603-
604604
spin_lock_irqsave(&chan->vc.lock, flags);
605605
vd = vchan_next_desc(&chan->vc);
606606
if (vd) {
@@ -641,8 +641,6 @@ static void dw_edma_abort_interrupt(struct dw_edma_chan *chan)
641641
struct virt_dma_desc *vd;
642642
unsigned long flags;
643643

644-
dw_edma_v0_core_clear_abort_int(chan);
645-
646644
spin_lock_irqsave(&chan->vc.lock, flags);
647645
vd = vchan_next_desc(&chan->vc);
648646
if (vd) {
@@ -654,63 +652,32 @@ static void dw_edma_abort_interrupt(struct dw_edma_chan *chan)
654652
chan->status = EDMA_ST_IDLE;
655653
}
656654

657-
static irqreturn_t dw_edma_interrupt(int irq, void *data, bool write)
655+
static inline irqreturn_t dw_edma_interrupt_write(int irq, void *data)
658656
{
659657
struct dw_edma_irq *dw_irq = data;
660-
struct dw_edma *dw = dw_irq->dw;
661-
unsigned long total, pos, val;
662-
unsigned long off;
663-
u32 mask;
664-
665-
if (write) {
666-
total = dw->wr_ch_cnt;
667-
off = 0;
668-
mask = dw_irq->wr_mask;
669-
} else {
670-
total = dw->rd_ch_cnt;
671-
off = dw->wr_ch_cnt;
672-
mask = dw_irq->rd_mask;
673-
}
674-
675-
val = dw_edma_v0_core_status_done_int(dw, write ?
676-
EDMA_DIR_WRITE :
677-
EDMA_DIR_READ);
678-
val &= mask;
679-
for_each_set_bit(pos, &val, total) {
680-
struct dw_edma_chan *chan = &dw->chan[pos + off];
681-
682-
dw_edma_done_interrupt(chan);
683-
}
684-
685-
val = dw_edma_v0_core_status_abort_int(dw, write ?
686-
EDMA_DIR_WRITE :
687-
EDMA_DIR_READ);
688-
val &= mask;
689-
for_each_set_bit(pos, &val, total) {
690-
struct dw_edma_chan *chan = &dw->chan[pos + off];
691-
692-
dw_edma_abort_interrupt(chan);
693-
}
694658

695-
return IRQ_HANDLED;
696-
}
697-
698-
static inline irqreturn_t dw_edma_interrupt_write(int irq, void *data)
699-
{
700-
return dw_edma_interrupt(irq, data, true);
659+
return dw_edma_core_handle_int(dw_irq, EDMA_DIR_WRITE,
660+
dw_edma_done_interrupt,
661+
dw_edma_abort_interrupt);
701662
}
702663

703664
static inline irqreturn_t dw_edma_interrupt_read(int irq, void *data)
704665
{
705-
return dw_edma_interrupt(irq, data, false);
666+
struct dw_edma_irq *dw_irq = data;
667+
668+
return dw_edma_core_handle_int(dw_irq, EDMA_DIR_READ,
669+
dw_edma_done_interrupt,
670+
dw_edma_abort_interrupt);
706671
}
707672

708673
static irqreturn_t dw_edma_interrupt_common(int irq, void *data)
709674
{
710-
dw_edma_interrupt(irq, data, true);
711-
dw_edma_interrupt(irq, data, false);
675+
irqreturn_t ret = IRQ_NONE;
676+
677+
ret |= dw_edma_interrupt_write(irq, data);
678+
ret |= dw_edma_interrupt_read(irq, data);
712679

713-
return IRQ_HANDLED;
680+
return ret;
714681
}
715682

716683
static int dw_edma_alloc_chan_resources(struct dma_chan *dchan)
@@ -811,7 +778,7 @@ static int dw_edma_channel_setup(struct dw_edma *dw, u32 wr_alloc, u32 rd_alloc)
811778

812779
vchan_init(&chan->vc, dma);
813780

814-
dw_edma_v0_core_device_config(chan);
781+
dw_edma_core_ch_config(chan);
815782
}
816783

817784
/* Set DMA channel capabilities */
@@ -956,14 +923,19 @@ int dw_edma_probe(struct dw_edma_chip *chip)
956923

957924
dw->chip = chip;
958925

926+
if (dw->chip->mf == EDMA_MF_HDMA_NATIVE)
927+
dw_hdma_v0_core_register(dw);
928+
else
929+
dw_edma_v0_core_register(dw);
930+
959931
raw_spin_lock_init(&dw->lock);
960932

961933
dw->wr_ch_cnt = min_t(u16, chip->ll_wr_cnt,
962-
dw_edma_v0_core_ch_count(dw, EDMA_DIR_WRITE));
934+
dw_edma_core_ch_count(dw, EDMA_DIR_WRITE));
963935
dw->wr_ch_cnt = min_t(u16, dw->wr_ch_cnt, EDMA_MAX_WR_CH);
964936

965937
dw->rd_ch_cnt = min_t(u16, chip->ll_rd_cnt,
966-
dw_edma_v0_core_ch_count(dw, EDMA_DIR_READ));
938+
dw_edma_core_ch_count(dw, EDMA_DIR_READ));
967939
dw->rd_ch_cnt = min_t(u16, dw->rd_ch_cnt, EDMA_MAX_RD_CH);
968940

969941
if (!dw->wr_ch_cnt && !dw->rd_ch_cnt)
@@ -982,7 +954,7 @@ int dw_edma_probe(struct dw_edma_chip *chip)
982954
dev_name(chip->dev));
983955

984956
/* Disable eDMA, only to establish the ideal initial conditions */
985-
dw_edma_v0_core_off(dw);
957+
dw_edma_core_off(dw);
986958

987959
/* Request IRQs */
988960
err = dw_edma_irq_request(dw, &wr_alloc, &rd_alloc);
@@ -995,7 +967,7 @@ int dw_edma_probe(struct dw_edma_chip *chip)
995967
goto err_irq_free;
996968

997969
/* Turn debugfs on */
998-
dw_edma_v0_core_debugfs_on(dw);
970+
dw_edma_core_debugfs_on(dw);
999971

1000972
chip->dw = dw;
1001973

@@ -1021,7 +993,7 @@ int dw_edma_remove(struct dw_edma_chip *chip)
1021993
return -ENODEV;
1022994

1023995
/* Disable eDMA */
1024-
dw_edma_v0_core_off(dw);
996+
dw_edma_core_off(dw);
1025997

1026998
/* Free irqs */
1027999
for (i = (dw->nr_irqs - 1); i >= 0; i--)

0 commit comments

Comments
 (0)