xref: /linux/Documentation/admin-guide/media/rkcif.rst (revision 3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d)
1.. SPDX-License-Identifier: GPL-2.0
2
3=========================================
4Rockchip Camera Interface (CIF)
5=========================================
6
7Introduction
8============
9
10The Rockchip Camera Interface (CIF) is featured in many Rockchip SoCs in
11different variants.
12The different variants are combinations of common building blocks, such as
13
14* INTERFACE blocks of different types, namely
15
16  * the Digital Video Port (DVP, a parallel data interface)
17  * the interface block for the MIPI CSI-2 receiver
18
19* CROP units
20
21* MIPI CSI-2 receiver (not available on all variants): This unit is referred
22  to as MIPI CSI HOST in the Rockchip documentation.
23  Technically, it is a separate hardware block, but it is strongly coupled to
24  the CIF and therefore included here.
25
26* MUX units (not available on all variants) that pass the video data to an
27  image signal processor (ISP)
28
29* SCALE units (not available on all variants)
30
31* DMA engines that transfer video data into system memory using a
32  double-buffering mechanism called ping-pong mode
33
34* Support for four streams per INTERFACE block (not available on all
35  variants), e.g., for MIPI CSI-2 Virtual Channels (VCs)
36
37This document describes the different variants of the CIF, their hardware
38layout, as well as their representation in the media controller centric rkcif
39device driver, which is located under drivers/media/platform/rockchip/rkcif.
40
41Variants
42========
43
44Rockchip PX30 Video Input Processor (VIP)
45-----------------------------------------
46
47The PX30 Video Input Processor (VIP) features a digital video port that accepts
48parallel video data or BT.656.
49Since these protocols do not feature multiple streams, the VIP has one DMA
50engine that transfers the input video data into system memory.
51
52The rkcif driver represents this hardware variant by exposing one V4L2 subdevice
53(the DVP INTERFACE/CROP block) and one V4L2 device (the DVP DMA engine).
54
55Rockchip RK3568 Video Capture (VICAP)
56-------------------------------------
57
58The RK3568 Video Capture (VICAP) unit features a digital video port and a MIPI
59CSI-2 receiver that can receive video data independently.
60The DVP accepts parallel video data, BT.656 and BT.1120.
61Since the BT.1120 protocol may feature more than one stream, the RK3568 VICAP
62DVP features four DMA engines that can capture different streams.
63Similarly, the RK3568 VICAP MIPI CSI-2 receiver features four DMA engines to
64handle different Virtual Channels (VCs).
65
66The rkcif driver represents this hardware variant by exposing up the following
67V4L2 subdevices:
68
69* rkcif-dvp0: INTERFACE/CROP block for the DVP
70
71and the following video devices:
72
73* rkcif-dvp0-id0: The support for multiple streams on the DVP is not yet
74  implemented, as it is hard to find test hardware. Thus, this video device
75  represents the first DMA engine of the RK3568 DVP.
76
77.. kernel-figure:: rkcif-rk3568-vicap.dot
78    :alt:   Topology of the RK3568 Video Capture (VICAP) unit
79    :align: center
80
81Rockchip RK3588 Video Capture (VICAP)
82-------------------------------------
83
84The RK3588 Video Capture (VICAP) unit features a digital video port and six
85MIPI CSI-2 capture interfaces that can receive video data independently.
86The DVP accepts parallel video data, BT.656 and BT.1120.
87Since the BT.1120 protocol may feature more than one stream, the RK3588 VICAP
88DVP features four DMA engines that can capture different streams.
89Similarly, the RK3588 VICAP MIPI CSI-2 receivers feature four DMA engines each
90to handle different Virtual Channels (VCs).
91
92The rkcif driver represents this hardware variant by exposing the following
93V4L2 subdevices:
94
95* dw-mipi-csi2rx fdd30000.csi: MIPI CSI-2 receiver connected to MIPI DPHY0
96* dw-mipi-csi2rx fdd50000.csi: MIPI CSI-2 receiver connected to MIPI DPHY1
97* rkcif-mipi2: INTERFACE/CROP block for the MIPI CSI-2 receiver connected to
98  MIPI DPHY0
99* rkcif-mipi4: INTERFACE/CROP block for the MIPI CSI-2 receiver connected to
100  MIPI DPHY1
101
102and the following video devices:
103
104* rkcif-mipi2-id{0,1,2,3}: The DMA engines connected to the rkcif-mipi2
105  INTERFACE/CROP block.
106* rkcif-mipi4-id{0,1,2,3}: The DMA engines connected to the rkcif-mipi4
107  INTERFACE/CROP block.
108
109.. kernel-figure:: rkcif-rk3588-vicap.dot
110    :alt:   Topology of the RK3588 Video Capture (VICAP) unit
111    :align: center
112