From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934398AbdBWAGm (ORCPT ); Wed, 22 Feb 2017 19:06:42 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35486 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933767AbdBWAGk (ORCPT ); Wed, 22 Feb 2017 19:06:40 -0500 Subject: Re: [PATCH v4 23/36] media: imx: Add MIPI CSI-2 Receiver subdev driver To: Russell King - ARM Linux , Philipp Zabel References: <1487211578-11360-1-git-send-email-steve_longerbeam@mentor.com> <1487211578-11360-24-git-send-email-steve_longerbeam@mentor.com> <1487328479.3107.21.camel@pengutronix.de> <20170217110616.GD21222@n2100.armlinux.org.uk> Cc: robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com, mchehab@kernel.org, hverkuil@xs4all.nl, nick@shmanahar.org, markus.heiser@darmarIT.de, laurent.pinchart+renesas@ideasonboard.com, bparrot@ti.com, geert@linux-m68k.org, arnd@arndb.de, sudipm.mukherjee@gmail.com, minghsiu.tsai@mediatek.com, tiffany.lin@mediatek.com, jean-christophe.trotin@st.com, horms+renesas@verge.net.au, niklas.soderlund+renesas@ragnatech.se, robert.jarzmik@free.fr, songjun.wu@microchip.com, andrew-ct.chen@mediatek.com, gregkh@linuxfoundation.org, shuah@kernel.org, sakari.ailus@linux.intel.com, pavel@ucw.cz, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Steve Longerbeam From: Steve Longerbeam Message-ID: <20b7d3b7-85be-b701-19ca-1e8024260fc2@gmail.com> Date: Wed, 22 Feb 2017 16:06:36 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170217110616.GD21222@n2100.armlinux.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/17/2017 03:06 AM, Russell King - ARM Linux wrote: > On Fri, Feb 17, 2017 at 11:47:59AM +0100, Philipp Zabel wrote: >> On Wed, 2017-02-15 at 18:19 -0800, Steve Longerbeam wrote: >>> +static void csi2_dphy_init(struct csi2_dev *csi2) >>> +{ >>> + /* >>> + * FIXME: 0x14 is derived from a fixed D-PHY reference >>> + * clock from the HSI_TX PLL, and a fixed target lane max >>> + * bandwidth of 300 Mbps. This value should be derived >> >> If the table in https://community.nxp.com/docs/DOC-94312 is correct, >> this should be 850 Mbps. Where does this 300 Mbps value come from? > > I thought you had some code to compute the correct value, although > I guess we've lost the ability to know how fast the sensor is going > to drive the link. > > Note that the IMX219 currently drives the data lanes at 912Mbps almost > exclusively, as I've yet to finish working out how to derive the PLL > parameters. (I have something that works, but it currently takes on > the order of 100k iterations to derive the parameters. gcd() doesn't > help you in this instance.) Hi Russell, As I mentioned, I've added code to imx6-mipi-csi2 to determine the sources link frequency via V4L2_CID_LINK_FREQ. If you were to implement this control and return 912 Mbps-per-lane, the D-PHY will be programmed correctly for the IMX219 (at least, that is the theory anyway). Alternatively, I could up the default in imx6-mipi-csi2 to 950 Mbps. I will have to test that to make sure it still works with OV5640 and tc358743. Steve From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Longerbeam Subject: Re: [PATCH v4 23/36] media: imx: Add MIPI CSI-2 Receiver subdev driver Date: Wed, 22 Feb 2017 16:06:36 -0800 Message-ID: <20b7d3b7-85be-b701-19ca-1e8024260fc2@gmail.com> References: <1487211578-11360-1-git-send-email-steve_longerbeam@mentor.com> <1487211578-11360-24-git-send-email-steve_longerbeam@mentor.com> <1487328479.3107.21.camel@pengutronix.de> <20170217110616.GD21222@n2100.armlinux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170217110616.GD21222-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Russell King - ARM Linux , Philipp Zabel Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, fabio.estevam-3arQi8VN3Tc@public.gmane.org, mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, hverkuil-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org, nick-gcszYUEDH4VrovVCs/uTlw@public.gmane.org, markus.heiser-O6JHGLzbNUwb1SvskN2V4Q@public.gmane.org, laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org, bparrot-l0cyMroinI0@public.gmane.org, geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, minghsiu.tsai-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, tiffany.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, jean-christophe.trotin-qxv4g6HH51o@public.gmane.org, horms+renesas-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org, niklas.soderlund+renesas-1zkq55x86MTxsAP9Fp7wbw@public.gmane.org, robert.jarzmik-GANU6spQydw@public.gmane.org, songjun.wu-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org, andrew-ct.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, pavel-+ZI9xUNit7I@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org List-Id: devicetree@vger.kernel.org On 02/17/2017 03:06 AM, Russell King - ARM Linux wrote: > On Fri, Feb 17, 2017 at 11:47:59AM +0100, Philipp Zabel wrote: >> On Wed, 2017-02-15 at 18:19 -0800, Steve Longerbeam wrote: >>> +static void csi2_dphy_init(struct csi2_dev *csi2) >>> +{ >>> + /* >>> + * FIXME: 0x14 is derived from a fixed D-PHY reference >>> + * clock from the HSI_TX PLL, and a fixed target lane max >>> + * bandwidth of 300 Mbps. This value should be derived >> >> If the table in https://community.nxp.com/docs/DOC-94312 is correct, >> this should be 850 Mbps. Where does this 300 Mbps value come from? > > I thought you had some code to compute the correct value, although > I guess we've lost the ability to know how fast the sensor is going > to drive the link. > > Note that the IMX219 currently drives the data lanes at 912Mbps almost > exclusively, as I've yet to finish working out how to derive the PLL > parameters. (I have something that works, but it currently takes on > the order of 100k iterations to derive the parameters. gcd() doesn't > help you in this instance.) Hi Russell, As I mentioned, I've added code to imx6-mipi-csi2 to determine the sources link frequency via V4L2_CID_LINK_FREQ. If you were to implement this control and return 912 Mbps-per-lane, the D-PHY will be programmed correctly for the IMX219 (at least, that is the theory anyway). Alternatively, I could up the default in imx6-mipi-csi2 to 950 Mbps. I will have to test that to make sure it still works with OV5640 and tc358743. Steve -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: slongerbeam@gmail.com (Steve Longerbeam) Date: Wed, 22 Feb 2017 16:06:36 -0800 Subject: [PATCH v4 23/36] media: imx: Add MIPI CSI-2 Receiver subdev driver In-Reply-To: <20170217110616.GD21222@n2100.armlinux.org.uk> References: <1487211578-11360-1-git-send-email-steve_longerbeam@mentor.com> <1487211578-11360-24-git-send-email-steve_longerbeam@mentor.com> <1487328479.3107.21.camel@pengutronix.de> <20170217110616.GD21222@n2100.armlinux.org.uk> Message-ID: <20b7d3b7-85be-b701-19ca-1e8024260fc2@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 02/17/2017 03:06 AM, Russell King - ARM Linux wrote: > On Fri, Feb 17, 2017 at 11:47:59AM +0100, Philipp Zabel wrote: >> On Wed, 2017-02-15 at 18:19 -0800, Steve Longerbeam wrote: >>> +static void csi2_dphy_init(struct csi2_dev *csi2) >>> +{ >>> + /* >>> + * FIXME: 0x14 is derived from a fixed D-PHY reference >>> + * clock from the HSI_TX PLL, and a fixed target lane max >>> + * bandwidth of 300 Mbps. This value should be derived >> >> If the table in https://community.nxp.com/docs/DOC-94312 is correct, >> this should be 850 Mbps. Where does this 300 Mbps value come from? > > I thought you had some code to compute the correct value, although > I guess we've lost the ability to know how fast the sensor is going > to drive the link. > > Note that the IMX219 currently drives the data lanes at 912Mbps almost > exclusively, as I've yet to finish working out how to derive the PLL > parameters. (I have something that works, but it currently takes on > the order of 100k iterations to derive the parameters. gcd() doesn't > help you in this instance.) Hi Russell, As I mentioned, I've added code to imx6-mipi-csi2 to determine the sources link frequency via V4L2_CID_LINK_FREQ. If you were to implement this control and return 912 Mbps-per-lane, the D-PHY will be programmed correctly for the IMX219 (at least, that is the theory anyway). Alternatively, I could up the default in imx6-mipi-csi2 to 950 Mbps. I will have to test that to make sure it still works with OV5640 and tc358743. Steve