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.

dm365 mt9v113 vga camera support

Other Parts Discussed in Thread: THS7303, TVP5146

hi all

i m trying to modify the rr kernel to support aptina vga sensor i have succeeded to insert it as a module but

i think the problem is coming when try to modify the "board-leopard-dm365.c"

as i m giving value to  .platform_data=&mt9v113_pdata

here is the stucture which ive  modifiedn in "board-leopard-dm365.c"

static struct i2c_board_info i2c_info[] = {
#if defined(CONFIG_VIDEO_MT9V113) || defined(CONFIG_VIDEO_MT9V113_MODULE)
 {   
    
    I2C_BOARD_INFO("mt9v113", MT9V113_I2C_ADDR),
         .platform_data =&mt9v113_pdata,

},
   
#endif


    {
        I2C_BOARD_INFO("tlv320aic3x", 0x18),
    },
    {
        I2C_BOARD_INFO("ths7303", 0x2c),
    }
};

i ve attached three files to the system

1.mt9v113.c  in <kernel>drivers/media/video

2.mt9v113_regs.h in same location

3.mt9v113.h in <kernel>include/media

pls tell me the right step if i m missing something

 

this is the kernel loading in leopard board

## Booting kernel from Legacy Image at 82000000 ...                            
   Image Name:   "RR Linux Kernel"                                             
   Image Type:   ARM Linux Kernel Image (uncompressed)                         
   Data Size:    4445856 Bytes =  4.2 MB                                       
   Load Address: 80008000                                                      
   Entry Point:  80008000                                                      
   Verifying Checksum ... OK                                                   
   Loading Kernel Image ... OK                                                 
OK                                                                             
                                                                               
Starting kernel ...                                                            
                                                                               
Linux version 2.6.32-rc2-ridgerun (dm365@dm365-desktop) (gcc version 4.2.4) #271
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177                  
CPU: VIVT data cache, VIVT instruction cache                                   
Machine: DM365 Leopard                                                         
Memory policy: ECC disabled, Data cache writeback                              
DaVinci dm365_rev1.2 variant 0x8                                               
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 13716    
Kernel command line: davinci_enc_mngr.ch0_output=COMPOSITE davinci_enc_mngr.ch0)
PID hash table entries: 256 (order: -2, 1024 bytes)                            
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)                  
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)                   
Memory: 54MB = 54MB total                                                      
Memory: 50100KB available (3996K code, 387K data, 148K init, 0K highmem)       
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1        
Hierarchical RCU implementation.                                               
NR_IRQS:245                                                                    
Console: colour dummy device 80x30                                             
Calibrating delay loop... 147.86 BogoMIPS (lpj=739328)                         
Mount-cache hash table entries: 512                                            
CPU: Testing write buffer coherency: ok                                        
DaVinci: 8 gpio irqs                                                           
NET: Registered protocol family 16                                             
davinci_serial_init:97: failed to get UART2 clock                              
bio: create slab <bio-0> at 0                                                  
DM365 IPIPE initialized in Single Shot mode                                    
SCSI subsystem initialized                                                     
usbcore: registered new interface driver usbfs                                 
usbcore: registered new interface driver hub                                   
usbcore: registered new device driver usb                                      
vpss vpss: dm365_vpss vpss probed                                              
vpss vpss: dm365_vpss vpss probe success                                       
dm365_afew_hw_init                                                             
ch0 default output "COMPOSITE", mode "720P-60"                                 
Invalid id...                                                                  
Setmode failed, reset to encoder default...                                    
VPBE Encoder Initialized                                                       
cfg80211: Using static regulatory domain info                                  
cfg80211: Regulatory domain: US                                                
        (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)      
        (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)           
        (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)           
        (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)           
        (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)           
        (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)           
        (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)           
cfg80211: Calling CRDA for country: US                                         
LogicPD encoder initialized                                                    
Leopard DVI encoder initialized                                                
Switching to clocksource timer0_1                                              
musb_hdrc: version 6.0, cppi-dma, host, debug=0                                
musb_hdrc: USB Host mode controller at fec64000 using DMA, IRQ 12              
musb_hdrc musb_hdrc: MUSB HDRC host driver                                     
musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1             
usb usb1: configuration #1 chosen from 1 choice                                
hub 1-0:1.0: USB hub found                                                     
hub 1-0:1.0: 1 port detected                                                   
NET: Registered protocol family 2                                              
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)                 
TCP established hash table entries: 2048 (order: 2, 16384 bytes)               
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)                       
TCP: Hash tables configured (established 2048 bind 2048)                       
TCP reno registered                                                            
NET: Registered protocol family 1                                              
RPC: Registered udp transport module.                                          
RPC: Registered tcp transport module.                                          
RPC: Registered tcp NFSv4.1 backchannel transport module.                      
JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.                           
msgmni has been set to 97                                                      
alg: No test for stdrng (krng)                                                 
io scheduler noop registered                                                   
io scheduler anticipatory registered (default)                                 
davincifb davincifb.0: dm_osd0_fb: 720x480x16@0,0 with framebuffer size 675KB  
davincifb davincifb.0: dm_osd1_fb: 720x480x4@0,0 with framebuffer size 675KB   
davinci_interrupt 368: VBUS error workaround (delay coming)                    
DM365 IPIPEIF probed                                                           
imp serializer initialized                                                     
davinci_previewer initialized                                                  
davinci_resizer initialized                                                    
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled                       
serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A                   
console [ttyS0] enabled                                                        
brd: module loaded                                                             
console [netcon0] enabled                                                      
netconsole: network logging started                                            
Initializing USB Mass Storage driver...                                        
usbcore: registered new interface driver usb-storage                           
USB Mass Storage support registered.                                           
usbcore: registered new interface driver usbtest                               
i2c /dev entries driver                                                        
Linux video capture interface: v2.00                                           
ths7303 1-002c: chip found @ 0x58 (DaVinci I2C adapter)                        
Unable to handle kernel NULL pointer dereference at virtual address 00000000   
pgd = c0004000                                                                 
[00000000] *pgd=00000000                                                       
Internal error: Oops: 5 [#1] PREEMPT                                           
Modules linked in:                                                             
CPU: 0    Not tainted  (2.6.32-rc2-ridgerun #27)                               
PC is at strcpy+0x10/0x24                                                      
LR is at mt9v113_probe+0x90/0x130                                              
pc : [<c017a064>]    lr : [<c0227a78>]    psr: a0000013                        
sp : c2029e48  ip : c2029e58  fp : c2029e54                                    
r10: 00000000  r9 : 00000001  r8 : c04392c0                                    
r7 : c2023a20  r6 : c043b2ac  r5 : c2023a00  r4 : c043b2f8                     
r3 : c043950c  r2 : c043b8c4  r1 : 00000000  r0 : c043b8c4                     
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel            
Control: 0005317f  Table: 80004000  DAC: 00000017                              
Process swapper (pid: 1, stack limit = 0xc2028270)                             
Stack: (0xc2029e48 to 0xc202a000)                                              
9e40:                   c2029e7c c2029e58 c0227a78 c017a064 c2029e7c c2029e68  
9e60: c02279e8 c2023a20 c2023a00 c043b268 c2029e9c c2029e80 c02116e8 c02279f8  
9e80: c00e9f2c c2023a20 c2023a54 c043b268 c2029ebc c2029ea0 c01be8ac c0211658  
9ea0: c2023a20 c2023a54 c043b268 c043b268 c2029edc c2029ec0 c01be9cc c01be80c  
9ec0: c2029edc 00000000 c2029ee0 c01be960 c2029f04 c2029ee0 c01bdcb4 c01be970  
9ee0: c205d0b8 c2054c30 c043b244 c043b268 c23c4b40 00000000 c2029f14 c2029f08  
9f00: c01be708 c01bdc6c c2029f44 c2029f18 c01be280 c01be6f8 c03e06fc c043b244  
9f20: c043b244 c043b268 c04392c0 00000000 00000000 c001cac4 c2029f6c c2029f48  
9f40: c01bedc4 c01be1ec c043b244 c0025040 c04392c0 00000000 00000000 c001cac4  
9f60: c2029f8c c2029f70 c02102bc c01bed24 00000000 c0024f84 c0025040 c04456ac  
9f80: c2029f9c c2029f90 c001cadc c0210250 c2029fdc c2029fa0 c002d340 c001cad4  
9fa0: 00000000 00000000 000000f5 c041df40 00000000 c0024f84 c0025040 00000000  
9fc0: 00000000 00000000 00000000 00000000 c2029ff4 c2029fe0 c0008798 c002d2f0  
9fe0: 00000000 00000000 00000000 c2029ff8 c0045738 c000870c e59f004c e1a01005  
Backtrace:                                                                     
[<c017a054>] (strcpy+0x0/0x24) from [<c0227a78>] (mt9v113_probe+0x90/0x130)    
[<c02279e8>] (mt9v113_probe+0x0/0x130) from [<c02116e8>] (i2c_device_probe+0xa0)
 r7:c043b268 r6:c2023a00 r5:c2023a20 r4:c02279e8                               
[<c0211648>] (i2c_device_probe+0x0/0xc4) from [<c01be8ac>] (driver_probe_device)
 r6:c043b268 r5:c2023a54 r4:c2023a20                                           
[<c01be7fc>] (driver_probe_device+0x0/0x164) from [<c01be9cc>] (__driver_attach)
 r7:c043b268 r6:c043b268 r5:c2023a54 r4:c2023a20                               
[<c01be960>] (__driver_attach+0x0/0x90) from [<c01bdcb4>] (bus_for_each_dev+0x5)
 r6:c01be960 r5:c2029ee0 r4:00000000                                           
[<c01bdc5c>] (bus_for_each_dev+0x0/0x8c) from [<c01be708>] (driver_attach+0x20/)
 r7:00000000 r6:c23c4b40 r5:c043b268 r4:c043b244                               
[<c01be6e8>] (driver_attach+0x0/0x28) from [<c01be280>] (bus_add_driver+0xa4/0x)
[<c01be1dc>] (bus_add_driver+0x0/0x228) from [<c01bedc4>] (driver_register+0xb0)
[<c01bed14>] (driver_register+0x0/0x13c) from [<c02102bc>] (i2c_register_driver)
[<c0210240>] (i2c_register_driver+0x0/0xa0) from [<c001cadc>] (mt9v113_init+0x1)
 r6:c04456ac r5:c0025040 r4:c0024f84                                           
[<c001cac4>] (mt9v113_init+0x0/0x20) from [<c002d340>] (do_one_initcall+0x60/0x)
[<c002d2e0>] (do_one_initcall+0x0/0x1ac) from [<c0008798>] (kernel_init+0x9c/0x)
[<c00086fc>] (kernel_init+0x0/0x110) from [<c0045738>] (do_exit+0x0/0x654)     
 r5:00000000 r4:00000000                                                       
Code: e1a0c00d e92dd800 e24cb004 e1a02000 (e4d13001)                           
---[ end trace 2fb026f5e56724ab ]---                                           
Kernel panic - not syncing: Attempted to kill init!                            
Backtrace:                                                                     
[<c0031730>] (dump_backtrace+0x0/0x110) from [<c0031874>] (dump_stack+0x18/0x1c)
 r6:0000000b r5:c0445e24 r4:c041d6f8                                           
[<c003185c>] (dump_stack+0x0/0x1c) from [<c00424f8>] (panic+0x54/0x134)        
[<c00424a4>] (panic+0x0/0x134) from [<c004579c>] (do_exit+0x64/0x654)          
 r3:c041d6f8 r2:c2028000 r1:00000001 r0:c03adbcc                               
[<c0045738>] (do_exit+0x0/0x654) from [<c00319f4>] (die+0x15c/0x17c)           
[<c0031898>] (die+0x0/0x17c) from [<c0033640>] (__do_kernel_fault+0x6c/0x7c)   
[<c00335d4>] (__do_kernel_fault+0x0/0x7c) from [<c003381c>] (do_page_fault+0x1c)
 r7:00000000 r6:00000000 r5:c2024000 r4:ffffffff                               
[<c0033650>] (do_page_fault+0x0/0x1e4) from [<c00338d4>] (do_translation_fault+)
[<c00338b8>] (do_translation_fault+0x0/0x84) from [<c002d27c>] (do_DataAbort+0x)
 r4:ffffffff                                                                   
[<c002d23c>] (do_DataAbort+0x0/0xa4) from [<c002da2c>] (__dabt_svc+0x4c/0x60)  
Exception stack(0xc2029e00 to 0xc2029e48)                                      
9e00: c043b8c4 00000000 c043b8c4 c043950c c043b2f8 c2023a00 c043b2ac c2023a20  
9e20: c04392c0 00000001 00000000 c2029e54 c2029e58 c2029e48 c0227a78 c017a064  
9e40: a0000013 ffffffff                                                        
 r8:c04392c0 r7:c2023a20 r6:c043b2ac r5:c2029e34 r4:ffffffff                   
[<c017a054>] (strcpy+0x0/0x24) from [<c0227a78>] (mt9v113_probe+0x90/0x130)    
[<c02279e8>] (mt9v113_probe+0x0/0x130) from [<c02116e8>] (i2c_device_probe+0xa0)
 r7:c043b268 r6:c2023a00 r5:c2023a20 r4:c02279e8                               
[<c0211648>] (i2c_device_probe+0x0/0xc4) from [<c01be8ac>] (driver_probe_device)
 r6:c043b268 r5:c2023a54 r4:c2023a20                                           
[<c01be7fc>] (driver_probe_device+0x0/0x164)                                   
davinci_interrupt 368: VBUS error workaround (delay coming)                    
from [<c01be9cc>] (__driver_attach+0x6c/0x90)                                  
 r7:c043b268 r6:c043b268 r5:c2023a54 r4:c2023a20                               
[<c01be960>] (__driver_attach+0x0/0x90) from [<c01bdcb4>] (bus_for_each_dev+0x5)
 r6:c01be960 r5:c2029ee0 r4:00000000                                           
[<c01bdc5c>] (bus_for_each_dev+0x0/0x8c) from [<c01be708>] (driver_attach+0x20/)
 r7:00000000 r6:c23c4b40 r5:c043b268 r4:c043b244                               
[<c01be6e8>] (driver_attach+0x0/0x28) from [<c01be280>] (bus_add_driver+0xa4/0x)
[<c01be1dc>] (bus_add_driver+0x0/0x228) from [<c01bedc4>] (driver_register+0xb0)
[<c01bed14>] (driver_register+0x0/0x13c) from [<c02102bc>] (i2c_register_driver)
[<c0210240>] (i2c_register_driver+0x0/0xa0) from [<c001cadc>] (mt9v113_init+0x1)
 r6:c04456ac r5:c0025040 r4:c0024f84                                           
[<c001cac4>] (mt9v113_init+0x0/0x20) from [<c002d340>] (do_one_initcall+0x60/0x)
[<c002d2e0>] (do_one_initcall+0x0/0x1ac) from [<c0008798>] (kernel_init+0x9c/0x)
[<c00086fc>] (kernel_init+0x0/0x110) from [<c0045738>] (do_exit+0x0/0x654)     
 r5:00000000 r4:00000000                                                       
davinci_interrupt 368: VBUS error workaround (delay coming)                    
davinci_interrupt 368: VBUS error workaround (delay coming)                    

i thhink error is coming becoz kernel is enable to handle address given in  ".platform_data=&mt9v113_pdata"

 

<kernel>=home/dm365/work/leo/kernel/linux-2.6.32

waiting for reply

kailash

 

  • I may not be able to help you from DM365 perspective, but this problem seems to be generic i2c binding issue, where your are passing platform data with wrong values. Can you paste the structure "mt9v113_pdata" here?

  • vaibhav sir

    this is the structure but i still dont know what value we shud pass

     

    struct mt9v113_platform_data {
        char *master;
        int (*power_set) (struct v4l2_int_device *s, enum v4l2_power on);
        int (*ifparm) (struct v4l2_ifparm *p);
        int (*priv_data_set) (void *);
        /* Interface control params */
        bool clk_polarity;
        bool hs_polarity;
        bool vs_polarity;
    };

    but i still dont know what value we shud pass

    this is link for omap board dont know how to change it for leopard

    http://gitorious.org/beagleboard-validation/linux/commit/3d5e34a2aafc643d2406d7fa1e468da9e9e94a27/diffs

    omap34xxcam.h can we use it wit dm365 also but there is no file like

    board-omap3beagle-camera.c is there and u image is even not touching this files

    thanxx

    kailash

  • I was referring to structure instance (where you initialized it) and not to the structure definition.

    Also you are mixing lot of things here, Dm365 is completely different architecture and driver for it also is different. Having said that,you should still be able to use sensor driver and some of the platform hookup/init code related to sensor.

    I hope you understand the V4L2 architecture, where everything is master <-> slave based, where sensor driver is slave driver which registers himself to the master driver via V4L2.

    So direct answer to your question is, You should be using beagle code as a reference for DM365.

    Thanks,

    Vaibhav

  • hi

    sir

    can u suggest any link how to insert driver support fot mt9v113 aptina vga sensor i m not able to get anything wht values to provide to structure

    on the top of the file mt9v113.c

    its written that

      *drivers/media/video/mt9v113.c
     *
     * Based on TI TVP5146/47 decoder driver

    the driver module is there so is that enough to select that module to run vga camera board based on mt9v113 cemos sensor

    i dont have mt9p031 board only vga board is there " LI-LBCMVGA"

    thus dm365 support this board i m using beta rr kernel

    thanxx

  • You have to read the kernel code and understand the basic implementation of the V4L2 internal interfaces. Additionally you can refer to the Kernel documents available @ <kernel home>/Documentation/video4linux/

    And some google on this should help you to fetch some internal documentation on driver hookup.

    Thanks,

    Vaibhav

  • Hi,

       I have recently started working with the DM365 LeapordBoard. I have LI-LBCMVGA camera module only (mt9t113 sensor).

       I have booted the kernel using both ridgerun sdk and leapord's prebuilt uimage and ramdisk binaries.

       Both of them don't appear to recognize the vga camera (no /dev/video0).

       rr doesn't have mt9t113 option in kernel->drivers->multimedia->adapters configuration.

       Can somebody help me to get started with the hardware working (either with rr \ leapordbinaries \ TI's DVSDK )?

       There are instructions to build a 2.6.29 kernel with vga driver here: http://processors.wiki.ti.com/index.php/Leopard_Board_DM355_Software_Overview

        (Links are broken, originally from here: http://designsomething.org/leopardboard/p/support.aspx).

       But the git tree is not available now in kernel.org. Also can I use the prebuilt uImage directly (which is meant for LeapordBoard DM355)? What rootfs will it work with?

    Thanks,

    Arun