diff mbox series

[v4,1/6] dt-bindings: media: Document bindings for DW MIPI CSI-2 Host

Message ID 1560280855-18085-2-git-send-email-luis.oliveira@synopsys.com (mailing list archive)
State New, archived
Headers show
Series platform: dwc: Adding DesignWare MIPI CSI-2 Host and D-PHY | expand

Commit Message

Luis de Oliveira June 11, 2019, 7:20 p.m. UTC
From: Luis Oliveira <lolivei@synopsys.com>

Add bindings for Synopsys DesignWare MIPI CSI-2 host.

Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
---
Changelog
v3-v4
- remove "plat" from the block name @rob @laurent
- remove "phy-names" when single-entry @rob
- remove "snps,output-type" -> went to the driver config @laurent

 .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt

Comments

Sakari Ailus June 28, 2019, 2:13 p.m. UTC | #1
Hi Luis,

Thank you for the patchset.

On Tue, Jun 11, 2019 at 09:20:50PM +0200, Luis Oliveira wrote:
> From: Luis Oliveira <lolivei@synopsys.com>
> 
> Add bindings for Synopsys DesignWare MIPI CSI-2 host.
> 
> Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
> ---
> Changelog
> v3-v4
> - remove "plat" from the block name @rob @laurent
> - remove "phy-names" when single-entry @rob
> - remove "snps,output-type" -> went to the driver config @laurent
> 
>  .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
> 
> diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> new file mode 100644
> index 0000000..613b7f9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> @@ -0,0 +1,41 @@
> +Synopsys DesignWare CSI-2 Host controller
> +
> +Description
> +-----------
> +
> +This HW block is used to receive image coming from an MIPI CSI-2 compatible
> +camera.
> +
> +Required properties:
> +- compatible		: shall be "snps,dw-csi"
> +- reg			: physical base address and size of the device memory
> +			  mapped registers;
> +- interrupts		: DW CSI-2 Host interrupts
> +- phys			: List of one PHY specifier (as defined in
> +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
> +			  This PHY is a MIPI DPHY working in RX mode.
> +- resets		: Reference to a reset controller (optional)
> +
> +The per-board settings:
> + - port sub-node describing a single endpoint connected to the camera as
> +   described in video-interfaces.txt[1].

Which endpoint properties in video-interfaces.txt are relevant for the
hardware? Which values may they have?

> +
> +Example:
> +
> +	csi2: csi2@3000 {
> +		compatible = "snps,dw-csi";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		reg = < 0x03000 0x7FF>;

reg = <0x03000 0x7FF>;

> +		phys = <&mipi_dphy_rx>;
> +		resets = <&dw_rst 1>;
> +		interrupts = <2>;
> +
> +		port@0 {
> +			reg = <0>;

You can drop "@0" and the reg property.

> +			csi_ep1: endpoint {
> +				remote-endpoint = <&camera_1>;
> +				data-lanes = <1 2>;
> +			};
> +		};
> +	};
Luis de Oliveira July 8, 2019, 3:21 p.m. UTC | #2
Hi Sakari,

Thank you for your feedback.
I have my comments inline.

From: Sakari Ailus <sakari.ailus@iki.fi>
Date: Fri, Jun 28, 2019 at 15:13:26

> Hi Luis,
> 
> Thank you for the patchset.
> 
> On Tue, Jun 11, 2019 at 09:20:50PM +0200, Luis Oliveira wrote:
> > From: Luis Oliveira <lolivei@synopsys.com>
> > 
> > Add bindings for Synopsys DesignWare MIPI CSI-2 host.
> > 
> > Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
> > ---
> > Changelog
> > v3-v4
> > - remove "plat" from the block name @rob @laurent
> > - remove "phy-names" when single-entry @rob
> > - remove "snps,output-type" -> went to the driver config @laurent
> > 
> >  .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
> >  1 file changed, 41 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > new file mode 100644
> > index 0000000..613b7f9
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > @@ -0,0 +1,41 @@
> > +Synopsys DesignWare CSI-2 Host controller
> > +
> > +Description
> > +-----------
> > +
> > +This HW block is used to receive image coming from an MIPI CSI-2 compatible
> > +camera.
> > +
> > +Required properties:
> > +- compatible		: shall be "snps,dw-csi"
> > +- reg			: physical base address and size of the device memory
> > +			  mapped registers;
> > +- interrupts		: DW CSI-2 Host interrupts
> > +- phys			: List of one PHY specifier (as defined in
> > +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
> > +			  This PHY is a MIPI DPHY working in RX mode.
> > +- resets		: Reference to a reset controller (optional)
> > +
> > +The per-board settings:
> > + - port sub-node describing a single endpoint connected to the camera as
> > +   described in video-interfaces.txt[1].
> 
> Which endpoint properties in video-interfaces.txt are relevant for the
> hardware? Which values may they have?
> 

Currently I'm using only two properties "data-lanes" and "bus-width", but 
I have plans to add blanking info also.
I will add more info.

> > +
> > +Example:
> > +
> > +	csi2: csi2@3000 {
> > +		compatible = "snps,dw-csi";
> > +		#address-cells = <1>;
> > +		#size-cells = <0>;
> > +		reg = < 0x03000 0x7FF>;
> 
> reg = <0x03000 0x7FF>;

Yes, I've missed that.

> 
> > +		phys = <&mipi_dphy_rx>;
> > +		resets = <&dw_rst 1>;
> > +		interrupts = <2>;
> > +
> > +		port@0 {
> > +			reg = <0>;
> 
> You can drop "@0" and the reg property.

Ok thank you.
> 
> > +			csi_ep1: endpoint {
> > +				remote-endpoint = <&camera_1>;
> > +				data-lanes = <1 2>;
> > +			};
> > +		};
> > +	};
> 
> -- 
> Kind regards,
> 
> Sakari Ailus

Best regards,
Luis
Eugen Hristev July 9, 2019, 2:33 p.m. UTC | #3
On 11.06.2019 22:20, Luis Oliveira wrote:
> From: Luis Oliveira <lolivei@synopsys.com>
> 
> Add bindings for Synopsys DesignWare MIPI CSI-2 host.
> 
> Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
> ---
> Changelog
> v3-v4
> - remove "plat" from the block name @rob @laurent
> - remove "phy-names" when single-entry @rob
> - remove "snps,output-type" -> went to the driver config @laurent
> 
>   .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
>   1 file changed, 41 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
> 
> diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> new file mode 100644
> index 0000000..613b7f9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> @@ -0,0 +1,41 @@
> +Synopsys DesignWare CSI-2 Host controller
> +
> +Description
> +-----------
> +
> +This HW block is used to receive image coming from an MIPI CSI-2 compatible
> +camera.
> +
> +Required properties:
> +- compatible		: shall be "snps,dw-csi"
> +- reg			: physical base address and size of the device memory
> +			  mapped registers;
> +- interrupts		: DW CSI-2 Host interrupts
> +- phys			: List of one PHY specifier (as defined in
> +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
> +			  This PHY is a MIPI DPHY working in RX mode.
> +- resets		: Reference to a reset controller (optional)
> +
> +The per-board settings:
> + - port sub-node describing a single endpoint connected to the camera as
> +   described in video-interfaces.txt[1].
> +
> +Example:
> +
> +	csi2: csi2@3000 {
> +		compatible = "snps,dw-csi";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		reg = < 0x03000 0x7FF>;
> +		phys = <&mipi_dphy_rx>;
> +		resets = <&dw_rst 1>;
> +		interrupts = <2>;
> +
> +		port@0 {
> +			reg = <0>;
> +			csi_ep1: endpoint {
> +				remote-endpoint = <&camera_1>;
> +				data-lanes = <1 2>;
> +			};

Hello Luis,

Which is the output port (endpoint) : how to connect the output of 
csi2host to another node ?
I mean, the second port of this block, or, how is the data taken from 
csi2host ?

Thanks,

Eugen

> +		};
> +	};
>
Luis de Oliveira July 9, 2019, 5:08 p.m. UTC | #4
Hi Eugen,


From: Eugen.Hristev@microchip.com <Eugen.Hristev@microchip.com>
Date: Tue, Jul 09, 2019 at 15:33:50

> 
> 
> On 11.06.2019 22:20, Luis Oliveira wrote:
> > From: Luis Oliveira <lolivei@synopsys.com>
> > 
> > Add bindings for Synopsys DesignWare MIPI CSI-2 host.
> > 
> > Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
> > ---
> > Changelog
> > v3-v4
> > - remove "plat" from the block name @rob @laurent
> > - remove "phy-names" when single-entry @rob
> > - remove "snps,output-type" -> went to the driver config @laurent
> > 
> >   .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
> >   1 file changed, 41 insertions(+)
> >   create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > new file mode 100644
> > index 0000000..613b7f9
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > @@ -0,0 +1,41 @@
> > +Synopsys DesignWare CSI-2 Host controller
> > +
> > +Description
> > +-----------
> > +
> > +This HW block is used to receive image coming from an MIPI CSI-2 compatible
> > +camera.
> > +
> > +Required properties:
> > +- compatible		: shall be "snps,dw-csi"
> > +- reg			: physical base address and size of the device memory
> > +			  mapped registers;
> > +- interrupts		: DW CSI-2 Host interrupts
> > +- phys			: List of one PHY specifier (as defined in
> > +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
> > +			  This PHY is a MIPI DPHY working in RX mode.
> > +- resets		: Reference to a reset controller (optional)
> > +
> > +The per-board settings:
> > + - port sub-node describing a single endpoint connected to the camera as
> > +   described in video-interfaces.txt[1].
> > +
> > +Example:
> > +
> > +	csi2: csi2@3000 {
> > +		compatible = "snps,dw-csi";
> > +		#address-cells = <1>;
> > +		#size-cells = <0>;
> > +		reg = < 0x03000 0x7FF>;
> > +		phys = <&mipi_dphy_rx>;
> > +		resets = <&dw_rst 1>;
> > +		interrupts = <2>;
> > +
> > +		port@0 {
> > +			reg = <0>;
> > +			csi_ep1: endpoint {
> > +				remote-endpoint = <&camera_1>;
> > +				data-lanes = <1 2>;
> > +			};
> 
> Hello Luis,
> 
> Which is the output port (endpoint) : how to connect the output of 
> csi2host to another node ?
> I mean, the second port of this block, or, how is the data taken from 
> csi2host ?
> 

I understand your question, I think you guessed this is not the complete 
pipeline (I have a top driver that interacts with this one).
I was not planning to submit it, do you think I should?

The behavior is very similar with this one 
./drivers/media/platform/exynos4-is/media-dev.c


> Thanks,
> 
> Eugen
> 
> > +		};
> > +	};
> > 

Thanks,
Luis
Sakari Ailus July 9, 2019, 6:25 p.m. UTC | #5
Hi Luis,

On Mon, Jul 08, 2019 at 03:21:50PM +0000, Luis de Oliveira wrote:
> Hi Sakari,
> 
> Thank you for your feedback.
> I have my comments inline.
> 
> From: Sakari Ailus <sakari.ailus@iki.fi>
> Date: Fri, Jun 28, 2019 at 15:13:26
> 
> > Hi Luis,
> > 
> > Thank you for the patchset.
> > 
> > On Tue, Jun 11, 2019 at 09:20:50PM +0200, Luis Oliveira wrote:
> > > From: Luis Oliveira <lolivei@synopsys.com>
> > > 
> > > Add bindings for Synopsys DesignWare MIPI CSI-2 host.
> > > 
> > > Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
> > > ---
> > > Changelog
> > > v3-v4
> > > - remove "plat" from the block name @rob @laurent
> > > - remove "phy-names" when single-entry @rob
> > > - remove "snps,output-type" -> went to the driver config @laurent
> > > 
> > >  .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
> > >  1 file changed, 41 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > 
> > > diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > new file mode 100644
> > > index 0000000..613b7f9
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > @@ -0,0 +1,41 @@
> > > +Synopsys DesignWare CSI-2 Host controller
> > > +
> > > +Description
> > > +-----------
> > > +
> > > +This HW block is used to receive image coming from an MIPI CSI-2 compatible
> > > +camera.
> > > +
> > > +Required properties:
> > > +- compatible		: shall be "snps,dw-csi"
> > > +- reg			: physical base address and size of the device memory
> > > +			  mapped registers;
> > > +- interrupts		: DW CSI-2 Host interrupts
> > > +- phys			: List of one PHY specifier (as defined in
> > > +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
> > > +			  This PHY is a MIPI DPHY working in RX mode.
> > > +- resets		: Reference to a reset controller (optional)
> > > +
> > > +The per-board settings:
> > > + - port sub-node describing a single endpoint connected to the camera as
> > > +   described in video-interfaces.txt[1].
> > 
> > Which endpoint properties in video-interfaces.txt are relevant for the
> > hardware? Which values may they have?
> > 
> 
> Currently I'm using only two properties "data-lanes" and "bus-width", but 
> I have plans to add blanking info also.
> I will add more info.

Isn't blanking defined by what the transmitter seneds? Or do you have
hardware limitations on the receiver side?

I've only heard of one such case before, and it was a very old parallel
receiver.

If you have a CSI-2 receiver, bus-width isn't relevant --- it's for paralle
interfaces only. Please add data-lanes to required endpoint properties.
Eugen Hristev July 10, 2019, 6:53 a.m. UTC | #6
On 09.07.2019 20:08, Luis de Oliveira wrote:

> 
> Hi Eugen,
> 
> 
> From: Eugen.Hristev@microchip.com <Eugen.Hristev@microchip.com>
> Date: Tue, Jul 09, 2019 at 15:33:50
> 
>>
>>
>> On 11.06.2019 22:20, Luis Oliveira wrote:
>>> From: Luis Oliveira <lolivei@synopsys.com>
>>>
>>> Add bindings for Synopsys DesignWare MIPI CSI-2 host.
>>>
>>> Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
>>> ---
>>> Changelog
>>> v3-v4
>>> - remove "plat" from the block name @rob @laurent
>>> - remove "phy-names" when single-entry @rob
>>> - remove "snps,output-type" -> went to the driver config @laurent
>>>
>>>    .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
>>>    1 file changed, 41 insertions(+)
>>>    create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
>>> new file mode 100644
>>> index 0000000..613b7f9
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
>>> @@ -0,0 +1,41 @@
>>> +Synopsys DesignWare CSI-2 Host controller
>>> +
>>> +Description
>>> +-----------
>>> +
>>> +This HW block is used to receive image coming from an MIPI CSI-2 compatible
>>> +camera.
>>> +
>>> +Required properties:
>>> +- compatible		: shall be "snps,dw-csi"
>>> +- reg			: physical base address and size of the device memory
>>> +			  mapped registers;
>>> +- interrupts		: DW CSI-2 Host interrupts
>>> +- phys			: List of one PHY specifier (as defined in
>>> +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
>>> +			  This PHY is a MIPI DPHY working in RX mode.
>>> +- resets		: Reference to a reset controller (optional)
>>> +
>>> +The per-board settings:
>>> + - port sub-node describing a single endpoint connected to the camera as
>>> +   described in video-interfaces.txt[1].
>>> +
>>> +Example:
>>> +
>>> +	csi2: csi2@3000 {
>>> +		compatible = "snps,dw-csi";
>>> +		#address-cells = <1>;
>>> +		#size-cells = <0>;
>>> +		reg = < 0x03000 0x7FF>;
>>> +		phys = <&mipi_dphy_rx>;
>>> +		resets = <&dw_rst 1>;
>>> +		interrupts = <2>;
>>> +
>>> +		port@0 {
>>> +			reg = <0>;
>>> +			csi_ep1: endpoint {
>>> +				remote-endpoint = <&camera_1>;
>>> +				data-lanes = <1 2>;
>>> +			};
>>
>> Hello Luis,
>>
>> Which is the output port (endpoint) : how to connect the output of
>> csi2host to another node ?
>> I mean, the second port of this block, or, how is the data taken from
>> csi2host ?
>>
> 
> I understand your question, I think you guessed this is not the complete
> pipeline (I have a top driver that interacts with this one).
> I was not planning to submit it, do you think I should?

Yes please, you can have the patch with subject DO NOT MERGE if you do 
not want that patch to be included in the kernel and just for reference.
but it would help me in understanding your setup

Thanks !

> 
> The behavior is very similar with this one
> ./drivers/media/platform/exynos4-is/media-dev.c
> 
> 
>> Thanks,
>>
>> Eugen
>>
>>> +		};
>>> +	};
>>>
> 
> Thanks,
> Luis
>
Luis de Oliveira July 10, 2019, 10:20 a.m. UTC | #7
Hi Sakari,

From: Sakari Ailus <sakari.ailus@iki.fi>
Date: Tue, Jul 09, 2019 at 19:25:00

> Hi Luis,
> 
> On Mon, Jul 08, 2019 at 03:21:50PM +0000, Luis de Oliveira wrote:
> > Hi Sakari,
> > 
> > Thank you for your feedback.
> > I have my comments inline.
> > 
> > From: Sakari Ailus <sakari.ailus@iki.fi>
> > Date: Fri, Jun 28, 2019 at 15:13:26
> > 
> > > Hi Luis,
> > > 
> > > Thank you for the patchset.
> > > 
> > > On Tue, Jun 11, 2019 at 09:20:50PM +0200, Luis Oliveira wrote:
> > > > From: Luis Oliveira <lolivei@synopsys.com>
> > > > 
> > > > Add bindings for Synopsys DesignWare MIPI CSI-2 host.
> > > > 
> > > > Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
> > > > ---
> > > > Changelog
> > > > v3-v4
> > > > - remove "plat" from the block name @rob @laurent
> > > > - remove "phy-names" when single-entry @rob
> > > > - remove "snps,output-type" -> went to the driver config @laurent
> > > > 
> > > >  .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
> > > >  1 file changed, 41 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > > new file mode 100644
> > > > index 0000000..613b7f9
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > > @@ -0,0 +1,41 @@
> > > > +Synopsys DesignWare CSI-2 Host controller
> > > > +
> > > > +Description
> > > > +-----------
> > > > +
> > > > +This HW block is used to receive image coming from an MIPI CSI-2 compatible
> > > > +camera.
> > > > +
> > > > +Required properties:
> > > > +- compatible		: shall be "snps,dw-csi"
> > > > +- reg			: physical base address and size of the device memory
> > > > +			  mapped registers;
> > > > +- interrupts		: DW CSI-2 Host interrupts
> > > > +- phys			: List of one PHY specifier (as defined in
> > > > +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
> > > > +			  This PHY is a MIPI DPHY working in RX mode.
> > > > +- resets		: Reference to a reset controller (optional)
> > > > +
> > > > +The per-board settings:
> > > > + - port sub-node describing a single endpoint connected to the camera as
> > > > +   described in video-interfaces.txt[1].
> > > 
> > > Which endpoint properties in video-interfaces.txt are relevant for the
> > > hardware? Which values may they have?
> > > 
> > 
> > Currently I'm using only two properties "data-lanes" and "bus-width", but 
> > I have plans to add blanking info also.
> > I will add more info.
> 
> Isn't blanking defined by what the transmitter seneds? Or do you have
> hardware limitations on the receiver side?
> 

When we use this IP in prototyping we configure blanking at the receiver 
side.
Some cameras don't have blanking configuration capabilities so we 
configure it on the RX side.

> I've only heard of one such case before, and it was a very old parallel
> receiver.
> 
> If you have a CSI-2 receiver, bus-width isn't relevant --- it's for paralle
> interfaces only. Please add data-lanes to required endpoint properties.
> 

I used bus-width property in the Synopsys IPI (Image Pixel Interface) 
that enables direct video stream access.
This interface is an output that can be 16-bit or 48-bit, that's why I 
used bus-width property.

> -- 
> Regards,
> 
> Sakari Ailus

Thank you,
Luis
Luis de Oliveira July 10, 2019, 10:23 a.m. UTC | #8
Hi Eugen,


From: Eugen.Hristev@microchip.com <Eugen.Hristev@microchip.com>
Date: Wed, Jul 10, 2019 at 07:53:02

> 
> 
> On 09.07.2019 20:08, Luis de Oliveira wrote:
> 
> > 
> > Hi Eugen,
> > 
> > 
> > From: Eugen.Hristev@microchip.com <Eugen.Hristev@microchip.com>
> > Date: Tue, Jul 09, 2019 at 15:33:50
> > 
> >>
> >>
> >> On 11.06.2019 22:20, Luis Oliveira wrote:
> >>> From: Luis Oliveira <lolivei@synopsys.com>
> >>>
> >>> Add bindings for Synopsys DesignWare MIPI CSI-2 host.
> >>>
> >>> Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
> >>> ---
> >>> Changelog
> >>> v3-v4
> >>> - remove "plat" from the block name @rob @laurent
> >>> - remove "phy-names" when single-entry @rob
> >>> - remove "snps,output-type" -> went to the driver config @laurent
> >>>
> >>>    .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
> >>>    1 file changed, 41 insertions(+)
> >>>    create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> >>> new file mode 100644
> >>> index 0000000..613b7f9
> >>> --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> >>> @@ -0,0 +1,41 @@
> >>> +Synopsys DesignWare CSI-2 Host controller
> >>> +
> >>> +Description
> >>> +-----------
> >>> +
> >>> +This HW block is used to receive image coming from an MIPI CSI-2 compatible
> >>> +camera.
> >>> +
> >>> +Required properties:
> >>> +- compatible		: shall be "snps,dw-csi"
> >>> +- reg			: physical base address and size of the device memory
> >>> +			  mapped registers;
> >>> +- interrupts		: DW CSI-2 Host interrupts
> >>> +- phys			: List of one PHY specifier (as defined in
> >>> +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
> >>> +			  This PHY is a MIPI DPHY working in RX mode.
> >>> +- resets		: Reference to a reset controller (optional)
> >>> +
> >>> +The per-board settings:
> >>> + - port sub-node describing a single endpoint connected to the camera as
> >>> +   described in video-interfaces.txt[1].
> >>> +
> >>> +Example:
> >>> +
> >>> +	csi2: csi2@3000 {
> >>> +		compatible = "snps,dw-csi";
> >>> +		#address-cells = <1>;
> >>> +		#size-cells = <0>;
> >>> +		reg = < 0x03000 0x7FF>;
> >>> +		phys = <&mipi_dphy_rx>;
> >>> +		resets = <&dw_rst 1>;
> >>> +		interrupts = <2>;
> >>> +
> >>> +		port@0 {
> >>> +			reg = <0>;
> >>> +			csi_ep1: endpoint {
> >>> +				remote-endpoint = <&camera_1>;
> >>> +				data-lanes = <1 2>;
> >>> +			};
> >>
> >> Hello Luis,
> >>
> >> Which is the output port (endpoint) : how to connect the output of
> >> csi2host to another node ?
> >> I mean, the second port of this block, or, how is the data taken from
> >> csi2host ?
> >>
> > 
> > I understand your question, I think you guessed this is not the complete
> > pipeline (I have a top driver that interacts with this one).
> > I was not planning to submit it, do you think I should?
> 
> Yes please, you can have the patch with subject DO NOT MERGE if you do 
> not want that patch to be included in the kernel and just for reference.
> but it would help me in understanding your setup
> 
> Thanks !
> 
Ok, thank you. I will included it next.

> > 
> > The behavior is very similar with this one
> > ./drivers/media/platform/exynos4-is/media-dev.c
> > 
> > 
> >> Thanks,
> >>
> >> Eugen
> >>
> >>> +		};
> >>> +	};
> >>>
> > 
> > Thanks,
> > Luis
> >
Sakari Ailus July 25, 2019, 8:02 p.m. UTC | #9
Hi Luis,

On Wed, Jul 10, 2019 at 10:20:55AM +0000, Luis de Oliveira wrote:
> Hi Sakari,
> 
> From: Sakari Ailus <sakari.ailus@iki.fi>
> Date: Tue, Jul 09, 2019 at 19:25:00
> 
> > Hi Luis,
> > 
> > On Mon, Jul 08, 2019 at 03:21:50PM +0000, Luis de Oliveira wrote:
> > > Hi Sakari,
> > > 
> > > Thank you for your feedback.
> > > I have my comments inline.
> > > 
> > > From: Sakari Ailus <sakari.ailus@iki.fi>
> > > Date: Fri, Jun 28, 2019 at 15:13:26
> > > 
> > > > Hi Luis,
> > > > 
> > > > Thank you for the patchset.
> > > > 
> > > > On Tue, Jun 11, 2019 at 09:20:50PM +0200, Luis Oliveira wrote:
> > > > > From: Luis Oliveira <lolivei@synopsys.com>
> > > > > 
> > > > > Add bindings for Synopsys DesignWare MIPI CSI-2 host.
> > > > > 
> > > > > Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
> > > > > ---
> > > > > Changelog
> > > > > v3-v4
> > > > > - remove "plat" from the block name @rob @laurent
> > > > > - remove "phy-names" when single-entry @rob
> > > > > - remove "snps,output-type" -> went to the driver config @laurent
> > > > > 
> > > > >  .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
> > > > >  1 file changed, 41 insertions(+)
> > > > >  create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > > > 
> > > > > diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > > > new file mode 100644
> > > > > index 0000000..613b7f9
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > > > @@ -0,0 +1,41 @@
> > > > > +Synopsys DesignWare CSI-2 Host controller
> > > > > +
> > > > > +Description
> > > > > +-----------
> > > > > +
> > > > > +This HW block is used to receive image coming from an MIPI CSI-2 compatible
> > > > > +camera.
> > > > > +
> > > > > +Required properties:
> > > > > +- compatible		: shall be "snps,dw-csi"
> > > > > +- reg			: physical base address and size of the device memory
> > > > > +			  mapped registers;
> > > > > +- interrupts		: DW CSI-2 Host interrupts
> > > > > +- phys			: List of one PHY specifier (as defined in
> > > > > +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
> > > > > +			  This PHY is a MIPI DPHY working in RX mode.
> > > > > +- resets		: Reference to a reset controller (optional)
> > > > > +
> > > > > +The per-board settings:
> > > > > + - port sub-node describing a single endpoint connected to the camera as
> > > > > +   described in video-interfaces.txt[1].
> > > > 
> > > > Which endpoint properties in video-interfaces.txt are relevant for the
> > > > hardware? Which values may they have?
> > > > 
> > > 
> > > Currently I'm using only two properties "data-lanes" and "bus-width", but 
> > > I have plans to add blanking info also.
> > > I will add more info.
> > 
> > Isn't blanking defined by what the transmitter seneds? Or do you have
> > hardware limitations on the receiver side?
> > 
> 
> When we use this IP in prototyping we configure blanking at the receiver 
> side.
> Some cameras don't have blanking configuration capabilities so we 
> configure it on the RX side.

I haven't come across a CSI-2 connected camera without some kind of
blanking configuration capabilities. Even if there was one, you couldn't
configure blanking from the receiver side.

Please document that the data-lanes property is required, and which values
are possible.

> 
> > I've only heard of one such case before, and it was a very old parallel
> > receiver.
> > 
> > If you have a CSI-2 receiver, bus-width isn't relevant --- it's for paralle
> > interfaces only. Please add data-lanes to required endpoint properties.
> > 
> 
> I used bus-width property in the Synopsys IPI (Image Pixel Interface) 
> that enables direct video stream access.
> This interface is an output that can be 16-bit or 48-bit, that's why I 
> used bus-width property.

Does this device write the image data to system memory, or is it another
device? If there's another one, then you should probably have another port
to describe that connection.
Luis de Oliveira July 26, 2019, 9:50 a.m. UTC | #10
Hi Sakari,

Thank you for the review, my answers inline.

> From: Sakari Ailus <sakari.ailus@iki.fi>
> Date: Thu, Jul 25, 2019 at 21:02:11
>
> Hi Luis,
> 
> On Wed, Jul 10, 2019 at 10:20:55AM +0000, Luis de Oliveira wrote:
> > Hi Sakari,
> > 
> > From: Sakari Ailus <sakari.ailus@iki.fi>
> > Date: Tue, Jul 09, 2019 at 19:25:00
> > 
> > > Hi Luis,
> > > 
> > > On Mon, Jul 08, 2019 at 03:21:50PM +0000, Luis de Oliveira wrote:
> > > > Hi Sakari,
> > > > 
> > > > Thank you for your feedback.
> > > > I have my comments inline.
> > > > 
> > > > From: Sakari Ailus <sakari.ailus@iki.fi>
> > > > Date: Fri, Jun 28, 2019 at 15:13:26
> > > > 
> > > > > Hi Luis,
> > > > > 
> > > > > Thank you for the patchset.
> > > > > 
> > > > > On Tue, Jun 11, 2019 at 09:20:50PM +0200, Luis Oliveira wrote:
> > > > > > From: Luis Oliveira <lolivei@synopsys.com>
> > > > > > 
> > > > > > Add bindings for Synopsys DesignWare MIPI CSI-2 host.
> > > > > > 
> > > > > > Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
> > > > > > ---
> > > > > > Changelog
> > > > > > v3-v4
> > > > > > - remove "plat" from the block name @rob @laurent
> > > > > > - remove "phy-names" when single-entry @rob
> > > > > > - remove "snps,output-type" -> went to the driver config @laurent
> > > > > > 
> > > > > >  .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
> > > > > >  1 file changed, 41 insertions(+)
> > > > > >  create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > > > > 
> > > > > > diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > > > > new file mode 100644
> > > > > > index 0000000..613b7f9
> > > > > > --- /dev/null
> > > > > > +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
> > > > > > @@ -0,0 +1,41 @@
> > > > > > +Synopsys DesignWare CSI-2 Host controller
> > > > > > +
> > > > > > +Description
> > > > > > +-----------
> > > > > > +
> > > > > > +This HW block is used to receive image coming from an MIPI CSI-2 compatible
> > > > > > +camera.
> > > > > > +
> > > > > > +Required properties:
> > > > > > +- compatible		: shall be "snps,dw-csi"
> > > > > > +- reg			: physical base address and size of the device memory
> > > > > > +			  mapped registers;
> > > > > > +- interrupts		: DW CSI-2 Host interrupts
> > > > > > +- phys			: List of one PHY specifier (as defined in
> > > > > > +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
> > > > > > +			  This PHY is a MIPI DPHY working in RX mode.
> > > > > > +- resets		: Reference to a reset controller (optional)
> > > > > > +
> > > > > > +The per-board settings:
> > > > > > + - port sub-node describing a single endpoint connected to the camera as
> > > > > > +   described in video-interfaces.txt[1].
> > > > > 
> > > > > Which endpoint properties in video-interfaces.txt are relevant for the
> > > > > hardware? Which values may they have?
> > > > > 
> > > > 
> > > > Currently I'm using only two properties "data-lanes" and "bus-width", but 
> > > > I have plans to add blanking info also.
> > > > I will add more info.
> > > 
> > > Isn't blanking defined by what the transmitter seneds? Or do you have
> > > hardware limitations on the receiver side?
> > > 
> > 
> > When we use this IP in prototyping we configure blanking at the receiver 
> > side.
> > Some cameras don't have blanking configuration capabilities so we 
> > configure it on the RX side.
> 
> I haven't come across a CSI-2 connected camera without some kind of
> blanking configuration capabilities. Even if there was one, you couldn't
> configure blanking from the receiver side.
> 
> Please document that the data-lanes property is required, and which values
> are possible.
> 

Ok, I will add the data-lanes property to the Documentation.

> > 
> > > I've only heard of one such case before, and it was a very old parallel
> > > receiver.
> > > 
> > > If you have a CSI-2 receiver, bus-width isn't relevant --- it's for paralle
> > > interfaces only. Please add data-lanes to required endpoint properties.
> > > 
> > 
> > I used bus-width property in the Synopsys IPI (Image Pixel Interface) 
> > that enables direct video stream access.
> > This interface is an output that can be 16-bit or 48-bit, that's why I 
> > used bus-width property.
> 
> Does this device write the image data to system memory, or is it another
> device? If there's another one, then you should probably have another port
> to describe that connection.
> 

Yes, it is another. I can add that connection port also. 


> -- 
> Kind regards,
> 
> Sakari Ailus

Thank you,

Luis
Eugen Hristev July 26, 2019, 11:13 a.m. UTC | #11
On 26.07.2019 12:50, Luis de Oliveira wrote:
> Hi Sakari,
> 
> Thank you for the review, my answers inline.
> 
>> From: Sakari Ailus <sakari.ailus@iki.fi>
>> Date: Thu, Jul 25, 2019 at 21:02:11
>>
>> Hi Luis,
>>
>> On Wed, Jul 10, 2019 at 10:20:55AM +0000, Luis de Oliveira wrote:
>>> Hi Sakari,
>>>
>>> From: Sakari Ailus <sakari.ailus@iki.fi>
>>> Date: Tue, Jul 09, 2019 at 19:25:00
>>>
>>>> Hi Luis,
>>>>
>>>> On Mon, Jul 08, 2019 at 03:21:50PM +0000, Luis de Oliveira wrote:
>>>>> Hi Sakari,
>>>>>
>>>>> Thank you for your feedback.
>>>>> I have my comments inline.
>>>>>
>>>>> From: Sakari Ailus <sakari.ailus@iki.fi>
>>>>> Date: Fri, Jun 28, 2019 at 15:13:26
>>>>>
>>>>>> Hi Luis,
>>>>>>
>>>>>> Thank you for the patchset.
>>>>>>
>>>>>> On Tue, Jun 11, 2019 at 09:20:50PM +0200, Luis Oliveira wrote:
>>>>>>> From: Luis Oliveira <lolivei@synopsys.com>
>>>>>>>
>>>>>>> Add bindings for Synopsys DesignWare MIPI CSI-2 host.
>>>>>>>
>>>>>>> Signed-off-by: Luis Oliveira <lolivei@synopsys.com>
>>>>>>> ---
>>>>>>> Changelog
>>>>>>> v3-v4
>>>>>>> - remove "plat" from the block name @rob @laurent
>>>>>>> - remove "phy-names" when single-entry @rob
>>>>>>> - remove "snps,output-type" -> went to the driver config @laurent
>>>>>>>
>>>>>>>   .../devicetree/bindings/media/snps,dw-csi.txt      | 41 ++++++++++++++++++++++
>>>>>>>   1 file changed, 41 insertions(+)
>>>>>>>   create mode 100644 Documentation/devicetree/bindings/media/snps,dw-csi.txt
>>>>>>>
>>>>>>> diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
>>>>>>> new file mode 100644
>>>>>>> index 0000000..613b7f9
>>>>>>> --- /dev/null
>>>>>>> +++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
>>>>>>> @@ -0,0 +1,41 @@
>>>>>>> +Synopsys DesignWare CSI-2 Host controller
>>>>>>> +
>>>>>>> +Description
>>>>>>> +-----------
>>>>>>> +
>>>>>>> +This HW block is used to receive image coming from an MIPI CSI-2 compatible
>>>>>>> +camera.
>>>>>>> +
>>>>>>> +Required properties:
>>>>>>> +- compatible		: shall be "snps,dw-csi"
>>>>>>> +- reg			: physical base address and size of the device memory
>>>>>>> +			  mapped registers;
>>>>>>> +- interrupts		: DW CSI-2 Host interrupts
>>>>>>> +- phys			: List of one PHY specifier (as defined in
>>>>>>> +			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
>>>>>>> +			  This PHY is a MIPI DPHY working in RX mode.
>>>>>>> +- resets		: Reference to a reset controller (optional)
>>>>>>> +
>>>>>>> +The per-board settings:
>>>>>>> + - port sub-node describing a single endpoint connected to the camera as
>>>>>>> +   described in video-interfaces.txt[1].
>>>>>>
>>>>>> Which endpoint properties in video-interfaces.txt are relevant for the
>>>>>> hardware? Which values may they have?
>>>>>>
>>>>>
>>>>> Currently I'm using only two properties "data-lanes" and "bus-width", but
>>>>> I have plans to add blanking info also.
>>>>> I will add more info.
>>>>
>>>> Isn't blanking defined by what the transmitter seneds? Or do you have
>>>> hardware limitations on the receiver side?
>>>>
>>>
>>> When we use this IP in prototyping we configure blanking at the receiver
>>> side.
>>> Some cameras don't have blanking configuration capabilities so we
>>> configure it on the RX side.
>>
>> I haven't come across a CSI-2 connected camera without some kind of
>> blanking configuration capabilities. Even if there was one, you couldn't
>> configure blanking from the receiver side.
>>
>> Please document that the data-lanes property is required, and which values
>> are possible.
>>
> 
> Ok, I will add the data-lanes property to the Documentation.
> 
>>>
>>>> I've only heard of one such case before, and it was a very old parallel
>>>> receiver.
>>>>
>>>> If you have a CSI-2 receiver, bus-width isn't relevant --- it's for paralle
>>>> interfaces only. Please add data-lanes to required endpoint properties.
>>>>
>>>
>>> I used bus-width property in the Synopsys IPI (Image Pixel Interface)
>>> that enables direct video stream access.
>>> This interface is an output that can be 16-bit or 48-bit, that's why I
>>> used bus-width property.
>>
>> Does this device write the image data to system memory, or is it another
>> device? If there's another one, then you should probably have another port
>> to describe that connection.
>>
> 
> Yes, it is another. I can add that connection port also.

Yes please. It is interesting for me to see how to connect the output of 
this device to another media device, and how to specify the bus in this 
situation.

Thanks,
Eugen

> 
> 
>> -- 
>> Kind regards,
>>
>> Sakari Ailus
> 
> Thank you,
> 
> Luis
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/snps,dw-csi.txt b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
new file mode 100644
index 0000000..613b7f9
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/snps,dw-csi.txt
@@ -0,0 +1,41 @@ 
+Synopsys DesignWare CSI-2 Host controller
+
+Description
+-----------
+
+This HW block is used to receive image coming from an MIPI CSI-2 compatible
+camera.
+
+Required properties:
+- compatible		: shall be "snps,dw-csi"
+- reg			: physical base address and size of the device memory
+			  mapped registers;
+- interrupts		: DW CSI-2 Host interrupts
+- phys			: List of one PHY specifier (as defined in
+			  Documentation/devicetree/bindings/phy/phy-bindings.txt).
+			  This PHY is a MIPI DPHY working in RX mode.
+- resets		: Reference to a reset controller (optional)
+
+The per-board settings:
+ - port sub-node describing a single endpoint connected to the camera as
+   described in video-interfaces.txt[1].
+
+Example:
+
+	csi2: csi2@3000 {
+		compatible = "snps,dw-csi";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = < 0x03000 0x7FF>;
+		phys = <&mipi_dphy_rx>;
+		resets = <&dw_rst 1>;
+		interrupts = <2>;
+
+		port@0 {
+			reg = <0>;
+			csi_ep1: endpoint {
+				remote-endpoint = <&camera_1>;
+				data-lanes = <1 2>;
+			};
+		};
+	};