diff mbox

[3/4] Documentation: dt: Add bindings documentation for CSI-2 Host Video Platform

Message ID 95825021f5eae29a118ce0a2570c5c1886023110.1488885081.git.roliveir@synopsys.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ramiro Oliveira March 7, 2017, 2:37 p.m. UTC
Create device tree bindings documentation for the CSI-2 Host Video
 platform.

Signed-off-by: Ramiro Oliveira <roliveir@synopsys.com>
---
 .../devicetree/bindings/media/snps,plat-csi2.txt   | 77 ++++++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/snps,plat-csi2.txt

Comments

Sakari Ailus March 8, 2017, 1:18 p.m. UTC | #1
Hi Ramiro,

On Tue, Mar 07, 2017 at 02:37:50PM +0000, Ramiro Oliveira wrote:
> Create device tree bindings documentation for the CSI-2 Host Video
>  platform.

Extra space here.

> 
> Signed-off-by: Ramiro Oliveira <roliveir@synopsys.com>
> ---
>  .../devicetree/bindings/media/snps,plat-csi2.txt   | 77 ++++++++++++++++++++++
>  1 file changed, 77 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/snps,plat-csi2.txt
> 
> diff --git a/Documentation/devicetree/bindings/media/snps,plat-csi2.txt b/Documentation/devicetree/bindings/media/snps,plat-csi2.txt
> new file mode 100644
> index 000000000000..f559257a0a44
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/snps,plat-csi2.txt
> @@ -0,0 +1,77 @@
> +Synopsys DesignWare CSI-2 Host Video Platform
> +
> +The Synopsys DesignWare CSI-2 Host Video Device subsystem comprises of multiple
> +sub-devices represented by separate device tree nodes. Currently this includes:
> +plat-csi2, video-device, and dw-mipi-csi.
> +
> +The sub-subdevices are defined as child nodes of the common 'camera'.
> +
> +Common 'camera' node
> +--------------------
> +
> +Required properties:
> +
> +- compatible: must be "snps,plat-csi2", "simple-bus"
> +
> +The 'camera' node must include at least one 'video-device' and one 'dw-mipi-csi'
> +child node.
> +
> +'video-device' device nodes
> +-------------------
> +
> +Required properties:
> +
> +- compatible: "snps,video-device"
> +- dmas, dma-names: List of one DMA specifier and identifier string (as defined
> +  in Documentation/devicetree/bindings/dma/dma.txt) per port. Each port
> +  requires a DMA channel with the identifier string set to "vdma" followed by
> +  the port index.
> +
> +Image sensor nodes
> +------------------
> +
> +The sensor device nodes should be added to their control bus controller (e.g.
> +I2C0) nodes and linked to a port node in the dw-mipi-csi,using the common video
> +interfaces bindings, defined in video-interfaces.txt.

You should defined which properties you explicitly support on endpoints and
elsewhere. There are some optional ones for CSI-2, for instance.

> +
> +Example:
> +
> +
> +	camera {
> +		compatible = "snps,plat-csi2", "simple-bus";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;

Is there something missing here?

> +			video_device: video-device@0x10000 {
> +				compatible = "snps,video-device";
> +				dmas = <&axi_vdma_0 0>;
> +				dma-names = "vdma0";
> +			};
> +
> +			csi2:	csi2@0x03000 {
> +				compatible = "snps,dw-mipi-csi";
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				reg = < 0x03000 0x7FF>;
> +				interrupts = <2>;
> +				phys = <&mipi_phy_ctrl1 0>;
> +				resets = <&csi2_rst 1>;
> +
> +				output-type = <2>;
> +				ipi-mode = <0>;
> +				ipi-color-mode = <0>;
> +				ipi-auto-flush = <1>;
> +				virtual-channel = <0>;
> +
> +				port@1 {

What are the valid ports for this device?

> +					reg = <1>;
> +					csi1_ep1: endpoint {
> +						remote-endpoint = <&camera>;
> +						data-lanes = <1 2>;
> +					};
> +				};
> +			};
> +		};
> +	};
> +
> +The dw-mipi-csi device binding is defined in snps,dw-mipi-csi.txt.
Rob Herring (Arm) March 15, 2017, 6:35 p.m. UTC | #2
On Tue, Mar 07, 2017 at 02:37:50PM +0000, Ramiro Oliveira wrote:
> Create device tree bindings documentation for the CSI-2 Host Video
>  platform.
> 
> Signed-off-by: Ramiro Oliveira <roliveir@synopsys.com>
> ---
>  .../devicetree/bindings/media/snps,plat-csi2.txt   | 77 ++++++++++++++++++++++
>  1 file changed, 77 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/snps,plat-csi2.txt
> 
> diff --git a/Documentation/devicetree/bindings/media/snps,plat-csi2.txt b/Documentation/devicetree/bindings/media/snps,plat-csi2.txt
> new file mode 100644
> index 000000000000..f559257a0a44
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/snps,plat-csi2.txt
> @@ -0,0 +1,77 @@
> +Synopsys DesignWare CSI-2 Host Video Platform
> +
> +The Synopsys DesignWare CSI-2 Host Video Device subsystem comprises of multiple
> +sub-devices represented by separate device tree nodes. Currently this includes:
> +plat-csi2, video-device, and dw-mipi-csi.
> +
> +The sub-subdevices are defined as child nodes of the common 'camera'.
> +
> +Common 'camera' node
> +--------------------
> +
> +Required properties:
> +
> +- compatible: must be "snps,plat-csi2", "simple-bus"
> +
> +The 'camera' node must include at least one 'video-device' and one 'dw-mipi-csi'
> +child node.
> +
> +'video-device' device nodes
> +-------------------
> +
> +Required properties:
> +
> +- compatible: "snps,video-device"
> +- dmas, dma-names: List of one DMA specifier and identifier string (as defined
> +  in Documentation/devicetree/bindings/dma/dma.txt) per port. Each port
> +  requires a DMA channel with the identifier string set to "vdma" followed by
> +  the port index.
> +
> +Image sensor nodes
> +------------------
> +
> +The sensor device nodes should be added to their control bus controller (e.g.
> +I2C0) nodes and linked to a port node in the dw-mipi-csi,using the common video
> +interfaces bindings, defined in video-interfaces.txt.
> +
> +Example:
> +
> +
> +	camera {
> +		compatible = "snps,plat-csi2", "simple-bus";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +			video_device: video-device@0x10000 {

Drop the '0x' and any leading 0s on unit addresses.

> +				compatible = "snps,video-device";
> +				dmas = <&axi_vdma_0 0>;
> +				dma-names = "vdma0";
> +			};

If video-device is not a real device, then you shouldn't need a DT node. 
I need a better explanation or diagram of what the h/w blocks and 
connections look like here.

From the looks of this, you can just move dmas to the csi2 node. But I 
don't think that is right, because you can't generally just use an 
external DMA controller with camera data (maybe for validation, but it's 
not something you see in SoCs).

> +
> +			csi2:	csi2@0x03000 {
> +				compatible = "snps,dw-mipi-csi";
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				reg = < 0x03000 0x7FF>;
> +				interrupts = <2>;
> +				phys = <&mipi_phy_ctrl1 0>;
> +				resets = <&csi2_rst 1>;
> +
> +				output-type = <2>;
> +				ipi-mode = <0>;
> +				ipi-color-mode = <0>;
> +				ipi-auto-flush = <1>;
> +				virtual-channel = <0>;
> +
> +				port@1 {
> +					reg = <1>;
> +					csi1_ep1: endpoint {
> +						remote-endpoint = <&camera>;
> +						data-lanes = <1 2>;
> +					};
> +				};
> +			};
> +		};
> +	};
> +
> +The dw-mipi-csi device binding is defined in snps,dw-mipi-csi.txt.
> -- 
> 2.11.0
> 
>
Ramiro Oliveira May 16, 2017, 6:02 p.m. UTC | #3
Hi Sakari,

Thank you for your feedback and sorry for the late response.

On 3/8/2017 1:18 PM, Sakari Ailus wrote:
> Hi Ramiro,
> 
> On Tue, Mar 07, 2017 at 02:37:50PM +0000, Ramiro Oliveira wrote:
>> Create device tree bindings documentation for the CSI-2 Host Video
>>  platform.
> 
> Extra space here.
> 
>>
>> Signed-off-by: Ramiro Oliveira <roliveir@synopsys.com>
>> ---
>>  .../devicetree/bindings/media/snps,plat-csi2.txt   | 77 ++++++++++++++++++++++
>>  1 file changed, 77 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/media/snps,plat-csi2.txt
>>
>> diff --git a/Documentation/devicetree/bindings/media/snps,plat-csi2.txt b/Documentation/devicetree/bindings/media/snps,plat-csi2.txt
>> new file mode 100644
>> index 000000000000..f559257a0a44
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/media/snps,plat-csi2.txt
>> @@ -0,0 +1,77 @@
>> +Synopsys DesignWare CSI-2 Host Video Platform
>> +
>> +The Synopsys DesignWare CSI-2 Host Video Device subsystem comprises of multiple
>> +sub-devices represented by separate device tree nodes. Currently this includes:
>> +plat-csi2, video-device, and dw-mipi-csi.
>> +
>> +The sub-subdevices are defined as child nodes of the common 'camera'.
>> +
>> +Common 'camera' node
>> +--------------------
>> +
>> +Required properties:
>> +
>> +- compatible: must be "snps,plat-csi2", "simple-bus"
>> +
>> +The 'camera' node must include at least one 'video-device' and one 'dw-mipi-csi'
>> +child node.
>> +
>> +'video-device' device nodes
>> +-------------------
>> +
>> +Required properties:
>> +
>> +- compatible: "snps,video-device"
>> +- dmas, dma-names: List of one DMA specifier and identifier string (as defined
>> +  in Documentation/devicetree/bindings/dma/dma.txt) per port. Each port
>> +  requires a DMA channel with the identifier string set to "vdma" followed by
>> +  the port index.
>> +
>> +Image sensor nodes
>> +------------------
>> +
>> +The sensor device nodes should be added to their control bus controller (e.g.
>> +I2C0) nodes and linked to a port node in the dw-mipi-csi,using the common video
>> +interfaces bindings, defined in video-interfaces.txt.
> 
> You should defined which properties you explicitly support on endpoints and
> elsewhere. There are some optional ones for CSI-2, for instance.
> 

I'll take a look and see if it makes sense to add support for some properties

>> +
>> +Example:
>> +
>> +
>> +	camera {
>> +		compatible = "snps,plat-csi2", "simple-bus";
>> +		#address-cells = <1>;
>> +		#size-cells = <1>;
>> +		ranges;
> 
> Is there something missing here?
> 

I don't think so, but should I add something?

>> +			video_device: video-device@0x10000 {
>> +				compatible = "snps,video-device";
>> +				dmas = <&axi_vdma_0 0>;
>> +				dma-names = "vdma0";
>> +			};
>> +
>> +			csi2:	csi2@0x03000 {
>> +				compatible = "snps,dw-mipi-csi";
>> +				#address-cells = <1>;
>> +				#size-cells = <0>;
>> +				reg = < 0x03000 0x7FF>;
>> +				interrupts = <2>;
>> +				phys = <&mipi_phy_ctrl1 0>;
>> +				resets = <&csi2_rst 1>;
>> +
>> +				output-type = <2>;
>> +				ipi-mode = <0>;
>> +				ipi-color-mode = <0>;
>> +				ipi-auto-flush = <1>;
>> +				virtual-channel = <0>;
>> +
>> +				port@1 {
> 
> What are the valid ports for this device?
> 

I don't think I understand what you mean by valid.

>> +					reg = <1>;
>> +					csi1_ep1: endpoint {
>> +						remote-endpoint = <&camera>;
>> +						data-lanes = <1 2>;
>> +					};
>> +				};
>> +			};
>> +		};
>> +	};
>> +
>> +The dw-mipi-csi device binding is defined in snps,dw-mipi-csi.txt.
>
Ramiro Oliveira May 16, 2017, 6:05 p.m. UTC | #4
Hi Rob,

Once again sorry for the late response and thank you for your feedback.

On 3/15/2017 6:35 PM, Rob Herring wrote:
> On Tue, Mar 07, 2017 at 02:37:50PM +0000, Ramiro Oliveira wrote:
>> Create device tree bindings documentation for the CSI-2 Host Video
>>  platform.
>>
>> Signed-off-by: Ramiro Oliveira <roliveir@synopsys.com>
>> ---
>>  .../devicetree/bindings/media/snps,plat-csi2.txt   | 77 ++++++++++++++++++++++
>>  1 file changed, 77 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/media/snps,plat-csi2.txt
>>
>> diff --git a/Documentation/devicetree/bindings/media/snps,plat-csi2.txt b/Documentation/devicetree/bindings/media/snps,plat-csi2.txt
>> new file mode 100644
>> index 000000000000..f559257a0a44
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/media/snps,plat-csi2.txt
>> @@ -0,0 +1,77 @@
>> +Synopsys DesignWare CSI-2 Host Video Platform
>> +
>> +The Synopsys DesignWare CSI-2 Host Video Device subsystem comprises of multiple
>> +sub-devices represented by separate device tree nodes. Currently this includes:
>> +plat-csi2, video-device, and dw-mipi-csi.
>> +
>> +The sub-subdevices are defined as child nodes of the common 'camera'.
>> +
>> +Common 'camera' node
>> +--------------------
>> +
>> +Required properties:
>> +
>> +- compatible: must be "snps,plat-csi2", "simple-bus"
>> +
>> +The 'camera' node must include at least one 'video-device' and one 'dw-mipi-csi'
>> +child node.
>> +
>> +'video-device' device nodes
>> +-------------------
>> +
>> +Required properties:
>> +
>> +- compatible: "snps,video-device"
>> +- dmas, dma-names: List of one DMA specifier and identifier string (as defined
>> +  in Documentation/devicetree/bindings/dma/dma.txt) per port. Each port
>> +  requires a DMA channel with the identifier string set to "vdma" followed by
>> +  the port index.
>> +
>> +Image sensor nodes
>> +------------------
>> +
>> +The sensor device nodes should be added to their control bus controller (e.g.
>> +I2C0) nodes and linked to a port node in the dw-mipi-csi,using the common video
>> +interfaces bindings, defined in video-interfaces.txt.
>> +
>> +Example:
>> +
>> +
>> +	camera {
>> +		compatible = "snps,plat-csi2", "simple-bus";
>> +		#address-cells = <1>;
>> +		#size-cells = <1>;
>> +		ranges;
>> +			video_device: video-device@0x10000 {
> 
> Drop the '0x' and any leading 0s on unit addresses.
> 

Sure.

>> +				compatible = "snps,video-device";
>> +				dmas = <&axi_vdma_0 0>;
>> +				dma-names = "vdma0";
>> +			};
> 
> If video-device is not a real device, then you shouldn't need a DT node. 
> I need a better explanation or diagram of what the h/w blocks and 
> connections look like here.
> 
> From the looks of this, you can just move dmas to the csi2 node. But I 
> don't think that is right, because you can't generally just use an 
> external DMA controller with camera data (maybe for validation, but it's 
> not something you see in SoCs).
> 

Actually we do use an external DMA controller directly connected to the CSI-2
Host controller, although, like you said, we use it for HW validation.

I "created" the video-device in order to remove the DMA engine control from the
CSI-2 Host driver, in order to make it more useful to other people.

>> +
>> +			csi2:	csi2@0x03000 {
>> +				compatible = "snps,dw-mipi-csi";
>> +				#address-cells = <1>;
>> +				#size-cells = <0>;
>> +				reg = < 0x03000 0x7FF>;
>> +				interrupts = <2>;
>> +				phys = <&mipi_phy_ctrl1 0>;
>> +				resets = <&csi2_rst 1>;
>> +
>> +				output-type = <2>;
>> +				ipi-mode = <0>;
>> +				ipi-color-mode = <0>;
>> +				ipi-auto-flush = <1>;
>> +				virtual-channel = <0>;
>> +
>> +				port@1 {
>> +					reg = <1>;
>> +					csi1_ep1: endpoint {
>> +						remote-endpoint = <&camera>;
>> +						data-lanes = <1 2>;
>> +					};
>> +				};
>> +			};
>> +		};
>> +	};
>> +
>> +The dw-mipi-csi device binding is defined in snps,dw-mipi-csi.txt.
>> -- 
>> 2.11.0
>>
>>
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/media/snps,plat-csi2.txt b/Documentation/devicetree/bindings/media/snps,plat-csi2.txt
new file mode 100644
index 000000000000..f559257a0a44
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/snps,plat-csi2.txt
@@ -0,0 +1,77 @@ 
+Synopsys DesignWare CSI-2 Host Video Platform
+
+The Synopsys DesignWare CSI-2 Host Video Device subsystem comprises of multiple
+sub-devices represented by separate device tree nodes. Currently this includes:
+plat-csi2, video-device, and dw-mipi-csi.
+
+The sub-subdevices are defined as child nodes of the common 'camera'.
+
+Common 'camera' node
+--------------------
+
+Required properties:
+
+- compatible: must be "snps,plat-csi2", "simple-bus"
+
+The 'camera' node must include at least one 'video-device' and one 'dw-mipi-csi'
+child node.
+
+'video-device' device nodes
+-------------------
+
+Required properties:
+
+- compatible: "snps,video-device"
+- dmas, dma-names: List of one DMA specifier and identifier string (as defined
+  in Documentation/devicetree/bindings/dma/dma.txt) per port. Each port
+  requires a DMA channel with the identifier string set to "vdma" followed by
+  the port index.
+
+Image sensor nodes
+------------------
+
+The sensor device nodes should be added to their control bus controller (e.g.
+I2C0) nodes and linked to a port node in the dw-mipi-csi,using the common video
+interfaces bindings, defined in video-interfaces.txt.
+
+Example:
+
+
+	camera {
+		compatible = "snps,plat-csi2", "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+			video_device: video-device@0x10000 {
+				compatible = "snps,video-device";
+				dmas = <&axi_vdma_0 0>;
+				dma-names = "vdma0";
+			};
+
+			csi2:	csi2@0x03000 {
+				compatible = "snps,dw-mipi-csi";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = < 0x03000 0x7FF>;
+				interrupts = <2>;
+				phys = <&mipi_phy_ctrl1 0>;
+				resets = <&csi2_rst 1>;
+
+				output-type = <2>;
+				ipi-mode = <0>;
+				ipi-color-mode = <0>;
+				ipi-auto-flush = <1>;
+				virtual-channel = <0>;
+
+				port@1 {
+					reg = <1>;
+					csi1_ep1: endpoint {
+						remote-endpoint = <&camera>;
+						data-lanes = <1 2>;
+					};
+				};
+			};
+		};
+	};
+
+The dw-mipi-csi device binding is defined in snps,dw-mipi-csi.txt.