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.

Camera support on OMAP3530

Other Parts Discussed in Thread: OMAP3530, DM3730

I use the Gingerbread-dev-Kit with 2.6.37 Kernel on OMAP3530,
but know I hope someone can help me on porting a driver for this OV3640...

I find that there is the driver for OV3640 in linux 2.6.32, have to  port it to linux 2.6.37?

have to modify board-omap3beagle-camera.c for adding OV3640 support to i2c subsystem.?

then do I select devkit 1.0 release or devkit 2.0 ?

"http://e2e.ti.com/support/embedded/android/f/509/t/111591.aspx

1. rowboat gingerbread devkit 1.0 release supports camera on beagleboard  "


Every guide or hint will be helpful!
Regards,

  • HI,

    why do you suggest use DevKit_2.1? I use OMAP3530 now and will use DM3730 later.

    DevKit_1.0 support for the OMAP35x EVM, AM35x EVM, AM37x EVM, DM37x EVM, Beagleboard Rev Cx and Beagleboard XM and TI DVSDK 4.01 for DM3730 , but DevKit_2.1 This release supports AM35x, AM37x Texas Instruments AM37x EVM (on the Mistral Rev G AM3715EVM) Texas Instruments AM35x EVM Beagleboard Rev Cx Beagleboard XM Rev A/B/C .

    DevKit_2.1 do not support DM3730. I think that DevKit_1.0 support better for OMAP3530 and DM3730 than DevKit_2.1?

    Regards,

    jian

  • Hi Jian,

    As you mentioned that you are using OMAP3530 so I mentioned about 2.1 release.

    If you are using DM3730 then you may stick to 1.0 release.

    If you want latest components you may refer to below wiki page.

    http://code.google.com/p/rowboat/wiki/TI_DM37x_Android_2_3_4_MM_Acceleration

    Regards,

    Pankaj Bharadiya

  • HI,

    thanks,

     (DVSDK) 4_01_00_09 for the OMAP3530 platform is based on linux 2.6.32, So I must use linux 2.6.32?

    As you mentioned that DVSDK is  supported  on Devkit 2.1.

    but  I do not find that  it   support OMAP3530 on Devkit 2.1 and Devkit 1.0.

    Will  you port  (DVSDK) 4_01_00_09 for the OMAP3530 platform from linux 2.6.32 to  linux 2.6.37?  or it is support on DevKit 2.1 for OMAP3530 later.?

    Regards,

    Jian

     

  • Hi Jian,

    DVSDK is not supported on 2.1 for OMAP3530 platfrom.

    Right now there are no plans to port DVSDK on 2.6.37 kernel of OMAP3530 platfrom.

    Please stick to 1.0 release if you are using OMAP3530 platform.

    Regards,

    Pankaj Bharadiya

  •      I am facing some problem in ov3640 interfaced with omap 3530 8bit interface. there is the ov3640 driver which use RAW 10 bit interface in devkit 1.0. how do I configure it to support V4L2_PIX_FMT_UYVY YUV 422?

    #define LDPCAM_USE_XCLKB 1

    #define VAUX_1_8_V  0x05
    #define VAUX_DEV_GRP_P1  0x20
    #define VAUX_DEV_GRP_NONE 0x00

    #if defined(CONFIG_VIDEO_OV3640) || defined(CONFIG_VIDEO_OV3640_MODULE)
    #define OV3640_RESET_GPIO   98
    #define OV3640_STANDBY_GPIO 7
    #include <media/ov3640.h>
    #include <../drivers/media/video/isp/ispcsi2.h>
    #define OV3640_CSI2_CLOCK_POLARITY 0 /* +/- pin order */
    #define OV3640_CSI2_DATA0_POLARITY 0 /* +/- pin order */
    #define OV3640_CSI2_DATA1_POLARITY 0 /* +/- pin order */
    #define OV3640_CSI2_CLOCK_LANE  1  /* Clock lane position: 1 */
    #define OV3640_CSI2_DATA0_LANE  2  /* Data0 lane position: 2 */
    #define OV3640_CSI2_DATA1_LANE  3  /* Data1 lane position: 3 */
    #define OV3640_CSI2_PHY_THS_TERM 4
    #define OV3640_CSI2_PHY_THS_SETTLE 14
    #define OV3640_CSI2_PHY_TCLK_TERM 0
    #define OV3640_CSI2_PHY_TCLK_MISS 1
    #define OV3640_CSI2_PHY_TCLK_SETTLE 14

    #define OV3640_BIGGEST_FRAME_BYTE_SIZE PAGE_ALIGN(2048 * 1536 * 2)

    static struct omap34xxcam_sensor_config ov3640_hwc = {
     .sensor_isp = 0,
     .capture_mem = OV3640_BIGGEST_FRAME_BYTE_SIZE * 2,
     .ival_default = { 1, 15 },
    };

    static struct isp_interface_config ov3640_if_config = {
     .ccdc_par_ser = ISP_CSIA,
     .dataline_shift = 0x0,
     .hsvs_syncdetect = ISPCTRL_SYNC_DETECT_VSRISE,
     .strobe = 0x0,
     .prestrobe = 0x0,
     .shutter = 0x0,
     .prev_sph = 2,
     .prev_slv = 1,
     .wenlog = ISPCCDC_CFG_WENLOG_AND,
     .wait_hs_vs = 2,
     .u.csi.crc = 0x0,
     .u.csi.mode = 0x0,
     .u.csi.edge = 0x0,
     .u.csi.signalling = 0x0,
     .u.csi.strobe_clock_inv = 0x0,
     .u.csi.vs_edge = 0x0,
     .u.csi.channel = 0x1,
     .u.csi.vpclk = 0x1,
     .u.csi.data_start = 0x0,
     .u.csi.data_size = 0x0,
     .u.csi.format = V4L2_PIX_FMT_SGRBG10,
    };

    static int ov3640_sensor_set_prv_data(struct v4l2_int_device *s, void *priv)
    {
     struct omap34xxcam_hw_config *hwc = priv;

     hwc->u.sensor.sensor_isp = ov3640_hwc.sensor_isp;
     hwc->dev_index = 1;
     hwc->dev_minor = 4;
     hwc->dev_type = OMAP34XXCAM_SLAVE_SENSOR;
     return 0;
    }

    static int ov3640_sensor_power_set(struct v4l2_int_device *s,
           enum v4l2_power power)
    {
     struct omap34xxcam_videodev *vdev = s->u.slave->master->priv;
     struct isp_csi2_lanes_cfg lanecfg;
     struct isp_csi2_phy_cfg phyconfig;
     static enum v4l2_power previous_power = V4L2_POWER_OFF;

     if (!cam_inited) {
      printk(KERN_ERR "OV3640: Unable to control board GPIOs!\n");
      return -EFAULT;
     }

     switch (power) {
     case V4L2_POWER_ON:
      if (previous_power == V4L2_POWER_OFF)
       isp_csi2_reset();
      lanecfg.clk.pol = OV3640_CSI2_CLOCK_POLARITY;
      lanecfg.clk.pos = OV3640_CSI2_CLOCK_LANE;
      lanecfg.data[0].pol = OV3640_CSI2_DATA0_POLARITY;
      lanecfg.data[0].pos = OV3640_CSI2_DATA0_LANE;
      lanecfg.data[1].pol = OV3640_CSI2_DATA1_POLARITY;
      lanecfg.data[1].pos = OV3640_CSI2_DATA1_LANE;
      lanecfg.data[2].pol = 0;
      lanecfg.data[2].pos = 0;
      lanecfg.data[3].pol = 0;
      lanecfg.data[3].pos = 0;
      isp_csi2_complexio_lanes_config(&lanecfg);
      isp_csi2_complexio_lanes_update(true);

      phyconfig.ths_term = OV3640_CSI2_PHY_THS_TERM;
      phyconfig.ths_settle = OV3640_CSI2_PHY_THS_SETTLE;
      phyconfig.tclk_term = OV3640_CSI2_PHY_TCLK_TERM;
      phyconfig.tclk_miss = OV3640_CSI2_PHY_TCLK_MISS;
      phyconfig.tclk_settle = OV3640_CSI2_PHY_TCLK_SETTLE;
      isp_csi2_phy_config(&phyconfig);
      isp_csi2_phy_update(true);

      isp_configure_interface(vdev->cam->isp, &ov3640_if_config);

      if (previous_power == V4L2_POWER_OFF) {
       /* turn on analog power */
       twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
         VAUX_1_8_V, TWL4030_VAUX4_DEDICATED);
       twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
         VAUX_DEV_GRP_P1, TWL4030_VAUX4_DEV_GRP);
       udelay(100);
       /* Turn ON Omnivision sensor */
       gpio_set_value(OV3640_RESET_GPIO, 1);
       gpio_set_value(OV3640_STANDBY_GPIO, 0);
       udelay(100);

       /* RESET Omnivision sensor */
       gpio_set_value(OV3640_RESET_GPIO, 0);
       udelay(100);
       gpio_set_value(OV3640_RESET_GPIO, 1);
      }
      break;
     case V4L2_POWER_OFF:
      /* Power Down Sequence */
      isp_csi2_complexio_power(ISP_CSI2_POWER_OFF);
      twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
        VAUX_DEV_GRP_NONE, TWL4030_VAUX4_DEV_GRP);
      break;
     case V4L2_POWER_STANDBY:
      break;
     }
     previous_power = power;
     return 0;
    }

    static u32 ov3640_sensor_set_xclk(struct v4l2_int_device *s, u32 xclkfreq)
    {
     struct omap34xxcam_videodev *vdev = s->u.slave->master->priv;

     return isp_set_xclk(vdev->cam->isp, xclkfreq, LDPCAM_USE_XCLKB);
    }

    struct ov3640_platform_data ldp_ov3640_platform_data = {
     .power_set  = ov3640_sensor_power_set,
     .priv_data_set  = ov3640_sensor_set_prv_data,
     .set_xclk  = ov3640_sensor_set_xclk,
    };

    #endif

    Will anyone give me some suggestion?

    best regards

     

  •     I am  also facing the some problem in ov3640 interfaced with omap 3530 8bit interface. ther is the ov3640 driver which use RAW 10bit interface,how do I configure it to support V4L2_PIX_FMT_UYVY YUV 422.

    static struct omap34xxcam_sensor_config ov3640_hwc = {
     .sensor_isp = 0,
     .capture_mem = OV3640_BIGGEST_FRAME_BYTE_SIZE * 2,
     .ival_default = { 1, 15 },
    };

    static struct isp_interface_config ov3640_if_config = {
     .ccdc_par_ser = ISP_CSIA,
     .dataline_shift = 0x0,
     .hsvs_syncdetect = ISPCTRL_SYNC_DETECT_VSRISE,
     .strobe = 0x0,
     .prestrobe = 0x0,
     .shutter = 0x0,
     .prev_sph = 2,
     .prev_slv = 1,
     .wenlog = ISPCCDC_CFG_WENLOG_AND,
     .wait_hs_vs = 2,
     .u.csi.crc = 0x0,
     .u.csi.mode = 0x0,
     .u.csi.edge = 0x0,
     .u.csi.signalling = 0x0,
     .u.csi.strobe_clock_inv = 0x0,
     .u.csi.vs_edge = 0x0,
     .u.csi.channel = 0x1,
     .u.csi.vpclk = 0x1,
     .u.csi.data_start = 0x0,
     .u.csi.data_size = 0x0,
     .u.csi.format = V4L2_PIX_FMT_SGRBG10,
    };

    static int ov3640_sensor_set_prv_data(struct v4l2_int_device *s, void *priv)
    {
     struct omap34xxcam_hw_config *hwc = priv;

     hwc->u.sensor.sensor_isp = ov3640_hwc.sensor_isp;
     hwc->dev_index = 1;
     hwc->dev_minor = 4;
     hwc->dev_type = OMAP34XXCAM_SLAVE_SENSOR;
     return 0;
    }

    static int ov3640_sensor_power_set(struct v4l2_int_device *s,
           enum v4l2_power power)
    {
     struct omap34xxcam_videodev *vdev = s->u.slave->master->priv;
     struct isp_csi2_lanes_cfg lanecfg;
     struct isp_csi2_phy_cfg phyconfig;
     static enum v4l2_power previous_power = V4L2_POWER_OFF;

     if (!cam_inited) {
      printk(KERN_ERR "OV3640: Unable to control board GPIOs!\n");
      return -EFAULT;
     }

     switch (power) {
     case V4L2_POWER_ON:
      if (previous_power == V4L2_POWER_OFF)
       isp_csi2_reset();
      lanecfg.clk.pol = OV3640_CSI2_CLOCK_POLARITY;
      lanecfg.clk.pos = OV3640_CSI2_CLOCK_LANE;
      lanecfg.data[0].pol = OV3640_CSI2_DATA0_POLARITY;
      lanecfg.data[0].pos = OV3640_CSI2_DATA0_LANE;
      lanecfg.data[1].pol = OV3640_CSI2_DATA1_POLARITY;
      lanecfg.data[1].pos = OV3640_CSI2_DATA1_LANE;
      lanecfg.data[2].pol = 0;
      lanecfg.data[2].pos = 0;
      lanecfg.data[3].pol = 0;
      lanecfg.data[3].pos = 0;
      isp_csi2_complexio_lanes_config(&lanecfg);
      isp_csi2_complexio_lanes_update(true);

      phyconfig.ths_term = OV3640_CSI2_PHY_THS_TERM;
      phyconfig.ths_settle = OV3640_CSI2_PHY_THS_SETTLE;
      phyconfig.tclk_term = OV3640_CSI2_PHY_TCLK_TERM;
      phyconfig.tclk_miss = OV3640_CSI2_PHY_TCLK_MISS;
      phyconfig.tclk_settle = OV3640_CSI2_PHY_TCLK_SETTLE;
      isp_csi2_phy_config(&phyconfig);
      isp_csi2_phy_update(true);

      isp_configure_interface(vdev->cam->isp, &ov3640_if_config);

      if (previous_power == V4L2_POWER_OFF) {
       /* turn on analog power */
       twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
         VAUX_1_8_V, TWL4030_VAUX4_DEDICATED);
       twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
         VAUX_DEV_GRP_P1, TWL4030_VAUX4_DEV_GRP);
       udelay(100);
       /* Turn ON Omnivision sensor */
       gpio_set_value(OV3640_RESET_GPIO, 1);
       gpio_set_value(OV3640_STANDBY_GPIO, 0);
       udelay(100);

       /* RESET Omnivision sensor */
       gpio_set_value(OV3640_RESET_GPIO, 0);
       udelay(100);
       gpio_set_value(OV3640_RESET_GPIO, 1);
      }
      break;
     case V4L2_POWER_OFF:
      /* Power Down Sequence */
      isp_csi2_complexio_power(ISP_CSI2_POWER_OFF);
      twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
        VAUX_DEV_GRP_NONE, TWL4030_VAUX4_DEV_GRP);
      break;
     case V4L2_POWER_STANDBY:
      break;
     }
     previous_power = power;
     return 0;
    }

    best regards,

     

  •     I am  also facing  some problem in ov3640 interfaced with omap 3530 8bit interface. ther is the ov3640 driver which use RAW 10bit interface in devkit 1.0,how do I configure it to support V4L2_PIX_FMT_UYVY YUV 422.   there is the reference in board-ldp-camera.c.

    static struct omap34xxcam_sensor_config ov3640_hwc = {
     .sensor_isp = 0,
     .capture_mem = OV3640_BIGGEST_FRAME_BYTE_SIZE * 2,
     .ival_default = { 1, 15 },
    };

    static struct isp_interface_config ov3640_if_config = {
     .ccdc_par_ser = ISP_CSIA,
     .dataline_shift = 0x0,
     .hsvs_syncdetect = ISPCTRL_SYNC_DETECT_VSRISE,
     .strobe = 0x0,
     .prestrobe = 0x0,
     .shutter = 0x0,
     .prev_sph = 2,
     .prev_slv = 1,
     .wenlog = ISPCCDC_CFG_WENLOG_AND,
     .wait_hs_vs = 2,
     .u.csi.crc = 0x0,
     .u.csi.mode = 0x0,
     .u.csi.edge = 0x0,
     .u.csi.signalling = 0x0,
     .u.csi.strobe_clock_inv = 0x0,
     .u.csi.vs_edge = 0x0,
     .u.csi.channel = 0x1,
     .u.csi.vpclk = 0x1,
     .u.csi.data_start = 0x0,
     .u.csi.data_size = 0x0,
     .u.csi.format = V4L2_PIX_FMT_SGRBG10,
    };

    static int ov3640_sensor_set_prv_data(struct v4l2_int_device *s, void *priv)
    {
     struct omap34xxcam_hw_config *hwc = priv;

     hwc->u.sensor.sensor_isp = ov3640_hwc.sensor_isp;
     hwc->dev_index = 1;
     hwc->dev_minor = 4;
     hwc->dev_type = OMAP34XXCAM_SLAVE_SENSOR;
     return 0;
    }

    static int ov3640_sensor_power_set(struct v4l2_int_device *s,
           enum v4l2_power power)
    {
     struct omap34xxcam_videodev *vdev = s->u.slave->master->priv;
     struct isp_csi2_lanes_cfg lanecfg;
     struct isp_csi2_phy_cfg phyconfig;
     static enum v4l2_power previous_power = V4L2_POWER_OFF;

     if (!cam_inited) {
      printk(KERN_ERR "OV3640: Unable to control board GPIOs!\n");
      return -EFAULT;
     }

     switch (power) {
     case V4L2_POWER_ON:
      if (previous_power == V4L2_POWER_OFF)
       isp_csi2_reset();
      lanecfg.clk.pol = OV3640_CSI2_CLOCK_POLARITY;
      lanecfg.clk.pos = OV3640_CSI2_CLOCK_LANE;
      lanecfg.data[0].pol = OV3640_CSI2_DATA0_POLARITY;
      lanecfg.data[0].pos = OV3640_CSI2_DATA0_LANE;
      lanecfg.data[1].pol = OV3640_CSI2_DATA1_POLARITY;
      lanecfg.data[1].pos = OV3640_CSI2_DATA1_LANE;
      lanecfg.data[2].pol = 0;
      lanecfg.data[2].pos = 0;
      lanecfg.data[3].pol = 0;
      lanecfg.data[3].pos = 0;
      isp_csi2_complexio_lanes_config(&lanecfg);
      isp_csi2_complexio_lanes_update(true);

      phyconfig.ths_term = OV3640_CSI2_PHY_THS_TERM;
      phyconfig.ths_settle = OV3640_CSI2_PHY_THS_SETTLE;
      phyconfig.tclk_term = OV3640_CSI2_PHY_TCLK_TERM;
      phyconfig.tclk_miss = OV3640_CSI2_PHY_TCLK_MISS;
      phyconfig.tclk_settle = OV3640_CSI2_PHY_TCLK_SETTLE;
      isp_csi2_phy_config(&phyconfig);
      isp_csi2_phy_update(true);

      isp_configure_interface(vdev->cam->isp, &ov3640_if_config);

      if (previous_power == V4L2_POWER_OFF) {
       /* turn on analog power */
       twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
         VAUX_1_8_V, TWL4030_VAUX4_DEDICATED);
       twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
         VAUX_DEV_GRP_P1, TWL4030_VAUX4_DEV_GRP);
       udelay(100);
       /* Turn ON Omnivision sensor */
       gpio_set_value(OV3640_RESET_GPIO, 1);
       gpio_set_value(OV3640_STANDBY_GPIO, 0);
       udelay(100);

       /* RESET Omnivision sensor */
       gpio_set_value(OV3640_RESET_GPIO, 0);
       udelay(100);
       gpio_set_value(OV3640_RESET_GPIO, 1);
      }
      break;
     case V4L2_POWER_OFF:
      /* Power Down Sequence */
      isp_csi2_complexio_power(ISP_CSI2_POWER_OFF);
      twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
        VAUX_DEV_GRP_NONE, TWL4030_VAUX4_DEV_GRP);
      break;
     case V4L2_POWER_STANDBY:
      break;
     }
     previous_power = power;
     return 0;
    }

     

    best regards,