Skip to content

Commit 1be5336

Browse files
Peter UjfalusiVinod Koul
authored andcommitted
dmaengine: edma: New device tree binding
With the old binding and driver architecture we had many issues: No way to assign eDMA channels to event queues, thus not able to tune the system by moving specific DMA channels to low/high priority servicing. We moved the cyclic channels to high priority within the code, but that was just a workaround to this issue. Memcopy was fundamentally broken: even if the driver scanned the DT/devices in the booted system for direct DMA users (which is not effective when the events are going through a crossbar) and created a map of 'used' channels, this information was not really usable. Since via dmaengien API the eDMA driver will be called with _some_ channel number, we would try to request this channel when any channel is requested for memcpy. By luck we got channel which is not used by any device most of the time so things worked, but if a device would have been using the given channel, but not requested it, the memcpy channel would have been waiting for HW event. The old code had the am33xx/am43xx DMA event router handling embedded. This should have been done in a separate driver since it is not part of the actual eDMA IP. There were no way to 'lock' PaRAM slots to be used by the DSP for example when booting with DT. In DT boot the edma node used more than one hwmod which is not a good practice and the kernel prints warning because of this. With the new bindings and the changes in the driver we can: - No regression with Legacy binding and non DT boot - DMA channels can be assigned to any TC (to set priority) - PaRAM slots can be reserved for other cores to use - Dynamic power management for CC and TCs, if only TC0 is used all other TC can be powered down for example Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
1 parent f7c7cae commit 1be5336

File tree

3 files changed

+459
-147
lines changed

3 files changed

+459
-147
lines changed

Documentation/devicetree/bindings/dma/ti-edma.txt

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,119 @@
1-
TI EDMA
1+
Texas Instruments eDMA
2+
3+
The eDMA3 consists of two components: Channel controller (CC) and Transfer
4+
Controller(s) (TC). The CC is the main entry for DMA users since it is
5+
responsible for the DMA channel handling, while the TCs are responsible to
6+
execute the actual DMA tansfer.
7+
8+
------------------------------------------------------------------------------
9+
eDMA3 Channel Controller
10+
11+
Required properties:
12+
- compatible: "ti,edma3-tpcc" for the channel controller(s)
13+
- #dma-cells: Should be set to <2>. The first number is the DMA request
14+
number and the second is the TC the channel is serviced on.
15+
- reg: Memory map of eDMA CC
16+
- reg-names: "edma3_cc"
17+
- interrupts: Interrupt lines for CCINT, MPERR and CCERRINT.
18+
- interrupt-names: "edma3_ccint", "emda3_mperr" and "edma3_ccerrint"
19+
- ti,tptcs: List of TPTCs associated with the eDMA in the following form:
20+
<&tptc_phandle TC_priority_number>. The highest priority is 0.
21+
22+
Optional properties:
23+
- ti,hwmods: Name of the hwmods associated to the eDMA CC
24+
- ti,edma-memcpy-channels: List of channels allocated to be used for memcpy, iow
25+
these channels will be SW triggered channels. The list must
26+
contain 16 bits numbers, see example.
27+
- ti,edma-reserved-slot-ranges: PaRAM slot ranges which should not be used by
28+
the driver, they are allocated to be used by for example the
29+
DSP. See example.
30+
31+
------------------------------------------------------------------------------
32+
eDMA3 Transfer Controller
33+
34+
Required properties:
35+
- compatible: "ti,edma3-tptc" for the transfer controller(s)
36+
- reg: Memory map of eDMA TC
37+
- interrupts: Interrupt number for TCerrint.
38+
39+
Optional properties:
40+
- ti,hwmods: Name of the hwmods associated to the given eDMA TC
41+
- interrupt-names: "edma3_tcerrint"
42+
43+
------------------------------------------------------------------------------
44+
Example:
45+
46+
edma: edma@49000000 {
47+
compatible = "ti,edma3-tpcc";
48+
ti,hwmods = "tpcc";
49+
reg = <0x49000000 0x10000>;
50+
reg-names = "edma3_cc";
51+
interrupts = <12 13 14>;
52+
interrupt-names = "edma3_ccint", "emda3_mperr", "edma3_ccerrint";
53+
dma-requests = <64>;
54+
#dma-cells = <2>;
55+
56+
ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 7>, <&edma_tptc2 0>;
57+
58+
/* Channel 20 and 21 is allocated for memcpy */
59+
ti,edma-memcpy-channels = /bits/ 16 <20 21>;
60+
/* The following PaRAM slots are reserved: 35-45 and 100-110 */
61+
ti,edma-reserved-slot-ranges = /bits/ 16 <35 10>,
62+
/bits/ 16 <100 10>;
63+
};
64+
65+
edma_tptc0: tptc@49800000 {
66+
compatible = "ti,edma3-tptc";
67+
ti,hwmods = "tptc0";
68+
reg = <0x49800000 0x100000>;
69+
interrupts = <112>;
70+
interrupt-names = "edm3_tcerrint";
71+
};
72+
73+
edma_tptc1: tptc@49900000 {
74+
compatible = "ti,edma3-tptc";
75+
ti,hwmods = "tptc1";
76+
reg = <0x49900000 0x100000>;
77+
interrupts = <113>;
78+
interrupt-names = "edm3_tcerrint";
79+
};
80+
81+
edma_tptc2: tptc@49a00000 {
82+
compatible = "ti,edma3-tptc";
83+
ti,hwmods = "tptc2";
84+
reg = <0x49a00000 0x100000>;
85+
interrupts = <114>;
86+
interrupt-names = "edm3_tcerrint";
87+
};
88+
89+
sham: sham@53100000 {
90+
compatible = "ti,omap4-sham";
91+
ti,hwmods = "sham";
92+
reg = <0x53100000 0x200>;
93+
interrupts = <109>;
94+
/* DMA channel 36 executed on eDMA TC0 - low priority queue */
95+
dmas = <&edma 36 0>;
96+
dma-names = "rx";
97+
};
98+
99+
mcasp0: mcasp@48038000 {
100+
compatible = "ti,am33xx-mcasp-audio";
101+
ti,hwmods = "mcasp0";
102+
reg = <0x48038000 0x2000>,
103+
<0x46000000 0x400000>;
104+
reg-names = "mpu", "dat";
105+
interrupts = <80>, <81>;
106+
interrupt-names = "tx", "rx";
107+
status = "disabled";
108+
/* DMA channels 8 and 9 executed on eDMA TC2 - high priority queue */
109+
dmas = <&edma 8 2>,
110+
<&edma 9 2>;
111+
dma-names = "tx", "rx";
112+
};
113+
114+
------------------------------------------------------------------------------
115+
DEPRECATED binding, new DTS files must use the ti,edma3-tpcc/ti,edma3-tptc
116+
binding.
2117

3118
Required properties:
4119
- compatible : "ti,edma3"

0 commit comments

Comments
 (0)