Skip to content

Commit 959ed53

Browse files
committed
Merge tag 'drm-xilinx-dpsub-20200718' of git://linuxtv.org/pinchartl/media into drm-next
Xilinx ZynqMP DisplayPort Subsystem driver Signed-off-by: Dave Airlie <[email protected]> From: Laurent Pinchart <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 2646699 + d76271d commit 959ed53

File tree

21 files changed

+5984
-1
lines changed

21 files changed

+5984
-1
lines changed
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/xlnx/xlnx,zynqmp-dpsub.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Xilinx ZynqMP DisplayPort Subsystem
8+
9+
description: |
10+
The DisplayPort subsystem of Xilinx ZynqMP (Zynq UltraScale+ MPSoC)
11+
implements the display and audio pipelines based on the DisplayPort v1.2
12+
standard. The subsystem includes multiple functional blocks as below:
13+
14+
+------------------------------------------------------------+
15+
+--------+ | +----------------+ +-----------+ |
16+
| DPDMA | --->| | --> | Video | Video +-------------+ |
17+
| 4x vid | | | | | Rendering | -+--> | | | +------+
18+
| 2x aud | | | Audio/Video | --> | Pipeline | | | DisplayPort |---> | PHY0 |
19+
+--------+ | | Buffer Manager | +-----------+ | | Source | | +------+
20+
| | and STC | +-----------+ | | Controller | | +------+
21+
Live Video --->| | --> | Audio | Audio | |---> | PHY1 |
22+
| | | | Mixer | --+-> | | | +------+
23+
Live Audio --->| | --> | | || +-------------+ |
24+
| +----------------+ +-----------+ || |
25+
+---------------------------------------||-------------------+
26+
vv
27+
Blended Video and
28+
Mixed Audio to PL
29+
30+
The Buffer Manager interacts with external interface such as DMA engines or
31+
live audio/video streams from the programmable logic. The Video Rendering
32+
Pipeline blends the video and graphics layers and performs colorspace
33+
conversion. The Audio Mixer mixes the incoming audio streams. The DisplayPort
34+
Source Controller handles the DisplayPort protocol and connects to external
35+
PHYs.
36+
37+
The subsystem supports 2 video and 2 audio streams, and various pixel formats
38+
and depths up to 4K@30 resolution.
39+
40+
Please refer to "Zynq UltraScale+ Device Technical Reference Manual"
41+
(https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf)
42+
for more details.
43+
44+
maintainers:
45+
- Laurent Pinchart <[email protected]>
46+
47+
properties:
48+
compatible:
49+
const: xlnx,zynqmp-dpsub-1.7
50+
51+
reg:
52+
maxItems: 4
53+
reg-names:
54+
items:
55+
- const: dp
56+
- const: blend
57+
- const: av_buf
58+
- const: aud
59+
60+
interrupts:
61+
maxItems: 1
62+
63+
clocks:
64+
description:
65+
The APB clock and at least one video clock are mandatory, the audio clock
66+
is optional.
67+
minItems: 2
68+
maxItems: 4
69+
items:
70+
- description: dp_apb_clk is the APB clock
71+
- description: dp_aud_clk is the Audio clock
72+
- description:
73+
dp_vtc_pixel_clk_in is the non-live video clock (from Processing
74+
System)
75+
- description:
76+
dp_live_video_in_clk is the live video clock (from Programmable
77+
Logic)
78+
clock-names:
79+
oneOf:
80+
- minItems: 2
81+
maxItems: 3
82+
items:
83+
- const: dp_apb_clk
84+
- enum: [ dp_vtc_pixel_clk_in, dp_live_video_in_clk ]
85+
- enum: [ dp_vtc_pixel_clk_in, dp_live_video_in_clk ]
86+
- minItems: 3
87+
maxItems: 4
88+
items:
89+
- const: dp_apb_clk
90+
- const: dp_aud_clk
91+
- enum: [ dp_vtc_pixel_clk_in, dp_live_video_in_clk ]
92+
- enum: [ dp_vtc_pixel_clk_in, dp_live_video_in_clk ]
93+
94+
power-domains:
95+
maxItems: 1
96+
97+
resets:
98+
maxItems: 1
99+
100+
dmas:
101+
maxItems: 4
102+
items:
103+
- description: Video layer, plane 0 (RGB or luma)
104+
- description: Video layer, plane 1 (U/V or U)
105+
- description: Video layer, plane 2 (V)
106+
- description: Graphics layer
107+
dma-names:
108+
items:
109+
- const: vid0
110+
- const: vid1
111+
- const: vid2
112+
- const: gfx0
113+
114+
phys:
115+
description: PHYs for the DP data lanes
116+
minItems: 1
117+
maxItems: 2
118+
phy-names:
119+
minItems: 1
120+
maxItems: 2
121+
items:
122+
- const: dp-phy0
123+
- const: dp-phy1
124+
125+
required:
126+
- compatible
127+
- reg
128+
- reg-names
129+
- interrupts
130+
- clocks
131+
- clock-names
132+
- power-domains
133+
- resets
134+
- dmas
135+
- dma-names
136+
- phys
137+
- phy-names
138+
139+
additionalProperties: false
140+
141+
examples:
142+
- |
143+
#include <dt-bindings/phy/phy.h>
144+
#include <dt-bindings/reset/xlnx-zynqmp-resets.h>
145+
146+
display@fd4a0000 {
147+
compatible = "xlnx,zynqmp-dpsub-1.7";
148+
reg = <0x0 0xfd4a0000 0x0 0x1000>,
149+
<0x0 0xfd4aa000 0x0 0x1000>,
150+
<0x0 0xfd4ab000 0x0 0x1000>,
151+
<0x0 0xfd4ac000 0x0 0x1000>;
152+
reg-names = "dp", "blend", "av_buf", "aud";
153+
interrupts = <0 119 4>;
154+
interrupt-parent = <&gic>;
155+
156+
clock-names = "dp_apb_clk", "dp_aud_clk", "dp_live_video_in_clk";
157+
clocks = <&dp_aclk>, <&clkc 17>, <&si570_1>;
158+
159+
power-domains = <&pd_dp>;
160+
resets = <&reset ZYNQMP_RESET_DP>;
161+
162+
dma-names = "vid0", "vid1", "vid2", "gfx0";
163+
dmas = <&xlnx_dpdma 0>,
164+
<&xlnx_dpdma 1>,
165+
<&xlnx_dpdma 2>,
166+
<&xlnx_dpdma 3>;
167+
168+
phys = <&psgtr 1 PHY_TYPE_DP 0 3 27000000>,
169+
<&psgtr 0 PHY_TYPE_DP 1 3 27000000>;
170+
171+
phy-names = "dp-phy0", "dp-phy1";
172+
};
173+
174+
...
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/dma/xilinx/xlnx,zynqmp-dpdma.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Xilinx ZynqMP DisplayPort DMA Controller Device Tree Bindings
8+
9+
description: |
10+
These bindings describe the DMA engine included in the Xilinx ZynqMP
11+
DisplayPort Subsystem. The DMA engine supports up to 6 DMA channels (3
12+
channels for a video stream, 1 channel for a graphics stream, and 2 channels
13+
for an audio stream).
14+
15+
maintainers:
16+
- Laurent Pinchart <[email protected]>
17+
18+
allOf:
19+
- $ref: "../dma-controller.yaml#"
20+
21+
properties:
22+
"#dma-cells":
23+
const: 1
24+
description: |
25+
The cell is the DMA channel ID (see dt-bindings/dma/xlnx-zynqmp-dpdma.h
26+
for a list of channel IDs).
27+
28+
compatible:
29+
const: xlnx,zynqmp-dpdma
30+
31+
reg:
32+
maxItems: 1
33+
34+
interrupts:
35+
maxItems: 1
36+
37+
clocks:
38+
description: The AXI clock
39+
maxItems: 1
40+
41+
clock-names:
42+
const: axi_clk
43+
44+
required:
45+
- "#dma-cells"
46+
- compatible
47+
- reg
48+
- interrupts
49+
- clocks
50+
- clock-names
51+
52+
additionalProperties: false
53+
54+
examples:
55+
- |
56+
#include <dt-bindings/interrupt-controller/arm-gic.h>
57+
58+
dma: dma-controller@fd4c0000 {
59+
compatible = "xlnx,zynqmp-dpdma";
60+
reg = <0x0 0xfd4c0000 0x0 0x1000>;
61+
interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
62+
interrupt-parent = <&gic>;
63+
clocks = <&dpdma_clk>;
64+
clock-names = "axi_clk";
65+
#dma-cells = <1>;
66+
};
67+
68+
...

Documentation/driver-api/dmaengine/client.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ The details of these operations are:
8686
- interleaved_dma: This is common to Slave as well as M2M clients. For slave
8787
address of devices' fifo could be already known to the driver.
8888
Various types of operations could be expressed by setting
89-
appropriate values to the 'dma_interleaved_template' members.
89+
appropriate values to the 'dma_interleaved_template' members. Cyclic
90+
interleaved DMA transfers are also possible if supported by the channel by
91+
setting the DMA_PREP_REPEAT transfer flag.
9092

9193
A non-NULL return of this transfer API represents a "descriptor" for
9294
the given transaction.

Documentation/driver-api/dmaengine/provider.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,27 @@ Currently, the types available are:
239239
want to transfer a portion of uncompressed data directly to the
240240
display to print it
241241

242+
- DMA_REPEAT
243+
244+
- The device supports repeated transfers. A repeated transfer, indicated by
245+
the DMA_PREP_REPEAT transfer flag, is similar to a cyclic transfer in that
246+
it gets automatically repeated when it ends, but can additionally be
247+
replaced by the client.
248+
249+
- This feature is limited to interleaved transfers, this flag should thus not
250+
be set if the DMA_INTERLEAVE flag isn't set. This limitation is based on
251+
the current needs of DMA clients, support for additional transfer types
252+
should be added in the future if and when the need arises.
253+
254+
- DMA_LOAD_EOT
255+
256+
- The device supports replacing repeated transfers at end of transfer (EOT)
257+
by queuing a new transfer with the DMA_PREP_LOAD_EOT flag set.
258+
259+
- Support for replacing a currently running transfer at another point (such
260+
as end of burst instead of end of transfer) will be added in the future
261+
based on DMA clients needs, if and when the need arises.
262+
242263
These various types will also affect how the source and destination
243264
addresses change over time.
244265

@@ -531,6 +552,34 @@ DMA_CTRL_REUSE
531552
writes for which the descriptor should be in different format from
532553
normal data descriptors.
533554

555+
- DMA_PREP_REPEAT
556+
557+
- If set, the transfer will be automatically repeated when it ends until a
558+
new transfer is queued on the same channel with the DMA_PREP_LOAD_EOT flag.
559+
If the next transfer to be queued on the channel does not have the
560+
DMA_PREP_LOAD_EOT flag set, the current transfer will be repeated until the
561+
client terminates all transfers.
562+
563+
- This flag is only supported if the channel reports the DMA_REPEAT
564+
capability.
565+
566+
- DMA_PREP_LOAD_EOT
567+
568+
- If set, the transfer will replace the transfer currently being executed at
569+
the end of the transfer.
570+
571+
- This is the default behaviour for non-repeated transfers, specifying
572+
DMA_PREP_LOAD_EOT for non-repeated transfers will thus make no difference.
573+
574+
- When using repeated transfers, DMA clients will usually need to set the
575+
DMA_PREP_LOAD_EOT flag on all transfers, otherwise the channel will keep
576+
repeating the last repeated transfer and ignore the new transfers being
577+
queued. Failure to set DMA_PREP_LOAD_EOT will appear as if the channel was
578+
stuck on the previous transfer.
579+
580+
- This flag is only supported if the channel reports the DMA_LOAD_EOT
581+
capability.
582+
534583
General Design Notes
535584
====================
536585

MAINTAINERS

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5839,6 +5839,15 @@ T: git git://anongit.freedesktop.org/drm/drm-misc
58395839
F: Documentation/gpu/xen-front.rst
58405840
F: drivers/gpu/drm/xen/
58415841

5842+
DRM DRIVERS FOR XILINX
5843+
M: Hyun Kwon <[email protected]>
5844+
M: Laurent Pinchart <[email protected]>
5845+
5846+
S: Maintained
5847+
T: git git://anongit.freedesktop.org/drm/drm-misc
5848+
F: Documentation/devicetree/bindings/display/xlnx/
5849+
F: drivers/gpu/drm/xlnx/
5850+
58425851
DRM DRIVERS FOR ZTE ZX
58435852
M: Shawn Guo <[email protected]>
58445853
@@ -18853,6 +18862,15 @@ F: Documentation/devicetree/bindings/media/xilinx/
1885318862
F: drivers/media/platform/xilinx/
1885418863
F: include/uapi/linux/xilinx-v4l2-controls.h
1885518864

18865+
XILINX ZYNQMP DPDMA DRIVER
18866+
M: Hyun Kwon <[email protected]>
18867+
M: Laurent Pinchart <[email protected]>
18868+
18869+
S: Supported
18870+
F: Documentation/devicetree/bindings/dma/xilinx/xlnx,zynqmp-dpdma.yaml
18871+
F: drivers/dma/xilinx/xilinx_dpdma.c
18872+
F: include/dt-bindings/dma/xlnx-zynqmp-dpdma.h
18873+
1885618874
XILLYBUS DRIVER
1885718875
M: Eli Billauer <[email protected]>
1885818876

drivers/dma/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,16 @@ config XILINX_ZYNQMP_DMA
707707
help
708708
Enable support for Xilinx ZynqMP DMA controller.
709709

710+
config XILINX_ZYNQMP_DPDMA
711+
tristate "Xilinx DPDMA Engine"
712+
select DMA_ENGINE
713+
select DMA_VIRTUAL_CHANNELS
714+
help
715+
Enable support for Xilinx ZynqMP DisplayPort DMA. Choose this option
716+
if you have a Xilinx ZynqMP SoC with a DisplayPort subsystem. The
717+
driver provides the dmaengine required by the DisplayPort subsystem
718+
display driver.
719+
710720
config ZX_DMA
711721
tristate "ZTE ZX DMA support"
712722
depends on ARCH_ZX || COMPILE_TEST

drivers/dma/xilinx/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
obj-$(CONFIG_XILINX_DMA) += xilinx_dma.o
33
obj-$(CONFIG_XILINX_ZYNQMP_DMA) += zynqmp_dma.o
4+
obj-$(CONFIG_XILINX_ZYNQMP_DPDMA) += xilinx_dpdma.o

0 commit comments

Comments
 (0)