Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | i.MX7 Video Capture Driver |
| 4 | ========================== |
| 5 | |
| 6 | Introduction |
| 7 | ------------ |
| 8 | |
| 9 | The i.MX7 contrary to the i.MX5/6 family does not contain an Image Processing |
| 10 | Unit (IPU); because of that the capabilities to perform operations or |
| 11 | manipulation of the capture frames are less feature rich. |
| 12 | |
| 13 | For image capture the i.MX7 has three units: |
| 14 | - CMOS Sensor Interface (CSI) |
| 15 | - Video Multiplexer |
| 16 | - MIPI CSI-2 Receiver |
| 17 | |
Mauro Carvalho Chehab | 3fecc49 | 2019-02-18 15:55:23 -0500 | [diff] [blame] | 18 | .. code-block:: none |
| 19 | |
| 20 | MIPI Camera Input ---> MIPI CSI-2 --- > |\ |
| 21 | | \ |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 22 | | \ |
| 23 | | M | |
| 24 | | U | ------> CSI ---> Capture |
| 25 | | X | |
| 26 | | / |
| 27 | Parallel Camera Input ----------------> | / |
| 28 | |/ |
| 29 | |
| 30 | For additional information, please refer to the latest versions of the i.MX7 |
| 31 | reference manual [#f1]_. |
| 32 | |
| 33 | Entities |
| 34 | -------- |
| 35 | |
| 36 | imx7-mipi-csi2 |
| 37 | -------------- |
| 38 | |
| 39 | This is the MIPI CSI-2 receiver entity. It has one sink pad to receive the pixel |
| 40 | data from MIPI CSI-2 camera sensor. It has one source pad, corresponding to the |
| 41 | virtual channel 0. This module is compliant to previous version of Samsung |
| 42 | D-phy, and supports two D-PHY Rx Data lanes. |
| 43 | |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 44 | csi-mux |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 45 | ------- |
| 46 | |
| 47 | This is the video multiplexer. It has two sink pads to select from either camera |
| 48 | sensor with a parallel interface or from MIPI CSI-2 virtual channel 0. It has |
| 49 | a single source pad that routes to the CSI. |
| 50 | |
| 51 | csi |
| 52 | --- |
| 53 | |
| 54 | The CSI enables the chip to connect directly to external CMOS image sensor. CSI |
| 55 | can interface directly with Parallel and MIPI CSI-2 buses. It has 256 x 64 FIFO |
| 56 | to store received image pixel data and embedded DMA controllers to transfer data |
| 57 | from the FIFO through AHB bus. |
| 58 | |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 59 | This entity has one sink pad that receives from the csi-mux entity and a single |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 60 | source pad that routes video frames directly to memory buffers. This pad is |
| 61 | routed to a capture device node. |
| 62 | |
| 63 | Usage Notes |
| 64 | ----------- |
| 65 | |
| 66 | To aid in configuration and for backward compatibility with V4L2 applications |
| 67 | that access controls only from video device nodes, the capture device interfaces |
| 68 | inherit controls from the active entities in the current pipeline, so controls |
| 69 | can be accessed either directly from the subdev or from the active capture |
| 70 | device interface. For example, the sensor controls are available either from the |
| 71 | sensor subdevs or from the active capture device. |
| 72 | |
| 73 | Warp7 with OV2680 |
| 74 | ----------------- |
| 75 | |
| 76 | On this platform an OV2680 MIPI CSI-2 module is connected to the internal MIPI |
| 77 | CSI-2 receiver. The following example configures a video capture pipeline with |
| 78 | an output of 800x600, and BGGR 10 bit bayer format: |
| 79 | |
| 80 | .. code-block:: none |
Mauro Carvalho Chehab | 3fecc49 | 2019-02-18 15:55:23 -0500 | [diff] [blame] | 81 | |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 82 | # Setup links |
| 83 | media-ctl -l "'ov2680 1-0036':0 -> 'imx7-mipi-csis.0':0[1]" |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 84 | media-ctl -l "'imx7-mipi-csis.0':1 -> 'csi-mux':1[1]" |
| 85 | media-ctl -l "'csi-mux':2 -> 'csi':0[1]" |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 86 | media-ctl -l "'csi':1 -> 'csi capture':0[1]" |
| 87 | |
| 88 | # Configure pads for pipeline |
| 89 | media-ctl -V "'ov2680 1-0036':0 [fmt:SBGGR10_1X10/800x600 field:none]" |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 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]" |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 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 | |
| 95 | After this streaming can start. The v4l2-ctl tool can be used to select any of |
| 96 | the resolutions supported by the sensor. |
| 97 | |
| 98 | .. code-block:: none |
Mauro Carvalho Chehab | 3fecc49 | 2019-02-18 15:55:23 -0500 | [diff] [blame] | 99 | |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 100 | # media-ctl -p |
| 101 | Media controller API version 5.2.0 |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 102 | |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 103 | Media device information |
| 104 | ------------------------ |
| 105 | driver imx7-csi |
| 106 | model imx-media |
| 107 | serial |
| 108 | bus info |
| 109 | hw revision 0x0 |
| 110 | driver version 5.2.0 |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 111 | |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 112 | Device topology |
| 113 | - entity 1: csi (2 pads, 2 links) |
| 114 | type V4L2 subdev subtype Unknown flags 0 |
| 115 | device node name /dev/v4l-subdev0 |
| 116 | pad0: Sink |
| 117 | [fmt:SBGGR10_1X10/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] |
| 118 | <- "csi-mux":2 [ENABLED] |
| 119 | pad1: Source |
| 120 | [fmt:SBGGR10_1X10/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] |
| 121 | -> "csi capture":0 [ENABLED] |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 122 | |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 123 | - entity 4: csi capture (1 pad, 1 link) |
| 124 | type Node subtype V4L flags 0 |
| 125 | device node name /dev/video0 |
| 126 | pad0: Sink |
| 127 | <- "csi":1 [ENABLED] |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 128 | |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 129 | - entity 10: csi-mux (3 pads, 2 links) |
| 130 | type V4L2 subdev subtype Unknown flags 0 |
| 131 | device node name /dev/v4l-subdev1 |
| 132 | pad0: Sink |
| 133 | [fmt:Y8_1X8/1x1 field:none] |
| 134 | pad1: Sink |
| 135 | [fmt:SBGGR10_1X10/800x600 field:none] |
| 136 | <- "imx7-mipi-csis.0":1 [ENABLED] |
| 137 | pad2: Source |
| 138 | [fmt:SBGGR10_1X10/800x600 field:none] |
| 139 | -> "csi":0 [ENABLED] |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 140 | |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 141 | - entity 14: imx7-mipi-csis.0 (2 pads, 2 links) |
| 142 | type V4L2 subdev subtype Unknown flags 0 |
| 143 | device node name /dev/v4l-subdev2 |
| 144 | pad0: Sink |
| 145 | [fmt:SBGGR10_1X10/800x600 field:none] |
| 146 | <- "ov2680 1-0036":0 [ENABLED] |
| 147 | pad1: Source |
| 148 | [fmt:SBGGR10_1X10/800x600 field:none] |
| 149 | -> "csi-mux":1 [ENABLED] |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 150 | |
Fabio Estevam | 8fb294c | 2019-08-01 14:56:11 -0300 | [diff] [blame] | 151 | - entity 17: ov2680 1-0036 (1 pad, 1 link) |
| 152 | type V4L2 subdev subtype Sensor flags 0 |
| 153 | device node name /dev/v4l-subdev3 |
| 154 | pad0: Source |
| 155 | [fmt:SBGGR10_1X10/800x600@1/30 field:none colorspace:srgb] |
| 156 | -> "imx7-mipi-csis.0":0 [ENABLED] |
Rui Miguel Silva | fa88fbd | 2019-02-06 10:13:25 -0500 | [diff] [blame] | 157 | |
| 158 | References |
| 159 | ---------- |
| 160 | |
| 161 | .. [#f1] https://www.nxp.com/docs/en/reference-manual/IMX7SRM.pdf |