This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux: AM5728 configuration for TVP5146

Other Parts Discussed in Thread: TVP5146

Tool/software: Linux

Hello. 

I work with am5728-evm board and linux version "4.9.65-rt23-g7069a470d5" on this board.

I connectd TVP5146 like image blew on my board and i want to show something of camera in LCD of my board !

in config of kernel CONFIG_VIDEO_TVP514X set to "m" and in device tree :

&i2c5 {

tvp514x@5D {

compatible = "ti,tvp5416";

reg = <0x5D>;

port {

tvp514x_1: endpoint {

remote-endpoint = <&vin3a>;

};

};

};

};

&vip2 {
status = "okay";
};

&vin3a {
status = "okay";
endpoint {
slave-mode;
remote-endpoint = <&tvp514x_1>;
};
};

after these settings, i dont see any videoN on /dev/ path!

when I cat uevent of i2c:

root@am57xx-evm:~# cd /sys/bus/i2c/devices/i2c-4/4-005d/
root@am57xx-evm:/sys/bus/i2c/devices/i2c-4/4-005d# cat uevent
OF_NAME=tvp514x
OF_FULLNAME=/ocp/i2c@4807c000/tvp514x@5D
OF_COMPATIBLE_0=ti,tvp5416
OF_COMPATIBLE_N=1
MODALIAS=i2c:tvp5416
root@am57xx-evm:/sys/bus/i2c/devices/i2c-4/4-005d#

  • Hi Saman,

    I see you have typed "ti,tvp5416" in compatible settings. You may want to fix that to tvp5146. If you see any more issues, you may want to check these posts on how to proceed with debug -

    Regards,

    Manisha

  • Hello Manisha, Thanks for your response
    I changed "ti,tvp5416" in compatible settings to "ti,tvp5146" and fix that problem. now when get dmesg of linux show these:
    root@am57xx-evm:~# dmesg | grep tvp
    [ 38.905291] tvp514x 4-005d: tvp514x 4-005d decoder driver registered !!
    [ 55.575593] vip2-s0: Port A: Using subdev tvp514x 4-005d for capture
    root@am57xx-evm:~#

    but still I have not any videoN!

    when use "dmesg | grep vip" command, results:

    root@am57xx-evm:~# dmesg | grep vip
    [ 49.591709] vip 48990000.vip: loading firmware vpdma-1b8.bin
    [ 49.850513] vip 48990000.vip: VPDMA firmware loaded
    [ 49.855552] vip2-s0: Port A: Using subdev tvp514x 4-005d for capture
    root@am57xx-evm:~#


    How can fix this?

  • Dear Manisha, I'm still waiting here...


    
    
  • Hi Saman,

    We only support V4l2 sub device driver for the camera that comes along with AM57x GP EVM and IDK boards. You will need to debug your system on why you don't see the camera input in your setup and come up with specific narrow set of questions when you need clarifications.  

    Please go through this wiki page to learn how to debug the camera capture related issues -

    Also, refer to the binding document of the linux kernel on needed dts settings 

    Documentation\devicetree\bindings\media\i2c

  • Hi Saman,

    Similar query came up on this other post that I think you might be benefited from -
    e2e.ti.com/.../2615982

    Regards,
    Manisha
  • Hello manisha.

    I almost solved my problem and I can see /dev/videoN in list of dev! by these changes:

    &i2c5 {

       status = "okay";

            tvp514x@5C {

    compatible = "ti,tvp5146";

    reg = <0x5c>;

                          port {

                                tvp514x_1: endpoint {

    hsync-active = <1>;

    vsync-active = <1>;

    pclk-sample = <0>;

                                           };

                               };

                   };

    };

    root@am57xx-evm:~# ls /dev/video*
    /dev/video0 /dev/video1 /dev/video10 /dev/video11

     

    root@am57xx-evm:~# dmesg | grep tvp
    [ 28.850790] tvp514x 4-005c: Write: retry ... 0
    [ 28.880533] tvp514x 4-005c: Write: retry ... 1
    [ 28.920747] tvp514x 4-005c: Write: retry ... 2
    [ 28.950671] tvp514x 4-005c: Write: retry ... 3
    [ 28.980533] tvp514x 4-005c: Write: retry ... 4
    [ 29.010520] tvp514x 4-005c: Write: retry ... 5
    [ 29.040624] tvp514x 4-005c: tvp514x 4-005c decoder driver registered !!
    [ 31.572118] vip2-s0: Port A: Using subdev tvp514x 4-005c for capture
    root@am57xx-evm:~#

     

    root@am57xx-evm:~# dmesg | grep vip
    [ 31.508281] vip 48990000.vip: loading firmware vpdma-1b8.bin
    [ 31.560666] vip 48990000.vip: VPDMA firmware loaded
    [ 31.572118] vip2-s0: Port A: Using subdev tvp514x 4-005c for capture
    [ 31.579264] vip2-s0: device registered as video1

     

     

    But still I have problem!!!!

    When I try to capture video by Qt program of TI, the program was failed...

    Here is ready Log of kernel in starting:

    [ 28.850790] tvp514x 4-005c: Write: retry ... 0
    [ 28.880533] tvp514x 4-005c: Write: retry ... 1
    [ 28.920747] tvp514x 4-005c: Write: retry ... 2
    [ 28.950671] tvp514x 4-005c: Write: retry ... 3
    [ 28.980533] tvp514x 4-005c: Write: retry ... 4
    [ 29.010520] tvp514x 4-005c: Write: retry ... 5
    [ 29.040624] tvp514x 4-005c: tvp514x 4-005c decoder driver registered !!

    when I trying read i2c register I face with this error:

    root@am57xx-evm:~# i2cget -f -y 4 0x5C 1 b
    Error: Read failed
    root@am57xx-evm:~#

    root@am57xx-evm:~# cd /sys/bus/i2c/devices/i2c-4/
    root@am57xx-evm:/sys/bus/i2c/devices/i2c-4# cat uevent
    OF_NAME=i2c
    OF_FULLNAME=/ocp/i2c@4807c000
    OF_COMPATIBLE_0=ti,omap4-i2c
    OF_COMPATIBLE_N=1
    OF_ALIAS_0=i2c4
    root@am57xx-evm:/sys/bus/i2c/devices/i2c-4#

    root@am57xx-evm:/sys/bus/i2c/devices/i2c-4# ls
    4-005c device name of_node subsystem
    delete_device i2c-dev new_device power uevent
    root@am57xx-evm:/sys/bus/i2c/devices/i2c-4#

     

    But Surprisingly, I can read 0x5D register!!!

    root@am57xx-evm:/sys/bus/i2c/devices/i2c-4# i2cget -f -y 4 0x5D 1 b
    0x0f
    root@am57xx-evm:/sys/bus/i2c/devices/i2c-4#

    please help me to understand it!

     

  • You may want to try two things -

    1. Lower down the speed of i2c clock
    2. Check the register and data size of i2c device. If it is not 8 bits for both, then reading the register from command line may not work. You may want to do that from driver source code and enable the debug prints.