xref: /freebsd/sys/contrib/device-tree/Bindings/dma/xilinx/xilinx_dma.txt (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1c66ec88fSEmmanuel VadotXilinx AXI VDMA engine, it does transfers between memory and video devices.
2c66ec88fSEmmanuel VadotIt can be configured to have one channel or two channels. If configured
3c66ec88fSEmmanuel Vadotas two channels, one is to transmit to the video device and another is
4c66ec88fSEmmanuel Vadotto receive from the video device.
5c66ec88fSEmmanuel Vadot
6c66ec88fSEmmanuel VadotXilinx AXI DMA engine, it does transfers between memory and AXI4 stream
7c66ec88fSEmmanuel Vadottarget devices. It can be configured to have one channel or two channels.
8c66ec88fSEmmanuel VadotIf configured as two channels, one is to transmit to the device and another
9c66ec88fSEmmanuel Vadotis to receive from the device.
10c66ec88fSEmmanuel Vadot
11c66ec88fSEmmanuel VadotXilinx AXI CDMA engine, it does transfers between memory-mapped source
12c66ec88fSEmmanuel Vadotaddress and a memory-mapped destination address.
13c66ec88fSEmmanuel Vadot
14c66ec88fSEmmanuel VadotXilinx AXI MCDMA engine, it does transfer between memory and AXI4 stream
15c66ec88fSEmmanuel Vadottarget devices. It can be configured to have up to 16 independent transmit
16c66ec88fSEmmanuel Vadotand receive channels.
17c66ec88fSEmmanuel Vadot
18c66ec88fSEmmanuel VadotRequired properties:
19c66ec88fSEmmanuel Vadot- compatible: Should be one of-
20c66ec88fSEmmanuel Vadot		"xlnx,axi-vdma-1.00.a"
21c66ec88fSEmmanuel Vadot		"xlnx,axi-dma-1.00.a"
22c66ec88fSEmmanuel Vadot		"xlnx,axi-cdma-1.00.a"
23c66ec88fSEmmanuel Vadot		"xlnx,axi-mcdma-1.00.a"
24c66ec88fSEmmanuel Vadot- #dma-cells: Should be <1>, see "dmas" property below
25c66ec88fSEmmanuel Vadot- reg: Should contain VDMA registers location and length.
26c66ec88fSEmmanuel Vadot- xlnx,addrwidth: Should be the vdma addressing size in bits(ex: 32 bits).
27c66ec88fSEmmanuel Vadot- dma-ranges: Should be as the following <dma_addr cpu_addr max_len>.
28c66ec88fSEmmanuel Vadot- dma-channel child node: Should have at least one channel and can have up to
29c66ec88fSEmmanuel Vadot	two channels per device. This node specifies the properties of each
30c66ec88fSEmmanuel Vadot	DMA channel (see child node properties below).
31c66ec88fSEmmanuel Vadot- clocks: Input clock specifier. Refer to common clock bindings.
32c66ec88fSEmmanuel Vadot- clock-names: List of input clocks
33c66ec88fSEmmanuel Vadot	For VDMA:
34c66ec88fSEmmanuel Vadot	Required elements: "s_axi_lite_aclk"
35c66ec88fSEmmanuel Vadot	Optional elements: "m_axi_mm2s_aclk" "m_axi_s2mm_aclk",
36c66ec88fSEmmanuel Vadot			   "m_axis_mm2s_aclk", "s_axis_s2mm_aclk"
37c66ec88fSEmmanuel Vadot	For CDMA:
38c66ec88fSEmmanuel Vadot	Required elements: "s_axi_lite_aclk", "m_axi_aclk"
39c66ec88fSEmmanuel Vadot	For AXIDMA and MCDMA:
40c66ec88fSEmmanuel Vadot	Required elements: "s_axi_lite_aclk"
41c66ec88fSEmmanuel Vadot	Optional elements: "m_axi_mm2s_aclk", "m_axi_s2mm_aclk",
42c66ec88fSEmmanuel Vadot			   "m_axi_sg_aclk"
43c66ec88fSEmmanuel Vadot
44c66ec88fSEmmanuel VadotRequired properties for VDMA:
45c66ec88fSEmmanuel Vadot- xlnx,num-fstores: Should be the number of framebuffers as configured in h/w.
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel VadotOptional properties for AXI DMA and MCDMA:
48c66ec88fSEmmanuel Vadot- xlnx,sg-length-width: Should be set to the width in bits of the length
49c66ec88fSEmmanuel Vadot	register as configured in h/w. Takes values {8...26}. If the property
50c66ec88fSEmmanuel Vadot	is missing or invalid then the default value 23 is used. This is the
51c66ec88fSEmmanuel Vadot	maximum value that is supported by all IP versions.
52*aa1a8ff2SEmmanuel Vadot
53*aa1a8ff2SEmmanuel VadotOptional properties for AXI DMA:
54*aa1a8ff2SEmmanuel Vadot- xlnx,axistream-connected: Tells whether DMA is connected to AXI stream IP.
55*aa1a8ff2SEmmanuel Vadot- xlnx,irq-delay: Tells the interrupt delay timeout value. Valid range is from
56*aa1a8ff2SEmmanuel Vadot	0-255. Setting this value to zero disables the delay timer interrupt.
57*aa1a8ff2SEmmanuel Vadot	1 timeout interval = 125 * clock period of SG clock.
58c66ec88fSEmmanuel VadotOptional properties for VDMA:
59c66ec88fSEmmanuel Vadot- xlnx,flush-fsync: Tells which channel to Flush on Frame sync.
60c66ec88fSEmmanuel Vadot	It takes following values:
61c66ec88fSEmmanuel Vadot	{1}, flush both channels
62c66ec88fSEmmanuel Vadot	{2}, flush mm2s channel
63c66ec88fSEmmanuel Vadot	{3}, flush s2mm channel
64c66ec88fSEmmanuel Vadot
65c66ec88fSEmmanuel VadotRequired child node properties:
66c66ec88fSEmmanuel Vadot- compatible:
67c66ec88fSEmmanuel Vadot	For VDMA: It should be either "xlnx,axi-vdma-mm2s-channel" or
68c66ec88fSEmmanuel Vadot	"xlnx,axi-vdma-s2mm-channel".
69c66ec88fSEmmanuel Vadot	For CDMA: It should be "xlnx,axi-cdma-channel".
70c66ec88fSEmmanuel Vadot	For AXIDMA and MCDMA: It should be either "xlnx,axi-dma-mm2s-channel"
71c66ec88fSEmmanuel Vadot	or "xlnx,axi-dma-s2mm-channel".
72c66ec88fSEmmanuel Vadot- interrupts: Should contain per channel VDMA interrupts.
73c66ec88fSEmmanuel Vadot- xlnx,datawidth: Should contain the stream data width, take values
74c66ec88fSEmmanuel Vadot	{32,64...1024}.
75c66ec88fSEmmanuel Vadot
76c66ec88fSEmmanuel VadotOptional child node properties:
77c66ec88fSEmmanuel Vadot- xlnx,include-dre: Tells hardware is configured for Data
78c66ec88fSEmmanuel Vadot	Realignment Engine.
79c66ec88fSEmmanuel VadotOptional child node properties for VDMA:
80c66ec88fSEmmanuel Vadot- xlnx,genlock-mode: Tells Genlock synchronization is
81c66ec88fSEmmanuel Vadot	enabled/disabled in hardware.
82c66ec88fSEmmanuel Vadot- xlnx,enable-vert-flip: Tells vertical flip is
83c66ec88fSEmmanuel Vadot	enabled/disabled in hardware(S2MM path).
84c66ec88fSEmmanuel VadotOptional child node properties for MCDMA:
85c66ec88fSEmmanuel Vadot- dma-channels: Number of dma channels in child node.
86c66ec88fSEmmanuel Vadot
87c66ec88fSEmmanuel VadotExample:
88c66ec88fSEmmanuel Vadot++++++++
89c66ec88fSEmmanuel Vadot
90c66ec88fSEmmanuel Vadotaxi_vdma_0: axivdma@40030000 {
91c66ec88fSEmmanuel Vadot	compatible = "xlnx,axi-vdma-1.00.a";
92c66ec88fSEmmanuel Vadot	#dma_cells = <1>;
93c66ec88fSEmmanuel Vadot	reg = < 0x40030000 0x10000 >;
94c66ec88fSEmmanuel Vadot	dma-ranges = <0x00000000 0x00000000 0x40000000>;
95c66ec88fSEmmanuel Vadot	xlnx,num-fstores = <0x8>;
96c66ec88fSEmmanuel Vadot	xlnx,flush-fsync = <0x1>;
97c66ec88fSEmmanuel Vadot	xlnx,addrwidth = <0x20>;
98c66ec88fSEmmanuel Vadot	clocks = <&clk 0>, <&clk 1>, <&clk 2>, <&clk 3>, <&clk 4>;
99c66ec88fSEmmanuel Vadot	clock-names = "s_axi_lite_aclk", "m_axi_mm2s_aclk", "m_axi_s2mm_aclk",
100c66ec88fSEmmanuel Vadot		      "m_axis_mm2s_aclk", "s_axis_s2mm_aclk";
101c66ec88fSEmmanuel Vadot	dma-channel@40030000 {
102c66ec88fSEmmanuel Vadot		compatible = "xlnx,axi-vdma-mm2s-channel";
103c66ec88fSEmmanuel Vadot		interrupts = < 0 54 4 >;
104c66ec88fSEmmanuel Vadot		xlnx,datawidth = <0x40>;
105c66ec88fSEmmanuel Vadot	} ;
106c66ec88fSEmmanuel Vadot	dma-channel@40030030 {
107c66ec88fSEmmanuel Vadot		compatible = "xlnx,axi-vdma-s2mm-channel";
108c66ec88fSEmmanuel Vadot		interrupts = < 0 53 4 >;
109c66ec88fSEmmanuel Vadot		xlnx,datawidth = <0x40>;
110c66ec88fSEmmanuel Vadot	} ;
111c66ec88fSEmmanuel Vadot} ;
112c66ec88fSEmmanuel Vadot
113c66ec88fSEmmanuel Vadot
114c66ec88fSEmmanuel Vadot* DMA client
115c66ec88fSEmmanuel Vadot
116c66ec88fSEmmanuel VadotRequired properties:
117c66ec88fSEmmanuel Vadot- dmas: a list of <[Video DMA device phandle] [Channel ID]> pairs,
118c66ec88fSEmmanuel Vadot	where Channel ID is '0' for write/tx and '1' for read/rx
119d5b0e70fSEmmanuel Vadot	channel. For MCMDA, MM2S channel(write/tx) ID start from
120d5b0e70fSEmmanuel Vadot	'0' and is in [0-15] range. S2MM channel(read/rx) ID start
121d5b0e70fSEmmanuel Vadot	from '16' and is in [16-31] range. These channels ID are
122d5b0e70fSEmmanuel Vadot	fixed irrespective of IP configuration.
123d5b0e70fSEmmanuel Vadot
124c66ec88fSEmmanuel Vadot- dma-names: a list of DMA channel names, one per "dmas" entry
125c66ec88fSEmmanuel Vadot
126c66ec88fSEmmanuel VadotExample:
127c66ec88fSEmmanuel Vadot++++++++
128c66ec88fSEmmanuel Vadot
129c66ec88fSEmmanuel Vadotvdmatest_0: vdmatest@0 {
130c66ec88fSEmmanuel Vadot	compatible ="xlnx,axi-vdma-test-1.00.a";
131c66ec88fSEmmanuel Vadot	dmas = <&axi_vdma_0 0
132c66ec88fSEmmanuel Vadot		&axi_vdma_0 1>;
133c66ec88fSEmmanuel Vadot	dma-names = "vdma0", "vdma1";
134c66ec88fSEmmanuel Vadot} ;
135