UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
858 Views
Registered: ‎02-22-2008

OF: /amba_pl/v_demosaic@43c00000: arguments longer than property

I'm working on a custom camera design using a Zynq SOC. I have a ZCU104 board with the IMX274 image sensor. The reVision stack works with this image sensor and has example DTSI files that implement the correct Device Tree. My design is very simple, I have a On-Semi AR0331 image sensor using the parallel IO interface. This is connected to a small custom IP block that converts the parallel data to an AXIS master interface. That data is fed into a demosaic block, then a VDMA block to write RGB frames to RAM. I have a bare metal implementation of this working. 

IP design.JPG

My next step is to get this working in Linux. So I started with the reVision DTSI files:

#include <dt-bindings/media/xilinx-vip.h>

&amba {
	axi_iic_0_sensor: i2c@a00a0000 {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "xlnx,xps-iic-2.00.a";
		interrupt-parent = <&axi_intc>;
		interrupts = <8 2>;
		reg = <0x0 0xa00a0000 0x0 0x10000>;
		clocks = <&axi_lite_clk>;
	};

	csiss_1: csiss@a0060000 {
		compatible = "xlnx,mipi-csi2-rx-subsystem-3.0";
		reg = <0x0 0xa0060000 0x0 0x10000>;
		clocks = <&axi_stream_clk>;
		interrupt-parent = <&axi_intc>;
		interrupts = <6 2>;

		xlnx,csi-pxl-format = "RAW8";
		xlnx,axis-tdata-width = <0x20>;
		xlnx,max-lanes = <0x4>;
		xlnx,en-active-lanes;
		xlnx,vc = <0x4>;
		xlnx,ppc = <0x4>;
		xlnx,vfb;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				xlnx,video-format = <XVIP_VF_MONO_SENSOR>;
				xlnx,video-width = <8>;
				xlnx,cfa-pattern = "rggb";

				csiss_out: endpoint {
					remote-endpoint = <&demosaic_in>;
				};
			};
			port@1 {
				reg = <1>;

				xlnx,video-format = <XVIP_VF_MONO_SENSOR>;
				xlnx,video-width = <8>;
				xlnx,cfa-pattern = "rggb";

				csiss_in: endpoint {
					data-lanes = <1 2 3 4>;
					remote-endpoint = <&sensor_out>;
				};
			};
		};
	};

	v_demosaic_0: v_demosaic@b0040000 {
		compatible = "xlnx,v-demosaic";
		reg = <0x0 0xb0040000 0x0 0x10000>;
		clocks = <&axi_stream_clk>;
		reset-gpios = <&gpio 85 1>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				xlnx,video-width = <8>;
				xlnx,cfa-pattern = "rggb";

				demosaic_in: endpoint {
					remote-endpoint = <&csiss_out>;
				};
			};

			port@1 {
				reg = <1>;

				xlnx,video-width = <8>;

				demosaic_out: endpoint {
					remote-endpoint = <&gamma_in>;
				};
			};
		};
	};

	gamma_1: v_gamma@b0010000 {
		compatible = "xlnx,v-gamma-lut";
		reg = <0x0 0xb0010000 0x0 0x10000>;
		clocks = <&axi_stream_clk>;
		reset-gpios = <&gpio 86 1>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				xlnx,video-width = <8>;

				gamma_in: endpoint {
					remote-endpoint = <&demosaic_out>;
				};
			};

			port@1 {
				reg = <1>;

				xlnx,video-width = <8>;

				gamma_out: endpoint {
					remote-endpoint = <&csc_in>;
				};
			};
		};
	};

	csc_1: csc@b0060000 {
		compatible = "xlnx,v-vpss-csc";
		reg = <0x0 0xb0060000 0x0 0x10000>;
		clocks = <&axi_stream_clk>;
		reset-gpios = <&gpio 84 1>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				xlnx,video-format = <XVIP_VF_RBG>;
				xlnx,video-width = <8>;

				csc_in: endpoint {
					remote-endpoint = <&gamma_out>;
				};
			};
			port@1 {
				reg = <1>;

				xlnx,video-format = <XVIP_VF_RBG>;
				xlnx,video-width = <8>;

				csc_out: endpoint {
					remote-endpoint = <&scaler_in>;
				};
			};
		};
	};

	scaler_1: scaler@b0080000 {
		compatible = "xlnx,v-vpss-scaler";
		reg = <0x0 0xb0080000 0x0 0x40000>;
		clocks = <&axi_stream_clk>;
		xlnx,num-hori-taps = <8>;
		xlnx,num-vert-taps = <8>;
		xlnx,pix-per-clk = <2>;
		reset-gpios = <&gpio 82 1>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;
				xlnx,video-format = <XVIP_VF_RBG>;
				xlnx,video-width = <8>;

				scaler_in: endpoint {
					remote-endpoint = <&csc_out>;
				};
			};
			port@1 {
				reg = <1>;
				xlnx,video-format = <XVIP_VF_YUV_422>;
				xlnx,video-width = <8>;

				scaler_out: endpoint {
					remote-endpoint = <&vcap_csi_in>;
				};
			};
		};
	};

	fb_wr_csi: fb_wr@b0020000 {
		compatible = "xlnx,axi-frmbuf-wr-v2";
		reg = <0x0 0xb0020000 0x0 0x10000>;
		#dma-cells = <1>;
		interrupt-parent = <&axi_intc>;
		interrupts = <7 2>;
#ifdef DESIGN_BASE_TRD
		xlnx,vid-formats = "yuyv", "uyvy", "y8";
#endif
#ifdef DESIGN_RV_SS
		xlnx,vid-formats = "yuyv", "uyvy", "y8", "rgb888";
#endif
		reset-gpios = <&gpio 80 1>;
		xlnx,dma-addr-width = <32>;
	};

	vcap_csi {
		compatible = "xlnx,video";
		dmas = <&fb_wr_csi 0>;
		dma-names = "port0";

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;
				direction = "input";

				vcap_csi_in: endpoint {
					remote-endpoint = <&scaler_out>;
				};
			};
		};
	};
};

I've removed everything other than my sensor, the demosaic block, and the vcap interface. It is shown below:

/include/ "system-conf.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/media/xilinx-vip.h>

&amba_pl {
    axi_iic_0: i2c@41600000 {
        ar0331: sensor@10 {
            compatible = "onsemi,ar0331";
            reg = <0x10>;
            #address-cells = <1>;
            #size-cells = <0>;
            reset-gpios = <&axi_gpio_0 9 GPIO_ACTIVE_LOW>;
            clocks = <&clkc 15>;
            status = "okay";

            port {
                ar0331_parallel: endpoint {
                    remote-endpoint = <&demosaic_in>;
                };
            };
        };
    };

    v_demosaic_0: v_demosaic@43c00000 {
        compatible = "xlnx,v-demosaic";
        interrupt-names = "interrupt";
        interrupt-parent = <&intc>;
        interrupts = <0 29 4>;
        reg = <0x43c00000 0x10000>;
        xlnx,s-axi-ctrl-addr-width = <0x6>;
        xlnx,s-axi-ctrl-data-width = <0x20>;

        clocks = <&clkc 15>;
        reset-gpios = <&axi_gpio_0 11 GPIO_ACTIVE_LOW>;

        ports {
            #address-cells = <1>;
            #size-cells = <0>;

            port@0 {
                reg = <0>;

                xlnx,video-width = <12>;
                xlnx,cfa-pattern = "rggb";

                demosaic_in: endpoint {
                    remote-endpoint = <&ar0331_parallel>;
                };
            };

            port@1 {
                reg = <1>;

                xlnx,video-width = <12>;

                demosaic_out: endpoint {
                    remote-endpoint = <&vcap_0_from_vdma_0>;
                };
            };
        };
    };

    vcap0: video_cap {
        compatible = "xlnx,video";
        dmas = <&axi_vdma_1 0>;
        dma-names = "port0";

        ports {
            #address-cells = <1>;
            #size-cells = <0>;

            port@0 {
                reg = <0>;
                direction = "input";
                vcap_0_from_vdma_0: endpoint {
                    remote-endpoint = <&demosaic_out>;
                };
            };
        };
    };
};

When Linux boots I get the following error messages:

[    0.858192] xilinx-video amba_pl:video_cap: device registered
[    0.863077] OF: /amba_pl/v_demosaic@43c00000: arguments longer than property
[    0.868820] xilinx-demosaic 43c00000.v_demosaic: Reset GPIO not setup in DT
[    0.874502] xilinx-demosaic: probe of 43c00000.v_demosaic failed with error -22

I can't figure out what I am doing wrong. The Reset GPIO is present, so I don't understand why that is failing, so I think my problem is with the first statement. This is error is generated in the of_phandle_iterator_next function. 

Does anyone know what is going on?

Thanks in advance.

0 Kudos
3 Replies
Contributor
Contributor
832 Views
Registered: ‎02-22-2008

Re: OF: /amba_pl/v_demosaic@43c00000: arguments longer than property

I tracked down some more details. Linux is trying to find the reset in the device tree. I have the reset to the demosaic block connected to an AXI GPIO in the fabric. The DTS fragment for that GPIO block is auto-generated and shown below.

		axi_gpio_0: gpio@41200000 {
			#gpio-cells = <3>;
			clock-names = "s_axi_aclk";
			clocks = <&clkc 15>;
			compatible = "xlnx,xps-gpio-1.00.a";
			gpio-controller ;
			reg = <0x41200000 0x10000>;
			xlnx,all-inputs = <0x0>;
			xlnx,all-inputs-2 = <0x0>;
			xlnx,all-outputs = <0x1>;
			xlnx,all-outputs-2 = <0x1>;
			xlnx,dout-default = <0x00000000>;
			xlnx,dout-default-2 = <0x00000000>;
			xlnx,gpio-width = <0x8>;
			xlnx,gpio2-width = <0xd>;
			xlnx,interrupt-present = <0x0>;
			xlnx,is-dual = <0x1>;
			xlnx,tri-default = <0xFFFFFFFF>;
			xlnx,tri-default-2 = <0xFFFFFFFF>;
		};

My reset-gpios line is attempting to use this GPIO:

        reset-gpios = <&axi_gpio_0 11 GPIO_ACTIVE_LOW>;

If I replace this line with the PS GPIO:

        reset-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;

I then get the following DMESG info (note I've put a lot of debug messages into the kernel to find this point):

[    1.250126] Trying to find reset
[    1.252066] con_id = reset, idx: 0, flags: 7
[    1.255024] xilinx-demosaic 43c00000.v_demosaic: GPIO lookup for consumer reset
[    1.261019] xilinx-demosaic 43c00000.v_demosaic: using device tree for GPIO lookup
[    1.267296] of_find_gpio
[    1.268515] reset-gpios
[    1.268524] cells_name: #gpio-cells
[    1.271842] it->cur: 3355421112, count: 2, end: 3355421120
[    1.276025] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/amba_pl/v_demosaic@43c00000[0]' - status (0)
[    1.285775] -565477200
[    1.286821] Found something
[    1.288314] devm_gpiod_get_index : -565477200
[    1.291353] Return value -565477200
[    1.294259] cells_name: #clock-cells
[    1.296522] it->cur: 3355421092, count: 1, end: 3355421096
[    1.300711] xilinx-video amba_pl:video_cap: Entity type for entity 43c00000.v_demosaic was not initialized!
[    1.309181] xilinx-demosaic 43c00000.v_demosaic: Xilinx Video Demosaic Probe Successful

So that looks like it works, but I've confused about the line that it was NOT initialized, but probed successfully. I would expect to find a v4l2 sub-dev, but that doesn't show up in /dev. The reset isn't hooked up correctly, so that could be part of the problem. 

Any ideas? I'm attaching the DTSI files and HDF files.

0 Kudos
Contributor
Contributor
532 Views
Registered: ‎05-07-2017

Re: OF: /amba_pl/v_demosaic@43c00000: arguments longer than property

For AXI GPIO, 

 

Example:
gpio: gpio@40000000 {
	#gpio-cells = <2>;
	compatible = "xlnx,xps-gpio-1.00.a";
	gpio-controller ;
	clock-names = "s_axi_aclk";
	clocks = <&clkc 71>;
	interrupt-parent = <&microblaze_0_intc>;
	interrupts = < 6 2 >;
	reg = < 0x40000000 0x10000 >;
	xlnx,all-inputs = <0x0>;
	xlnx,all-inputs-2 = <0x0>;
	xlnx,dout-default = <0x0>;
	xlnx,dout-default-2 = <0x0>;
	xlnx,gpio-width = <0x2>;
	xlnx,gpio2-width = <0x2>;
	xlnx,interrupt-present = <0x1>;
	xlnx,is-dual = <0x1>;
	xlnx,tri-default = <0xffffffff>;
	xlnx,tri-default-2 = <0xffffffff>;
} ;

Example to demonstrate how reset-gpios property is used in drivers:

driver: driver@80000000 {
	compatible = "xlnx,driver";
	reset-gpios = <&gpio 0 0 GPIO_ACTIVE_LOW>; /* gpio phandle, gpio pin-number, channel offset, flag state */
	reg = <0x0 0x80000000 0x0 0x10000>;
};
==v=i=v=o==
0 Kudos
Contributor
Contributor
531 Views
Registered: ‎05-07-2017

Re: OF: /amba_pl/v_demosaic@43c00000: arguments longer than property

please refer: https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt

notice when you refer axi gpio, there are 4 fields, not 3.
==v=i=v=o==
0 Kudos