Getting the OV5640 camera to work under armbian with kernel 5.8

I am still trying to get my ov5640 camera to work on my M64. I recompiled kernel 5.8.16-sunxi64 to include the ov5640 kernel module and I included that module in the initramfs. I also updated the sun50i-a64-bananapi-m64.dts file by copying and adjusting the camera overlay code from sun50i-a64-pinetab.dts, but it is not working.

gollumm64% v4l2-ctl --list-devices
cedrus (platform:cedrus):
        /dev/video0
        /dev/media0

gollumm64% v4l2-ctl -d 0 --list-formats --list-ctrls

Codec Controls

        mpeg_2_slice_parameters 0x009909fa (unknown): type=103 flags=has-payload
   mpeg_2_quantization_matrices 0x009909fb (unknown): type=104 flags=has-payload
    h264_sequence_parameter_set 0x00990ce8 (unknown): type=110 flags=has-payload
     h264_picture_parameter_set 0x00990ce9 (unknown): type=111 flags=has-payload
            h264_scaling_matrix 0x00990cea (unknown): type=112 flags=has-payload
          h264_slice_parameters 0x00990ceb (unknown): type=113 flags=has-payload
         h264_decode_parameters 0x00990cec (unknown): type=114 flags=has-payload
               h264_decode_mode 0x00990ced (menu)   : min=0 max=0 default=0 value=0
                h264_start_code 0x00990cee (menu)   : min=0 max=0 default=0 value=0
    hevc_sequence_parameter_set 0x00990cf0 (unknown): type=120 flags=has-payload
     hevc_picture_parameter_set 0x00990cf1 (unknown): type=121 flags=has-payload
          hevc_slice_parameters 0x00990cf2 (unknown): type=122 flags=has-payload
               hevc_decode_mode 0x00990cf7 (menu)   : min=0 max=0 default=0 value=0
                hevc_start_code 0x00990cf8 (menu)   : min=0 max=0 default=0 value=0
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'ST12' (Sunxi Tiled NV12 Format, compressed)
        [1]: 'NV12' (Y/CbCr 4:2:0)
gollumm64% media-ctl --device /dev/media0 -p
Media controller API version 5.8.16

Media device information
------------------------
driver          cedrus
model           cedrus
serial          
bus info        platform:cedrus
hw revision     0x0
driver version  5.8.16

Device topology
- entity 1: cedrus-source (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Source
                -> "cedrus-proc":0 [ENABLED,IMMUTABLE]

- entity 3: cedrus-proc (2 pads, 2 links)
            type Node subtype Unknown flags 0
        pad0: Sink
                <- "cedrus-source":0 [ENABLED,IMMUTABLE]
        pad1: Source
                -> "cedrus-sink":0 [ENABLED,IMMUTABLE]

- entity 6: cedrus-sink (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "cedrus-proc":1 [ENABLED,IMMUTABLE]

This is the dts code I added to sun50i-a64-bananapi-m64.dts:

	i2c-csi {
		compatible = "i2c-gpio";
		sda-gpios = <&pio 4 13 GPIO_ACTIVE_HIGH>; /* PE13 */
		scl-gpios = <&pio 4 12 GPIO_ACTIVE_HIGH>; /* PE12 */
		i2c-gpio,delay-us = <5>;
		#address-cells = <1>;
		#size-cells = <0>;

		ov5640: camera@3c {
			compatible = "ovti,ov5640";
			reg = <0x3c>;
			pinctrl-names = "default";
			pinctrl-0 = <&csi_mclk_pin>;
			clocks = <&ccu CLK_CSI_MCLK>;
			clock-names = "xclk";

			AVDD-supply = <&reg_dldo3>;
			DOVDD-supply = <&reg_aldo1>;
			DVDD-supply = <&reg_eldo3>;
			reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */
			powerdown-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */

			port {
				ov5640_ep: endpoint {
					remote-endpoint = <&csi_ep>;
					bus-width = <8>;
					hsync-active = <1>; /* Active high */
					vsync-active = <0>; /* Active low */
					data-active = <1>;  /* Active high */
					pclk-sample = <1>;  /* Rising */
				};
			};
		};
	};

&csi {
	status = "okay";

	port {
		#address-cells = <1>;
		#size-cells = <0>;

		csi_ep: endpoint {
			remote-endpoint = <&ov5640_ep>;
			bus-width = <8>;
			hsync-active = <1>; /* Active high */
			vsync-active = <0>; /* Active low */
			data-active = <1>;  /* Active high */
			pclk-sample = <1>;  /* Rising */
		};
	};
};

What am I missing?

1 Like