Errors is"Reference to non-existent node or label "vi_in0" "if I run "make dtbs" at TX1 R24,2

Errors is"Reference to non-existent node or label “vi_in0” "if I run “make dtbs” at TX1 R24,2

i dtsi file is below.

#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>

#define GANG_MODE_L_R 1
#define GANG_MODE_T_B 2
#define GANG_MODE_R_L 3
#define GANG_MODE_B_T 4

#define CAM0_RST_L	TEGRA_GPIO(S, 4)
#define CAM2_RST_L	TEGRA_GPIO(S, 5)

#define CAM1_PWDN	TEGRA_GPIO(T, 0)

//GPIOs
/ {
  /* set camera gpio direction to output */
  gpio: gpio@6000d000 {
    camera-control {
      gpio-output-high = <
                        CAM0_RST_L
                        CAM2_RST_L
						CAM1_PWDN
                        >;
    };
  };
};


/ {
  host1x {
    vi_base: vi {
      num-channels = <1>;
      ports {
        #address-cells = <1>;
        #size-cells = <0>;
        vi_port0: port@0 {
          status = "okay";
          reg = <0>;
          vi_in0: endpoint {
            status = "okay";
            csi-port = <0>;
            bus-width = <2>;
            remote-endpoint = <&imx219_out0>;
          };
        };


      };
    };


    i2c@546c0000  {
        status = "okay";
        reg = <0>;
        #address-cells = <1>;
        #size-cells = <0>;
        imx219_a@10 {
          compatible = "nvidia,imx219";
          devnode="video0";
          // I2C Device Address
          reg = <0x10>;
          reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_LOW>;

          //Physical Dimenstion of sensor
          physical_w = "5.095";
          physical_h = "4.930";

          //Sensor Model
          sensor_model ="imx219";

//XXX: Experiment
					dovdd-supply = <&en_vdd_cam>;
          avdd-reg = "vana";
          dvdd-reg = "vdig";
					//iovdd-reg = "dovdd";
          iovdd-reg = "vif";
//XXX: Experiment


          //avdd-reg = "vana";
          //iovdd-reg = "vif";
          //dvdd-reg = "vdig";
          clocks = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
          clock-names = "mclk";
          clock-frequency = <24000000>;
          mclk = "cam_mclk1";

          post_crop_frame_drop = "0";
		  
          mode0 { // IMX219_MODE_640X480

            //mclk_khz = "47000";
            mclk_khz = "24000";
            mclk_multiplier = "17.0";
            pix_clk_hz = "182400000";
            //pix_clk_hz = "170000000";

            num_lanes = "2";
            tegra_sinterface = "serial_a";
            discontinuous_clk = "yes";
            cil_settletime = "0";
            pixel_t = "bayer_rggb";
            readout_orientation = "90";
            inherent_gain = "0";

            active_w = "640";
            active_h = "480";

            //line_length = "752";
            //line_length = "1752";
            line_length = "3448";
            //line_length = "3559";
            dpcm_enable = "false";

            min_gain_val = "1";
            max_gain_val = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "64";
            min_framerate = "1";
            max_framerate = "90";
            min_exp_time = "22";
					  max_exp_time = "358733";
            //embedded_metadata_height = "2";
          };

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

            port@0 {
              reg = <0>;
              imx219_out0: endpoint {
                csi-port = <0>;
                bus-width = <2>;
                remote-endpoint = <&vi_in0>;
              };
            };
          };
        };
      };
     

 

  };
};

/ {
  tegra-camera-platform {
		/**
		* Physical settings to calculate max ISO BW
		*
		* num_csi_lanes = <>;
		* Total number of CSI lanes when all cameras are active
		*
		* max_lane_speed = <>;
		* Max lane speed in Kbit/s
		*
		* min_bits_per_pixel = <>;
		* Min bits per pixel
		*
		* vi_peak_byte_per_pixel = <>;
		* Max byte per pixel for the VI ISO case
		*
		* vi_bw_margin_pct = <>;
		* Vi bandwidth margin in percentage
		*
		* isp_peak_byte_per_pixel = <>;
		* Max byte per pixel for the ISP ISO case
		*
		* isp_bw_margin_pct = <>;
		* Isp bandwidth margin in percentage
		*/

    compatible = "nvidia, tegra-camera-platform";
		num_csi_lanes = <2>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <182400>;
		isp_peak_byte_per_pixel = <2>;
		isp_bw_margin_pct = <25>;


    modules {
      cam_module0: module0 {
        status = "okay";
        badge = "uav_back_imx219";
        position = "rear";
        orientation = "0";
        cam_module0_drivernode0: drivernode0 {
          /* Declare PCL support driver (classically known as guid)  */
          pcl_id = "v4l2_sensor";
          /* Driver's v4l2 device name */
          devname = "imx219 7-0010";
          /* Declare the device-tree hierarchy to driver instance */
          proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/imx219_a@10";
          status = "okay";
        };
      };


    };
  };
};

How can I fix this question?

hello sensor_test,

please refer to our reference device tree to have implementation.
moreover, please check the JetPack Tutorials, there’s [V4L2 Sensor Driver Development Tutorial] for your reference,
thanks

Hello JerryChang,
There’s [V4L2 Sensor Driver Development Tutorial] for your reference.I also readed.But the question is not fix.
Can you offert some helps?

hello sensor_test,

you may also check the [Port Binding] in the [Sensor Driver Programming Guide]
please based on our reference sensor device tree to have implementation,
thanks

hello JerryChang,
I also check the [Port Binding] in the [Sensor Driver Programming Guide],my dtsi file is reference nvidia sensor device tree,I can not find different.
But this error is exist.
How can fix this?

hello sensor_test,

you may refer to the failure logs and check into your device tree to find the failure.
thanks

hello JerryChang,

How can I read out device tree info at jetson TX1 2.0?

hello sensor_test,

you may look into kernel sources to understand your implementation.
or, you could disassembler the dtb file into txt file for verification.
for example,

dtc -I dtb -O dts -o temp.txt tegra210.dtb

hello JerryChang,
There are can not find “tegra210.dtb” at I run command :dtc -I dtb -O dts -o temp.txt tegra210.dtb

nvidia@tegra-ubuntu:~$ ls
cuda-l4t                                          libvisionworks-sfm-repo_0.90.1_arm64_l4t-r24.deb       OpenCV4Tegra
cudnn_samples_v5                                  libvisionworks-tracking-repo_0.88.0_arm64_l4t-r24.deb  PerfKit
examples.desktop                                  nv-gie-repo-ubuntu1604-6-rc-cuda8.0_1.0.2-1_arm64.deb  tegra_multimedia_api
libvisionworks-repo_1.6.0.235n_arm64_l4t-r24.deb  NVIDIA_CUDA-8.0_Samples                                VisionWorks-SFM-0.90-Samples
nvidia@tegra-ubuntu:~$ dtc -I dtb -O dts -o temp.txt tegra210.dtb
FATAL ERROR: Couldn't open "tegra210.dtb": No such file or directory

How can I read out device tree info at jetson TX1 3.0?

sensor_test,

JerryChang was just providing example syntax, the actual dtb file you’ll want to look at is located in /boot on your board. To find which one is being loaded you can check dmesg.

dmesg | grep dts

I see you found the other posts in which this was solved way back in r24.2, essentially the solution is to remove the extraneous dtb files from the kernel-dts Makefile so that ‘make dtbs’ produces only the TX1’s dtb.

I don’t have the r24.2 filesystem installed anymore, but you should be able to find the Makefile by going to your kernel source directory and running

grep -re ".dtb"

Here is example output from r28.2 which may or may not match r24.2:

platform/t210/common/kernel-dts/t210-common-platforms/tegra210-common.dtsi:	nvidia,dtbbuildtime = __DATE__, __TIME__;
platform/t210/jetson/kernel-dts/tegra210-jetson-common.dtsi:	nvidia,dtbbuildtime = __DATE__, __TIME__;
platform/t210/jetson/kernel-dts/Makefile:old-dtb := $(dtb-y)
platform/t210/jetson/kernel-dts/Makefile:dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-jetson-cv-base-p2597-2180-a00.dtb
platform/t210/jetson/kernel-dts/Makefile:dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-jetson-cv-p2597-2180-a00.dtb
platform/t210/jetson/kernel-dts/Makefile:dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-jetson-cv-p2597-2180-imx274-hdmi.dtb
platform/t210/jetson/kernel-dts/Makefile:dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-jetson-cv-p2597-2180-a00-auo-1080p-edp.dtb
platform/t210/jetson/kernel-dts/Makefile:dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-jetson-tx1-p2597-2180-a01-android-devkit.dtb
platform/t210/jetson/kernel-dts/Makefile:dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
platform/t210/jetson/kernel-dts/Makefile:dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-jetson-e-base-p2595-0000-a00.dtb
platform/t210/jetson/kernel-dts/Makefile:dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-jetson-e-p2595-0000-a00-00.dtb
platform/t210/jetson/kernel-dts/Makefile:dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-jetson-tx1-p2597-2180-a02-devkit-24x7.dtb
platform/t210/jetson/kernel-dts/Makefile:ifneq ($(dtb-y),)
platform/t210/jetson/kernel-dts/Makefile:dtb-y := $(addprefix $(makefile-path)/,$(dtb-y))
platform/t210/jetson/kernel-dts/Makefile:dtb-y += $(old-dtb)

I would navigate to platform/t210/jetson/kernel-dts/Makefile and comment out each of the dtb lines except for the one that matches the dts you found from “dmesg | grep dts”

dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb