From patchwork Wed Feb 6 15:13:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 157639 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6525398jaa; Wed, 6 Feb 2019 07:14:04 -0800 (PST) X-Google-Smtp-Source: AHgI3IZNuDw/TwZnx00IKfYtPIgJi3RgTMgQuD67OqKyfdrF3eQr7Qg8NnAu2sEYwhxUyw8A+A6E X-Received: by 2002:a17:902:e612:: with SMTP id cm18mr7494389plb.172.1549466044010; Wed, 06 Feb 2019 07:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549466044; cv=none; d=google.com; s=arc-20160816; b=T4br5d/zEIlEX0khdHu9sckPQtPcoIf+2Wsm+NbzHV7+aOY8CAXtKuaZDscZzD/sIC J6/gdEyc5f14YwLMIQvPOe6RLohkWnC0Kr+JOOwxaJPEEecFoHcogdPZUhb3G0afVoLB yWcd95kwzGv+RViSKBLLqQd3dCjuQ+asjW+jlTP445PWKo+6OipAAu4yedgo1iLajhG5 8f/iOgbdsG/DUs30DvBlXRCQ2tK54QpASuHPMofmYniJaVyrv5v8ADQdd0fDQ7b16Ebm rNBRVk/mpxGMBP0y4QPNG4rZUGNjm1U1oFYBMLM3hZciW0sUFIguL3hhl2sfSabsn9TT rlbQ== 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=NsGgdO07PG/gbs4ACVbwVYSzhg8weZOmSFSCwVRo/x0=; b=StLCSRXyoPHQJmNosh1jZ6ohdtkHbShHyKwaTgLLQUIGEm7ID9+qV7A8giuuLdtd0M WolWhOdQ3IV9+qREKRz3SDn4hICRNCteRWep0670+F+mG5n207hux7PkhFQgdYnFCzvv v73Ygf3uZvYkSiik9pMRqCmJgoPv5HwB5Q9YdQb3f8zWoxLXruxjp9VD8V7raxB3qnSD 2AF6aKzkcqPZm5KI2twFtXat9n5BGuwIeRZ/Qg0nFpVXgbRHbKiLBuzI/TFS4U1J8XAR EcZ4sGOxcUgjHqgwk4Jtte/dBsHJcJd2oQFdNbd01SeO1y/8yaTb371PRoeHE+gNNPXn x9bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XzPdrB8d; 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 e4si6111576pgk.127.2019.02.06.07.14.03; Wed, 06 Feb 2019 07:14:04 -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=XzPdrB8d; 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 S1730280AbfBFPOD (ORCPT + 7 others); Wed, 6 Feb 2019 10:14:03 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40640 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731182AbfBFPOD (ORCPT ); Wed, 6 Feb 2019 10:14:03 -0500 Received: by mail-wr1-f67.google.com with SMTP id p4so7958815wrt.7 for ; Wed, 06 Feb 2019 07:14:01 -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=NsGgdO07PG/gbs4ACVbwVYSzhg8weZOmSFSCwVRo/x0=; b=XzPdrB8dh5X2MYW3gBDGxfqcoV3OYsgACZJ0telChNLoou2mQXwNZ5QkwIXlRhOk/0 2moC7B7Q9AnnNkkzbsYMW9kTPiBGDF/2WBSS0lvvAqgZ9QOQlc3iKdrUHfHcns+c1+u0 rkgyK9IO2sD8kOOTtd/bF6kcf2p0jm/4sgcL9bZl5yd46CzeIPczSSsEWX7jAhifUGLR bx9wVwGlMV8+NkH+eccuL8Li/9dSrBHhjicWY0kquixa39gcIrxyRw9w9/tfglcjfwWP /hnWmGISJjZxhAlJOdUwhG2fY+8CJUN8wABaq36fpTR6ilX5v527o2G6+cv9usKVEDUC iIxw== 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=NsGgdO07PG/gbs4ACVbwVYSzhg8weZOmSFSCwVRo/x0=; b=d5Jr7mj0//70NU2aXJ3FocK1RROw6G54qQ4rYRKkOBbfngS4i1vFUCabkdU+aMmJct bfkPf9u+Sa9llFS/ASvBAjUzqFTU12bqpNr3fMgJYLTkNppzo6IweWvVOVX14+yNYWMI uI8UoxppsqUA7BhWeYqSGM+b9g2OzZVcFcPSih+aD/oBw2ZXTTmvjnLksZzYuPInIIHw 6RzxlgIrm+9CrRSA4pyHxyLWJ+WKptBJFqngBR41o99TFbpoENl2Iyzg7WQLU7jqxzHl rhtNv1eLJluU1Yayg0qadZMCD+0Z5xg6NiLpTrRuuBB+6QPJlPetjKrx7NxaBlZExWH9 QXsg== X-Gm-Message-State: AHQUAuaF1leWWYdffEj1Me8+L6+8g98J5/TvFmmvFpLFXgbT3vNdhbwv asmBKIcHD7pvxZOdcbGScZVISQ== X-Received: by 2002:adf:efcb:: with SMTP id i11mr2305486wrp.295.1549466040684; Wed, 06 Feb 2019 07:14:00 -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 f22sm11207836wmj.26.2019.02.06.07.13.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 07:14:00 -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 v14 10/13] media: imx7.rst: add documentation for i.MX7 media driver Date: Wed, 6 Feb 2019 15:13:25 +0000 Message-Id: <20190206151328.21629-11-rui.silva@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206151328.21629-1-rui.silva@linaro.org> References: <20190206151328.21629-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 Acked-by: Sakari Ailus --- Documentation/media/v4l-drivers/imx7.rst | 159 ++++++++++++++++++++++ Documentation/media/v4l-drivers/index.rst | 1 + 2 files changed, 160 insertions(+) create mode 100644 Documentation/media/v4l-drivers/imx7.rst -- 2.20.1 diff --git a/Documentation/media/v4l-drivers/imx7.rst b/Documentation/media/v4l-drivers/imx7.rst new file mode 100644 index 000000000000..804d900da535 --- /dev/null +++ b/Documentation/media/v4l-drivers/imx7.rst @@ -0,0 +1,159 @@ +.. SPDX-License-Identifier: GPL-2.0 + +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 f28570ec9e42..dfd4b205937c 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 ipu3 ivtv max2175