SK-AM62P-LP: Enabling 4 AHD Cameras

Part Number: SK-AM62P-LP

Tool/software:

Hi

We're using linux SDK 10.00.07.04 and kernel 6.6, and we have already implemented the driver for our 4-CH Automotive AHD RX with MIPI-CSI2 Interface, and we have updated our DTS file. But he video didn't worked properly

here is a stract to our device tree


&main_i2c2 {
	#address-cells = <1>;
    #size-cells = <0>;
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&main_i2c2_pins_default>;
	clock-frequency = <400000>;

	i2c-switch@71 {
		compatible = "nxp,pca9543";
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <0x71>;

		/* CAM port */
		i2c@1 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <1>;

			nvp6324: camera@33 {
				compatible = "nextchip,nvp6324_mipi";
				reg = <0x33>;
			
				clocks = <&clk_nvp6324_fixed>;
				clock-names = "capture_mclk";
			
				mclk = <27000000>;
				mclk_source = <0>;
				pwn-gpios = <&exp1 13 GPIO_ACTIVE_HIGH>;

					port {
						csi2_cam0: endpoint {
						remote-endpoint = <&mipi_csi0_ep>;
						clock-lanes = <0>;
						data-lanes = <1 2 3 4>;
						};
					};
			};
		};
	};
};

&cdns_csi2rx0 {
	status = "okay";
	ports{
		#address-cells = <1>;
		#size-cells = <0>;
		
		csi0_port0: port@0{
			reg = <0>;
			status = "okay";	

			mipi_csi0_ep: endpoint {
				remote-endpoint = <&csi2_cam0>;
				bus-type = <4>; /* MIPI CSI-2 D-PHY */
				clock-lanes = <0>;
				data-lanes = <1 2 3 4>;
			};
		};
	};
};

&ti_csi2rx0 {
	status = "okay";
};

&dphy0 {
	status = "okay";
};



Is there anything missing on the Device tree?

we have used this commands on the terminal

insmod ./nvp6324.ko
media-ctl -V '"nvp6324_mipi 5-0033":0 [fmt:UYVY8_1X16/1280x720 field:none]'
media-ctl -V '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:UYVY8_1X16/1280x720 field:none]'
media-ctl -V '"cdns_csi2rx.30101000.csi-bridge":1 [fmt:UYVY8_1X16/1280x720 field:none]'
media-ctl -V '"30102000.ticsi2rx":0 [fmt:UYVY8_1X16/1280x720 field:none]'
media-ctl -V '"30102000.ticsi2rx":1 [fmt:UYVY8_1X16/1280x720 field:none]'
v4l2-ctl -z platform:30102000.ticsi2rx -d "30102000.ticsi2rx context 0" -v width=1280,height=720,pixelformat=UYVY
GST_DEBUG=3 gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw,width=1280,height=720,framerate=30/1,format=UYVY ! ticolorconvert ! waylandsink

but it didn't show any camera image.

Anyone has any idea for fixing that?


BR

  • running the command "GST_DEBUG=3 gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw,width=1280,height=720,framerate=30/1,format=UYVY ! ticolorconvert ! waylandsink", I had the following output.



    root@am62pxx-evm:~# GST_DEBUG=3 gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw,width=1280,height=720,framerate=30/1,format=UYVY ! ticolorconvert ! waylandsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    0:00:00.356606430 2175 0xffff78000b70 WARN v4l2 gstv4l2object.c:4666:gst_v4l2_object_get_crop_rect:<v4l2src0:src> VIDIOC_CROPCAP failed
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt709
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt709
    /GstPipeline:pipeline0/GstTIColorConvert:ticolorconvert0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)30/1
    /GstPipeline:pipeline0/GstWaylandSink:waylandsink0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)30/1
    /GstPipeline:pipeline0/GstTIColorConvert:ticolorconvert0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt709
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt709
    0:00:00.361180360 2175 0xffff78000b70 WARN v4l2 gstv4l2object.c:4666:gst_v4l2_object_get_crop_rect:<v4l2src0:src> VIDIOC_CROPCAP failed
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Execution ended after 0:30:21.400837505
    Setting pipeline to NULL ...

  • Hello Sergio,

    Can you provide a little more information about your 4-CH Automotive AHD RX with MIPI-CSI2 Interface? Do you have the public spec? Specifically, does it send data in 4 channels?

    Thanks,

    Jianzhong

  • Sure

    NVP6324 includes 4-Channel Automotive AHDTM RX with MIPI-CSI2/BT.656 Interface. It delivers high quality CVBS, 1M, 2M image. It accepts CVBS, COMET, 1M / 2M analog inputs from Camera and the other video signal sources. It accepts Single-ended/Differential analog SD/HD/FHD video signals, and then Processing Clamp/AGC(Auto Gain Control)/YC Separation and Converting BT.656/BT.1120/MIPI-CSI2 Format. MIPI-CSI2 interface compliant with MIPI D-PHY v1.1.

    NVP6324 is able to use same transmission cable with conventional one for CVBS/COMET(SD level), 1M/2M(HD/FHD level) and they provide the superior-image quality by minimizing the interference when separating Y and C.

    NVP6324 support Coaxial Communication Protocol communicates between controller(DVR) and camera on the video signal through coaxial
    cable.

    Video Decoder
     Input Formats
    - 4CH Single-ended & Differential Analog Video Input
    : CVBS / COMET(720H/960H)
    : AHD

    Output Formats
    - Support 8bit*4 parallel output port, each port video output format
    selectable
    - Support Byte-interleave for each 8bit parallel output port
    - Support MIPI-CSI2, 4 Lane for single and virtual channel
    - MIPI-CSI2 1/2/4 Data Lane Configuration
    : YUV422 8bit Format
    - 2 Data Lanes for up to 1080p@25/30 2CH
    - 4 Data Lanes for up to 1080p@25/30 4CH

    MIPI Output Format
    NVP6324 supports 4CH Analog Video Input (CVBS/ AHD) to a MIPI Interface compliant with MIPI CSI2 V1.1 SPEC. and D-PHY V1.1 SPEC
    with 1 clock Lane and 4 data Lanes. The max data rate of MIPI data lane is up to 1.5Gbps with YUV422/YUV420/LegacyYUV420-8bit format.
    The 4 data lane should be used for 4ch 1920x1080@20/30Hz format and 2 data lane can be used for 4ch 1280x720@25/30 Hz format.
    CSI-2 is a lane-scalable specification. The applications that require more bandwidth that what is provide by one data lane or those trying to
    avoid high clock rates can expand the data path to two, four lanes and obtain approximately linear increases in the peak bus bandwidth. The
    data stream is distributed between the lanes.

  • Thanks for the spec. I guess you configured it to output YUV422 via 4 Data Lanes. Are there 4 virtual channels (for up to 1080p@25/30 4CH)?

  • hi, we had configured then to YUYV8, and we we're using 1280x720@30, we had used this set of commands bellow.

    media-ctl -V '"nvp6324_mipi 5-0033":0 [fmt:UYVY8_1X16/1280x720 field:none]'
    media-ctl -V '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:UYVY8_1X16/1280x720 field:none]'
    media-ctl -V '"cdns_csi2rx.30101000.csi-bridge":1 [fmt:UYVY8_1X16/1280x720 field:none]'
    media-ctl -V '"30102000.ticsi2rx":0 [fmt:UYVY8_1X16/1280x720 field:none]'
    media-ctl -V '"30102000.ticsi2rx":1 [fmt:UYVY8_1X16/1280x720 field:none]' v4l2-ctl -z  platform:30102000.ticsi2rx -d "30102000.ticsi2rx context 0" -v width=1280,height=720,pixelformat=UYVY
    GST_DEBUG=3 gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw,width=1280,height=720,framerate=30/1,format=UYVY ! ticolorconvert ! waylandsink

  • bellow is our topology

    root@am62pxx-evm:~# media-ctl -p
    Media controller API version 6.6.32
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial          
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.6.32
    
    Device topology
    - entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev0
    	routes:
    		0/0 -> 1/0 [ACTIVE]
    	pad0: Sink
    		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    		<- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
    	pad1: Source
    		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    		-> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
    	pad2: Source
    		-> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
    	pad3: Source
    		-> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
    	pad4: Source
    		-> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
    	pad5: Source
    		-> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
    	pad6: Source
    		-> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
    
    - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev1
    	routes:
    		0/0 -> 1/0 [ACTIVE]
    	pad0: Sink
    		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    		<- "nvp6324_mipi 5-0033":0 [ENABLED,IMMUTABLE]
    	pad1: Source
    		[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    		-> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
    	pad2: Source
    	pad3: Source
    	pad4: Source
    
    - entity 15: nvp6324_mipi 5-0033 (4 pads, 1 link, 0 routes)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
    	pad0: Source
    		[stream:0 fmt:UYVY8_1X16/1280x720 field:none
    		 crop.bounds:(0,0)/1280x720
    		 crop:(0,0)/1280x720]
    		-> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    	pad1: Source
    	pad2: Source
    	pad3: Source
    
    - entity 24: 30102000.ticsi2rx context 0 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
    	pad0: Sink
    		<- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 30: 30102000.ticsi2rx context 1 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
    	pad0: Sink
    		<- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 36: 30102000.ticsi2rx context 2 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video4
    	pad0: Sink
    		<- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 42: 30102000.ticsi2rx context 3 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video5
    	pad0: Sink
    		<- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    - entity 48: 30102000.ticsi2rx context 4 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video6
    	pad0: Sink
    		<- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]
    
    - entity 54: 30102000.ticsi2rx context 5 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video7
    	pad0: Sink
    		<- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]
    

  • Hello,

    My question is, does your NVP6324 send data in 4 virtual channels, or just 1 virtual channel?

    Thanks,

    Jianzhong

  • Hello, our NVP is connected directly into this pins

    and on it's datasheet is mentioned on it's output " NVP6324 supports 4CH Analog Video Input (CVBS/ AHD) to a MIPI Interface compliant with MIPI CSI2 V1.1 SPEC. and D-PHY V1.1 SPEC
    with 1 clock Lane and 4 data Lanes. "

  • Based on what you provided, "The 4 data lane should be used for 4ch 1920x1080@20/30Hz format and 2 data lane can be used for 4ch 1280x720@25/30 Hz format.", it seems to me this device has 4 virtual channels. You'll need to make sure the driver is programmed to send data in 4 virtual channels.

    Please refer to this dicussion.