Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc

    SOLVED RAW-MIPI-SC132M on VisionFive 2

    General Discussion
    2
    3
    506
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      desperex last edited by

      Hi, just tried to use the camera with recently received StarFive VisionFive 2 SBC, I know it's "out of your support list" for now, but I just can't make it go through power on cycle.
      I use the same camera driver port from rpi5.15 which worked just fine on Rock Pi 4b. But there's something I'm probably missing in DTS part.
      (Q1) Wrong power-on sequence? Wrong pinctrl? Wrong GPIO pins?
      I use this code:

      / {
          cam_vana_2v8: 2p8v {
              compatible = "regulator-fixed";
              regulator-name = "camera_vana";
              regulator-min-microvolt = <2800000>;
              regulator-max-microvolt = <2800000>;
              regulator-always-on;
          };
      
          cam_vdig_1v8: 1p8v {
              compatible = "regulator-fixed";
              regulator-name = "camera_vdig";
              regulator-min-microvolt = <1800000>;
              regulator-max-microvolt = <1800000>;
              regulator-always-on;
          };
      
          cam_vddl_1v2: 1p2v {
              compatible = "regulator-fixed";
              regulator-name = "camera_vddl";
              regulator-min-microvolt = <1200000>;
              regulator-max-microvolt = <1200000>;
              regulator-always-on;
          };
      
          cam_clk: cam_clk {
              status = "okay";
              compatible = "fixed-clock";
              #clock-cells = <0>;
              clock-frequency = <24000000>;
          };
      };
      
      &vin_sysctl {
          status = "okay";
      
          ports {
              #address-cells = <1>;
              #size-cells = <0>;
      
              port@1 {
                  reg = <1>;
                  #address-cells = <1>;
                  #size-cells = <0>;
      
                  mipi_in_ucam: endpoint@0 {
                      reg = <0>;
                      remote-endpoint = <&ucam_out>;
                      bus-type = <4>;      /* MIPI CSI-2 D-PHY */
                      clock-lanes = <4>;
                      data-lanes = <0 1>;
                      lane-polarities = <0 0 0>;
                      status = "okay";
                  };
              };
          };
      };
      
      &i2c6 {
          status = "okay";
          clock-frequency = <100000>; //????
          i2c-sda-hold-time-ns = <300>;
          i2c-sda-falling-time-ns = <510>;
          i2c-scl-falling-time-ns = <510>;
          auto_calc_scl_lhcnt;
          pinctrl-names = "default";
          pinctrl-0 = <&i2c6_pins>;
      
          veyemvcam: veyemvcam@3b {
              compatible = "veye,mvcam";
              reg = <0x3b>;
              status = "okay";
      
              //clocks = <&cam_clk>;
              clocks = <&clk_ext_camera>;
              clock-names = "xclk";
      
              VANA-supply = <&cam_vana_2v8>;
              VDIG-supply = <&cam_vdig_1v8>;
              VDDL-supply = <&cam_vddl_1v2>;
              rotation = <0>;
      
              pinctrl-names = "default";
              pinctrl-0 = <&csi_pins>;
              reset-gpio = <&gpio 18 0>;
      
              port {
                  ucam_out: endpoint {
                      remote-endpoint = <&mipi_in_ucam>;
                      clock-lanes = <4>;
                      data-lanes = <0 1>;
                      lane-polarities = <0 0 0>;
                      clock-noncontinuous;
                      link-frequencies =
                          /bits/ 64 <750000000>;
                  };
              };
          };
      };
      

      StarFive DTS stuff can be found here - https://github.com/starfive-tech/linux/tree/JH7110_VisionFive2_devel/arch/riscv/boot/dts/starfive
      And I use jh7110-visionfive-v2.dts with above overrides of jh7110-visionfive-v2.dtsi.
      Media platform and camera drivers go here - https://github.com/starfive-tech/linux/tree/JH7110_VisionFive2_devel/drivers/media/platform/starfive

      (Q2) Am I right that with wrong power-on sequence I won't see camera using i2cdetect? Now it shows blank (--) and there's no mvcam logs in dmesg.

      It would be really great if you could shed some light on that issue.

      veye_xumm 1 Reply Last reply Reply Quote 0
      • veye_xumm
        veye_xumm @desperex last edited by

        @desperex
        Sorry, I'm not familiar with this platform. And I can't give you any direct help with the current work plan. But I can say something about the basic idea.

        @desperex said in RAW-MIPI-SC132M on VisionFive 2:

        Am I right that with wrong power-on sequence I won't see camera using i2cdetect? Now it shows blank (--) and there's no mvcam logs in dmesg.

        Pins J1-11 need to be pulled high.
        http://wiki.veye.cc/index.php/RAW-MIPI-SC132M_Data_Sheet#Interface_.26_Pin_list

        I don't think you can put the Raspberry Pi dts directly onto Vision Five. This dts corresponds to two parts of the driver. The part of the camera driver named veyemvcam, and the other part corresponds to the mipi reception and processing driver of the main chip (for your board it is the Vision Five main chip).

        We suggest you find a dts of mipi sensor that has been running successfully on Vision Five for reference, or seek help from the board manufacturer.

        D 1 Reply Last reply Reply Quote 0
        • D
          desperex @veye_xumm last edited by

          @veye_xumm said in RAW-MIPI-SC132M on VisionFive 2:

          We suggest you find a dts of mipi sensor that has been running successfully on Vision Five for reference, or seek help from the board manufacturer.

          Current device tree for VF2 includes working example of imx219 sensor, which is used as a base for your own driver - https://github.com/starfive-tech/linux/blob/JH7110_VisionFive2_devel/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi
          I just don't see big difference.

          Pins J1-11 need to be pulled high.
          http://wiki.veye.cc/index.php/RAW-MIPI-SC132M_Data_Sheet#Interface_.26_Pin_list

          I don't think you can put the Raspberry Pi dts directly onto Vision Five. This dts corresponds to two parts of the driver. The part of the camera driver named veyemvcam, and the other part corresponds to the mipi reception and processing driver of the main chip (for your board it is the Vision Five main chip).

          Thanks, I'd probably need to study specs & docs for the sensor and SBC more deeply.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post