cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wzab
Mentor
Mentor
4,620 Views
Registered: ‎08-24-2011

Incorrectly generated DT for Test Pattern Generator

I tried to create a minimal design with TPG connected directly to Video Frembuffer Write IP core on Zynq7 platform.

(In fact to check if the problems described in https://forums.xilinx.com/t5/Embedded-Linux/Does-framebuffer-write-support-32-bit-mode-in-64-bit-system/m-p/860381 occur also in 32-bit platform).

However, when I export the design from Vivado, and import it into Petalinux, the generated part of the device tree looks as follows:

    v_tpg_0: v_tpg@40000000 {
       compatible = "xlnx,v-tpg-7.0";
       interrupt-parent = <&intc>;
       interrupts = <0 29 4>;
       reg = <0x40000000 0x10000>;
       xlnx,s-axi-ctrl-addr-width = <0x8>;
       xlnx,s-axi-ctrl-data-width = <0x20>;
    };

And the TPG device is not properly recognized during the start of the system.

Comparing to description  in https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/devicetree/bindings/media/xilinx/xlnx%2Cv-tpg.txt it seems that there are no "ports" and "clocks" definitions.

Why Vivado+Petalinux is not able to correctly generate DT for TPG. How should I fix it?

 

TIA & Regards,

Wojtek

 

0 Kudos
13 Replies
wzab
Mentor
Mentor
4,617 Views
Registered: ‎08-24-2011

I have added the following system-user.dtsi:

/include/ "system-conf.dtsi"

&v_frmbuf_wr_0 {
   #dma-cells = <1>;
   compatible = "xlnx,axi-frmbuf-wr-v2";
   xlnx,dma-addr-width = <32>;
   xlnx,vid-formats = "rgb888";
   reset-gpios = <&gpio0 54 1>;
};

&v_tpg_0 {
   clock-names = "fclk0";
   clocks = <&clkc 15>;
   ports {
      #address-cells = <1>;
      #size-cells = <0>;
      port@1 {
	reg = <1>;
	xlnx,video-format = <2>;
	xlnx,video-width = <8>;
	tpg_in: endpoint {
	remote-endpoint = <&v_frmbuf_wr_0>;
	};
      };
   };
};

But the TGP probe function still returns -2.

 

Regards,

Wojtek

0 Kudos
wzab
Mentor
Mentor
4,594 Views
Registered: ‎08-24-2011

I have found, that it was necessary to add yet reset definition in the system-user.dtsi:

/include/ "system-conf.dtsi"

&v_frmbuf_wr_0 {
   #dma-cells = <1>;
   compatible = "xlnx,axi-frmbuf-wr-v2";
   xlnx,dma-addr-width = <32>;
   xlnx,vid-formats = "rgb888";
   reset-gpios = <&gpio0 54 1>;
};

&v_tpg_0 {
   clock-names = "fclk0";
   clocks = <&clkc 15>;
   reset-gpios = <&gpio0 55 1>;
   ports {
      #address-cells = <1>;
      #size-cells = <0>;
      port@1 {
	reg = <1>;
	xlnx,video-format = <2>;
	xlnx,video-width = <8>;
	tpg_in: endpoint {
	remote-endpoint = <&v_frmbuf_wr_0>;
	};
      };
   };
};

Now the TPG driver probes the devices correctly, however incorrectly reports its version:

[   12.187485] xilinx-tpg 40000000.v_tpg: device found, version 0.000   

The Framebuffer Write is also detected correctly:

[   11.904892] xilinx-frmbuf 43c00000.v_frmbuf_wr: Xilinx AXI frmbuf DMA_DEV_TO_MEM
[   11.911151] xilinx-frmbuf 43c00000.v_frmbuf_wr: Xilinx AXI FrameBuffer Engine Driver Probed!!

However no /dev/video0 node is created.

wzab
Mentor
Mentor
4,567 Views
Registered: ‎08-24-2011

It looks like I have yet to define the video device in the DT:

/include/ "system-conf.dtsi"

&v_frmbuf_wr_0 {
   #dma-cells = <1>;
   clock-names = "fclk0";
   clocks = <&clkc 15>;
   compatible = "xlnx,axi-frmbuf-wr-v2";
   xlnx,dma-addr-width = <32>;
   xlnx,vid-formats = "bgr888","rgb888","xbgr8888","abgr8888";
   reset-gpios = <&gpio0 54 1>;
};

&v_tpg_0 {
   clock-names = "fclk0";
   clocks = <&clkc 15>;
   reset-gpios = <&gpio0 55 1>;
   ports {
      #address-cells = <1>;
      #size-cells = <0>;
      port@1 {
	reg = <1>;
	xlnx,video-format = <2>;
	xlnx,video-width = <8>;
	tpg_out: endpoint {
	remote-endpoint = <&v_frmbuf_wr_0>;
	};
      };
   };
};

&amba_pl {
  video_cap_tpg {
   compatible = "xlnx,video";
   dmas = <&v_frmbuf_wr_0 1>;
   dma-names = "port0";

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

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

Now the device /dev/video0 is created, and v4l2-ctl reports:

root@os_prj1:~# v4l2-ctl -D
Driver Info (not using libv4l2):
        Driver name   : xilinx-vipp
        Card type     : video_cap_tpg output 0
        Bus info      : platform:video_cap_tpg:0
        Driver version: 4.9.0
        Capabilities  : 0x84200001
                Video Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps   : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format

However, there are still annoying messages:

 

root@os_prj1:~# dmesg | grep tpg
[ 12.147404] xilinx-video amba_pl:video_cap_tpg: device registered [ 12.929391] xilinx-tpg 40000000.v_tpg: device found, version 0.000 [ 12.965016] xilinx-video amba_pl:video_cap_tpg: Entity type for entity 40000000.v_tpg was not initialized!

Regards,

Wojtek

0 Kudos
wzab
Mentor
Mentor
4,545 Views
Registered: ‎08-24-2011

0 Kudos
florentw
Moderator
Moderator
4,539 Views
Registered: ‎11-09-2015

HI @wzab,

 

Did you tried the patched from your previous link?

 

I am not linux expert but would also point you to the ZCU102 TRD as it uses the Test Pattern Generator in the PL.

 

Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
wzab
Mentor
Mentor
4,533 Views
Registered: ‎08-24-2011

Yes, I have tried and finally I got the device initialized and created without the Ooops or panic messages from the kernel.

Current configuration is as follows:

system-user.dtsi

/include/ "system-conf.dtsi"

&v_frmbuf_wr_0 {
   #dma-cells = <1>;
   clock-names = "fclk0";
   clocks = <&clkc 15>;
   compatible = "xlnx,axi-frmbuf-wr-v2";
   xlnx,dma-addr-width = <32>;
   xlnx,vid-formats = "bgr888","rgb888","xbgr8888","abgr8888";
   reset-gpios = <&gpio0 54 1>;
};

&v_tpg_0 {
   clock-names = "fclk0";
   clocks = <&clkc 15>;
   reset-gpios = <&gpio0 55 1>;
   ports {
      #address-cells = <1>;
      #size-cells = <0>;
      port@0 {
	reg = <0>;
	xlnx,video-format = <2>;
	xlnx,video-width = <8>;
	tpg_out: endpoint {
	remote-endpoint = <&vcap_in>;
	};
      };
   };
};

&amba_pl {
  video_cap_tpg {
   compatible = "xlnx,video";
   dmas = <&v_frmbuf_wr_0 1>;
   dma-names = "port0";

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

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

I have also downloaded the patch from the referenced thread: https://forums.xilinx.com/xlnx/attachments/xlnx/ELINUX/25446/1/0003-Ignoring-device-tree-node-errors.patch , put it into the project-spec/meta-user/recipes-kernel/linux/linux-xlnx directory, and modified the project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend file:

SRC_URI += "file://user_2018-04-06-21-43-00.cfg \
            ... Removed other configuration modifications ...
            file://0003-Ignoring-device-tree-node-errors.patch \
            "

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

However I still get those annoying messages:

[   12.956251] xilinx-tpg 40000000.v_tpg: device found, version 0.000
[   12.993513] xilinx-video amba_pl:video_cap_tpg: Entity type for entity 40000000.v_tpg was not initialized!

And when I try to run ffprobe I get finally:

root@os_prj1:~# ffprobe -v trace /dev/video0                                                                    
ffprobe version 3.1.3 Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 6.2.1 (Linaro GCC 6.2-2016.11) 20161016
[...]
Probing video4linux2,v4l2 score:99 size:0
[video4linux2,v4l2 @ 0x41a00] fd:3 capabilities:84200001
[video4linux2,v4l2 @ 0x41a00] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device
/dev/video0: Inappropriate ioctl for device

 

0 Kudos
florentw
Moderator
Moderator
4,423 Views
Registered: ‎11-09-2015

Hi @wzab,

 

Did you find a solution about the messages?


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
wzab
Mentor
Mentor
4,400 Views
Registered: ‎08-24-2011

It looks like the VIPP driver does not support VIDIOC_G_INPUT ioctl (or maybe it should be the TPG driver?).

Probably it will be necessary to patch one of them.

 

Regards,

Wojtek

0 Kudos
lh123lh
Visitor
Visitor
3,483 Views
Registered: ‎11-21-2018

Hi,@wzab

I have the same problem("xilinx-video amba:test_cap: Entity type for entity 43c00000.v_tpg was not initialized!"),how can i init the device?

0 Kudos
plant1976
Visitor
Visitor
3,188 Views
Registered: ‎10-25-2013

I have similar issue using petalinux 2018.2 and Zynq MPSoC.

Has anybody found a solution?

Thank you

0 Kudos
shrtique
Participant
Participant
2,590 Views
Registered: ‎08-22-2016

Hello, guys.

Met quite similar problems.

Current Config: Zynq 7020 + Petalinux 2018.2

Previously I worked with Petalinux 2015.4 and everything worked properly.
For the test I've created the folliwing pipeline:

TGP -> Cresample -> VDMA

The problem is that in /dev/ I've got video device, two sub-devices, but there is no media entity! Still according to log everything is probed succesfully and media device is created.

Please look though attached snippet of device-tree and verbose log (only information which is connected with v4l2).

Ps. you could see that I use tpg driver ver 5. According to description it doesn't need to have reset and timing gpios. Still I tried to use ver 7 with gpios nodes in device-tree - the result was the same.

 

Do you have any ideas?

0 Kudos
tgharbi2020
Contributor
Contributor
1,434 Views
Registered: ‎09-28-2019

Hello guys,

Did you find a solution for the error: xilinx-video amba:test_cap: Entity type for entity 43c00000.v_tpg was not initialized! ?

Thanks.

0 Kudos
shrtique
Participant
Participant
1,412 Views
Registered: ‎08-22-2016

Hi, as for me - unfortunately not. We spent  several weeks digging deeper in the drivers, but unsuccessfully.

0 Kudos