i.MX6Q : Parallel CSI#2 not working

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX6Q : Parallel CSI#2 not working

Jump to solution
6,627 Views
frederic_coiffi
Contributor II

We have made a custom board based on i.MX6Q able to manage camera connected either to :

  • Parallel CSI#1 : camera module OV5642
  • Parallel CSI#2 : camera module OV5642
  • MIPI CSI : camera module OV5640

Parallel CSI#1 and MIPI CSI are well supported, but parallel CSI#2 isn’t working…

We have checked and re-checked the IOMUX and believe the problem can’t be there.

We haven’t found compiling option (in Linux .config) related to parallel CSI#2 support.

Freescale document fix about CSI numbering : The latest Rev 1 or i.MX6 RM for D&Q says the second parallel camera is connected to CSI1 whereas previous version of the same document said it was connected to CSI0. Was it purely a document issue or is it linked to a silicium revision of i.MX6Q ?

Strange observation #1 : Can’t make IPU#2 working

This could fully explain our problem. Parallel CSI#2 camera can only work on IPU#2 but MIPI CSI camera can run either on IPU#1 or IPU#2 and we didn’t succeed in making it work on IPU#2.

In the code, IPU#2 seems initialized by imx6q_add_ipuv3(1, &ipu_data[1]);

Strange observation #2 : First parallel CSI camera requires MIPI CSI support

Using a single camera connected on the first parallel CSI port, we can’t make it work without MIPI CSI support… If the following 2 lines are removed, it doesn’t work :

                imx6q_add_v4l2_capture(1, &capture_data[1]);

                imx6q_add_mipi_csi2(&mipi_csi2_pdata);

So it seems there is a global initialisation done by one of the above lines that is required to support the first CSI camera.

Has anybody succeeded in making the second parallel CSI camera work ? Does it require a particular patch ?

Regards.

Labels (2)
Tags (2)
1 Solution
1,252 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

The default Freescale BSP supports two camera: one CSI parallel camera and one mipi camera.
For your three camera use case, the followed setting was needed in board-mx6q_sabresd.c:

static struct fsl_mxc_capture_platform_data capture_data[] = {
{
  .csi = 0,
  .ipu = 0,
  .mclk_source = 0,
  .is_mipi = 0,
}, {
  .csi = 1,
  .ipu = 0,
  .mclk_source = 0,
  .is_mipi = 1,
}, {
  .csi = 1,
  .ipu = 1,
  .mclk_source = 0,
  .is_mipi = 0,
},
};

static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.ipu_id  = 0,
.csi_id = 1,
.v_channel = 0,
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
};

static struct fsl_mxc_camera_platform_data mipi_csi2_data = {
.mclk = 24000000,
.mclk_source = 0,
.csi = 1,
.io_init = mx6q_mipi_sensor_io_init,
.pwdn = mx6q_mipi_powerdown,
};

static struct fsl_mxc_camera_platform_data camera_data = {
.mclk = 24000000,
.mclk_source = 0,
.csi = 0,
.io_init = mx6q_csi0_io_init,
.pwdn = mx6q_csi0_cam_powerdown,
};

static struct fsl_mxc_camera_platform_data camera2_data = {
.mclk = 24000000,
.mclk_source = 0,
.csi = 1,
.io_init = mx6q_csi1_io_init,
.pwdn = mx6q_csi1_cam_powerdown,
};

static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {
{
  I2C_BOARD_INFO("ov564x", 0x3c),
  .platform_data = (void *)&camera_data,
},
};

static struct i2c_board_info mxc_i2c1_board_info[] __initdata = {
{
  I2C_BOARD_INFO("ov5640_mipi", 0x3c),
  .platform_data = (void *)&mipi_csi2_data,
},
};

static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {
{
  I2C_BOARD_INFO("ov564x", 0x3c),
  .platform_data = (void *)&camera2_data,
},
};

In function mx6q_mipi_sensor_io_init():
if (cpu_is_mx6q())
  mxc_iomux_set_gpr_register(1, 19, 1, 1);

In function mx6q_csi0_io_init():
if (cpu_is_mx6q())
  mxc_iomux_set_gpr_register(1, 19, 1, 1);

In function mx6q_csi1_io_init():
if (cpu_is_mx6q())
  mxc_iomux_set_gpr_register(1, 20, 1, 1);

In function mx6_sabresd_board_init():
imx6q_add_v4l2_capture(0, &capture_data[0]);
imx6q_add_v4l2_capture(1, &capture_data[1]);
imx6q_add_v4l2_capture(2, &capture_data[2]);
imx6q_add_mipi_csi2(&mipi_csi2_pdata);

View solution in original post

0 Kudos
17 Replies
1,252 Views
liyu1
Contributor III

Dear :

     Qiang !

 

  my platform is:

 imx6Q

   OS: android 4.2.2 jb_1.1.0


   I want to open csi0(parallel camera) + csi1(parallel tvin) + mipi three camera functions in the following ways:


 static struct fsl_mxc_camera_platform_data camera_data = {

    .mclk = 24000000,

    .mclk_source = 0,

   .csi = 0,

    .io_init = mx6q_csi0_io_init,

    .pwdn = mx6q_csi0_cam_powerdown,

};

static struct fsl_mxc_tvin_platform_data adv7180_data = {

    .dvddio_reg    = NULL,

    .dvdd_reg    = NULL,

    .avdd_reg    = NULL,

    .pvdd_reg    = NULL,

    .pwdn        = adv7180_pwdn,

    .reset        = adv7180_reset,

    .cvbs        = true,

    .io_init    = mx6q_csi1_io_init,

};

  adv7180 driver probe is as follows:

memset(&adv7180_data, 0, sizeof(adv7180_data));

    adv7180_data.sen.i2c_client = client;

    adv7180_data.sen.streamcap.timeperframe.denominator = 30;

    adv7180_data.sen.streamcap.timeperframe.numerator = 1;

    adv7180_data.std_id = V4L2_STD_ALL;

    video_idx = ADV7180_NOT_LOCKED;

    adv7180_data.sen.pix.width = video_fmts[video_idx].raw_width;

    adv7180_data.sen.pix.height = video_fmts[video_idx].raw_height;

    adv7180_data.sen.pix.pixelformat = V4L2_PIX_FMT_UYVY;  /* YUV422 */

    adv7180_data.sen.pix.priv = 1;  /* 1 is used to indicate TV in */

    adv7180_data.sen.on = true;

    adv7180_data.sen.csi = 1;

static struct fsl_mxc_camera_platform_data mipi_csi2_data = {

    .mclk = 24000000,

    .mclk_source = 0,

    .csi = 1,

    .io_init = mx6q_mipi_sensor_io_init,

    .pwdn = mx6q_mipi_powerdown,

};

static struct mipi_csi2_platform_data mipi_csi2_pdata = {

    .ipu_id     = 0,

    .csi_id = 1,

    .v_channel = 0,

    .lanes = 2,

    .dphy_clk = "mipi_pllref_clk",

    .pixel_clk = "emi_clk",

};

static struct fsl_mxc_capture_platform_data capture_data[] = {

    {

        .csi = 0,

        .ipu = 0,

        .mclk_source = 0,

        .is_mipi = 0,

    }, {

        .csi = 1,

        .ipu = 0,

        .mclk_source = 0,

        .is_mipi = 1,

    },{

        .csi = 1,

        .ipu = 1,

        .mclk_source = 0,

        .is_mipi = 0,

    },

};

//register

 imx6q_add_v4l2_capture(0, &capture_data[0]);

    imx6q_add_v4l2_capture(1, &capture_data[1]);

    imx6q_add_v4l2_capture(2, &capture_data[2]);

   imx6q_add_mipi_csi2(&mipi_csi2_pdata);

  ls /dev/video*                                   

  video0  video1  video16 video17 video18 video19 video2

 init.freescale.rc prop setting is as follows:

    setprop back_camera_name ov5640_mipi,adv7180_decoder

    setprop back_camera_orient 90

    setprop front_camera_name mt9d112

    setprop front_camera_orient 90

   When registering using the above methods, I found mipi cameracan not be used

 Because the camera is not detected,log is as follows:

root@android:/ # logcat |grep aHAL

I/FslCameraHAL( 2389): Face Back Camera is ov5640_mipi,adv7180_decoder, orient is 90

 

I/FslCameraHAL( 2389): Face Front Camera is mt9d112, orient is 90

I/FslCameraHAL( 2389): Checking the camera ov5640_mipi

I/FslCameraHAL( 2389): Checking the camera adv7180_decoder

I/FslCameraHAL( 2389): Get sensor adv7180_decoder's dev path /dev/video2

I/FslCameraHAL( 2389): Camera ID 0: name adv7180_decoder, Facing 0, orientation 90, dev path /dev/video2

I/FslCameraHAL( 2389): Checking the camera mt9d112

I/FslCameraHAL( 2389): Get sensor mt9d112's dev path /dev/video0

I/FslCameraHAL( 2389): Camera ID 1: name mt9d112, Facing 1, orientation 90, dev path /dev/video0


/dev/video1 is ov5640_mipi Not been detected !

 But when I commented :

   //imx6q_add_v4l2_capture(2, &capture_data[2]);

 /*{

        I2C_BOARD_INFO("adv7180", 0x21),

        .platform_data = (void *)&adv7180_data,

    },*/

root@android:/ # logcat |grep aHAL

I/FslCameraHAL( 2384): Face Back Camera is ov5640_mipi,adv7180_decoder, orient is 90

I/FslCameraHAL( 2384): Face Front Camera is mt9d112, orient is 90

I/FslCameraHAL( 2384): Checking the camera ov5640_mipi

I/FslCameraHAL( 2384): Get sensor ov5640_mipi's dev path /dev/video1

I/FslCameraHAL( 2384): Camera ID 0: name ov5640_mipi, Facing 0, orientation 90, dev path /dev/video1

I/FslCameraHAL( 2384): Checking the camera mt9d112

I/FslCameraHAL( 2384): Get sensor mt9d112's dev path /dev/video0

I/FslCameraHAL( 2384): Camera ID 1: name mt9d112, Facing 1, orientation 90, dev path /dev/video0

mipi camera and mt9d112 work fine !

  Please help me !

  how to let kernel(3.0.35) support csi0(parallel camera) + csi1(parallel tvin) +mipi csi2 three camera in kernel ?

Abstraction layer has been completed  !

 

I have achieved csi0 (parallel camera) +  mipi + uvc switch  between three camera .


But our projects have to support  csi0 (parallel camera) + csi1 (parallel tvin) + mipi csi2 three camera!


I feel android 4.2.2 mipi camera and csi1 (parallel tvin) can not be registered at the same time


Please help me !



0 Kudos
1,252 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think you'd better to try three cameras in Linux first, this make sure the kernel driver is OK for such use case, for Android HAL to support three cameras, this is another issue.

0 Kudos
1,252 Views
liyu1
Contributor III

HI :

    Qiang li !

     How to let  Android HAL to support three cameras ?

0 Kudos
1,252 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi liyu, we had never implemented three cameras in Android, so if you need this special feature, I think you can ask for software service to Freescale marketing people.

0 Kudos
1,252 Views
liyu1
Contributor III

Hi:

    Qiang Li,

           Now I just let HAL layer supports two cameras(mipi (ov5640) + csi 0(mt9d112)), but the kernel I registered three camera

   (mipi (ov5640) + csi0(mt9d112) +csi1 (adv7180)) ,


 In kernel : 


        I registered three camera


static struct fsl_mxc_camera_platform_data camera_data = {

    .mclk = 24000000,

    .mclk_source = 0,

   .csi = 0,

    .io_init = mx6q_csi0_io_init,

    .pwdn = mx6q_csi0_cam_powerdown,

};

static struct fsl_mxc_tvin_platform_data adv7180_data = {

    .dvddio_reg    = NULL,

    .dvdd_reg    = NULL,

    .avdd_reg    = NULL,

    .pvdd_reg    = NULL,

    .pwdn        = adv7180_pwdn,

    .reset        = adv7180_reset,

    .cvbs        = true,

    .io_init    = mx6q_csi1_io_init,

};

  adv7180 driver probe is as follows:

   memset(&adv7180_data, 0, sizeof(adv7180_data));

    adv7180_data.sen.i2c_client = client;

    adv7180_data.sen.streamcap.timeperframe.denominator = 30;

    adv7180_data.sen.streamcap.timeperframe.numerator = 1;

    adv7180_data.std_id = V4L2_STD_ALL;

    video_idx = ADV7180_NOT_LOCKED;

    adv7180_data.sen.pix.width = video_fmts[video_idx].raw_width;

    adv7180_data.sen.pix.height = video_fmts[video_idx].raw_height;

    adv7180_data.sen.pix.pixelformat = V4L2_PIX_FMT_UYVY;  /* YUV422 */

    adv7180_data.sen.pix.priv = 1;  /* 1 is used to indicate TV in */

    adv7180_data.sen.on = true;

    adv7180_data.sen.csi = 1;

static struct fsl_mxc_camera_platform_data mipi_csi2_data = {

    .mclk = 24000000,

    .mclk_source = 0,

    .csi = 1,

    .io_init = mx6q_mipi_sensor_io_init,

    .pwdn = mx6q_mipi_powerdown,

};

static struct mipi_csi2_platform_data mipi_csi2_pdata = {

    .ipu_id     = 0,

    .csi_id = 1,

    .v_channel = 0,

    .lanes = 2,

    .dphy_clk = "mipi_pllref_clk",

    .pixel_clk = "emi_clk",

};

static struct fsl_mxc_capture_platform_data capture_data[] = {

    {

        .csi = 0,

        .ipu = 0,

        .mclk_source = 0,

        .is_mipi = 0,

    }, {

        .csi = 1,

        .ipu = 0,

        .mclk_source = 0,

        .is_mipi = 1,

    },{

        .csi = 1,

        .ipu = 1,

        .mclk_source = 0,

        .is_mipi = 0,

    },

};

//register

 imx6q_add_v4l2_capture(0, &capture_data[0]);

    imx6q_add_v4l2_capture(1, &capture_data[1]);

    imx6q_add_v4l2_capture(2, &capture_data[2]);

    imx6q_add_mipi_csi2(&mipi_csi2_pdata);

static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {

      {

        I2C_BOARD_INFO("mt9d112", 0x3c),

        .platform_data = (void *)&camera_data,

    },

    {

        I2C_BOARD_INFO("adv7180", 0x21),

        .platform_data = (void *)&adv7180_data,

    },

static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {

   {

        I2C_BOARD_INFO("ov5640_mipi", 0x3c),

        .platform_data = (void *)&mipi_csi2_data,

    },


IN   init.freescale.rc prop  setting is as follows:      Only to detect whether there are the two cameras


 setprop back_camera_name ov5640_mipi

    setprop back_camera_orient 90

    setprop front_camera_name mt9d112

    setprop front_camera_orient 90


But   : #logcat |grep HAL


I/FslCameraHAL( 2395): Face Back Camera is ov5640_mipi, orient is 90

I/FslCameraHAL( 2395): Face Front Camera is mt9d112, orient is 90

I/FslCameraHAL( 2395): Checking the camera ov5640_mipi

I/FslCameraHAL( 2395): Checking the camera mt9d112

I/FslCameraHAL( 2395): Get sensor mt9d112's dev path /dev/video0

I/FslCameraHAL( 2395): Camera ID 0: name mt9d112, Facing 1, orientation 90, dev path /dev/video0


mipi camera can't detect


If I don't sign up for adv7180


// imx6q_add_v4l2_capture(2, &capture_data[2]);

 

static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {

      {

        I2C_BOARD_INFO("mt9d112", 0x3c),

        .platform_data = (void *)&camera_data,

    },

   /* {

        I2C_BOARD_INFO("adv7180", 0x21),

        .platform_data = (void *)&adv7180_data,

    },*/


# logcat |grep HAL


I/FslCameraHAL( 2389): Get sensor ov5640_mipi's dev path /dev/video1

I/FslCameraHAL( 2389): Camera ID 0: name ov5640_mipi, Facing 0, orientation 90, dev path /dev/video1

I/FslCameraHAL( 2389): Checking the camera mt9d112

I/FslCameraHAL( 2389): Get sensor mt9d112's dev path /dev/video0

I/FslCameraHAL( 2389): Camera ID 1: name mt9d112, Facing 1, orientation 90, dev path /dev/video0

  Now can detect ov5640, So I suspect that ov5640 and csi1 adv7180 cannot be registered at the same time !


 Is there any way to solve this problem ?



0 Kudos
1,252 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think you need check your kernel boot up log, are the two cameras detected successfully in kernel?

0 Kudos
1,252 Views
liyu1
Contributor III

How to let kernel support adv7180 's driver select ipu and csi channel ?   I'm sure, causes the registration failure is IPU and CSI channel selection error , Following patch is someone else's adv7180 channel selection, I hope can get detailed patches

mx6_nitrogen6x: add adv7180 tv input camera · 73898f3 · boundarydevices/linux-imx6 · GitHub

0 Kudos
1,252 Views
liyu1
Contributor III

e !!!!!!!!!!!!!!!!!!!!!!!!!!!pn544 probe !!!!!!!!!!!!!!!!!!!!!!!!!!!nfc probe step01 !!!!!!!!!!!!!!!!!!!!!is ok

<4>nfc probe step02 !!!!!!!!!!!!!!!!!!!!! is ok

<4>platform_data upg 1 !!!!!!!!!!!!!!!!!!

<4>nfc probe step03B !!!!!!!!!!!!!!!is ok

<4>platform_data ven 1 !!!!!!!!!!!!!!!!!!

<4>nfc probe step04 !!!!!!!!!!!!!!!!!is ok

<4>nfc probe step05!!!!!!!!!!!!!!!!!!!!!!!! is ok

<4>nfc probe step06 !!!!!!!!!!!!!!!!!!!!!!!!!is ok

<6>pn544_probe : requesting IRQ 413

<4>irq number:413

<4>nfc probe is !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!ok

<4>irq value:0=====================================================

<6>GPMI NAND driver registered. (IMX)

<6>vcan: Virtual CAN interface driver

<6>CAN device driver interface

<6>flexcan netdevice driver

<6>PPP generic driver version 2.4.2

<6>PPP Deflate Compression module registered

<6>PPP BSD Compression module registered

<6>PPP MPPE Compression module registered

<6>NET: Registered protocol family 24

<6>PPTP driver version 0.8.5

<6>tun: Universal TUN/TAP device driver, 1.6

<6>tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>

<6>ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

<6>fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller

<6>fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1

<6>fsl-ehci fsl-ehci.0: irq 75, io base 0x02184000

<6>fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00

<6>hub 1-0:1.0: USB hub found

<6>hub 1-0:1.0: 1 port detected

<6>add wake up source irq 72

<4>imx6q host power on !!!!!!!!!!!!!!!!!!!!!

<6>fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller

<6>fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2

<6>fsl-ehci fsl-ehci.1: irq 72, io base 0x02184200

<6>fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00

<6>hub 2-0:1.0: USB hub found

<6>hub 2-0:1.0: 1 port detected

<6>usbcore: registered new interface driver cdc_acm

<6>cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

<6>Initializing USB Mass Storage driver...

<6>usbcore: registered new interface driver usb-storage

<6>USB Mass Storage support registered.

<6>usbcore: registered new interface driver usbserial

<6>USB Serial support registered for generic

<6>usbcore: registered new interface driver usbserial_generic

<6>usbserial: USB Serial Driver core

<6>USB Serial support registered for ch341-uart

<6>usbcore: registered new interface driver ch341

<6>USB Serial support registered for GSM modem (1-port)

<6>usbcore: registered new interface driver option

<6>option: v0.7.2:USB Driver for GSM modems

<6>USB Serial support registered for Qualcomm USB modem

<6>usbcore: registered new interface driver qcserial

<6>ARC USBOTG Device Controller driver (1 August 2005)

<6>android_usb gadget: Mass Storage Function, version: 2009/09/11

<6>android_usb gadget: Number of LUNs=1

<6> lun0: LUN: removable file: (no medium)

<4>Gadget Android: controller 'fsl-usb2-udc' not recognized

<6>android_usb gadget: android_usb ready

<6>Suspend udc for OTG auto detect

<7>USB Host suspend begins

<7>will suspend roothub and its children

<7>ehci_fsl_bus_suspend begins, DR

<7>ehci_fsl_bus_suspend ends, DR

<7>host suspend ends

<7>USB Gadget resume begins

<7>fsl_udc_resume, Wait for wakeup thread finishes

<7>dr_controller_run: udc out low power mode

<7>USB Gadget resume ends

<6>fsl-usb2-udc: bind to driver android_usb 

<6>mousedev: PS/2 mouse device common for all mice

<6>input: gpio-keys as /devices/platform/gpio-keys/input/input0

<6>input: gpio-keys-BJ110 as /devices/platform/gpio-keys-BJ110/input/input1

<6>input: imx-keypad as /devices/platform/imx-keypad/input/input2

<6>usbcore: registered new interface driver fitouch

<6>usbcore: registered new interface driver iSolution Touchscreen Driver for Android/Linux

<4>iSolution Touchscreen driver initial

<6>usbtouch2==ft5x0x_ts_init==

<4>[FTS] ft5x0x_ts_probe, driver version is 2.0.

<4>[leo]---tp test id=0xff--

<4>[leo]---tp test id=0xff--

<4>[leo]---tp test id=0xff--

<4>[leo]---tp test id=0xff--

<4>[leo]---tp test id=0xff--

<6>input: ft5x0x_ts as /devices/virtual/input/input3

<4>==register_early_suspend =

<6>usb 2-1: new high speed USB device number 2 using fsl-ehci

<4>[FTS] Firmware version = 0x10

<4>[FTS] report rate is 160Hz.

<4>[FTS] touch threshold is 88.

<4>[FTS] ==probe over =

<4>ret=0

<4>i2c-core: driver [isl29023] using legacy suspend method

<4>i2c-core: driver [isl29023] using legacy resume method

<6>rtc-pcf8563 1-0051: chip found, driver version 0.4.3

<3>rtc-pcf8563 1-0051: retrieved date/time is not valid.

<6>using rtc device, rtc-pcf8563, for alarms

<6>rtc-pcf8563 1-0051: rtc core: registered rtc-pcf8563 as rtc0

<6>i2c /dev entries driver

<6>lirc_dev: IR Remote Control driver registered, major 250 

<6>IR NEC protocol handler initialized

<6>IR RC5(x) protocol handler initialized

<6>IR RC6 protocol handler initialized

<6>IR JVC protocol handler initialized

<6>IR Sony protocol handler initialized

<6>IR RC5 (streamzap) protocol handler initialized

<6>IR LIRC bridge handler initialized

<4>call the function gpio_ir_recv_init!!!!!!!!!!!!!!!!

<6>android_work: did not send uevent (0 0   (null))

<6>Linux video capture interface: v2.00

<6>hub 2-1:1.0: USB hub found

<6>hub 2-1:1.0: 4 ports detected

<3>Printk1 - kern_err

<6>Printk2 - kern_info

<4>In mt9d112_init

<4>==========mt9d112_probe============

<4>   client name is mt9d112

<4>   type is 2 (expect 2)

<4>   num ioctls is 12

<4>mclk is 24000000,mclk source is 0==============>

<6>android_work: sent uevent USB_STATE=CONNECTED

<6>android_work: sent uevent USB_STATE=DISCONNECTED

<6>android_work: sent uevent USB_STATE=CONNECTED

<6>android_work: sent uevent USB_STATE=DISCONNECTED

<4>mt9d112 model_id = 0x1580

<4>ioctl_dev_exit=========

<4>In mt9d112:ioctl_s_power ====>0

<4>In mt9d112:ioctl_g_fmt_cap.

<4>   Returning size of 640x480

<4>================retval is 0===============

<4>===============mt9d112 is found !===============

<6>android_work: sent uevent USB_STATE=CONNECTED

<6>android_work: sent uevent USB_STATE=DISCONNECTED

<6>usb 2-1.4: new full speed USB device number 3 using fsl-ehci

<6>android_work: sent uevent USB_STATE=CONNECTED

<6>android_work: sent uevent USB_STATE=DISCONNECTED

<4>ioctl_dev_exit=========

<4>In mt9d112:ioctl_s_power ====>0

<4>ov5640_probe ok

<4>In adv7180_init

<3>DBG sensor data is at c09f3ff8

<4>In adv7180_probe

<7>USB Gadget resume begins

<7>fsl_udc_resume, Wait for wakeup thread finishes

<6>ch341 2-1.4:1.0: ch341-uart converter detected

<6>usb 2-1.4: ch341-uart converter now attached to ttyUSB0

<6>android_work: sent uevent USB_STATE=CONNECTED

<6>android_work: sent uevent USB_STATE=DISCONNECTED

<4>adv7180_probe:adv7180 probe i2c address is 0x21

<4>adv7180_probe:Analog Device adv71c detected!

<4>In adv7180:adv7180_hard_reset

<6>android_work: sent uevent USB_STATE=CONNECTED

<4>   type is 2 (expect 2)

<4>   num ioctls is 13

<4>adv7180:ioctl_s_power

<4>adv7180:ioctl_s_power off

<4>adv7180:ioctl_g_fmt_cap

<4>Returning size of 720x625

<6>mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video16

<6>mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video17

<6>mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video18

<6>mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video19

<6>usbcore: registered new interface driver uvcvideo

<6>USB Video Class driver (v1.1.0)

<6>bq2419x 0-006b: chip type BQ24192/3 detected

<6>print_constraints: bq2419x-charger: normal standby

<6>print_constraints: bq2419x-charger: normal standby

<4>rdev_init_debugfs: bq2419x-charger: Failed to create debugfs directory

<6>bq2419x 0-006b: Charging enabled

<6>bq2419x 0-006b: Charging enabled

<6>mag3110 1-000e: check mag3110 chip ID

<6>input: mag3110 as /devices/virtual/input/input4

<6>mag3110 1-000e: mag3110 is probed

<4>i2c-core: driver [mag3110] using legacy suspend method

<4>i2c-core: driver [mag3110] using legacy resume method

<4>mma 8451 probe !!!!!!!!!!!!!!!!!!!!!

<6>input: mma845x as /devices/virtual/input/input5

<6>LTR558<1><<< ltr558_driverinit: LTR-558ALS Driver Module LOADED >>>

<6>

<6>LTR558<1>ltr558_probe:start probe

<6>LTR558<1>ltr558_probe: LTR-558ALS functionality check success.

<6>

<6>LTR558<1>ltr558_probe: LTR-558ALS kzalloc success.

<6>

<6>LTR558<1>ltr558_probe: LTR-558ALS device init failed.

<6>

<6>LTR558ltr558_probe: Probe Fail!

<6>

<4>ltr558: probe of 1-0023 failed with error -110

<4>i2c-core: driver [ltr558] using legacy suspend method

<4>i2c-core: driver [ltr558] using legacy resume method

<6>imx2-wdt imx2-wdt.0: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=1)

<6>device-mapper: uevent: version 1.0.3

<6>device-mapper: ioctl: 4.20.0-ioctl (2011-02-02) initialised: dm-devel@redhat.com

<6>Bluetooth: Virtual HCI driver ver 1.3

<6>Bluetooth: HCI UART driver ver 2.2

<6>Bluetooth: HCIATH3K protocol initialized

<6>Bluetooth: Generic Bluetooth USB driver ver 0.6

<6>usbcore: registered new interface driver btusb

<6>sdhci: Secure Digital Host Controller Interface driver

<6>sdhci: Copyright(c) Pierre Ossman

<6>mmc0: SDHCI controller on platform [sdhci-esdhc-imx.3] using DMA

<6>mmc1: SDHCI controller on platform [sdhci-esdhc-imx.2] using DMA

<6>mmc2: SDHCI controller on platform [sdhci-esdhc-imx.1] using DMA

<6>mmc3: SDHCI controller on platform [sdhci-esdhc-imx.0] using DMA

<6>mxc_vdoa mxc_vdoa: i.MX Video Data Order Adapter(VDOA) driver probed

<6>VPU initialized

<6>mxc_asrc registered

<6>Galcore version 4.6.9.6622

<4>revserved_memory_account:viv_gpu registerd

<6>Thermal calibration data is 0x5744d769

<6>Thermal sensor with ratio = 180

<6>Anatop Thermal registered as thermal_zone0

<6>anatop_thermal_probe: default cooling device is cpufreq!

<7>Registered led device: BJ110_LED1

<7>Registered led device: BJ110_LED2

<7>Registered led device: (null)

<7>Registered led device: BJ110_LED4

<6>usbcore: registered new interface driver usbhid

<6>usbhid: USB HID core driver

<6>logger: created 256K log 'log_main'

<6>logger: created 256K log 'log_events'

<6>logger: created 256K log 'log_radio'

<6>logger: created 256K log 'log_system'

<6>adt75 1-0048: adt75 temperature sensor registered.

<6>usbcore: registered new interface driver snd-usb-audio

<6>mxc_hdmi_soc mxc_hdmi_soc.0: MXC HDMI Audio

<4>imx_rt3261_probe ==================>

<4>Codec driver version 0.7 alsa 1.0.24

<6>mmc0: new high speed DDR MMC card at address 0001

<6>Codec driver version 0.7 alsa 1.0.24

<6>mmcblk0: mmc0:0001 004G90 3.68 GiB 

<6>mmcblk0boot0: mmc0:0001 004G90 partition 1 2.00 MiB

<6>mmcblk0boot1: mmc0:0001 004G90 partition 2 2.00 MiB

<6> mmcblk0: p1 p2 p3 < p5 p6 p7 p8 > p4

<4>mmcblk0: p4 size 5539840 extends beyond EOD, read 0xfd=0x6

<4>truncated

<6> mmcblk0boot1: unknown partition table

<6> mmcblk0boot0: unknown partition table

<6>DSP version code = 0x501a

<4>hp disable !!!!!!!!!!!!!!!!

<6>asoc: rt3261-aif1 <-> imx-ssi.1 mapping ok

<6>input: rt3261-audio DMIC as /devices/platform/soc-audio.5/sound/card0/input6

<6>input: rt3261-audio Headphone Jack as /devices/platform/soc-audio.5/sound/card0/input7

<6>asoc: mxc-hdmi-soc <-> imx-hdmi-soc-dai.0 mapping ok

<6>ALSA device list:

<6>  #0: rt3261-audio

<6>  #1: imx-hdmi-soc

<6>oprofile: using arm/armv7-ca9

<6>GACT probability NOT on

<6>Mirror/redirect action on

<6>u32 classifier

<6>    Actions configured

<6>Netfilter messages via NETLINK v0.30.

<6>nf_conntrack version 0.5.0 (12084 buckets, 48336 max)

<6>ctnetlink v0.93: registering with nfnetlink.

<6>NF_TPROXY: Transparent proxy support initialized, version 4.1.0

<6>NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.

<6>xt_time: kernel timezone is -0000

<6>IPv4 over IPv4 tunneling driver

<6>GRE over IPv4 demultiplexor driver

<6>ip_tables: (C) 2000-2006 Netfilter Core Team

<6>arp_tables: (C) 2002 David S. Miller

<6>TCP cubic registered

<6>NET: Registered protocol family 10

<6>Mobile IPv6

<6>ip6_tables: (C) 2000-2006 Netfilter Core Team

<6>IPv6 over IPv4 tunneling driver

<6>NET: Registered protocol family 17

<6>NET: Registered protocol family 15

<6>can: controller area network core (rev 20090105 abi 8)

<6>NET: Registered protocol family 29

<6>can: raw protocol (rev 20090105)

<6>can: broadcast manager protocol (rev 20090105 t)

<6>Bluetooth: RFCOMM TTY layer initialized

<6>Bluetooth: RFCOMM socket layer initialized

<6>Bluetooth: RFCOMM ver 1.11

<6>Bluetooth: BNEP (Ethernet Emulation) ver 1.3

<6>Bluetooth: BNEP filters: protocol multicast

<6>Bluetooth: HIDP (Human Interface Emulation) ver 1.2

<6>L2TP core driver, V2.0

<6>PPPoL2TP kernel driver, V2.0

<6>L2TP IP encapsulation support (L2TPv3)

<6>L2TP netlink interface

<6>L2TP ethernet pseudowire support (L2TPv3)

<6>lib80211: common routines for IEEE802.11 drivers

<7>lib80211_crypt: registered algorithm 'NULL'

<7>lib80211_crypt: registered algorithm 'WEP'

<7>lib80211_crypt: registered algorithm 'CCMP'

<7>lib80211_crypt: registered algorithm 'TKIP'

<6>VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4

<6>Bus freq driver module loaded

<6>Bus freq driver Enabled

<6>mxc_dvfs_core_probe

<6>DVFS driver module loaded

<3>rtc-pcf8563 1-0051: retrieved date/time is not valid.

<3>rtc-pcf8563 1-0051: hctosys: invalid date/time

<6>Freeing init memory: 260K

<3>init: /init.rc: 673: invalid option 'chmod'

<3>init: /init.freescale.rc: 157: invalid option 'mkdir'

<3>init: /init.freescale.rc: 158: invalid option 'chmod'

<3>init: /init.freescale.rc: 159: invalid option 'chmod'

<3>init: /init.freescale.rc: 160: invalid option 'chown'

<3>init: /init.freescale.rc: 162: invalid option 'mkdir'

<3>init: /init.freescale.rc: 163: invalid option 'mkdir'

<3>init: /init.freescale.rc: 164: invalid option 'chmod'

<3>init: /init.freescale.rc: 165: invalid option 'chmod'

<3>init: /init.freescale.rc: 166: invalid option 'chown'

<3>init: /init.freescale.rc: 167: invalid option 'chown'

<3>init: /init.freescale.rc: 198: ignored duplicate definition of service 'dhcpcd_p2p'

<4>init (1): /proc/1/oom_adj is deprecated, please use /proc/1/oom_score_adj instead.

<6>keychord: using input dev gpio-keys for fevent

<6>EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)

<4>EXT4-fs (mmcblk0p4): warning: maximal mount count reached, running e2fsck is recommended

<6>EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,noauto_da_alloc,errors=panic

<4>EXT4-fs (mmcblk0p6): warning: maximal mount count reached, running e2fsck is recommended

<6>EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Opts: nomblk_io_submit

<6>EXT4-fs (mmcblk0p7): mounted filesystem with ordered data mode. Opts: (null)

<6>rfkill: BT RF going to : off

<3>init: using deprecated syntax for specifying property 'ro.product.manufacturer', use ${name} instead

<3>init: using deprecated syntax for specifying property 'ro.product.model', use ${name} instead

<3>init: using deprecated syntax for specifying property 'ro.serialno', use ${name} instead

<3>init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'

<3>android_usb: already disabled

<3>android_usb: already disabled

<6>mtp_bind_config

<6>adb_bind_config

<6>adb_open

<6>input: eCompass as /devices/virtual/input/input8

<6>android_work: sent uevent USB_STATE=DISCONNECTED

<6>android_work: sent uevent USB_STATE=CONNECTED

<6>android_work: sent uevent USB_STATE=DISCONNECTED

<6>android_work: sent uevent USB_STATE=CONNECTED

<6>android_usb gadget: high speed config #1: android

<6>android_work: sent uevent USB_STATE=CONFIGURED

<6>imx-ipuv3 imx-ipuv3.1: IPU DMFC DP HIGH RESOLUTION: 1(0,1), 5B(2~5), 5F(6,7)

<6>warning: `zygote' uses 32-bit capabilities (legacy support in use)

<6>request_suspend_state: wakeup (3->0) at 17100989337 (1970-01-02 00:00:04.681168000 UTC)

<6>cpufreq_interactive_input_connect: connect to ft5x0x_ts

<7>mma enable setting active

<3>ERROR: v4l2 capture: slave not found!

<4>adv7180:ioctl_g_ifparm

<4>adv7180:ioctl_g_fmt_cap

<4>Returning size of 720x625

<4>adv7180:ioctl_s_power

<4>adv7180:ioctl_s_power on

<4>In adv7180:ioctl_init

<4>adv7180:ioctl_dev_init

<4>adv7180:ioctl_g_chip_ident

<4>adv7180:ioctl_s_power

<4>adv7180:ioctl_s_power off

0 Kudos
1,252 Views
liyu1
Contributor III

问题我已经解决了!谢谢!

0 Kudos
1,251 Views
liyu1
Contributor III

hi Qiang li !

   I have verified that each camera image capture function, That could prove my camera driver no problem !

    

   But when the three-way camera registered,

          csi0(parallel camera (mt9d112)) + csi1 (parallel tvin(adv7180)) +  mipi csi2(ov5640_mipi) 


code :

   

static struct fsl_mxc_camera_platform_data camera_data = {

    .mclk = 24000000,

    .mclk_source = 0,

   .csi = 0,

    .io_init = mx6q_csi0_io_init,

    .pwdn = mx6q_csi0_cam_powerdown,

};

static struct fsl_mxc_tvin_platform_data adv7180_data = {

    .dvddio_reg    = NULL,

    .dvdd_reg    = NULL,

    .avdd_reg    = NULL,

    .pvdd_reg    = NULL,

    .pwdn        = adv7180_pwdn,

    .reset        = adv7180_reset,

    .cvbs        = true,

    .io_init    = mx6q_csi1_io_init,

};

  adv7180 driver probe is as follows:

   memset(&adv7180_data, 0, sizeof(adv7180_data));

    adv7180_data.sen.i2c_client = client;

    adv7180_data.sen.streamcap.timeperframe.denominator = 30;

    adv7180_data.sen.streamcap.timeperframe.numerator = 1;

    adv7180_data.std_id = V4L2_STD_ALL;

    video_idx = ADV7180_NOT_LOCKED;

    adv7180_data.sen.pix.width = video_fmts[video_idx].raw_width;

    adv7180_data.sen.pix.height = video_fmts[video_idx].raw_height;

    adv7180_data.sen.pix.pixelformat = V4L2_PIX_FMT_UYVY;  /* YUV422 */

    adv7180_data.sen.pix.priv = 1;  /* 1 is used to indicate TV in */

    adv7180_data.sen.on = true;

    adv7180_data.sen.csi = 1;

static struct fsl_mxc_camera_platform_data mipi_csi2_data = {

    .mclk = 24000000,

    .mclk_source = 0,

    .csi = 1,

    .io_init = mx6q_mipi_sensor_io_init,

    .pwdn = mx6q_mipi_powerdown,

};

static struct mipi_csi2_platform_data mipi_csi2_pdata = {

    .ipu_id     = 0,

    .csi_id = 1,

    .v_channel = 0,

    .lanes = 2,

    .dphy_clk = "mipi_pllref_clk",

    .pixel_clk = "emi_clk",

};

static struct fsl_mxc_capture_platform_data capture_data[] = {

    {

        .csi = 0,

        .ipu = 0,

        .mclk_source = 0,

        .is_mipi = 0,

    }, {

        .csi = 1,

        .ipu = 0,

        .mclk_source = 0,

        .is_mipi = 1,

    },{

        .csi = 1,

        .ipu = 1,

        .mclk_source = 0,

        .is_mipi = 0,

    },

};

//register

 imx6q_add_v4l2_capture(0, &capture_data[0]);

    imx6q_add_v4l2_capture(1, &capture_data[1]);

    imx6q_add_v4l2_capture(2, &capture_data[2]);

    imx6q_add_mipi_csi2(&mipi_csi2_pdata);

   but

static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {

      {

        I2C_BOARD_INFO("mt9d112", 0x3c),

        .platform_data = (void *)&camera_data,

    },

    {

        I2C_BOARD_INFO("adv7180", 0x21),

        .platform_data = (void *)&adv7180_data,

    },

static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {

   {

        I2C_BOARD_INFO("ov5640_mipi", 0x3c),

        .platform_data = (void *)&mipi_csi2_data,

    },

init.freescale.rc prop setting is as follows:

    setprop back_camera_name ov5640_mipi,adv7180_decoder

    setprop back_camera_orient 90

    setprop front_camera_name mt9d112

    setprop front_camera_orient 90

But :

   

 Because the camera is not detected,log is as follows:

root@android:/ # logcat |grep aHAL

I/FslCameraHAL( 2389): Face Back Camera is ov5640_mipi,adv7180_decoder, orient is 90

 

I/FslCameraHAL( 2389): Face Front Camera is mt9d112, orient is 90

I/FslCameraHAL( 2389): Checking the camera ov5640_mipi

I/FslCameraHAL( 2389): Checking the camera adv7180_decoder

I/FslCameraHAL( 2389): Get sensor adv7180_decoder's dev path /dev/video2

I/FslCameraHAL( 2389): Camera ID 0: name adv7180_decoder, Facing 0, orientation 90, dev path /dev/video2

I/FslCameraHAL( 2389): Checking the camera mt9d112

I/FslCameraHAL( 2389): Get sensor mt9d112's dev path /dev/video0

I/FslCameraHAL( 2389): Camera ID 1: name mt9d112, Facing 1, orientation 90, dev path /dev/video0


ov5640_mipi Not been detected ! Why ?

  

I feel android 4.2.2 mipi camera and csi1 (parallel tvin) can not be registered at the same time


  Please help me !



     Thanks !

    

  

0 Kudos
1,252 Views
ct3paul
Contributor II

Hi

My two csi camera also can't work when I do like you said.

My camera chip is ADV7180.It can work well when I loaded one chip driver.

But when I add two devices to i2c struct like this:

static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {

  #if 1

  {

  I2C_BOARD_INFO("adv7180", 0x20),

  .platform_data = (void *)&adv7180_data,

  },

  #endif

#if 1

  {

  I2C_BOARD_INFO("adv7180", 0x21),

  .platform_data = (void *)&camera2_data,

  },

  #endif

};

I can't load my driver.I enter a loop and I cat't break it when I loadind drivers if I add two devices to i2c struct.

My drivers:

insmod ipu_bg_overlay_sdc.ko

insmod ipu_csi_enc.ko

insmod ipu_fg_overlay_sdc.ko

insmod ipu_prp_enc.ko

insmod ipu_still.ko

insmod adv7180_tvin.ko

insmod mxc_v4l2_capture.ko

Thanks

Chen

0 Kudos
1,252 Views
mehmet
Contributor I

Hello,

I use fsl-yocto-3.14.28 on custom board similar to sabreauto board.

I have to use 2 camera like you. I applied patch but problem goes on. Did you solve problem?

I have two v4l2 capture masters; mxc_v4l2_cap0 and mxc_v4l2_cap1

and two slaves; adv7180 and adv7180

Don't i need changes on drivers/media/platform/mxc/adv7180.c? If i don't change adv7180 for second slave, how can i attach it to master? adv7180_int_device is declared statically. So in v4l2_int_device_register function, it is a big problem. Am i wrong?

How did you use adv7180_tvin.ko for 2 device?

Thanks

Mehmet

0 Kudos
1,251 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

If the two cameras are connected at the same IPU, another patch was needed.

0 Kudos
1,251 Views
ct3paul
Contributor II

Hi

I had patched this patch,but the problem could't be solved.

Thanks

Chen

0 Kudos
1,251 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

It seems you haven't successfully enabled two camera drivers in your BSP. Please reference to Freescale BSP carefully.

0 Kudos
1,251 Views
ct3paul
Contributor II

YES.I can't load my driver.I enter a loop and I cat't break it when I loadind drivers if I add two devices to i2c struct.


But it can work well if I just add one device to i2c struct.

0 Kudos
1,253 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

The default Freescale BSP supports two camera: one CSI parallel camera and one mipi camera.
For your three camera use case, the followed setting was needed in board-mx6q_sabresd.c:

static struct fsl_mxc_capture_platform_data capture_data[] = {
{
  .csi = 0,
  .ipu = 0,
  .mclk_source = 0,
  .is_mipi = 0,
}, {
  .csi = 1,
  .ipu = 0,
  .mclk_source = 0,
  .is_mipi = 1,
}, {
  .csi = 1,
  .ipu = 1,
  .mclk_source = 0,
  .is_mipi = 0,
},
};

static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.ipu_id  = 0,
.csi_id = 1,
.v_channel = 0,
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
};

static struct fsl_mxc_camera_platform_data mipi_csi2_data = {
.mclk = 24000000,
.mclk_source = 0,
.csi = 1,
.io_init = mx6q_mipi_sensor_io_init,
.pwdn = mx6q_mipi_powerdown,
};

static struct fsl_mxc_camera_platform_data camera_data = {
.mclk = 24000000,
.mclk_source = 0,
.csi = 0,
.io_init = mx6q_csi0_io_init,
.pwdn = mx6q_csi0_cam_powerdown,
};

static struct fsl_mxc_camera_platform_data camera2_data = {
.mclk = 24000000,
.mclk_source = 0,
.csi = 1,
.io_init = mx6q_csi1_io_init,
.pwdn = mx6q_csi1_cam_powerdown,
};

static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {
{
  I2C_BOARD_INFO("ov564x", 0x3c),
  .platform_data = (void *)&camera_data,
},
};

static struct i2c_board_info mxc_i2c1_board_info[] __initdata = {
{
  I2C_BOARD_INFO("ov5640_mipi", 0x3c),
  .platform_data = (void *)&mipi_csi2_data,
},
};

static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {
{
  I2C_BOARD_INFO("ov564x", 0x3c),
  .platform_data = (void *)&camera2_data,
},
};

In function mx6q_mipi_sensor_io_init():
if (cpu_is_mx6q())
  mxc_iomux_set_gpr_register(1, 19, 1, 1);

In function mx6q_csi0_io_init():
if (cpu_is_mx6q())
  mxc_iomux_set_gpr_register(1, 19, 1, 1);

In function mx6q_csi1_io_init():
if (cpu_is_mx6q())
  mxc_iomux_set_gpr_register(1, 20, 1, 1);

In function mx6_sabresd_board_init():
imx6q_add_v4l2_capture(0, &capture_data[0]);
imx6q_add_v4l2_capture(1, &capture_data[1]);
imx6q_add_v4l2_capture(2, &capture_data[2]);
imx6q_add_mipi_csi2(&mipi_csi2_pdata);

0 Kudos