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.

i2c and vpss-m3 firmware

Other Parts Discussed in Thread: TVP7002, PCF8575, THS7375

I am a bit confused on which firmware I should use to the VPSS subsystem in the TMS320C6A8168 processor. The hardware I use is based on the DM816X EVM, and the software components I use come from the EZSDK. Recently I ran into a problem when using i2c-2 at the same time as I was using the VPSS, which I read was due to the dm816x_hdvpss.xem3 firmware was using this i2c to communicate with the tvp7002 chip (which I do not have on my hardware).

I read somewhere that I should use the dm816x_hdvpss_v4l2.xem3 firmware instead. This seems to have solved the problem and everything seems to be running fine. However, I am seeing a lot of i2c-stuff from the kernel in the syslog.

<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: addr: 0x0079, len: 9, flags: 0x0, stop: 1
<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: IRQ (ISR = 0x0010)
<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: IRQ (ISR = 0x1010)
<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: IRQ (ISR = 0x1010)
<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: IRQ (ISR = 0x1010)
<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: IRQ (ISR = 0x1010)
<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: IRQ (ISR = 0x1010)
<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: IRQ (ISR = 0x1010)
<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: IRQ (ISR = 0x1010)
<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: IRQ (ISR = 0x1010)
<15>Sep  8 16:03:46 kernel: [ 5759.730000] omap_i2c omap_i2c.2: IRQ (ISR = 0x0004)

Is this an error indication of some kind? And if so, how can I use this information to troubleshoot the source of the error? Sometimes I also see these messages

[ 5463.620000] omap_i2c omap_i2c.2: Arbitration lost
[ 5622.600000] omap_i2c omap_i2c.2: controller timed out

I use the following procedure to set up my system.

insmod /ti/syslink.ko
/usr/local/bin/firmware_loader 2 /ti/dm816x_hdvpss_v4l2.xem3 start
modprobe vpss sbufaddr=0xBFB00000 mode=dvo2:mobill i2c_mode=1

modprobe ti81xxvo video1_numbuffers=2 video1_bufsize=4147200 video2_numbuffers=2 video2_bufsize=4147200
modprobe ov3640
modprobe ti81xxvin
modprobe ti81xxfb vram=0:8M,1:8M

When I remove the i2c_mode=1, the procedure stops working, and I get a segmentation fault when trying to load the VPSS kernel module. However, when I read http://processors.wiki.ti.com/index.php/DM814X_AM387X_VPSS_Video_Driver_User_Guide it seems to me that I should not use i2c_mode=1. Do I need to modify the VPSS module in some way? The i2c-communication with the decoder is handled by the ov3640 module. Should this work, or is this just a lucky coincident that it acctually does work?

  • Hi,

    As the Video driver user guide explains, when i2c_mode is set to 1, M3 controls external i2c-based video devices. Have you tried  loading  "dm816x_hdvpss.xem3"  without setting i2c_mode to 1.

    Thanks,

    Deepthy

  • Yes, I have tried that. This results in the same crash as when trying to load vpss without i2c_mode=1 when using dm816x_hdvpss_v4l2.xem.

    root@MValidator:~# /usr/local/bin/firmware_loader 2 /ti/dm816x_hdvpss.xem3 start
    FIRMWARE: Memory map bin file not passed
    Usage : /usr/local/bin/firmware_loader <Processor Id> <Location of Firmware> <start|stop> [Location of Mem map bin file]
    FIRMWARE: Default memory configuration is used
    MemCfg: DCMM (Dynamically Configurable Memory Map) Version :  2.1.1.1
    FIRMWARE: Memory Configuration status : In Progress
    FIRMWARE: 2 start Successful
    root@MValidator:~# modprobe vpss sbufaddr=0xBFB00000 mode=dvo2:mobill
    [  121.040000] Unable to handle kernel NULL pointer dereference at virtual address 00000002
    [  121.040000] pgd = c6c2c000
    [  121.050000] [00000002] *pgd=86dd1031, *pte=00000000, *ppte=00000000
    [  121.050000] Internal error: Oops: 17 [#1]
    [  121.050000] last sysfs file: /sys/devices/platform/omap/ti81xx-usbss/musb-hdrc.1/usb2/product
    [  121.050000] Modules linked in: vpss(+) syslink gpio_exposer
    [  121.050000] CPU: 0    Not tainted  (2.6.37+ #37)
    [  121.050000] PC is at pcf8575_ths7375_enable+0x30/0x78
    [  121.050000] LR is at vps_dc_init+0xa6c/0xbcc [vpss]
    [  121.050000] pc : [<c00589dc>]    lr : [<bf15cb90>]    psr: 60000013
    [  121.050000] sp : c6cd3d60  ip : c6cd3d98  fp : c6cd3d94
    [  121.050000] r10: c6661148  r9 : 00000000  r8 : c6cd3d64
    [  121.050000] r7 : 00000000  r6 : bf156a04  r5 : c047aac4  r4 : 00000000
    [  121.050000] r3 : 00000000  r2 : 0000000c  r1 : 00000000  r0 : c6cd3d64
    [  121.050000] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
    [  121.050000] Control: 10c5387d  Table: 86c2c019  DAC: 00000015
    [  121.050000] Process modprobe (pid: 886, stack limit = 0xc6cd22e8)
    [  121.050000] Stack: (0xc6cd3d60 to 0xc6cd4000)
    [  121.050000] 3d60: c6cd3d94 00000003 bf14a90c 00000004 00000000 00000004 00000000 bf156a04
    [  121.050000] 3d80: bf1568c4 c044b768 c6cd3e0c c6cd3d98 bf15cb90 c00589b8 00000003 c6666680
    [  121.050000] 3da0: 00000000 c044b758 c045e828 00000002 00000003 00000002 00000004 00000000
    [  121.050000] 3dc0: 00000000 00000000 00000000 00000004 00000031 00000001 00000000 0000057c
    [  121.050000] 3de0: 00000000 00000000 c044b758 bf156d18 c6d92400 c045e828 c6cd2000 00000000
    [  121.050000] 3e00: c6cd3e2c c6cd3e10 bf148104 bf15c130 c044b760 c044b760 bf156888 c6d92400
    [  121.050000] 3e20: c6cd3e3c c6cd3e30 c01abb5c bf14806c c6cd3e5c c6cd3e40 c01aaac8 c01abb48
    [  121.050000] 3e40: c044b760 c044b794 bf156888 c6d92400 c6cd3e7c c6cd3e60 c01aabf0 c01aaa04
    [  121.050000] 3e60: 00000000 c01aab88 bf156888 c6d92400 c6cd3ea4 c6cd3e80 c01aa274 c01aab94
    [  121.050000] 3e80: c781bfb8 c7845eb0 c016a3d8 00000000 bf156874 bf156888 c6cd3eb4 c6cd3ea8
    [  121.050000] 3ea0: c01aa8ec c01aa230 c6cd3ee4 c6cd3eb8 c01a9b4c c01aa8d8 bf153117 c6cd3ec8
    [  121.050000] 3ec0: 00000000 bf156874 bf156888 401c4000 bf15c000 00000000 c6cd3f0c c6cd3ee8
    [  121.050000] 3ee0: c01aaf28 c01a9aa4 00000000 bf156874 0001b128 401c4000 bf15c000 c6cd2000
    [  121.050000] 3f00: c6cd3f1c c6cd3f10 c01abe48 c01aae84 c6cd3f34 c6cd3f20 c01abe7c c01abe08
    [  121.050000] 3f20: 00000000 bf156bf4 c6cd3f44 c6cd3f38 bf15c030 c01abe68 c6cd3f7c c6cd3f48
    [  121.050000] 3f40: c0037420 bf15c00c bf156bf4 0001b128 401c4000 c0041fe8 00000000 bf156bf4
    [  121.050000] 3f60: 0001b128 401c4000 c0041fe8 00000000 c6cd3fa4 c6cd3f80 c0093190 c003735c
    [  121.050000] 3f80: c00c09a0 c00c08b8 00001030 0001b128 00000000 00000080 00000000 c6cd3fa8
    [  121.050000] 3fa0: c0041e40 c0093100 00001030 0001b128 401c4000 0001c49c 0001b128 0001ac94
    [  121.050000] 3fc0: 00001030 0001b128 00000000 00000080 0001b090 be8e4c44 00000000 be8e4c44
    [  121.050000] 3fe0: 0001b390 be8e492c 0000b678 4015d7d4 60000010 401c4000 00000004 000d0072
    [  121.050000] Backtrace:
    [  121.050000] [<c00589ac>] (pcf8575_ths7375_enable+0x0/0x78) from [<bf15cb90>] (vps_dc_init+0xa6c/0xbcc [vpss])
    [  121.050000]  r8:c044b768 r7:bf1568c4 r6:bf156a04 r5:00000000 r4:00000004
    [  121.050000] [<bf15c124>] (vps_dc_init+0x0/0xbcc [vpss]) from [<bf148104>] (vps_probe+0xa4/0x160 [vpss])
    [  121.050000] [<bf148060>] (vps_probe+0x0/0x160 [vpss]) from [<c01abb5c>] (platform_drv_probe+0x20/0x24)
    [  121.050000]  r7:c6d92400 r6:bf156888 r5:c044b760 r4:c044b760
    [  121.050000] [<c01abb3c>] (platform_drv_probe+0x0/0x24) from [<c01aaac8>] (driver_probe_device+0xd0/0x190)
    [  121.050000] [<c01aa9f8>] (driver_probe_device+0x0/0x190) from [<c01aabf0>] (__driver_attach+0x68/0x8c)
    [  121.050000]  r7:c6d92400 r6:bf156888 r5:c044b794 r4:c044b760
    [  121.050000] [<c01aab88>] (__driver_attach+0x0/0x8c) from [<c01aa274>] (bus_for_each_dev+0x50/0x84)
    [  121.050000]  r7:c6d92400 r6:bf156888 r5:c01aab88 r4:00000000
    [  121.050000] [<c01aa224>] (bus_for_each_dev+0x0/0x84) from [<c01aa8ec>] (driver_attach+0x20/0x28)
    [  121.050000]  r6:bf156888 r5:bf156874 r4:00000000
    [  121.050000] [<c01aa8cc>] (driver_attach+0x0/0x28) from [<c01a9b4c>] (bus_add_driver+0xb4/0x234)
    [  121.050000] [<c01a9a98>] (bus_add_driver+0x0/0x234) from [<c01aaf28>] (driver_register+0xb0/0x13c)
    [  121.050000] [<c01aae78>] (driver_register+0x0/0x13c) from [<c01abe48>] (platform_driver_register+0x4c/0x60)
    [  121.050000]  r9:c6cd2000 r8:bf15c000 r7:401c4000 r6:0001b128 r5:bf156874
    [  121.050000] r4:00000000
    [  121.050000] [<c01abdfc>] (platform_driver_register+0x0/0x60) from [<c01abe7c>] (platform_driver_probe+0x20/0x70)
    [  121.050000] [<c01abe5c>] (platform_driver_probe+0x0/0x70) from [<bf15c030>] (vps_init+0x30/0x5c [vpss])
    [  121.050000]  r5:bf156bf4 r4:00000000
    [  121.050000] [<bf15c000>] (vps_init+0x0/0x5c [vpss]) from [<c0037420>] (do_one_initcall+0xd0/0x1a4)
    [  121.050000] [<c0037350>] (do_one_initcall+0x0/0x1a4) from [<c0093190>] (sys_init_module+0x9c/0x1bc)
    [  121.050000] [<c00930f4>] (sys_init_module+0x0/0x1bc) from [<c0041e40>] (ret_fast_syscall+0x0/0x30)
    [  121.050000]  r7:00000080 r6:00000000 r5:0001b128 r4:00001030
    [  121.050000] Code: e3a0200c e1a00008 e5957000 e2044003 (e1d760b2)
    [  121.530000] ---[ end trace dabdcc4c6e9103d0 ]---
    Segmentation fault
    root@MValidator:~#

  • Hi,

    If you refer http://processors.wiki.ti.com/index.php/DM816X_AM389X_VPSS_Video_Driver_User_Guide#VPSS_Driver , 'sbufaddr' to be used is 0xA0200000 and notifyk.vpssm3_sva = 0xA0000000. I am not sure of the sbufaddr that you are using.

    Are you using the pre-built binaries ? If you are building your own binaries, please make sure that they are compiled properly.

    Thanks,

    Deepthy

  • The VPSS firmware is the pre-built from ti-ezsdk_dm816x-evm_5.03.01.15 (board-support/prebuilt-images/dm816x-firmware_05_02_00_30/dm816x_hdvpss_v4l2.xem3). The hardware only have 512MiB RAM, so we used the addresses suggested from  EZSDK Memory map (512MiB system).

    The kernel command line is as follows:
    [    0.000000] Kernel command line: console=ttyO2,115200n8
    [    0.000000]  rootwait
    [    0.000000]  root=/dev/nfs
    [    0.000000]  nfsroot=172.20.169.1:/srv/nfs/rootfs
    [    0.000000]  ro
    [    0.000000]  mem=176M
    [    0.000000]  earlyprintk
    [    0.000000]  notifyk.vpssm3_sva=0xBF900000
    [    0.000000]  vram=50M
    [    0.000000]  ti8168xfb.vram=1:16M
    [    0.000000]  ip=dhcp
    [    0.000000]  noinitrd

    I found out that the I2C IRQ-messages was due to DEBUG output was enabled in the i2c-omap kernel module. However, it still seems strange that loading vpss results in a NULL pointer error in the kernel module. It also seems to me that the correct procedure should be loading dm816x_hdvpss_v4l2.xem3 (which doesn't use I2C, right?) and then loading vpss, without the omap_i2c option. Or should I consider the i2c_mode=1 option as "I2C control from VPSS kernel module is disabled"?

    Thanks for all the fast responses, they have been really helpful :-).

  • The null pointer error was due to having removed code in the arch/arm/mach-omap2/board-ti8168evm.c. I had modified I2C structures to not include circuits not present on the board. However, since there where calls from VPSS to some of the functions in the board file, which assumed some circuits being present. This resulted in NULL pointers being de-referenced.

    I still wonder if setting i2c_mode=1 for vpss while using dm816x_hdvpss_v4l2.xem3 really removes the I2C conflicts? I am still seeing some "omap_i2c omap_i2c.2: controller timed out", when this has started to happen I can no longer use I2C communication at all.

  • Hi,

    Actually the EZSDK package is configured for 1GB board by default. So it will not work for 512MB board. Please refer  "Additional Procedures" section of  "DM816x EZ Software Developers Guide". There is a link specified which will guide you through the steps to accomplish this. Basically you need to modify the configurations for 512MB and rebuild the binaries. This link has all the details http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map#

    Regards,

    Deepthy

  • Deepthy Ravi said:

    Hi,

    Actually the EZSDK package is configured for 1GB board by default. So it will not work for 512MB board. Please refer  "Additional Procedures" section of  "DM816x EZ Software Developers Guide". There is a link specified which will guide you through the steps to accomplish this. Basically you need to modify the configurations for 512MB and rebuild the binaries. This link has all the details http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map#

    Regards,

    Deepthy

    The firmware_loader is updated for the new addresses implied by the 512MiB system, so the binaries should be compatible :-)

  • Ok. I believe your NULL pointer exception is resolved now.