2020-11-25 13:05:11

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: [PATCH v2 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors

Hi All,

This patch set enables to connect ov7725 sensors on iWave-RZ/G1H Qseven
board.

This patch is based on top of [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/
renesas-devel.git/log/?h=renesas-arm-dt-for-v5.11

Changes for v2:
* Separated out ov5640 ep into a dtsi

v1: https://patchwork.kernel.org/project/linux-renesas-soc/patch/
[email protected]/

Cheers,
Prabhakar

Lad Prabhakar (2):
ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Separate out ov5640 nodes
ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725
sensors

.../boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 104 +++++-------------
.../dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi | 89 +++++++++++++++
.../dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi | 77 +++++++++++++
3 files changed, 194 insertions(+), 76 deletions(-)
create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi
create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi

--
2.17.1


2020-11-25 13:05:32

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: [PATCH v2 2/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add support for 8-bit ov7725 sensors

The 8-bit ov7725 sensors can also be connected to the camera daughter
board.

This patch creates a separate dtsi file for ov7725 sensors and is included
in r8a7742-iwg21d-q7-dbcm-ca.dts (which is commented out as by default
ov5640 is enabled)

Signed-off-by: Lad Prabhakar <[email protected]>
Reviewed-by: Biju Das <[email protected]>
---
.../boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 2 +
.../dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi | 77 +++++++++++++++++++
2 files changed, 79 insertions(+)
create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi

diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
index a632b08a8dbb..6216a6b0f927 100644
--- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
+++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
@@ -29,7 +29,9 @@
#define MCLK_CAM4 mclk_cam4
#define VIN3_EP vin3ep

+/* Comment the below according to connected cameras */
#include "r8a7742-iwg21d-q7-dbcm-ov5640.dtsi"
+/* #include "r8a7742-iwg21d-q7-dbcm-ov7725.dtsi" */

/ {
model = "iWave Systems RZ/G1H Qseven development platform with camera add-on";
diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi
new file mode 100644
index 000000000000..28b509942702
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov7725.dtsi
@@ -0,0 +1,77 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * This include file ties VIN interfaces with ov7725 sensors on
+ * iWave-RZ/G1H Qseven board development platform connected with
+ * camera daughter board.
+ *
+ * Copyright (C) 2020 Renesas Electronics Corp.
+ */
+
+#define VIN0_REMOTE_EP ov7725_0
+#define VIN1_REMOTE_EP ov7725_1
+#define VIN2_REMOTE_EP ov7725_2
+#define VIN3_REMOTE_EP ov7725_3
+
+&CAM1_PARENT_I2C {
+ ov7725@21 {
+ compatible = "ovti,ov7725";
+ reg = <0x21>;
+ clocks = <&MCLK_CAM1>;
+
+ port {
+ ov7725_0: endpoint {
+ bus-width = <8>;
+ bus-type = <6>;
+ remote-endpoint = <&VIN0_EP>;
+ };
+ };
+ };
+};
+
+&CAM2_PARENT_I2C {
+ ov7725@21 {
+ compatible = "ovti,ov7725";
+ reg = <0x21>;
+ clocks = <&MCLK_CAM2>;
+
+ port {
+ ov7725_1: endpoint {
+ bus-width = <8>;
+ bus-type = <6>;
+ remote-endpoint = <&VIN1_EP>;
+ };
+ };
+ };
+};
+
+&CAM3_PARENT_I2C {
+ ov7725@21 {
+ compatible = "ovti,ov7725";
+ reg = <0x21>;
+ clocks = <&MCLK_CAM3>;
+
+ port {
+ ov7725_2: endpoint {
+ bus-width = <8>;
+ bus-type = <6>;
+ remote-endpoint = <&VIN2_EP>;
+ };
+ };
+ };
+};
+
+&CAM4_PARENT_I2C {
+ ov7725@21 {
+ compatible = "ovti,ov7725";
+ reg = <0x21>;
+ clocks = <&MCLK_CAM4>;
+
+ port {
+ ov7725_3: endpoint {
+ bus-width = <8>;
+ bus-type = <6>;
+ remote-endpoint = <&VIN3_EP>;
+ };
+ };
+ };
+};
--
2.17.1

2020-11-25 13:05:53

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: [PATCH v2 1/2] ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Separate out ov5640 nodes

The camera daughter board can also be connected to 8-bit ov7725 sensors,
so in preparation for configurable option to choose depending on the
camera's connected separate out ov5640 nodes in a dtsi file.

Signed-off-by: Lad Prabhakar <[email protected]>
Reviewed-by: Biju Das <[email protected]>
---
.../boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts | 102 +++++-------------
.../dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi | 89 +++++++++++++++
2 files changed, 115 insertions(+), 76 deletions(-)
create mode 100644 arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi

diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
index 98c3fbd89fa6..a632b08a8dbb 100644
--- a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
+++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dts
@@ -9,6 +9,28 @@
/dts-v1/;
#include "r8a7742-iwg21d-q7.dts"

+/* 8bit CMOS Camera 1 (J13) */
+#define CAM1_PARENT_I2C i2c0
+#define MCLK_CAM1 mclk_cam1
+#define VIN0_EP vin0ep
+
+/* 8bit CMOS Camera 2 (J14) */
+#define CAM2_PARENT_I2C i2c1
+#define MCLK_CAM2 mclk_cam2
+#define VIN1_EP vin1ep
+
+/* 8bit CMOS Camera 3 (J12) */
+#define CAM3_PARENT_I2C i2c2
+#define MCLK_CAM3 mclk_cam3
+#define VIN2_EP vin2ep
+
+/* 8bit CMOS Camera 4 (J11) */
+#define CAM4_PARENT_I2C i2c3
+#define MCLK_CAM4 mclk_cam4
+#define VIN3_EP vin3ep
+
+#include "r8a7742-iwg21d-q7-dbcm-ov5640.dtsi"
+
/ {
model = "iWave Systems RZ/G1H Qseven development platform with camera add-on";
compatible = "iwave,g21d", "iwave,g21m", "renesas,r8a7742";
@@ -91,67 +113,12 @@
status = "okay";
};

-&i2c0 {
- ov5640@3c {
- compatible = "ovti,ov5640";
- reg = <0x3c>;
- clocks = <&mclk_cam1>;
- clock-names = "xclk";
-
- port {
- ov5640_0: endpoint {
- bus-width = <8>;
- data-shift = <2>;
- bus-type = <6>;
- pclk-sample = <1>;
- remote-endpoint = <&vin0ep>;
- };
- };
- };
-};
-
&i2c1 {
pinctrl-0 = <&i2c1_pins>;
pinctrl-names = "default";

status = "okay";
clock-frequency = <400000>;
-
- ov5640@3c {
- compatible = "ovti,ov5640";
- reg = <0x3c>;
- clocks = <&mclk_cam2>;
- clock-names = "xclk";
-
- port {
- ov5640_1: endpoint {
- bus-width = <8>;
- data-shift = <2>;
- bus-type = <6>;
- pclk-sample = <1>;
- remote-endpoint = <&vin1ep>;
- };
- };
- };
-};
-
-&i2c2 {
- ov5640@3c {
- compatible = "ovti,ov5640";
- reg = <0x3c>;
- clocks = <&mclk_cam3>;
- clock-names = "xclk";
-
- port {
- ov5640_2: endpoint {
- bus-width = <8>;
- data-shift = <2>;
- bus-type = <6>;
- pclk-sample = <1>;
- remote-endpoint = <&vin2ep>;
- };
- };
- };
};

&i2c3 {
@@ -160,23 +127,6 @@

status = "okay";
clock-frequency = <400000>;
-
- ov5640@3c {
- compatible = "ovti,ov5640";
- reg = <0x3c>;
- clocks = <&mclk_cam4>;
- clock-names = "xclk";
-
- port {
- ov5640_3: endpoint {
- bus-width = <8>;
- data-shift = <2>;
- bus-type = <6>;
- pclk-sample = <1>;
- remote-endpoint = <&vin3ep>;
- };
- };
- };
};

&pfc {
@@ -278,7 +228,7 @@

port {
vin0ep: endpoint {
- remote-endpoint = <&ov5640_0>;
+ remote-endpoint = <&VIN0_REMOTE_EP>;
bus-width = <8>;
bus-type = <6>;
};
@@ -293,7 +243,7 @@

port {
vin1ep: endpoint {
- remote-endpoint = <&ov5640_1>;
+ remote-endpoint = <&VIN1_REMOTE_EP>;
bus-width = <8>;
bus-type = <6>;
};
@@ -307,7 +257,7 @@

port {
vin2ep: endpoint {
- remote-endpoint = <&ov5640_2>;
+ remote-endpoint = <&VIN2_REMOTE_EP>;
bus-width = <8>;
data-shift = <8>;
bus-type = <6>;
@@ -322,7 +272,7 @@

port {
vin3ep: endpoint {
- remote-endpoint = <&ov5640_3>;
+ remote-endpoint = <&VIN3_REMOTE_EP>;
bus-width = <8>;
bus-type = <6>;
};
diff --git a/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi
new file mode 100644
index 000000000000..bd037789c6df
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ov5640.dtsi
@@ -0,0 +1,89 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * This include file ties VIN interfaces with ov5640 sensors on
+ * iWave-RZ/G1H Qseven board development platform connected with
+ * camera daughter board.
+ *
+ * Copyright (C) 2020 Renesas Electronics Corp.
+ */
+
+#define VIN0_REMOTE_EP ov5640_0
+#define VIN1_REMOTE_EP ov5640_1
+#define VIN2_REMOTE_EP ov5640_2
+#define VIN3_REMOTE_EP ov5640_3
+
+&CAM1_PARENT_I2C {
+ ov5640@3c {
+ compatible = "ovti,ov5640";
+ reg = <0x3c>;
+ clocks = <&MCLK_CAM1>;
+ clock-names = "xclk";
+
+ port {
+ ov5640_0: endpoint {
+ bus-width = <8>;
+ data-shift = <2>;
+ bus-type = <6>;
+ pclk-sample = <1>;
+ remote-endpoint = <&VIN0_EP>;
+ };
+ };
+ };
+};
+
+&CAM2_PARENT_I2C {
+ ov5640@3c {
+ compatible = "ovti,ov5640";
+ reg = <0x3c>;
+ clocks = <&MCLK_CAM2>;
+ clock-names = "xclk";
+
+ port {
+ ov5640_1: endpoint {
+ bus-width = <8>;
+ data-shift = <2>;
+ bus-type = <6>;
+ pclk-sample = <1>;
+ remote-endpoint = <&VIN1_EP>;
+ };
+ };
+ };
+};
+
+&CAM3_PARENT_I2C {
+ ov5640@3c {
+ compatible = "ovti,ov5640";
+ reg = <0x3c>;
+ clocks = <&MCLK_CAM3>;
+ clock-names = "xclk";
+
+ port {
+ ov5640_2: endpoint {
+ bus-width = <8>;
+ data-shift = <2>;
+ bus-type = <6>;
+ pclk-sample = <1>;
+ remote-endpoint = <&VIN2_EP>;
+ };
+ };
+ };
+};
+
+&CAM4_PARENT_I2C {
+ ov5640@3c {
+ compatible = "ovti,ov5640";
+ reg = <0x3c>;
+ clocks = <&MCLK_CAM4>;
+ clock-names = "xclk";
+
+ port {
+ ov5640_3: endpoint {
+ bus-width = <8>;
+ data-shift = <2>;
+ bus-type = <6>;
+ pclk-sample = <1>;
+ remote-endpoint = <&VIN3_EP>;
+ };
+ };
+ };
+};
--
2.17.1

2020-11-25 16:24:47

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors

Hi Prabhakar,

On Wed, Nov 25, 2020 at 2:02 PM Lad Prabhakar
<[email protected]> wrote:
> This patch set enables to connect ov7725 sensors on iWave-RZ/G1H Qseven
> board.

Thanks for your series!

Do you think it's a valid use case to mix and match ov5640 and ov7725
cameras? E.g. connect two of each?
Or should all four cameras be of the same type?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2020-11-25 16:32:16

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: RE: [PATCH v2 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors

Hi Geert,

> -----Original Message-----
> From: Geert Uytterhoeven <[email protected]>
> Sent: 25 November 2020 16:21
> To: Prabhakar Mahadev Lad <[email protected]>
> Cc: Magnus Damm <[email protected]>; Rob Herring <[email protected]>; Linux-Renesas <linux-
> [email protected]>; open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
> <[email protected]>; Linux Kernel Mailing List <[email protected]>; Biju Das
> <[email protected]>; Prabhakar <[email protected]>
> Subject: Re: [PATCH v2 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors
>
> Hi Prabhakar,
>
> On Wed, Nov 25, 2020 at 2:02 PM Lad Prabhakar
> <[email protected]> wrote:
> > This patch set enables to connect ov7725 sensors on iWave-RZ/G1H Qseven
> > board.
>
> Thanks for your series!
>
> Do you think it's a valid use case to mix and match ov5640 and ov7725
> cameras? E.g. connect two of each?
>
Yes that is valid case to mix and match. Do you want me to make it configurable too ?

Cheers,
Prabhakar

> Or should all four cameras be of the same type?
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds

2020-11-25 16:34:23

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors

Hi Prabhakar,

On Wed, Nov 25, 2020 at 5:26 PM Prabhakar Mahadev Lad
<[email protected]> wrote:
> > -----Original Message-----
> > From: Geert Uytterhoeven <[email protected]>
> > Sent: 25 November 2020 16:21
> > To: Prabhakar Mahadev Lad <[email protected]>
> > Cc: Magnus Damm <[email protected]>; Rob Herring <[email protected]>; Linux-Renesas <linux-
> > [email protected]>; open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
> > <[email protected]>; Linux Kernel Mailing List <[email protected]>; Biju Das
> > <[email protected]>; Prabhakar <[email protected]>
> > Subject: Re: [PATCH v2 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors
> >
> > Hi Prabhakar,
> >
> > On Wed, Nov 25, 2020 at 2:02 PM Lad Prabhakar
> > <[email protected]> wrote:
> > > This patch set enables to connect ov7725 sensors on iWave-RZ/G1H Qseven
> > > board.
> >
> > Thanks for your series!
> >
> > Do you think it's a valid use case to mix and match ov5640 and ov7725
> > cameras? E.g. connect two of each?
> >
> Yes that is valid case to mix and match. Do you want me to make it configurable too ?

If this is a valid use case, then please do so.
Thanks!

> > Or should all four cameras be of the same type?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2020-11-25 17:27:38

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors

Hi Geert,

On Wed, Nov 25, 2020 at 4:32 PM Geert Uytterhoeven <[email protected]> wrote:
>
> Hi Prabhakar,
>
> On Wed, Nov 25, 2020 at 5:26 PM Prabhakar Mahadev Lad
> <[email protected]> wrote:
> > > -----Original Message-----
> > > From: Geert Uytterhoeven <[email protected]>
> > > Sent: 25 November 2020 16:21
> > > To: Prabhakar Mahadev Lad <[email protected]>
> > > Cc: Magnus Damm <[email protected]>; Rob Herring <[email protected]>; Linux-Renesas <linux-
> > > [email protected]>; open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
> > > <[email protected]>; Linux Kernel Mailing List <[email protected]>; Biju Das
> > > <[email protected]>; Prabhakar <[email protected]>
> > > Subject: Re: [PATCH v2 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors
> > >
> > > Hi Prabhakar,
> > >
> > > On Wed, Nov 25, 2020 at 2:02 PM Lad Prabhakar
> > > <[email protected]> wrote:
> > > > This patch set enables to connect ov7725 sensors on iWave-RZ/G1H Qseven
> > > > board.
> > >
> > > Thanks for your series!
> > >
> > > Do you think it's a valid use case to mix and match ov5640 and ov7725
> > > cameras? E.g. connect two of each?
> > >
> > Yes that is valid case to mix and match. Do you want me to make it configurable too ?
>
> If this is a valid use case, then please do so.
>
In that case do we still want to keep the ov7725/ov5640 nodes in
separate dtsi ?

Cheers,
Prabhakar

> Thanks!
>
> > > Or should all four cameras be of the same type?
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds

2020-11-25 22:12:14

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors

Hi Prabhakar,

On Wed, Nov 25, 2020 at 6:23 PM Lad, Prabhakar
<[email protected]> wrote:
> On Wed, Nov 25, 2020 at 4:32 PM Geert Uytterhoeven <[email protected]> wrote:
> > On Wed, Nov 25, 2020 at 5:26 PM Prabhakar Mahadev Lad
> > <[email protected]> wrote:
> > > > -----Original Message-----
> > > > From: Geert Uytterhoeven <[email protected]>
> > > > Sent: 25 November 2020 16:21
> > > > To: Prabhakar Mahadev Lad <[email protected]>
> > > > Cc: Magnus Damm <[email protected]>; Rob Herring <[email protected]>; Linux-Renesas <linux-
> > > > [email protected]>; open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
> > > > <[email protected]>; Linux Kernel Mailing List <[email protected]>; Biju Das
> > > > <[email protected]>; Prabhakar <[email protected]>
> > > > Subject: Re: [PATCH v2 0/2] r8a7742-iwg21d-q7-dbcm: Add support for ov7725 sensors
> > > >
> > > > On Wed, Nov 25, 2020 at 2:02 PM Lad Prabhakar
> > > > <[email protected]> wrote:
> > > > > This patch set enables to connect ov7725 sensors on iWave-RZ/G1H Qseven
> > > > > board.
> > > >
> > > > Thanks for your series!
> > > >
> > > > Do you think it's a valid use case to mix and match ov5640 and ov7725
> > > > cameras? E.g. connect two of each?
> > > >
> > > Yes that is valid case to mix and match. Do you want me to make it configurable too ?
> >
> > If this is a valid use case, then please do so.
> >
> In that case do we still want to keep the ov7725/ov5640 nodes in
> separate dtsi ?

You can, if you define only a single camera in each include file,
and #include four camera include files, with some #define/#undef-ery
around each #include.

Cfr. my suggestion in
https://lore.kernel.org/linux-renesas-soc/CAMuHMdXAB-eUAMSeptptajr0eReHXHFuoR5HZkB-X+AKBUsyxA@mail.gmail.com/

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds