From patchwork Fri Aug 10 14:20:43 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: 143938 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp16116ljj; Fri, 10 Aug 2018 07:21:57 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxtBlhtVaJvA9+rqjJqnc/BNtzklrhH0dFQw+fGbX8ZUepnj+DTmg8qZ32xJvNNUZtT99Uj X-Received: by 2002:a63:1015:: with SMTP id f21-v6mr6792392pgl.354.1533910917501; Fri, 10 Aug 2018 07:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533910917; cv=none; d=google.com; s=arc-20160816; b=RsZ+cZSuWSt8r8KYyVuCiAu+1IBNTCcTVZ1jmq0avLRtB34W5ro42lrf4F/RgSyUoQ jwdhfARN5gJYOMdAL6bIyY2ICWs6U1oKsakykMWGTMBmUNsao01CP94nNfrCjLjlWwi3 1PmYLneVgryQE4Yb5ilfldOfZHV6IASesd+ojLNIG3y/VVDedYS1mLMNWClw6i1X9yMn 3mi8cQhsMe6jPR22+hAp1ThFK5X8FiHhjQr6mkv4jW5fb7Hnr5riuRzeSaKxc/n3K2fm +/Yjoh/c0TZECNDJE2Wkyyt7d8i4RZe2wkF4AgCyj9GGjkiV8ltgaykHQ+cIVOF+8+sG d9iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=HLhi6DLyeVM7vNAvlklQUJ7sBVfU/dAer7JD04mR7ps=; b=pQBsh14/U440V2QVGXGULsdyoOeSsemkIbxC05txBqU8qIPzWADz13scwWtxt7xGZM ccSw9pa6im5eM+CGlGmBBpR171wVH2EVfNC0RzMzLdAV34ibwVNfaWFV7giBJBIkP9k3 A3Zn8vXUiwXkadDPnnZLu4YNgL2IwRVjvV+McTNP3u8tEcCQqSLm5V0BQN2TK8504DI1 PGj5GyCdsR5qd8vZmQea84uovOR8ZMiGATGL9bqOE0J9ED6ZVKPtX8weNW7jXD3if4E0 4Fq7wZywKYF3UC7ETsC+9qIh7VXPi8EV+wIyniDMZCtlfAE/xhoF6VHosoFh55a8GuVk ndJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cjCfpwGI; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 91-v6si7981107ply.405.2018.08.10.07.21.57; Fri, 10 Aug 2018 07:21:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-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=cjCfpwGI; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 S1728234AbeHJQwD (ORCPT + 4 others); Fri, 10 Aug 2018 12:52:03 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:52304 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbeHJQwD (ORCPT ); Fri, 10 Aug 2018 12:52:03 -0400 Received: by mail-wm0-f66.google.com with SMTP id o11-v6so2092916wmh.2 for ; Fri, 10 Aug 2018 07:21:55 -0700 (PDT) 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; bh=HLhi6DLyeVM7vNAvlklQUJ7sBVfU/dAer7JD04mR7ps=; b=cjCfpwGIugY34lwsOAPtil+qba3eKeRXL81luzpY27rtnd0DTGZyhUtGVfHYPf2Obj HyF2yC9+03vwwkMljwDdU3PU7jhRdN1hDAFYnU8hhGq+4/StyEniKlA+tNMD8zWHDDrQ zYuUkoYM8FuZz9HJnaAtsrhoX3Cf4kSn3JBHE= 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; bh=HLhi6DLyeVM7vNAvlklQUJ7sBVfU/dAer7JD04mR7ps=; b=oEe6C997+OBqeWIaQyJ48wgp99GsyOYZlrs3AtV+t/QuRLoyrMPxZOQPVKojtQKkqM UBEvlCWEqP/qprbMg4U/UO+B5VqpNokDebV9uVlxlutJH49kO8W0tA+VOG+IcmQ46VAu dvuzhp0KKz1tr9Z0bVmD7uFHVygHqrRQSAplZXuV2vuYRWY92NRua31Xy3Xy/MgeagWX Q6Aj3tlrvjnHlIWYyod/GZmP11tkjSNsPDrmdvWMw4Q3RSB12QvaaPvQjamt8Ud7a/1r 1a0h+6YoyeKorzHmZKa38bsHgWn/C0XQ+aa73wCpPbN7an7inruMxtHT+dQXs1CH5/2o 3GkA== X-Gm-Message-State: AOUpUlGqMgxWkLdSx+4FtvmRd/WlByYcXLm38wU/F/edL+F3ip0eIt62 uNCX8C7hnUy7wPkEAKUoKMdqmw== X-Received: by 2002:a1c:545:: with SMTP id 66-v6mr1746623wmf.140.1533910914520; Fri, 10 Aug 2018 07:21:54 -0700 (PDT) Received: from arch-late.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id b13-v6sm13077578wrn.17.2018.08.10.07.21.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 07:21:53 -0700 (PDT) From: Rui Miguel Silva To: mchehab@kernel.org, sakari.ailus@linux.intel.com, Philipp Zabel , Rob Herring Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Fabio Estevam , devicetree@vger.kernel.org, Greg Kroah-Hartman , Ryan Harkin , Rui Miguel Silva Subject: [PATCH v7 10/12] media: imx7.rst: add documentation for i.MX7 media driver Date: Fri, 10 Aug 2018 15:20:43 +0100 Message-Id: <20180810142045.27657-11-rui.silva@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810142045.27657-1-rui.silva@linaro.org> References: <20180810142045.27657-1-rui.silva@linaro.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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.18.0 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