Message ID | 20240126133116.121981-1-biju.das.jz@bp.renesas.com (mailing list archive) |
---|---|
Headers |
Received: from am.mirrors.kernel.org ([147.75.80.249]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <linux-media+bounces-4220-patchwork=linuxtv.org@vger.kernel.org>) id 1rTMJ0-0001OC-2n for patchwork@linuxtv.org; Fri, 26 Jan 2024 13:31:41 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 71FDC1F252B4 for <patchwork@linuxtv.org>; Fri, 26 Jan 2024 13:31:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E28E11B81A; Fri, 26 Jan 2024 13:31:29 +0000 (UTC) X-Original-To: linux-media@vger.kernel.org Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD45E1B80A; Fri, 26 Jan 2024 13:31:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706275889; cv=none; b=JKiyWOxVabGy8FzGAXgAXfvT6PTQdLCfRdzWHoV1q8x+0sB3o2Qie5jLbA++iVfCx8NAV5DiFQ1f8uh+QLjVFoBweCmgzMU59llWIHk5ZlHSQkdYAHWSAAhr1tZAaqh5b/hnlS8wFZCq7uSebexbh6Bq2RKI+qH76TBAsLNnfvA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706275889; c=relaxed/simple; bh=yq7gXz6EMMDvPq+xqJcZsYjDsjo7f4BdUx8TEsQuwGU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=RRBvE7YYRslHKXNQ8gK2xWjhk/p4Eb43oyfNB6QQteI9oJ/QYX9P4oOeYqtKstFuGcVQ2LMOTCG74kwofOoMIroRrv7tUCUZYj6fRz2muzTO2VJ7o0ijcg+i7PbAVf4LQIvzIXBmdFBFvC1vPHYyMNi4B3gcuzwrl0vRqJN486s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.05,216,1701097200"; d="scan'208";a="191845957" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 26 Jan 2024 22:31:24 +0900 Received: from localhost.localdomain (unknown [10.226.93.117]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 18452422D9A9; Fri, 26 Jan 2024 22:31:20 +0900 (JST) From: Biju Das <biju.das.jz@bp.renesas.com> To: Mauro Carvalho Chehab <mchehab@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: Biju Das <biju.das.jz@bp.renesas.com>, Geert Uytterhoeven <geert+renesas@glider.be>, Magnus Damm <magnus.damm@gmail.com>, Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das <biju.das.au@gmail.com> Subject: [PATCH v2 0/5] Add RZ/G2UL CRU and CSI support Date: Fri, 26 Jan 2024 13:31:11 +0000 Message-Id: <20240126133116.121981-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: <linux-media.vger.kernel.org> List-Subscribe: <mailto:linux-media+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-media+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-LSpam-Score: -2.0 (--) X-LSpam-Report: No, score=-2.0 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,DMARC_NONE=0.898,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no |
Series |
Add RZ/G2UL CRU and CSI support
|
|
Message
Biju Das
Jan. 26, 2024, 1:31 p.m. UTC
This patch series aims to enable CSI/CRU interface found on RZ/G2UL SMARC EVK using DT overlay. v1->v2: * Added Ack from Conor Dooley for patch#1. * Dropped driver reference from commit description for the binding patches. Biju Das (5): media: dt-bindings: renesas,rzg2l-csi2: Document Renesas RZ/G2UL CSI-2 block media: dt-bindings: renesas,rzg2l-cru: Document Renesas RZ/G2UL CRU block arm64: dts: renesas: r9a07g043u: Add CSI and CRU nodes arm64: dts: renesas: rzg2ul-smarc: Enable CRU, CSI support arm64: dts: renesas: r9a07g043u11-smarc-cru-csi-ov5645: Reduce I2C frequency .../bindings/media/renesas,rzg2l-cru.yaml | 35 ++++++++-- .../bindings/media/renesas,rzg2l-csi2.yaml | 1 + arch/arm64/boot/dts/renesas/Makefile | 2 + arch/arm64/boot/dts/renesas/r9a07g043u.dtsi | 69 +++++++++++++++++++ .../r9a07g043u11-smarc-cru-csi-ov5645.dtso | 25 +++++++ 5 files changed, 128 insertions(+), 4 deletions(-) create mode 100644 arch/arm64/boot/dts/renesas/r9a07g043u11-smarc-cru-csi-ov5645.dtso
Comments
Hi Geert, > -----Original Message----- > From: Biju Das > Sent: Friday, January 26, 2024 3:57 PM > Subject: RE: [PATCH v2 5/5] arm64: dts: renesas: r9a07g043u11-smarc-cru- > csi-ov5645: Reduce I2C frequency > > Hi Geert, > > Thanks for the feedback. > > > -----Original Message----- > > From: Geert Uytterhoeven <geert@linux-m68k.org> > > Sent: Friday, January 26, 2024 1:53 PM > > Subject: Re: [PATCH v2 5/5] arm64: dts: renesas: > > r9a07g043u11-smarc-cru- > > csi-ov5645: Reduce I2C frequency > > > > Hi Biju, > > > > On Fri, Jan 26, 2024 at 2:31 PM Biju Das <biju.das.jz@bp.renesas.com> > > wrote: > > > Reduce i2c freq from 400->100 kHz on RZ/G2UL SMARC EVK as the > > > captured image is not proper with the sensor configuration over I2C. > > > > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > > > > Thanks for your patch! > > > > > --- > > > a/arch/arm64/boot/dts/renesas/r9a07g043u11-smarc-cru-csi-ov5645.dtso > > > +++ b/arch/arm64/boot/dts/renesas/r9a07g043u11-smarc-cru-csi-ov5645. > > > +++ dt > > > +++ so > > > @@ -19,3 +19,7 @@ &ov5645 { > > > enable-gpios = <&pinctrl RZG2L_GPIO(4, 4) GPIO_ACTIVE_HIGH>; > > > reset-gpios = <&pinctrl RZG2L_GPIO(0, 1) GPIO_ACTIVE_LOW>; > > > }; > > > + > > > +&i2c0 { > > > + clock-frequency = <100000>; > > > +}; > > > > Is this a limitation of one of the I2C devices on the bus, or a PCB > > design issue? > > Currently versa3 clock generator connected to the same bus and it works ok > with 400kHz clock. Maybe it is stressed not that much compared to OV5645 > sensor configuration. > > At the moment with 400kHz I2C bus clock, Camera capture is not working > properly on RZ/G2UL, but with same bus frequency the same works fine on > RZ/{G2L,G2LC,V2L}. > There may be some hardware differences which is causing this issue. > > > > > Doesn't this need a Fixes tag? > > I can create a new patch updating bus frequency as 100kHz and add fixes > tag. > After this I will drop this patch as it no longer needed. > > Please let me know. + media Adding a delay after Software reset makes it to work at 400kHz with RZ/G2UL SMARC EVK. So not sure we need to add delay after software reset? Now after OV5645 gpio reset, then there is 20msec delay and then again we are issuing software reset and there is no delay after this for this software reset. diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index a26ac11c989d..d67a5e23fe5a 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -622,11 +622,19 @@ static int ov5645_set_register_array(struct ov5645 *ov5645, { unsigned int i; int ret; for (i = 0; i < num_settings; ++i, ++settings) { ret = ov5645_write_reg(ov5645, settings->reg, settings->val); if (ret < 0) return ret; + + if (settings->reg == OV5645_SYSTEM_CTRL0) + fsleep(1000); Cheers, Biju
Hi Geert, > -----Original Message----- > From: Biju Das > Sent: Tuesday, January 30, 2024 2:15 PM > Subject: RE: [PATCH v2 5/5] arm64: dts: renesas: r9a07g043u11-smarc-cru- > csi-ov5645: Reduce I2C frequency > > Hi Geert, > > > -----Original Message----- > > From: Biju Das > > Sent: Friday, January 26, 2024 3:57 PM > > Subject: RE: [PATCH v2 5/5] arm64: dts: renesas: > > r9a07g043u11-smarc-cru- > > csi-ov5645: Reduce I2C frequency > > > > Hi Geert, > > > > Thanks for the feedback. > > > > > -----Original Message----- > > > From: Geert Uytterhoeven <geert@linux-m68k.org> > > > Sent: Friday, January 26, 2024 1:53 PM > > > Subject: Re: [PATCH v2 5/5] arm64: dts: renesas: > > > r9a07g043u11-smarc-cru- > > > csi-ov5645: Reduce I2C frequency > > > > > > Hi Biju, > > > > > > On Fri, Jan 26, 2024 at 2:31 PM Biju Das > > > <biju.das.jz@bp.renesas.com> > > > wrote: > > > > Reduce i2c freq from 400->100 kHz on RZ/G2UL SMARC EVK as the > > > > captured image is not proper with the sensor configuration over I2C. > > > > > > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > > > > > > Thanks for your patch! > > > > > > > --- > > > > a/arch/arm64/boot/dts/renesas/r9a07g043u11-smarc-cru-csi-ov5645.dt > > > > so > > > > +++ b/arch/arm64/boot/dts/renesas/r9a07g043u11-smarc-cru-csi-ov5645. > > > > +++ dt > > > > +++ so > > > > @@ -19,3 +19,7 @@ &ov5645 { > > > > enable-gpios = <&pinctrl RZG2L_GPIO(4, 4) GPIO_ACTIVE_HIGH>; > > > > reset-gpios = <&pinctrl RZG2L_GPIO(0, 1) GPIO_ACTIVE_LOW>; > > > > }; > > > > + > > > > +&i2c0 { > > > > + clock-frequency = <100000>; }; > > > > > > Is this a limitation of one of the I2C devices on the bus, or a PCB > > > design issue? > > > > Currently versa3 clock generator connected to the same bus and it > > works ok with 400kHz clock. Maybe it is stressed not that much > > compared to OV5645 sensor configuration. > > > > At the moment with 400kHz I2C bus clock, Camera capture is not working > > properly on RZ/G2UL, but with same bus frequency the same works fine > > on RZ/{G2L,G2LC,V2L}. > > There may be some hardware differences which is causing this issue. > > > > > > > > Doesn't this need a Fixes tag? > > > > I can create a new patch updating bus frequency as 100kHz and add > > fixes tag. > > After this I will drop this patch as it no longer needed. > > > > Please let me know. > > + media > > Adding a delay after Software reset makes it to work at 400kHz with > RZ/G2UL SMARC EVK. > > So not sure we need to add delay after software reset? > > Now after OV5645 gpio reset, then there is 20msec delay and then again we > are issuing software reset and there is no delay after this for this > software reset. > > diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index > a26ac11c989d..d67a5e23fe5a 100644 > --- a/drivers/media/i2c/ov5645.c > +++ b/drivers/media/i2c/ov5645.c > @@ -622,11 +622,19 @@ static int ov5645_set_register_array(struct ov5645 > *ov5645, { > unsigned int i; > int ret; > > for (i = 0; i < num_settings; ++i, ++settings) { > ret = ov5645_write_reg(ov5645, settings->reg, settings- > >val); > if (ret < 0) > return ret; > + > + if (settings->reg == OV5645_SYSTEM_CTRL0) > + fsleep(1000); > This issue seen on RZ/G2L SMARC EVK as well. My testing on G2L family shows we need to add delay to make OV5645 to work @400kHZ. I am not sure any one tested OV5645 with I2C bus frequency 400kHz? Cheers, Biju
Hi folks, On Fri, Feb 09, 2024 at 02:36:22PM +0000, Biju Das wrote: > Hi Geert, > > > -----Original Message----- > > From: Biju Das > > Sent: Tuesday, January 30, 2024 2:15 PM > > Subject: RE: [PATCH v2 5/5] arm64: dts: renesas: r9a07g043u11-smarc-cru- > > csi-ov5645: Reduce I2C frequency > > > > Hi Geert, > > > > > -----Original Message----- > > > From: Biju Das > > > Sent: Friday, January 26, 2024 3:57 PM > > > Subject: RE: [PATCH v2 5/5] arm64: dts: renesas: > > > r9a07g043u11-smarc-cru- > > > csi-ov5645: Reduce I2C frequency > > > > > > Hi Geert, > > > > > > Thanks for the feedback. > > > > > > > -----Original Message----- > > > > From: Geert Uytterhoeven <geert@linux-m68k.org> > > > > Sent: Friday, January 26, 2024 1:53 PM > > > > Subject: Re: [PATCH v2 5/5] arm64: dts: renesas: > > > > r9a07g043u11-smarc-cru- > > > > csi-ov5645: Reduce I2C frequency > > > > > > > > Hi Biju, > > > > > > > > On Fri, Jan 26, 2024 at 2:31 PM Biju Das > > > > <biju.das.jz@bp.renesas.com> > > > > wrote: > > > > > Reduce i2c freq from 400->100 kHz on RZ/G2UL SMARC EVK as the > > > > > captured image is not proper with the sensor configuration over I2C. > > > > > > > > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > > > > > > > > Thanks for your patch! > > > > > > > > > --- > > > > > a/arch/arm64/boot/dts/renesas/r9a07g043u11-smarc-cru-csi-ov5645.dt > > > > > so > > > > > +++ b/arch/arm64/boot/dts/renesas/r9a07g043u11-smarc-cru-csi-ov5645. > > > > > +++ dt > > > > > +++ so > > > > > @@ -19,3 +19,7 @@ &ov5645 { > > > > > enable-gpios = <&pinctrl RZG2L_GPIO(4, 4) GPIO_ACTIVE_HIGH>; > > > > > reset-gpios = <&pinctrl RZG2L_GPIO(0, 1) GPIO_ACTIVE_LOW>; > > > > > }; > > > > > + > > > > > +&i2c0 { > > > > > + clock-frequency = <100000>; }; > > > > > > > > Is this a limitation of one of the I2C devices on the bus, or a PCB > > > > design issue? > > > > > > Currently versa3 clock generator connected to the same bus and it > > > works ok with 400kHz clock. Maybe it is stressed not that much > > > compared to OV5645 sensor configuration. > > > > > > At the moment with 400kHz I2C bus clock, Camera capture is not working > > > properly on RZ/G2UL, but with same bus frequency the same works fine > > > on RZ/{G2L,G2LC,V2L}. > > > There may be some hardware differences which is causing this issue. > > > > > > > > > > > Doesn't this need a Fixes tag? > > > > > > I can create a new patch updating bus frequency as 100kHz and add > > > fixes tag. > > > After this I will drop this patch as it no longer needed. > > > > > > Please let me know. > > > > + media > > > > Adding a delay after Software reset makes it to work at 400kHz with > > RZ/G2UL SMARC EVK. > > > > So not sure we need to add delay after software reset? > > > > Now after OV5645 gpio reset, then there is 20msec delay and then again we > > are issuing software reset and there is no delay after this for this > > software reset. > > > > diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index > > a26ac11c989d..d67a5e23fe5a 100644 > > --- a/drivers/media/i2c/ov5645.c > > +++ b/drivers/media/i2c/ov5645.c > > @@ -622,11 +622,19 @@ static int ov5645_set_register_array(struct ov5645 > > *ov5645, { > > unsigned int i; > > int ret; > > > > for (i = 0; i < num_settings; ++i, ++settings) { > > ret = ov5645_write_reg(ov5645, settings->reg, settings- > > >val); > > if (ret < 0) > > return ret; > > + > > + if (settings->reg == OV5645_SYSTEM_CTRL0) > > + fsleep(1000); > > > > This issue seen on RZ/G2L SMARC EVK as well. My testing on G2L family shows > we need to add delay to make OV5645 to work @400kHZ. Typically there's a delay before the chip is accessible over I²C after resetting it. It's a bit open whether this one needs it, very probably it does. It'd be nicer nonetheless to do this outside the register list and instead use a separate ov5645_write_reg() call. Probably the first write is redundant. The second write resets the device. 0x80 should be sufficient value for that.
Hi Sakari Ailus, > -----Original Message----- > From: Sakari Ailus <sakari.ailus@linux.intel.com> > Sent: Friday, February 9, 2024 3:18 PM > Subject: Re: [PATCH v2 5/5] arm64: dts: renesas: r9a07g043u11-smarc-cru- > csi-ov5645: Reduce I2C frequency > > Hi folks, > > On Fri, Feb 09, 2024 at 02:36:22PM +0000, Biju Das wrote: > > Hi Geert, > > > > > -----Original Message----- > > > From: Biju Das > > > Sent: Tuesday, January 30, 2024 2:15 PM > > > Subject: RE: [PATCH v2 5/5] arm64: dts: renesas: > > > r9a07g043u11-smarc-cru- > > > csi-ov5645: Reduce I2C frequency > > > > > > Hi Geert, > > > > > > > -----Original Message----- > > > > From: Biju Das > > > > Sent: Friday, January 26, 2024 3:57 PM > > > > Subject: RE: [PATCH v2 5/5] arm64: dts: renesas: > > > > r9a07g043u11-smarc-cru- > > > > csi-ov5645: Reduce I2C frequency > > > > > > > > Hi Geert, > > > > > > > > Thanks for the feedback. > > > > > > > > > -----Original Message----- > > > > > From: Geert Uytterhoeven <geert@linux-m68k.org> > > > > > Sent: Friday, January 26, 2024 1:53 PM > > > > > Subject: Re: [PATCH v2 5/5] arm64: dts: renesas: > > > > > r9a07g043u11-smarc-cru- > > > > > csi-ov5645: Reduce I2C frequency > > > > > > > > > > Hi Biju, > > > > > > > > > > On Fri, Jan 26, 2024 at 2:31 PM Biju Das > > > > > <biju.das.jz@bp.renesas.com> > > > > > wrote: > > > > > > Reduce i2c freq from 400->100 kHz on RZ/G2UL SMARC EVK as the > > > > > > captured image is not proper with the sensor configuration over > I2C. > > > > > > > > > > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > > > > > > > > > > Thanks for your patch! > > > > > > > > > > > --- > > > > > > a/arch/arm64/boot/dts/renesas/r9a07g043u11-smarc-cru-csi-ov564 > > > > > > 5.dt > > > > > > so > > > > > > +++ b/arch/arm64/boot/dts/renesas/r9a07g043u11-smarc-cru-csi- > ov5645. > > > > > > +++ dt > > > > > > +++ so > > > > > > @@ -19,3 +19,7 @@ &ov5645 { > > > > > > enable-gpios = <&pinctrl RZG2L_GPIO(4, 4) > GPIO_ACTIVE_HIGH>; > > > > > > reset-gpios = <&pinctrl RZG2L_GPIO(0, 1) > > > > > > GPIO_ACTIVE_LOW>; }; > > > > > > + > > > > > > +&i2c0 { > > > > > > + clock-frequency = <100000>; }; > > > > > > > > > > Is this a limitation of one of the I2C devices on the bus, or a > > > > > PCB design issue? > > > > > > > > Currently versa3 clock generator connected to the same bus and it > > > > works ok with 400kHz clock. Maybe it is stressed not that much > > > > compared to OV5645 sensor configuration. > > > > > > > > At the moment with 400kHz I2C bus clock, Camera capture is not > > > > working properly on RZ/G2UL, but with same bus frequency the same > > > > works fine on RZ/{G2L,G2LC,V2L}. > > > > There may be some hardware differences which is causing this issue. > > > > > > > > > > > > > > Doesn't this need a Fixes tag? > > > > > > > > I can create a new patch updating bus frequency as 100kHz and add > > > > fixes tag. > > > > After this I will drop this patch as it no longer needed. > > > > > > > > Please let me know. > > > > > > + media > > > > > > Adding a delay after Software reset makes it to work at 400kHz with > > > RZ/G2UL SMARC EVK. > > > > > > So not sure we need to add delay after software reset? > > > > > > Now after OV5645 gpio reset, then there is 20msec delay and then > > > again we are issuing software reset and there is no delay after this > > > for this software reset. > > > > > > diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c > > > index a26ac11c989d..d67a5e23fe5a 100644 > > > --- a/drivers/media/i2c/ov5645.c > > > +++ b/drivers/media/i2c/ov5645.c > > > @@ -622,11 +622,19 @@ static int ov5645_set_register_array(struct > > > ov5645 *ov5645, { > > > unsigned int i; > > > int ret; > > > > > > for (i = 0; i < num_settings; ++i, ++settings) { > > > ret = ov5645_write_reg(ov5645, settings->reg, > > > settings- > > > >val); > > > if (ret < 0) > > > return ret; > > > + > > > + if (settings->reg == OV5645_SYSTEM_CTRL0) > > > + fsleep(1000); > > > > > > > This issue seen on RZ/G2L SMARC EVK as well. My testing on G2L family > > shows we need to add delay to make OV5645 to work @400kHZ. > > Typically there's a delay before the chip is accessible over I²C after > resetting it. It's a bit open whether this one needs it, very probably it > does. It'd be nicer nonetheless to do this outside the register list and > instead use a separate ov5645_write_reg() call. OK. > > Probably the first write is redundant. The second write resets the device. > 0x80 should be sufficient value for that. Will test and send patch for it. Cheers, Biju