// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2025 TuxVision. All rights reserved. * * tegra234-p3767-camera-p3768-nv-toto-cam0-4lane-overlay.dts - Test camera device tree overlay */ /dts-v1/; /plugin/; #include #include #include / { overlay-name = "Test TOTO-CAM0-4Lane"; jetson-header-name = "Jetson 24pin CSI Connector"; compatible = JETSON_COMPATIBLE_P3768; /* toto camera on CSI PORT A / cam 0 */ fragment@0 { target-path = "/"; __overlay__ { tegra-capture-vi { num-channels = <1>; ports { #address-cells = <1>; #size-cells = <0>; vi_port0: port@0 { reg = <0>; jetson_vi_in0: endpoint { port-index = <0>; bus-width = <4>; remote-endpoint = <&jetson_csi_out0>; }; }; }; }; tegra-camera-platform { compatible = "nvidia, 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 * * max_pixel_rate = <>; * Max pixel rate in Kpixel/s for the ISP ISO case * * isp_peak_byte_per_pixel = <>; * Max byte per pixel for the ISP ISO case * * isp_bw_margin_pct = <>; * Isp bandwidth margin in percentage */ num_csi_lanes = <2>; max_lane_speed = <2500000>; min_bits_per_pixel = <8>; vi_peak_byte_per_pixel = <5>; vi_bw_margin_pct = <25>; isp_peak_byte_per_pixel = <5>; isp_bw_margin_pct = <25>; /** * The general guideline for naming badge_info contains 3 parts, and is as follows, * The first part is the camera_board_id for the module; if the module is in a FFD * platform, then use the platform name for this part. * The second part contains the position of the module, ex. "rear" or "front". * The third part contains the last 6 characters of a part number which is found * in the module's specsheet from the vender. */ modules { cam_module0: module0 { badge = "fcb_cam_bottom"; position = "bottom"; orientation = "0"; cam_module0_drivernode0: drivernode0 { pcl_id = "v4l2_sensor"; sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@c250000/toto_a@10"; }; }; }; }; bus@0 { host1x@13e00000 { nvcsi@15a00000 { num-channels = <1>; #address-cells = <1>; #size-cells = <0>; csi_chan0: channel@0 { reg = <0>; ports { #address-cells = <1>; #size-cells = <0>; csi_chan0_port0: port@0 { reg = <0>; jetson_csi_in0: endpoint@0 { port-index = <0>; bus-width = <4>; remote-endpoint = <&jetson_cam_out0>; }; }; csi_chan0_port1: port@1 { reg = <1>; jetson_csi_out0: endpoint@1 { remote-endpoint = <&jetson_vi_in0>; }; }; }; }; }; }; i2c@c250000 { status = "okay"; #address-cells = <1>; #size-cells = <0>; mcp23008_27: gpio@27 { compatible = "microchip,mcp23008"; gpio-controller; #gpio-cells = <2>; reg = <0x27>; status = "okay"; interrupt-parent = <&gpio_aon>; // gpiochip1: registered GPIOs 316 to 347 on tegra234-gpio-aon // interrupts = ; // GPIO6/GPIO06/PCC.03/331 irq-gpios = <&gpio_aon TEGRA234_AON_GPIO(CC, 3) GPIO_ACTIVE_HIGH>; // GPIO6/GPIO06/PCC.03/331 reset-gpios = <&gpio TEGRA234_MAIN_GPIO(P, 6) GPIO_ACTIVE_LOW>; // GPIO2/GPIO02/PP.06/446 interrupt-controller; #interrupt-cells=<2>; microchip,irq-mirror; microchip,irq-active-high; mcp23008_27_output_low { status = "disabled"; }; mcp23008_27_output_high { gpio-hog; output-high; gpios = <1 0 2 0 3 0>; }; }; toto_a@10 { status = "okay"; compatible = "nvidia,toto"; /* I2C device address */ reg = <0x10>; /* V4L2 device node location */ devnode = "video0"; /* Physical dimensions of sensor */ physical_w = "1.944"; physical_h = "1.097"; sensor_model = "toto"; use_sensor_mode_id = "false"; /* 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 */ avdd-reg = "vana"; iovdd-reg = "vif"; dvdd-reg = "vdig"; //vana-supply = <&p3509_avdd_cam_2v8>; //vif-supply = <&p3509_vdd_1v8_cvb>; //vana-supply = <&p3509_vdd_3v3_cvb>; //vdig-supply = <&p3509_vdd_sys_en>; clocks = <&bpmp TEGRA234_CLK_EXTPERIPH1>, <&bpmp TEGRA234_CLK_EXTPERIPH1>; clock-names = "extperiph1", "pllp_grtba"; mclk = "extperiph1"; clock-frequency = <24000000>; reset-gpios = <&mcp23008_27 3 GPIO_ACTIVE_LOW>; mode0 { //1920x1080_60Fps mclk_khz = "24000"; set_mode_delay_ms = "5000"; num_lanes = "4"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; active_w = "1920"; active_h = "1080"; mode_type = "yuv"; pixel_phase = "uyvy"; pixel_t = "yuv_uyvy16"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "371250000"; gain_factor = "16"; framerate_factor = "1000000"; exposure_factor = "1000000"; min_gain_val = "16"; /* 1.00x */ max_gain_val = "170"; /* 10.66x */ step_gain_val = "1"; default_gain = "16"; /* 1.00x */ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "2000000"; /* 2.0 fps */ max_framerate = "60000000"; /* 60.0 fps */ step_framerate = "1"; default_framerate = "60000000"; /* 60.0 fps */ min_exp_time = "13"; /* us */ max_exp_time = "683709"; /* us */ step_exp_time = "1"; default_exp_time = "16667"; /* us */ embedded_metadata_height = "0"; }; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; jetson_cam_out0: endpoint { status = "okay"; port-index = <0>; bus-width = <4>; remote-endpoint = <&jetson_csi_in0>; }; }; }; }; }; }; }; }; };