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.

How to connect 8-bit data interface of camera module to OMAP4460 CPI interface

Other Parts Discussed in Thread: SYSCONFIG

Dear expert,

Our product have two cameras, one is low resolution for front facing, another is high resolution for back facing. As we know, parallel interface is familiar for low resolution camera module.

The low resolution camera has 8-bit or 10-bit parallel interface named Y0~Y7 or Y0~Y9. How  do these signals connect to CPI interface (cam2_d0~ d15) of  OMAP4460?

Camera module Y0 <-> OMAP4460 cam2_dxx

Camera module Y1 <-> OMAP4460 cam2_dxx

...

Camera module Y9 <-> OMAP4460 cam2_dxx

Best regards,

wells

  • Hi Wells,

    You can refer to the OMAP4460 TRM at http://www.ti.com/general/docs/wtbu/wtbudocumentcenter.tsp?templateId=6123&navigationId=12037 for further details on the cam2_d0~d15 in regards to their pad configurations. You can refer to in particular to Table 18.10 Device Core Control Module Pad Configuration Register Fields under Control Module Functional Description section.

    You can observe that when these cam2_dxx pins are muxed with the CSI2 pins and few of Key Pad Pins. You can look at the above Table for making appropriate assignment as per your needs.

    Thanks & Best Regards,

    Venkat

  • Hi Venkat,

    First thank you for your kind reply. But I still can not find the answer to my question.

    In the TRM, I can find the description of CPI pad configurations. But I can not find the real connection description between camera parallel data port and OMAP4460 CPI port.

    If the interface of camera module is 8-bit parallel interface named cam_d[7:0], how does cam_d[7:0] connect to OMAP4460 CPI cam2_d[15:0]? similarly, how about 10-bit parallel interface?

    Best regards

    wells

  • Can you please help us understand the scope of the work? I hope you realize that TI provides no software support for parallel camera interface. We can help you with hardware related questions, but you will have to develop the driver from scratch.

  • Hello

    Please do not paint the picture in dark colors :)

    If he wants to get only 8-bit data without any other ISP functionality he can write driver by himself. All that he have to do is to read TRM carefully.

  • Dear Experts,

    I think what I ask is hardware related question. I can understand that TI don't support the software of CPI interface.
    But for front facing, the low resolution camera is enough. And for low resolution camera module, parallel port is much popular.
    So our company will develop the software of CPI interface by ourselves.

    I want to connect camera sensor OV7690 to CPI interface of OMAP4460. The output format of OV7690 is 8-bit YUV422/YCbCr422/RGB565/CCIR656/raw RGB data. The signal of OV7690 digital video port is DATA0~DATA7.
    If the MSB bit of OV7690 digital video port is DATA7, then what is the MSB bit of OMAP4460 CPI interface?

  • Hello.

    It depends on what you wan to get :)

    If you connect your 8-bit sensor interface to cam2_d0...cam2_d7 you will get usual 1 byte video data. If you want something other you may connect sensors MSB to other higher bits of CPI.

    All this thing wrapped by ISP settings. Please read TRM carefully and you'll find the answer for most of your questions.

  • Hi Egor,

    I read TRM again, but can not find the answer.

    Can you show me the related ISP setting register and description?

    I learn that you got CPI working on Variscite DVK.

    Can you share some document about it?

  • In short to make CPI support is easy enough:

    1. read TRM - to understand ISS and ISP

    2. read OMAP4 ISS opensource driver - to understand how you can control ISP (whithout this some parts of TRM confuse my understanding :) )

    i made driver not V4L as i spent match time to understand 2 things: V4L and ISS...so i decided to move one of them :)

    driver just alloc dma memory, mmap it to user space, and set up ISS ans ISP...thats all

    I use the following path for video data: ISS VP -> IPIPEIF ->ISIF -> Memory.

    So i switched off all IPIPEIF and ISIF submodules and got an image.

    WBR,

  • Hello,

    Could this path: CPI -> VP -> IPIPEIF -> ISIF -> memory also work when output buffer is in shared region w/out any DMA configured?

    I am trying it on TI 8127 / 8147 / 8148 so board is different, but main question regarding data flow in ISS should be almost the same.

    PRCM registers, ISS_CTRL and ISS_CLKCTRL are set up,  image size related parameters are given, external write (SWEN: ISIF_MODESET bit5 = 1)  and immediate write of registers (ISIF_CCDCFG = 0x8000) enabled, storage of image in memory is enabled (ISIF_SYNCEN = 2; // bit1: DWEN), CADU and CADL are filled with adress pointing into SR1, sync enabled (ISIF_SYNCEN = 3; // bit0: SYEN).

    What could be wrong? I tried with PG input too, but I don't know if I have problem with input or output configuration. 

    Regards 

    Krisztián 

  • Hi.

    I didn't make any espiciall DMA settings. I alloc CMA buffer and set up pointer to it on ISIF settings.

    WBR,

  • Hello Egor,

    thank You for the swift answer! Meanwhile it has turned out that there are obvious problems with the input: no HS_VS_IRQ at all. :-\

    Any ideas what could be the root cause here? Could it be exclusively hw (wiring, pinmux?) or something with ISS input interface configuration?

    Regards
    Krisztián 

  • Hi.

    I also have same problems in early stage. The reason can be any thing like: incorrect ISS settings or IPIPE/ISIF settings. As i made this driver in April i do not remember exaclty all problems and detailt of develop process...sorry.

    Check all setting with TRM again....i'm regular user...so i also had only TRM whithout any magic information about CPI in OM4460. All TI's people told that this interface doesn't support....so i read TRM that's all.

    But next week i'll have to add new sensor to my driver ( with YUV output )...so may be i can answer to you more correctly.

    WBR,

  • Hi Egor,

    Do You have any hints which 'modules' to program at all and in which order?

    Now I keep trying with following sequence:
    0. image sensor PLL and reasonable gain / exp
    1. PRCM for ISP
    2. CSI2 and SC reset 
    3. ISS / ISP5 CTRL, CLKCTRL and SYSCONF registers
    (4. PG - selected if my config with VP input fails)
    5. ISIF
    6. IPIPEIF - not even enabled at this time
    7. IPIPE
    8. RSZ

    I followed Programming Model subchapters of each modules from 4 to 8. I did not subsribed to interrupts at this stage. I just want the device to put something in the shared memory area..

    May I add to my friends on E2E? 

    Krisztián

  • I programmed IPIPEIF and ISIF. I didn't  use PG, RESIZER and IPIPE.

    this is my init sequence:

     if(!VALID_DEVICE(dev))
                    return (-ENODEV);
            
            //prepare register links
            dev->ipipeif.regs_sys1 = dev->regs[OMAP4_ISS_MEM_ISP_SYS1];
            dev->ipipeif.regs_isif = dev->regs[OMAP4_ISS_MEM_ISP_ISIF];
            dev->ipipeif.regs_ipipeif = dev->regs[OMAP4_ISS_MEM_ISP_IPIPEIF];

            //wait until ISP in reset
            while(--timeout > 0)
            {
                    //read SOFTRESET bit
                    val = readl(dev->regs[OMAP4_ISS_MEM_ISP_SYS1] + ISS_HL_SYSCONFIG );
                    deb(0, "ISS ISP state: 0x%.8lX", val);
                    if( !(val & 0x02) )
                            break;
            
                    msleep(500);
            }

            if(!timeout)
            {
                    deb(0, "Timeout expired while waiting ISS ISP reset finished");
                    return (-EBUSY);
            }

            val = readl(dev->regs[OMAP4_ISS_MEM_TOP] + ISS_PM_STATUS );
            deb(0, "ISS PMSTATUS: 0x%.8lX", val);


            //configure PHY level (OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX reg)
            ret = omap4iss_cpiphy_config( dev );
            if(SUCCESS != ret)
            {
                    deb(0, "Failed to config CPI PHY: %d", ret);
                    return ret;
            }
            
            //configure bridge to CPI VP (ISS level ISP5_CTRL reg)
            omap4iss_configure_bridge( dev );

            val = readl(dev->regs[OMAP4_ISS_MEM_ISP_SYS1] + ISP5_CTRL_REG );
            deb(0, "ISS ISP5_CTRL: 0x%.8lX", val);
            val = readl( dev->regs[OMAP4_ISS_MEM_ISP_SYS1] + ISP5_IRQSTATUS_RAW_REG(0) );
            deb(0, "ISS ISP5_IRQSTATUS_RAW0: 0x%.8lX", val);
            val = readl(dev->regs[OMAP4_ISS_MEM_ISP_SYS1] + ISP5_IRQSTATUS(0));
            deb(0, "ISS ISP5_IRQSTATUS0: 0x%.8lX", val);

            //enable IPIPEIF & ISIF clk's
            omap4iss_isp_subclk_enable(dev, IPIPEIF_DRV_SUBCLK_MASK);
            msleep(1);

            deb(0, "init IPIPEIF");
            ipipeif_apply_ipipeif_cfg( &dev->ipipeif );

            deb(0, "init ISIF");
            ipipeif_apply_isif_cfg( &dev->ipipeif );

            //disable IPIPEIF & ISIF clocks
            omap4iss_isp_subclk_disable(dev, IPIPEIF_DRV_SUBCLK_MASK);

            return SUCCESS;

    Hope this will help.

    WBR,

  • hi, Egor.

    I'm working on omap4460 and want to make the cpi interface available.  As far as I know, Ti do not support the cpi interface, and I have read all the information you posted  on the forum. But I am still not clear with all the things, So I want to ask you some questions:

    1. you said your cpi driver based on Sergio Aguirre CSI driver, did you mean http://dev.omapzoom.org/?p=saaguirre/linux-omap-camera.git;a=summary ?

    but i t is for omap3iss. If i was wrong, please tell me the right code tree.

    2.Did you have some document or tips about how to make cpi work ? If convenient, can I have a copy of your source code?

    Thank you for you reply.

  • Hi, Andy.

    My driver basically use https://gitorious.org/omap4-v4l2-camera/pages/Home omap4iss driver.

    This driver do most things that you need to make CPI working.

    My driver isn't V4L, so i neeed an example how to work with ISS, ISP subblocks.

    So as i described before:

    - allocate DMA memory

    - set up ISS to use CPI

    - set up IPIPEIF, ISIF properly according my sensor's needs

    - start video from sensor and wait for interrupts form ISS and ISP.

    It's simple enough...

    About 2 - it'll be violation of my contract...sorry.

    If you have any other questions i'll glad to answer

    WBR,

  • Egor, thanks for your replay, but i still do not quite understand your describe.

    1. you said the omap4iss drive and your own driver, what is the relationship between them? Do you mean you changed the omap4iss driver code or you wrote a driver by your self that refered to omap4iss driver code?

    2. omap4iss is based on v4l2, but your driver is not v4l2, when you say the example how to work with iss, isp subblocks, do you mean the way omap4iss driver did to make iss, isp subblocks work?

    my email is shenxm06@gmail.com, look forward to your reply.

  • 1. They both working with ISS/ISP :)

    I had to write CPi driver very fast but TRM describes clearly not all questions. No one from TI or Variscite support didn't want to answer my questions. The only things what i got in that moment were TRM and Sergio's CSI V4L driver.

    This driver helped to understand how can i se tup DMA pointers in ISIF registers - i didn't understand this from TRM.

    After that i wrote usual charaster driver which knows nothing about V4L.

    So next was simple - alloc buffers, set up clocks, set up ISS and ISP from TRM, start sensor, wait for interrupts.

  • ipipeif_apply_ipipeif_cfg( &dev->ipipeif );
    ipipeif_apply_isif_cfg( &dev->ipipeif );

    what configuration table's do you use?

    can you tell what chip(sensor model) do you make's to work?

  • Hi,

    8.3.4.1 ISS ISP PG Programming Model

    8.3.4.3.1.2 ISS ISP IPIPEIF Register Setup

    8.3.4.2.1.2 ISS ISP ISIF Register Setup

    We use Aptina MT9P031 RGB sensor and Sony AF YCrCB sensors.

    WBR,

  • Hi Egor,

    I am working on omap4460 and i am trying to enable CPI port.

    can you please share with me some information regarding your solution.

    i would appreciate it if you will please contact me :

    ofer@trego.co.il

    thanks

             ofer

  • Hi, Ofer.

    We disscussed this question much times.

    What exactly you don't understand whith ISS/ISP CPI support? Have you tried to write some of code?

    I think at first you have to write driver which configures ISS part, if you will see ISS high level interrupts from your sensor you can try to programm ISP registers for your sensor.

    WBR,

  • Hi Egor

    Thank you for your swift reply.

    I am trying to configure the CPI through devmem2 from userspace.

    I am familiar with the cpi since I enabled it on top of dm814x processor.

    the way I am trying to enable it is use gstreamer with openmax plugin. 

    I am running a pipe that does capture from CSI port -> HDMI/LCD display.

    another camera is connected to the CPI port and I am trying to configure ISS registers and iomux to move to CPI while playing.

    Do you think this way I can operate the port ?

    How did you test the CPI, do you have some kind of userspace program that I can use for testing ?

    Can you give me more tips about what is the right sequence to get the port working?

    Thanks

    Ofer

  • I don't use gsreamer and OMX.

    I wrote userspace programm which get data from mapped buffers and draw it.

    May be devmem2 is a good choise for start but you have to write some of driver. You need alloc DMA consistent memory and map it to userspace. I don't think than you can do this with devmem2 :)

    I described several times CPI configuration sequence in this thread or other on this forum....try to search.