OV9732 Camera Bringup on TX2

I am doing OV9732 camera bringup on TX2-4GB varient and have taken OV5693 as base for this.
As OV9732 and OV5693 both are quiet similar.

During bringup i am getting below errors due to which ov9732 probe is deffered.

[ 1.732490] ov9732 7-0036: get mclk extperiph2
[ 1.737479] ov9732 7-0036: ov9732_power_get: camera_common_regulator_get called for 2.8V
[ 1.746323] ov9732 7-0036: camera_common_regulator_get vana ERR: fffffffffffffdfb
[ 1.753836] ov9732 7-0036: ov9732_power_get: camera_common_regulator_get called for 1.8V
[ 1.762526] ov9732 7-0036: camera_common_regulator_get vif ERR: fffffffffffffdfb

Please suggest what could be the possible reason for this vana and vif failure.

Maybe you didn’t define the vana-supply and vif-supply like below in the device tree of the sensor scope.

		ov5693_c@36 {
 			/* Define any required hw resources needed by driver */
 			/* ie. clocks, io pins, power sources */
 			/* mclk-index indicates the index of the */
 			/* mclk-name with in the clock-names array */
 
 			clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>,
 					 <&tegra_car TEGRA186_CLK_PLLP_OUT0>;
 			clock-names = "extperiph1", "pllp_grtba";
 			mclk = "extperiph1";
 			clock-frequency = <24000000>;
 			reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
 			pwdn-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
 			vana-supply = <&en_vdd_cam_hv_2v8>;
 			vif-supply = <&en_vdd_cam>;
 		};

Hi Shane,

vana-supply and vif-supply are already in place in kernel_source/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-camera-e3326-a00.dtsi

i2c@c250000 {
    ov9732_c@36 {
        /* Define any required hw resources needed by driver */
        /* ie. clocks, io pins, power sources */
        /* mclk-index indicates the index of the */
        /* mclk-name with in the clock-names array */

        clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH2>,
                 <&tegra_car TEGRA186_CLK_PLLP_OUT0>;
        clock-names = "extperiph2", "pllp_grtba";
        mclk = "extperiph2";
        clock-frequency = <24000000>;
        reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
        vana-supply = <&en_vdd_cam_hv_2v8>;
        vif-supply = <&en_vdd_cam>;

gpio@2200000 {
    camera-control-output-high {
        gpio-hog;
        output-high;
        gpios = <CAM0_PWDN 1>;
        label = "cam0-pwdn";
        status = "okay";
    };

Still these errors are coming. Any suggestions ?

Also did you add avdd-reg = “vana”… as below?

	i2c@3180000 {
 		ov5693_c@36 {
 			compatible = "nvidia,ov5693";
 			/* I2C device address */
 			reg = <0x36>;
 
 			/* V4L2 device node location */
 			devnode = "video0";
 
 			/* Physical dimensions of sensor */
 			physical_w = "3.674";
 			physical_h = "2.738";
 
 			/* Define any required hw resources needed by driver */
 			/* ie. clocks, io pins, power sources */
 			avdd-reg = "vana";
 			iovdd-reg = "vif";

Hi Shane,

yes avdd-reg and iovdd-reg are also defined in kernel_source/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-modules/tegra186-camera-e3326-a00.dtsi as below

i2c@c250000 {
    ov9732_c@36 {
        compatible = "nvidia,ov9732";
        /* I2C device address */
        reg = <0x36>;

        /* V4L2 device node location */
        devnode = "video0";

        /* Physical dimensions of sensor */
        physical_w = "3.674";
        physical_h = "2.738";

        /* Define any required hw resources needed by driver */
        /* ie. clocks, io pins, power sources */
        avdd-reg = "vana";                                                                                                                                     
        iovdd-reg = "vif";

        /* Sensor output flip settings */
        vertical-flip = "true";

Also implement the *[ov5693_parse_dt() too, If yes please check if any error while system boot up.

Hi Shane,

This is also implemented and i am facing below error.

[ 1.684687] ov9732 7-0036: probing v4l2 sensor.
[ 1.689292] ov9732 7-0036: ov9732_common_ops called here
[ 1.695149] ov9732 7-0036: ov9732_subdev_internal_ops called here
[ 1.701777] ov9732 7-0036: ov9732_ctrl_ops
[ 1.706469] ov9732 7-0036: ov9732_parse_dt called here
[ 1.712156] ov9732 7-0036: mclk in DT extperiph2
[ 1.716797] ov9732 7-0036: power down gpio not in DT: -2
[ 1.722122] ov9732 7-0036: power down gpio in DT: 0
[ 1.727248] ov9732 7-0036: reset gpios in DT: 457
[ 1.731088] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[ 1.732490] ov9732 7-0036: get mclk extperiph2
[ 1.737479] ov9732 7-0036: ov9732_power_get: camera_common_regulator_get called for 2.8V
[ 1.746323] ov9732 7-0036: camera_common_regulator_get vana ERR: fffffffffffffdfb
[ 1.753836] ov9732 7-0036: ov9732_power_get: camera_common_regulator_get called for 1.8V
[ 1.762526] ov9732 7-0036: camera_common_regulator_get vif ERR: fffffffffffffdfb
[ 1.769942] ov9732 7-0036: ov9732_power_get can’t request pwdn_gpio -517
[ 1.776656] ov9732 7-0036: ov9732_power_get can’t request reset_gpio -517
[ 1.783456] ov9732 7-0036: unable to power get
[ 1.787915] ov9732 7-0036: tegra camera driver registration failed
[ 1.794196] ov9732: probe of 7-0036 failed with error -14

Due to which probe success is not happeing, Please suggest on this.

Check if your device is in the list.

sudo ls /sys/kernel/debug/regulator/en-vdd-cam-hv-2v8/

Hi Shane,

This sysfs entry is not present

root@localhost:/home/ubuntu# sudo ls /sys/kernel/debug/regulator/en-vdd-cam-hv-2v8/
ls: cannot access ‘/sys/kernel/debug/regulator/en-vdd-cam-hv-2v8/’: No such file or directory

Where could we look for this ?

Those regulator should define in …/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-cvb-prod-p2597-b00-p3310-1000-a00-00.dtsi

Hi Shane,

Yes, these en_vdd_cam_hv_2v8: regulator@11 and en_vdd_cam: regulator@2 are present in the mentioned file.
P3310 is for TX2-8GB varient and i am using TX2-4GB varient P3489-0888.
Do we need to add these regulators in the p3489-0888 device-tree source? but during compilation i did not get any error related to these regulator’s node definition ?

Please suggest on this .

Yes, suppose need to add it for the TX2 4G dts.

1 Like

I check with my device TX2 4G with the r32.4.3 default image and dtb that have en_vdd_cam, maybe you have some modify the dts to remove them accidentally. Could you check with the original dtb to check it present?

Actually i have not changed anything in the device-tree, I just compiled the R32.4.3 system.img using “sudo ./flash.sh --no-flash jetson-tx2-4GB mmcblk0p1”

I have connected ov9732 on I2c-7 and taken reference of ov5693 device tree for ov9732 device tree source.

Could you use dtc to check you dtb file have define the “en_vdd_cam” with the original dtb and current used dtb file.

As per the findings:
file tegra186-quill-p3489-0888-a00-00-base.dts includes below
#include <t18x-common-platforms/tegra186-quill-power-tree-p3489-1000-a00-00.dtsi>
and “tegra186-quill-power-tree-p3489-1000-a00-00.dtsi” includes “tegra186-cvb-prod-p2597-b00-p3489-1000-a00-00.dtsi”

In this tegra186-cvb-prod-p2597-b00-p3489-1000-a00-00.dtsi file en_vdd_cam and en_vdd_cam_hv_2v8 are already in place.

    en_vdd_cam: regulator@2 {
        compatible = "regulator-fixed-sync";
        reg = <2>;
        regulator-name = "en-vdd-cam";
        regulator-min-microvolt = <1800000>;
        regulator-max-microvolt = <1800000>;
        gpio = <&gpio_i2c_0_77 9 1>;
        enable-active-high;
    };

    en_vdd_cam_hv_2v8: regulator@11 {                                                                                                                          
        compatible = "regulator-fixed-sync";
        reg = <11>;
        regulator-name = "en-vdd-cam-hv-2v8";
        regulator-min-microvolt = <2800000>;
        regulator-max-microvolt = <2800000>;
        gpio = <&gpio_i2c_0_74 13 1>;
        enable-active-high;
    };

So in p3489-0888 the regulator support is already available. so what could be the possible reason for this.

Hi Shane,
I checked the compiled tegra186-quill-p3489-0888-a00-00-base.dtb in default and modified code

In the original default dtb file for TX2-4GB, here
en_vdd_cam_hv_2v8 = “/fixed-regulators/regulator@11”;
en_vdd_cam = “/fixed-regulators/regulator@2”;

and in my compiled dtb also these regulators are available
en_vdd_cam_hv_2v8 = “/fixed-regulators/regulator@11”;
en_vdd_cam = “/fixed-regulators/regulator@2”;

I am also attaching the generated dtsi from dtb for your reference.

modified_base.txt → with the changes of OV9732 camera
base_default.txt–>default
modified_base.txt (763.4 KB) base_default.txt (763.5 KB)

Hi Shane

Any suggestions ?

Check the extracted_proc.dts if them are present.

sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree