From patchwork Wed Jan 23 10:52:19 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: 156364 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp576423jaa; Wed, 23 Jan 2019 02:53:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ofpk0Zzc3gqBnhuvsBt21DJf1vMieK2PY+XpEPaG/bHeokicjeJwRwie3Ya8GtDmx7nYN X-Received: by 2002:a17:902:48:: with SMTP id 66mr1698286pla.68.1548240790667; Wed, 23 Jan 2019 02:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548240790; cv=none; d=google.com; s=arc-20160816; b=va7SEgT38pmuoTTEcdb+l//3mBhlUpe8JtK8jQ8Uu6Go0SrQyLUgIIRl5qiWoHCvEE 3nAxUbT80yPFzj99gEKXcv1v2jEdXPSJ5G4Gtivh4JL1RQqpIiM6oHvwGtud1ZYSmnyN ELugTaj6FzmgWbOVSFvFb0rKawFfXtwpNEn0t56NEb85S5cJYKFsa6Pcv1EwF9Xk3oyl fgjJf2VRfIKHCLJ3SNO0jWbfZ5FXbnQKxbcBaDjccFzpJxMb2tjBUJcFVmCBKusiSION USTCUcSZgy3FVXThdQxH4tgCk1Xh7C33ieovetzBybBOKkh+lrsH3ChDMnRHw9jkceBG HnjQ== 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=DnJ2RqgpJhj0Ztv6nP4DGS7MdxcLdu5DEO0+wqKlVlo=; b=mKUBBvgAdFAK76y3b+Y9TqXvbiMEdjobpPh3PyOvdfUKmoRavvNaTPIqBvfNrTuwC1 BgxufLY/hpsWrPa7rr7fOX/cyO7tsL2Zvr6YZU+PLDrJpQJsG638bpFtwJMLU+9WKYh3 KIx1SYHiRhDEWlDi4c5K6V2lr/0GoYnxXxdwNdcllM1PK8ZqSawxlerVASn9nPuwoqoU GgtUZKjJKsMymdX8Law92jKNFdqwNSJ7nAx4m8n5OmLF1Zqb4itVA3EOjQ5pKnNJdOAl /i6F6Qt0v0GnMghgWjbJ1bqnxtwkNU84NPI9/a88KPiRHjzp8m7I4S+8/ACSAp7oH5he 2/7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iijaSYTi; 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 a6si18061494pfa.227.2019.01.23.02.53.10; Wed, 23 Jan 2019 02:53:10 -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=iijaSYTi; 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 S1727468AbfAWKxJ (ORCPT + 7 others); Wed, 23 Jan 2019 05:53:09 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33015 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727506AbfAWKxJ (ORCPT ); Wed, 23 Jan 2019 05:53:09 -0500 Received: by mail-wr1-f67.google.com with SMTP id p7so1891823wru.0 for ; Wed, 23 Jan 2019 02:53:07 -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=DnJ2RqgpJhj0Ztv6nP4DGS7MdxcLdu5DEO0+wqKlVlo=; b=iijaSYTiBmjtciZicPW9E42vEce6JTSvkH4uj6TNgxACPlky3mTZ2AKENw0vUSMVe6 BT5UaKavdJYl2DGqGqKmBkF2aDLagoaYrN8f6thGneCrcm6gf6yRqXHSyZJAivYS+R8B gfijGLtAwDLNZ+9W/83C0pFa/2HtpCCMk//8c= 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=DnJ2RqgpJhj0Ztv6nP4DGS7MdxcLdu5DEO0+wqKlVlo=; b=TtWW751Oaf0gjBwaZl4X2QxRqsrWz8DdtPsxV0hsQNa5eSgWb1by3immWLuoqrujhn GNm5mGT6jF6PQ2V/H3CvUDqIPuhhZW5mShG+r4+NU744/Cg+y0ibKavKH2W3wkA+pcdX IZnc0zFZZPZlyyfBosilFBFJpHF+A/KluWhID/J6CN/+R19Ssjr8E3ra78qhqqNXuiJp dgfaDlQQy7KOg4bN+gGMQutv54Mu43RdGvhTxEd/KvBE5IS729UPmJTe/ZFWFbyDbTE8 Hl432ROJacUstsRCz2TsZqijL9prPpK5wMjGKWs3pTApOPPFWZef/4sFSR2ifVgQerfK FgSA== X-Gm-Message-State: AJcUukem1HVtTDuhAAP495+Vrp0Z/BdmyT/aMESV/h3uoIRXNkHzxcbC KtS0/qAInXdMhAsO1uIFndHJvw== X-Received: by 2002:a5d:4046:: with SMTP id w6mr2238029wrp.92.1548240787169; Wed, 23 Jan 2019 02:53:07 -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 143sm120717646wml.14.2019.01.23.02.53.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 02:53:06 -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 v10 10/13] media: imx7.rst: add documentation for i.MX7 media driver Date: Wed, 23 Jan 2019 10:52:19 +0000 Message-Id: <20190123105222.2378-11-rui.silva@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190123105222.2378-1-rui.silva@linaro.org> References: <20190123105222.2378-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.20.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 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