We try to interface ADV7282-m sensor with MIPI for imx6 quad plus on custom board under linux 3.14.52 (yocto-jethro compatible).
We configure in our device tree with the following definitions:
&mipi_csi{
status = "okay";
ipu_id = <0>; /* IPU1 is selected */
csi_id = <0>; /* CSI0 is selected */
v_channel = <0>; /* virtual channel0 selected */
lanes = <1>; /* DATA0 only */
};
v4l2_cap_1 {
compatible = "fsl,imx6q-v4l2-capture";
ipu_id = <0>; /* IPU1 selected */
csi_id = <0>; /* virtual channel0 selected */
mclk_source = <0>;
mipi_camera = <1>;
status = "okay";
};
/*
* I2C-1 bus management
*/
&i2c1 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>;
status = "okay";
adv7282-m {
compatible = "adv7282";
pinctrl-names = "default";
reg = <0x21>;
csi_id = <0>; /* video source : CSI0 */
cvbs = <1>; /* ANALOGIC channel INPUT#1 */
DOVDD-supply = <®_3p3v>; // 3.3v
AVDD-supply = <®_3p3v>; // 1.8v
DVDD-supply = <®_3p3v>; // 1.8v
PVDD-supply = <®_3p3v>; // 1.8v
clocks = <&clks 201>;
clock-names = "csi_mclk";
mipi_camera = <1>; /* Needed for v4l2 configuration */
mclk_source = <0>;
mclk = <24000000>;
ipu_id = <0>; /* IPU1 selected */
status = "okay";
};
};
Driver configure MIPI with YUV442 configuration and we measure MIPI clock signal with 108MHz frequency so we add a path in mxc_mipi_csi2.c file
(from “Some Experience When Enable MIPI Camera” : https://community.nxp.com/thread/307065 & Debug steps for customer MIPI sensor.docx )
And our mipi initialization configuration is as follow :
mipi_csi2_write(info, 0x00000002, CSI2_PHY_TST_CTRL0);
mipi_csi2_write(info, 0x00010044, CSI2_PHY_TST_CTRL1);
mipi_csi2_write(info, 0x00000000, CSI2_PHY_TST_CTRL0);
- mipi_csi2_write(info, 0x00000014, CSI2_PHY_TST_CTRL1);
+ mipi_csi2_write(info, 0x00000026, CSI2_PHY_TST_CTRL1);
mipi_csi2_write(info, 0x00000002, CSI2_PHY_TST_CTRL0);
mipi_csi2_write(info, 0x00000000, CSI2_PHY_TST_CTRL0);
In custom driver, we configure i2c initialization with these definitions (AUTODETECT CVBS Single Ended In Ain 1, MIPI Out):
42 0F 00 ; Exit Power Down Mode
42 00 00 ; INSEL = CVBS in on Ain 1
42 0E 80 ; ADI Required Write
42 9C 00 ; ADI Required Write
42 9C FF ; ADI Required Write
42 0E 00 ; Enter User Sub Map
42 03 4E ; ADI Required Write
42 04 57 ; Power-up INTRQ pin
42 13 00 ; Enable INTRQ output driver
42 17 41 ; select SH1
42 1D C0 ; Tri-State LLC output driver
42 52 CD ; ADI Required Write
42 80 51 ; ADI Required Write
42 81 51 ; ADI Required Write
42 82 68 ; ADI Required Write
42 5D 1C ; Enable Diagnostic pin 1 - Level=1.125V
42 5E 1C ; Enable Diagnostic pin 2 - Level=1.125V
42 FE 88 ; Set CSI Map Address
88 DE 02 ; Power up MIPI D-PHY
88 D2 F7 ; ADI Required Write
88 D8 65 ; ADI Required Write
88 E0 09 ; ADI Required Write
88 2C 00 ; ADI Required Write
88 00 00 ; Power up MIPI CSI-2 Tx --done--
As a result: no acquisition display…
So we tried another ADV7282-m configuration (Color Bars 576i MIPI Out with free-run):
42 0F 00 ; Exit Power Down Mode
42 00 04 ; ADI Required Write
42 0C 37 ; Force Free-run mode
42 02 84 ; Force standard to PAL
42 14 11 ; Set Free-run pattern to color bars
42 03 4E ; ADI Required Write
42 04 57 ; Power-up INTRQ pin
42 13 00 ; Enable INTRQ output driver
42 17 41 ; select SH1
42 1D C0 ; Tri-State LLC output driver
42 52 CD ; ADI Required Write
42 80 51 ; ADI Required Write
42 81 51 ; ADI Required Write
42 82 68 ; ADI Required Write
42 5D 1C ; Enable Diagnostic pin 1 - Level=1.125V
42 5E 1C ; Enable Diagnostic pin 2 - Level=1.125V
42 FE 88 ; Set CSI Map Address
88 DE 02 ; Power up MIPI D-PHY
88 D2 F7 ; ADI Required Write
88 D8 65 ; ADI Required Write
88 E0 09 ; ADI Required Write
88 2C 00 ; ADI Required Write
88 00 00 ; Power up MIPI CSI-2 Tx --done—
As a result:
- MIPI clock is Ok and present
- Data are receive by MIPI_CSI2 and a dataflow seem Ok (cat /dev/video0 is present)
- Gstreamer1 tool don’t’ display anything (but it was ok with an adv7080 an evaluation board and same kernel & root filesystem): it is not a rootfs or plugin problem.
If we start acquisition:
gst-launch-1.0 --gst-debug=*:1 -v imxv4l2src device=/dev/video0 ! imxv4l2sink
====== IMXV4L2SRC: 4.0.8 build on Jul 13 2016 15:19:44. ======
====== IMXV4L2SINK: 4.0.8 build on Jul 13 2016 15:19:44. ======
Setting pipeline to PAUSED ...
display(/dev/fb0) resolution is (1024x768).
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstImxV4l2Src:imxv4l2src0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)720\,\ height\=\(int\)576\,\ framerate\=\(fraction\)25/1\,\ interlace-mode\=\(string\)interleaved"
/GstPipeline:pipeline0/GstImxV4l2Sink:imxv4l2sink0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)720\,\ height\=\(int\)576\,\ framerate\=\(fraction\)25/1\,\ interlace-mode\=\(string\)interleaved"
V4L debug command gives:
v4l2-ctl -d /dev/video0 --all
Driver Info (not using libv4l2):
Driver name : mxc_v4l2
Card type :
Bus info :
Driver version: 0.1.11
Capabilities : 0x05000005
Video Capture
Video Overlay
Read/Write
Streaming
Video input : 1 (CSI MEM: no power)
Video output: 0 (DISP3 BG)
Video Standard = 0x00ffffff
PAL-B/B1/G/H/I/D/D1/K/M/N/Nc/60
NTSC-M/M-JP/443/M-KR
SECAM-B/D/G/H/K/K1/L/Lc
Format Video Capture:
Width/Height : 720/576
Pixel Format : 'NV12'
Field : Any
Bytes per Line: 720
Size Image : 622080
Colorspace : Unknown (00000000)
Format Video Overlay:
Left/Top : 0/0
Width/Height: 160/160
Field : Any
Chroma Key : 0x00000000
Global Alpha: 0x00
Clip Count : 0
Clip Bitmap : No
Framebuffer Format:
Capability : Extern Overlay
Flags : Overlay Matches Capture/Output Size
Width : 0
Height : 0
Pixel Format : ''
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 720, Height 625
Default : Left 0, Top 0, Width 720, Height 625
Pixel Aspect: 0/0
Crop: Left 0, Top 0, Width 720, Height 625
Streaming Parameters Video Capture:
Frames per second: 30.000 (30/1)
Read buffers : 0
Streaming Parameters Video Output:
Frames per second: invalid (0/0)
Write buffers : 0
Try with low-level tool :
/unit_tests/mxc_v4l2_capture.out -d /dev/video0 -m 1
in_width = 176, in_height = 144
out_width = 176, out_height = 144
top = 0, left = 0
sensor chip is adv7282-m_decoder
sensor supported frame size:
720x576
Width = 176 Height = 144 Image size = 38016
pixelformat: YU12
VIDIOC_DQBUF failed.
VIDIOC_QBUF failed
Can you help us to understand why there is no acquisition display?
Witch control can we do?
Original Attachment has been moved to: LOG.txt.zip