IMX290 / IMX519 / IMX708 / IMX477 on zero 3W

I’m trying to enable IMX290 IR-CUT / IMX519 / IMX708 / IMX477 on Radxa Zero 3W.

Sensor Status IQfile FPS
IMX290 i2c and MIPI errors / driver no
IMX519 driver working / manual focus done 10 FPS / 60 FPS / 120 FPS
IMX708 driver working with auto-focus done 14 FPS / 60 FPS / 120 FPS
IMX477 driver working done 10 FPS / 40 FPS / 50 FPS

IMX708 is missing the auto-focus, don’t have any rockchip example to be based on. Current limitation is max window size of 4080x2568.

IMX708 1920x1080 60 FPS

IMX708 1536x864 120 FPS

IMX477 working on 1920x1080 40 fps, current limitation is the max window size 4048x3040

IMX519 1920x1080 (out of focus)

IMX519 4080x3024 (no focus)

I can’t find a working AK7375, still hopes. Focus works issuing a v4l2 command.

IMX519 1280x720 120 FPS

References:

imx519: linux/drivers/media/i2c/imx519.c at rpi-5.15.y · raspberrypi/linux · GitHub
imx708: add support for imx708 raspberry pi v3 camera by ackPeng · Pull Request #457 · armbian/linux-rockchip · GitHub
imx477: IMX477 / IMX577 / IMX766 on Rock 5 - #10 by avaf

1 Like

Regarding IMX290 , the lack of hardware knowledge prevents me from getting this working, i2c detect the hardware but failed to send / receive commands, also i get MIPI errors so i think i am missing something.

Reference: linux/drivers/media/i2c/imx290.c at rpi-5.15.y · raspberrypi/linux · GitHub

After replacing the cable and testing all the sensors, the connector lock became loose, so care must be taken.
I will order a new rock 3w and try again if someone spot something wrong with dtsi or if someone at radxa can post here that it’s not possible to use this sensor on 3W, then that’s it.

Anyway, if someone wants to give it a try and fix what i missed, here is the DTSI i used:

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>

/ {
        imx290_vana_2v8: 2p8v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vana";
                regulator-min-microvolt = <2800000>;
                regulator-max-microvolt = <2800000>;
                regulator-always-on;
        };

        imx290_vdig_1v2: 1p2v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vdig";
                regulator-min-microvolt = <1200000>;
                regulator-max-microvolt = <1200000>;
                regulator-always-on;
        };

        imx290_vddl_1v8: 1p8v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vddl";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
                regulator-always-on;
        };

        clk_cam_37m: external-camera-clock-37m {
                status = "okay";
                compatible = "fixed-clock";
                clock-frequency = <37125000>;
                clock-output-names = "clk_cam_37m";
                #clock-cells = <0>;
        };

        camera_pwdn_gpio: camera-pwdn-gpio {
                status = "okay";
                compatible = "regulator-fixed";
                regulator-name = "camera_pwdn_gpio";
                regulator-always-on;
                regulator-boot-on;
                enable-active-high;
                gpio = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>;
        };
};

&i2c2 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&i2c2m1_xfer>;
        #address-cells = <1>;
        #size-cells = <0>;

        camera_imx290: camera-imx290@1a {
                status = "okay";
                compatible = "sony,imx290";
                reg = <0x1a>;
                clocks = <&clk_cam_37m>;
                assigned-clocks = <&clk_cam_37m>;
                assigned-clock-rates = <37125000>;
                clock-frequency = <37125000>;
                clock-names = "xclk";
                /* pwdn-gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>; */

                rockchip,camera-vflip = <1>;
                rockchip,camera-hflip = <1>;
                rockchip,camera-mode = <0>;
                rockchip,camera-module-index = <0>;
                rockchip,camera-module-facing = "back";
                rockchip,camera-module-name = "imx290";
                rockchip,camera-module-lens-name = "default";
                rotation = <0>;
                orientation = <2>;

                vdda-supply = <&imx290_vana_2v8>;       /* 2.8v */
                vddd-supply = <&imx290_vdig_1v2>;       /* 1.2v */
                vdddo-supply = <&imx290_vddl_1v8>;      /* 1.8v */

                port {
                        ucam_out0: endpoint {
                                remote-endpoint = <&mipi_in_ucam0>;
                                data-lanes = <1 2>;
                                link-frequencies = /bits/ 64 <445500000 297000000>;
                        };
                };
        };
};

&csi2_dphy_hw {
        status = "okay";
};

&csi2_dphy0 {
        status = "okay";
        ports {
                #address-cells = <1>;
                #size-cells = <0>;

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

                        mipi_in_ucam0: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&ucam_out0>;
                                data-lanes = <1 2>;
                        };
                };

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

                        dphy0_out: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&isp0_in>;
                        };
                };
        };
};

&rkisp_vir0 {
        status = "okay";
        port {
                #address-cells = <1>;
                #size-cells = <0>;

                isp0_in: endpoint@0 {
                        reg = <0>;
                        remote-endpoint = <&dphy0_out>;
                };
        };
};

&rkisp {
        status = "okay";
};

&rkisp_mmu {
        status = "okay";
};

&rkcif_mmu {
        status = "okay";
};

&rkcif {
        status = "okay";
};

Nice work, getting cameras going is a bit tricky when information is hard to come by (sensor datasheets, PCB connector pin outs, broken I2C drivers etc). My work on this front has been put on hold whilst I have other projects to get through and that work has only been on RK3576 so far, where the 3W would be slightly different again with its 22 pin connector.

My problems with the IMX290 came down to the I2C driver that ships with the Rockchip 6.1 kernel being totally broken which would explain your MIPI errors. I ended up back porting a working RPI Linux 6.1 driver to be compatible with Rockchips way of doing things with the RKAIQ server.

What are you doing for the IQfile tuning, do you have a proper Light box to use along with RKISP?

For obtaining the “confidential” Sony sensor datasheets I found these are available on Chinese forums, usually for sale for a couple of dollars.

I compiled and ran your driver for the imx290 on my Rock 5C. Unfortunately, I wasn’t successful on the first attempt; I received some error/warning messages, although, at least, there were no I2C errors. I need to review the dtsi file.

Made a mistake, its working. Can get some image now.

First picture, 60 fps only? ops, forgot its two lane.

v4l2-ctl --device /dev/video11 --stream-mmap=4 --stream-count=1 --stream-skip=150 --set-fmt-video=width=1920,height=1080,pixelformat=NV12
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 60.00 fps, dropped buffers: 12
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 60.00 fps, dropped buffers: 10
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

No proper Light box here.

Its nice you have access to some register to improve the driver/drivers.

By the way, looks like Radxa is launching IMX577 soon.

Question for you: I see you use isp39 on your iqfile, is it new camera engine? And it’s working for you, or is just for reference?

ISP39 is for RK3576 as it uses the newer ISP version. For other Rockchip SoC models you have to use the ISP version made specifically for it. RK3588 uses ISP30.

@3djelly Thanks for your work. Here my iqfile for Rock 5C / Rock 5C lite / Rock 5B.

Tested with IR to see the result , but still needs some adjustments (pink). going day to night with IR works , switching off IR sometimes need to switch a few times back and forth to recover.

IR off.

IR on

imx290_imx290_default.json.zip (96.9 KB)

In the past couple of days I have been working on the OV9282 sensor and came up against a FPS limit also, however 2 MIPI lanes does have the bandwidth to achieve 120 FPS.

The first of the issues was the ov9282 I2C driver being non functional, which required fixing to match the working ov9281 driver, but I also had to add in support for 30/60/120 FPS.

Secondly I was initially using OpenCV to use the camera which required a JPEG encode step that was being offloaded to the CPU and only achieved a 60 FPS rate. I switched to using Gstreamer with the Rockchip mppjpegenc hardware encoder and that then allowed the full 120 FPS rate.