222 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3i.MX7 Video Capture Driver4==========================5 6Introduction7------------8 9The i.MX7 contrary to the i.MX5/6 family does not contain an Image Processing10Unit (IPU); because of that the capabilities to perform operations or11manipulation of the capture frames are less feature rich.12 13For image capture the i.MX7 has three units:14- CMOS Sensor Interface (CSI)15- Video Multiplexer16- MIPI CSI-2 Receiver17 18.. code-block:: none19 20 MIPI Camera Input ---> MIPI CSI-2 --- > |\21 | \22 | \23 | M |24 | U | ------> CSI ---> Capture25 | X |26 | /27 Parallel Camera Input ----------------> | /28 |/29 30For additional information, please refer to the latest versions of the i.MX731reference manual [#f1]_.32 33Entities34--------35 36imx-mipi-csi237--------------38 39This is the MIPI CSI-2 receiver entity. It has one sink pad to receive the pixel40data from MIPI CSI-2 camera sensor. It has one source pad, corresponding to the41virtual channel 0. This module is compliant to previous version of Samsung42D-phy, and supports two D-PHY Rx Data lanes.43 44csi-mux45-------46 47This is the video multiplexer. It has two sink pads to select from either camera48sensor with a parallel interface or from MIPI CSI-2 virtual channel 0. It has49a single source pad that routes to the CSI.50 51csi52---53 54The CSI enables the chip to connect directly to external CMOS image sensor. CSI55can interface directly with Parallel and MIPI CSI-2 buses. It has 256 x 64 FIFO56to store received image pixel data and embedded DMA controllers to transfer data57from the FIFO through AHB bus.58 59This entity has one sink pad that receives from the csi-mux entity and a single60source pad that routes video frames directly to memory buffers. This pad is61routed to a capture device node.62 63Usage Notes64-----------65 66To aid in configuration and for backward compatibility with V4L2 applications67that access controls only from video device nodes, the capture device interfaces68inherit controls from the active entities in the current pipeline, so controls69can be accessed either directly from the subdev or from the active capture70device interface. For example, the sensor controls are available either from the71sensor subdevs or from the active capture device.72 73Warp7 with OV268074-----------------75 76On this platform an OV2680 MIPI CSI-2 module is connected to the internal MIPI77CSI-2 receiver. The following example configures a video capture pipeline with78an output of 800x600, and BGGR 10 bit bayer format:79 80.. code-block:: none81 82 # Setup links83 media-ctl -l "'ov2680 1-0036':0 -> 'imx7-mipi-csis.0':0[1]"84 media-ctl -l "'imx7-mipi-csis.0':1 -> 'csi-mux':1[1]"85 media-ctl -l "'csi-mux':2 -> 'csi':0[1]"86 media-ctl -l "'csi':1 -> 'csi capture':0[1]"87 88 # Configure pads for pipeline89 media-ctl -V "'ov2680 1-0036':0 [fmt:SBGGR10_1X10/800x600 field:none]"90 media-ctl -V "'csi-mux':1 [fmt:SBGGR10_1X10/800x600 field:none]"91 media-ctl -V "'csi-mux':2 [fmt:SBGGR10_1X10/800x600 field:none]"92 media-ctl -V "'imx7-mipi-csis.0':0 [fmt:SBGGR10_1X10/800x600 field:none]"93 media-ctl -V "'csi':0 [fmt:SBGGR10_1X10/800x600 field:none]"94 95After this streaming can start. The v4l2-ctl tool can be used to select any of96the resolutions supported by the sensor.97 98.. code-block:: none99 100 # media-ctl -p101 Media controller API version 5.2.0102 103 Media device information104 ------------------------105 driver imx7-csi106 model imx-media107 serial108 bus info109 hw revision 0x0110 driver version 5.2.0111 112 Device topology113 - entity 1: csi (2 pads, 2 links)114 type V4L2 subdev subtype Unknown flags 0115 device node name /dev/v4l-subdev0116 pad0: Sink117 [fmt:SBGGR10_1X10/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]118 <- "csi-mux":2 [ENABLED]119 pad1: Source120 [fmt:SBGGR10_1X10/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]121 -> "csi capture":0 [ENABLED]122 123 - entity 4: csi capture (1 pad, 1 link)124 type Node subtype V4L flags 0125 device node name /dev/video0126 pad0: Sink127 <- "csi":1 [ENABLED]128 129 - entity 10: csi-mux (3 pads, 2 links)130 type V4L2 subdev subtype Unknown flags 0131 device node name /dev/v4l-subdev1132 pad0: Sink133 [fmt:Y8_1X8/1x1 field:none]134 pad1: Sink135 [fmt:SBGGR10_1X10/800x600 field:none]136 <- "imx7-mipi-csis.0":1 [ENABLED]137 pad2: Source138 [fmt:SBGGR10_1X10/800x600 field:none]139 -> "csi":0 [ENABLED]140 141 - entity 14: imx7-mipi-csis.0 (2 pads, 2 links)142 type V4L2 subdev subtype Unknown flags 0143 device node name /dev/v4l-subdev2144 pad0: Sink145 [fmt:SBGGR10_1X10/800x600 field:none]146 <- "ov2680 1-0036":0 [ENABLED]147 pad1: Source148 [fmt:SBGGR10_1X10/800x600 field:none]149 -> "csi-mux":1 [ENABLED]150 151 - entity 17: ov2680 1-0036 (1 pad, 1 link)152 type V4L2 subdev subtype Sensor flags 0153 device node name /dev/v4l-subdev3154 pad0: Source155 [fmt:SBGGR10_1X10/800x600@1/30 field:none colorspace:srgb]156 -> "imx7-mipi-csis.0":0 [ENABLED]157 158i.MX6ULL-EVK with OV5640159------------------------160 161On this platform a parallel OV5640 sensor is connected to the CSI port.162The following example configures a video capture pipeline with an output163of 640x480 and UYVY8_2X8 format:164 165.. code-block:: none166 167 # Setup links168 media-ctl -l "'ov5640 1-003c':0 -> 'csi':0[1]"169 media-ctl -l "'csi':1 -> 'csi capture':0[1]"170 171 # Configure pads for pipeline172 media-ctl -v -V "'ov5640 1-003c':0 [fmt:UYVY8_2X8/640x480 field:none]"173 174After this streaming can start:175 176.. code-block:: none177 178 gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,format=UYVY,width=640,height=480 ! v4l2convert ! fbdevsink179 180.. code-block:: none181 182 # media-ctl -p183 Media controller API version 5.14.0184 185 Media device information186 ------------------------187 driver imx7-csi188 model imx-media189 serial190 bus info191 hw revision 0x0192 driver version 5.14.0193 194 Device topology195 - entity 1: csi (2 pads, 2 links)196 type V4L2 subdev subtype Unknown flags 0197 device node name /dev/v4l-subdev0198 pad0: Sink199 [fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]200 <- "ov5640 1-003c":0 [ENABLED,IMMUTABLE]201 pad1: Source202 [fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]203 -> "csi capture":0 [ENABLED,IMMUTABLE]204 205 - entity 4: csi capture (1 pad, 1 link)206 type Node subtype V4L flags 0207 device node name /dev/video1208 pad0: Sink209 <- "csi":1 [ENABLED,IMMUTABLE]210 211 - entity 10: ov5640 1-003c (1 pad, 1 link)212 type V4L2 subdev subtype Sensor flags 0213 device node name /dev/v4l-subdev1214 pad0: Source215 [fmt:UYVY8_2X8/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]216 -> "csi":0 [ENABLED,IMMUTABLE]217 218References219----------220 221.. [#f1] https://www.nxp.com/docs/en/reference-manual/IMX7SRM.pdf222