AnsweredAssumed Answered

imx6q IPU2 CSI1 timeout

Question asked by beal romain on Oct 11, 2018
Latest reply on Oct 12, 2018 by beal romain

Dear all,

 

We tried to use IPU2 CSI1 with an ADV7182 on imx6q variscite dart.

We compiled yocto krogoth.

Modules activated :

CONFIG_MXC_TVIN_ADV7180
CONFIG_VIDEO_MXC_CAPTURE

 

dtb : 

 

In iomux section

pinctrl_ipu2: ipu2grp { /* parallel port 16-bit */
fsl,pins = <

MX6QDL_PAD_EIM_A17__IPU2_CSI1_DATA12 0xb0b1
MX6QDL_PAD_EIM_A18__IPU2_CSI1_DATA13 0xb0b1
MX6QDL_PAD_EIM_A19__IPU2_CSI1_DATA14 0xb0b1
MX6QDL_PAD_EIM_A20__IPU2_CSI1_DATA15 0xb0b1
MX6QDL_PAD_EIM_A21__IPU2_CSI1_DATA16 0xb0b1
MX6QDL_PAD_EIM_A22__IPU2_CSI1_DATA17 0xb0b1
MX6QDL_PAD_EIM_A23__IPU2_CSI1_DATA18 0xb0b1
MX6QDL_PAD_EIM_A24__IPU2_CSI1_DATA19 0xb0b1
MX6QDL_PAD_EIM_A16__IPU2_CSI1_PIXCLK 0xb0b1
MX6QDL_PAD_EIM_DA10__IPU2_CSI1_DATA_EN 0xb0b1 /* remove this line has no effect */
MX6QDL_PAD_EIM_DA11__IPU2_CSI1_HSYNC 0xb0b1
MX6QDL_PAD_EIM_DA12__IPU2_CSI1_VSYNC 0xb0b1
>;
};

 

 

In i2c section
adv7180: adv7180@20 {
compatible = "adv,adv7180";
reg = <0x20>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ipu2>;
clocks = <&clks 201>;
clock-names = "csi_mclk";
DOVDD-supply = <&reg_3p3v>; /* 3.3v, enabled via 2.8 VGEN6 */
AVDD-supply = <&reg_3p3v>; /* 1.8v */
DVDD-supply = <&reg_3p3v>; /* 1.8v */
PVDD-supply = <&reg_3p3v>; /* 1.8v */
pwn-gpios = <&gpio4 21 0>;
ipu_id = <1>;
csi_id = <1>;
mclk = <24000000>;
mclk_source = <0>;
cvbs = <1>;
};

 

in / section

v4l2_cap_0 {
compatible = "fsl,imx6q-v4l2-capture";
ipu_id = <1>;
csi_id = <1>;
mclk_source = <0>;
status = "okay";
};

 

There are  no io conflicts.

The IPU2_CSI1_DATA_EN is pulled down at startup and connected to another cpu's io.

Change io level has no effect.

 

cat /dev/video0
prp_still_start: ipu_channel_request still 1 1
ERROR: v4l2 capture: mxc_v4l_read timeout counter 0
cat: read error: Timer expired
root@var-som-mx6:~# dmesg
adv7180 0-0020: adv7180:ioctl_g_ifparm
adv7180 0-0020: adv7180:ioctl_g_fmt_cap
Returning size of 720x625
imx-ipuv3 2800000.ipu: CSI_SENS_CONF = 0x80000A02
imx-ipuv3 2800000.ipu: CSI_ACT_FRM_SIZE = 0x027002CF
adv7180 0-0020: adv7180:ioctl_s_power
adv7180 0-0020: In adv7180:ioctl_init
adv7180 0-0020: adv7180:ioctl_dev_init
prp_still_start: ipu_channel_request still 1 1
imx-ipuv3 2800000.ipu: init channel = 15
imx-ipuv3 2800000.ipu: ipu busfreq high requst.
imx-ipuv3 2800000.ipu: initializing idma ch 0 @ c0980000
imx-ipuv3 2800000.ipu: ch 0 word 0 - 00000000 0C600000 0003DE00 E0000000 00057C23
imx-ipuv3 2800000.ipu: ch 0 word 1 - 07840000 00F09000 0047C000 000047C0 0000008F
imx-ipuv3 2800000.ipu: PFS 0x2,
imx-ipuv3 2800000.ipu: BPP 0x0,
imx-ipuv3 2800000.ipu: NPB 0x1f
imx-ipuv3 2800000.ipu: FW 287,
imx-ipuv3 2800000.ipu: FH 351,
imx-ipuv3 2800000.ipu: EBA0 0x3c200000
imx-ipuv3 2800000.ipu: EBA1 0x3c240000
imx-ipuv3 2800000.ipu: Stride 287
imx-ipuv3 2800000.ipu: scan_order 0
imx-ipuv3 2800000.ipu: uv_stride 143
imx-ipuv3 2800000.ipu: u_offset 0x18c00
imx-ipuv3 2800000.ipu: v_offset 0x1ef00
imx-ipuv3 2800000.ipu: Width0 0+1,
imx-ipuv3 2800000.ipu: Width1 0+1,
imx-ipuv3 2800000.ipu: Width2 0+1,
imx-ipuv3 2800000.ipu: Width3 0+1,
imx-ipuv3 2800000.ipu: Offset0 15,
imx-ipuv3 2800000.ipu: Offset1 4,
imx-ipuv3 2800000.ipu: Offset2 0,
imx-ipuv3 2800000.ipu: Offset3 0
ERROR: v4l2 capture: mxc_v4l_read timeout counter 0
imx-ipuv3 2800000.ipu: CSI stop timeout - 5 * 10ms
imx-ipuv3 2800000.ipu: ipu busfreq high release.
adv7180 0-0020: adv7180:ioctl_s_power

 

cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
16: 5504 2740 1398 295 GIC 29 Edge twd
17: 97575 0 0 0 GPC 55 Level i.MX Timer Tick
24: 3515 0 0 0 GPC 26 Level 2020000.serial
25: 0 0 0 0 GPC 47 Level 202c000.ssi
26: 0 0 0 0 GPC 50 Level 2034000.asrc
27: 0 0 0 0 GPC 3 Edge VPU_JPG_IRQ
28: 0 0 0 0 GPC 12 Level VPU_CODEC_IRQ
39: 0 0 0 0 gpio-mxc 6 Edge 2194000.usdhc cd
160: 0 0 0 0 gpio-mxc 25 Edge Menu
161: 0 0 0 0 gpio-mxc 26 Edge Back
180: 0 0 0 0 gpio-mxc 11 Edge Home
269: 0 0 0 0 GPC 80 Level 20bc000.wdog
272: 0 0 0 0 GPC 49 Level imx_thermal
277: 0 0 0 0 GPC 19 Level rtc alarm
278: 0 0 0 0 GPC 4 Level 20cc000.snvs:snvs-powerkey
285: 0 0 0 0 GPC 2 Level sdma
286: 144 0 0 0 GPC 43 Level 2184000.usb
287: 1731 0 0 0 GPC 40 Level 2184200.usb
288: 64 0 0 0 GPC 118 Level 2188000.ethernet
289: 0 0 0 0 GPC 119 Level 2188000.ethernet
290: 147 0 0 0 GPC 22 Level mmc0
291: 0 0 0 0 GPC 23 Level mmc1
292: 1437 0 0 0 GPC 24 Level mmc2
293: 766 0 0 0 GPC 36 Level 21a0000.i2c
294: 176 0 0 0 GPC 37 Level 21a4000.i2c
295: 2 0 0 0 GPC 38 Level 21a8000.i2c
299: 0 0 0 0 GPC 18 Level vdoa
300: 0 0 0 0 GPC 27 Level 21e8000.serial
301: 0 0 0 0 GPC 28 Level 21ec000.serial
302: 4 0 0 0 GPC 6 Level 2400000.ipu
303: 0 0 0 0 GPC 5 Level 2400000.ipu
304: 0 0 0 0 GPC 107 Level mmdc_1
305: 0 0 0 0 GPC 112 Level mmdc_1
306: 0 0 0 0 GPC 113 Level mmdc_1
307: 0 0 0 0 GPC 114 Level mmdc_1
311: 0 0 0 0 GPC 8 Level 2800000.ipu
312: 0 0 0 0 GPC 7 Level 2800000.ipu
313: 2 0 0 0 GIC 137 Level 2101000.jr0
314: 0 0 0 0 GIC 138 Level 2102000.jr1
IPI0: 0 0 0 0 CPU wakeup interrupts
IPI1: 0 43648 4490 188 Timer broadcast interrupts
IPI2: 8650 14077 13812 16788 Rescheduling interrupts
IPI3: 20 24 26 17 Function call interrupts
IPI4: 4 10 1 0 Single function call interrupts
IPI5: 0 0 0 0 CPU stop interrupts
IPI6: 1 0 0 0 IRQ work interrupts
IPI7: 0 0 0 0 completion interrupts
Err: 0

 

 

We tried to apply Omar's patchs from this link : IPU2 parallel port on IMX6Q 

 

All ios are muxed correctly. Checked with IMX6QDRM datasheet.

 

With an oscilloscope there are PIXCLK V/HSYNC and DATA when cat /dev/video0 is clalled.

 

Thanks for your help

Outcomes