From patchwork Thu Nov 22 15:18:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 151797 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp877365ljp; Thu, 22 Nov 2018 07:19:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/W12VGNEkkdLNA8wmZaeYaHGcBReYsDu41fwOqF0KxpIZ5XF1tv0haaZx0XeApQpPeFVDQW X-Received: by 2002:a17:902:680f:: with SMTP id h15mr11454663plk.40.1542899958288; Thu, 22 Nov 2018 07:19:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542899958; cv=none; d=google.com; s=arc-20160816; b=HTOuRYnvUtbB4fRNttSAXcHHI4FfNMsm5M6BWxVx6IOh9GsjTOZST8/TLNULuJfSo0 eU8ONLEhWEc8VPGR3ktt9SbE6/7F4bwVrhT9UF0+wy7+4/ZvKaL3LGChTmI3lEwimp0C 8zMEI3Gmc1DUTiSC+ECxTgVgiOl3o4tr6JztY3Yc9/arSUrmE+XBFNkCNVqEz01616k1 8fzVrp8ArvWgbAZrh3JPbdzDjJpFLfp8qDNVhFKc7cNMZYwbEgUYs5QQp/rszx5AGI+x 4UyWpNtUfrgx4YjK+Yj94BjTt784cGmcGCgEk8KzCGJe7YE9oBR18IzsIbv83vBIb9kE p6Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kP+VjY7TNhfRQLdEzA2J5W8tv3OspNePqgoe976NOZw=; b=PCYO3ODlapQ7w4wmk0UMsH0YE8/PygdSxjVDKQX2j0hRfbCAn3EVpFPV1gmPMZ9VUG xLeVAi9LIRbglvRecOtWcmGgRRxbdLA0srs4d4HtgYq/eT9wsgxTjeFWsh1UIs+ThutW 3P/waHT7xJlVaa8fwSSl/+L8FoIQ5izu6fu7K72iVQQS5/BkpRqDZFkiPzbggkirxFuv fMSoH8+amtz6Sbn2r2XXKdsEP6TpOQHUikXNuDy7XpSp3aPrdiZ+AlmghpXHqnpoVu6e aaAXA8FqvDA58Ap/XJNFHrSubeDTsjTSe0FYcrywf/jSe8i/mBhaWRV3v8w5y79sTK0E peJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jA44Yx7w; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si27736717pgl.468.2018.11.22.07.19.18; Thu, 22 Nov 2018 07:19:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jA44Yx7w; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437580AbeKWB7E (ORCPT + 6 others); Thu, 22 Nov 2018 20:59:04 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:37774 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437573AbeKWB7E (ORCPT ); Thu, 22 Nov 2018 20:59:04 -0500 Received: by mail-wm1-f67.google.com with SMTP id p2-v6so9435086wmc.2 for ; Thu, 22 Nov 2018 07:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kP+VjY7TNhfRQLdEzA2J5W8tv3OspNePqgoe976NOZw=; b=jA44Yx7w2aYr6wwSWdlp9r53MeVMaLfGcWF+XGsuF1hVNa/xRBs+Pglm4jAHtCTibU kydutw8dmwJkYBLwD+Ad6j3JVX59qtJd2KYoHmkffQcS7DkD6q1lNDoboJ+RbCzhe+TA 92U/zI+n8NApBn9uuKJhvNDUBQ1FThuXR9Z8k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kP+VjY7TNhfRQLdEzA2J5W8tv3OspNePqgoe976NOZw=; b=QdE3KcdYclzmIW+rL1gjL1pzkYUWC/i8y5Mpg2Hl5T40dI66EWSJCFqPOhn05VyMMk PysXu+oqoSJn5Ji/Dr/yz8hRNxAbSyz5EG1QJ0kv/qpt0qPUBRvdhohx2XHA6IW7sJsQ A6aKycc/CKYB6Hw+Nb60InU4SGjs3EHHASbK5gfjWfDLkXTV0LlCPkjF+SgJTY5ua8GA 5vZ8HmVlW72X/brLfcRfPm2KxlHAt8ZkT2HcfOXWfhl3u1H3XRm+cY5p0lYGwAVT/vAw l3TNk8VFA/zJ5h5mXJsxZEb57m7Xn3RLQ1UFjMODwfOgzLDO8BDX0iu7w9gcp345BkQ5 W8wQ== X-Gm-Message-State: AA+aEWbmFcSu5y6RD2R4ghKvfBXHrgE8/eKGdqanrw7uXuXeftbvJnvq 92DoR0TGfO4QzMocrNTyAI5cLA== X-Received: by 2002:a1c:2304:: with SMTP id j4mr9862491wmj.14.1542899954705; Thu, 22 Nov 2018 07:19:14 -0800 (PST) Received: from arch-late.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id q7-v6sm4642476wmg.27.2018.11.22.07.19.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 07:19:14 -0800 (PST) From: Rui Miguel Silva To: sakari.ailus@linux.intel.com, Steve Longerbeam , Hans Verkuil , Philipp Zabel Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, devicetree@vger.kernel.org, Greg Kroah-Hartman , Rui Miguel Silva Subject: [PATCH v9 10/13] media: imx7.rst: add documentation for i.MX7 media driver Date: Thu, 22 Nov 2018 15:18:31 +0000 Message-Id: <20181122151834.6194-11-rui.silva@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181122151834.6194-1-rui.silva@linaro.org> References: <20181122151834.6194-1-rui.silva@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add rst document to describe the i.MX7 media driver and also a working example from the Warp7 board usage with a OV2680 sensor. Signed-off-by: Rui Miguel Silva --- Documentation/media/v4l-drivers/imx7.rst | 157 ++++++++++++++++++++++ Documentation/media/v4l-drivers/index.rst | 1 + 2 files changed, 158 insertions(+) create mode 100644 Documentation/media/v4l-drivers/imx7.rst -- 2.19.1 diff --git a/Documentation/media/v4l-drivers/imx7.rst b/Documentation/media/v4l-drivers/imx7.rst new file mode 100644 index 000000000000..cd1195d391c5 --- /dev/null +++ b/Documentation/media/v4l-drivers/imx7.rst @@ -0,0 +1,157 @@ +i.MX7 Video Capture Driver +========================== + +Introduction +------------ + +The i.MX7 contrary to the i.MX5/6 family does not contain an Image Processing +Unit (IPU); because of that the capabilities to perform operations or +manipulation of the capture frames are less feature rich. + +For image capture the i.MX7 has three units: +- CMOS Sensor Interface (CSI) +- Video Multiplexer +- MIPI CSI-2 Receiver + +:: + |\ + MIPI Camera Input ---> MIPI CSI-2 --- > | \ + | \ + | M | + | U | ------> CSI ---> Capture + | X | + | / + Parallel Camera Input ----------------> | / + |/ + +For additional information, please refer to the latest versions of the i.MX7 +reference manual [#f1]_. + +Entities +-------- + +imx7-mipi-csi2 +-------------- + +This is the MIPI CSI-2 receiver entity. It has one sink pad to receive the pixel +data from MIPI CSI-2 camera sensor. It has one source pad, corresponding to the +virtual channel 0. This module is compliant to previous version of Samsung +D-phy, and supports two D-PHY Rx Data lanes. + +csi_mux +------- + +This is the video multiplexer. It has two sink pads to select from either camera +sensor with a parallel interface or from MIPI CSI-2 virtual channel 0. It has +a single source pad that routes to the CSI. + +csi +--- + +The CSI enables the chip to connect directly to external CMOS image sensor. CSI +can interface directly with Parallel and MIPI CSI-2 buses. It has 256 x 64 FIFO +to store received image pixel data and embedded DMA controllers to transfer data +from the FIFO through AHB bus. + +This entity has one sink pad that receives from the csi_mux entity and a single +source pad that routes video frames directly to memory buffers. This pad is +routed to a capture device node. + +Usage Notes +----------- + +To aid in configuration and for backward compatibility with V4L2 applications +that access controls only from video device nodes, the capture device interfaces +inherit controls from the active entities in the current pipeline, so controls +can be accessed either directly from the subdev or from the active capture +device interface. For example, the sensor controls are available either from the +sensor subdevs or from the active capture device. + +Warp7 with OV2680 +----------------- + +On this platform an OV2680 MIPI CSI-2 module is connected to the internal MIPI +CSI-2 receiver. The following example configures a video capture pipeline with +an output of 800x600, and BGGR 10 bit bayer format: + +.. code-block:: none + # Setup links + media-ctl -l "'ov2680 1-0036':0 -> 'imx7-mipi-csis.0':0[1]" + media-ctl -l "'imx7-mipi-csis.0':1 -> 'csi_mux':1[1]" + media-ctl -l "'csi_mux':2 -> 'csi':0[1]" + media-ctl -l "'csi':1 -> 'csi capture':0[1]" + + # Configure pads for pipeline + media-ctl -V "'ov2680 1-0036':0 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'csi_mux':1 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'csi_mux':2 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'imx7-mipi-csis.0':0 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'csi':0 [fmt:SBGGR10_1X10/800x600 field:none]" + +After this streaming can start. The v4l2-ctl tool can be used to select any of +the resolutions supported by the sensor. + +.. code-block:: none + root@imx7s-warp:~# media-ctl -p + Media controller API version 4.17.0 + + Media device information + ------------------------ + driver imx-media + model imx-media + serial + bus info + hw revision 0x0 + driver version 4.17.0 + + Device topology + - entity 1: csi (2 pads, 2 links) + type V4L2 subdev subtype Unknown flags 0 + device node name /dev/v4l-subdev0 + pad0: Sink + [fmt:SBGGR10_1X10/800x600 field:none] + <- "csi_mux":2 [ENABLED] + pad1: Source + [fmt:SBGGR10_1X10/800x600 field:none] + -> "csi capture":0 [ENABLED] + + - entity 4: csi capture (1 pad, 1 link) + type Node subtype V4L flags 0 + device node name /dev/video0 + pad0: Sink + <- "csi":1 [ENABLED] + + - entity 10: csi_mux (3 pads, 2 links) + type V4L2 subdev subtype Unknown flags 0 + device node name /dev/v4l-subdev1 + pad0: Sink + [fmt:unknown/0x0] + pad1: Sink + [fmt:unknown/800x600 field:none] + <- "imx7-mipi-csis.0":1 [ENABLED] + pad2: Source + [fmt:unknown/800x600 field:none] + -> "csi":0 [ENABLED] + + - entity 14: imx7-mipi-csis.0 (2 pads, 2 links) + type V4L2 subdev subtype Unknown flags 0 + device node name /dev/v4l-subdev2 + pad0: Sink + [fmt:SBGGR10_1X10/800x600 field:none] + <- "ov2680 1-0036":0 [ENABLED] + pad1: Source + [fmt:SBGGR10_1X10/800x600 field:none] + -> "csi_mux":1 [ENABLED] + + - entity 17: ov2680 1-0036 (1 pad, 1 link) + type V4L2 subdev subtype Sensor flags 0 + device node name /dev/v4l-subdev3 + pad0: Source + [fmt:SBGGR10_1X10/800x600 field:none] + -> "imx7-mipi-csis.0":0 [ENABLED] + + +References +---------- + +.. [#f1] https://www.nxp.com/docs/en/reference-manual/IMX7SRM.pdf diff --git a/Documentation/media/v4l-drivers/index.rst b/Documentation/media/v4l-drivers/index.rst index 679238e786a7..693295bbc53f 100644 --- a/Documentation/media/v4l-drivers/index.rst +++ b/Documentation/media/v4l-drivers/index.rst @@ -44,6 +44,7 @@ For more details see the file COPYING in the source distribution of Linux. davinci-vpbe fimc imx + imx7 ivtv max2175 meye