#include #include #include "dt-bindings/clock/tegra186-clock.h" /* camera control gpio definitions */ #define CAM0_RST_L TEGRA_MAIN_GPIO(R, 5) #define CAM0_PWDN TEGRA_MAIN_GPIO(R, 0) #define CAM1_RST_L TEGRA_MAIN_GPIO(R, 1) #define CAM1_PWDN TEGRA_MAIN_GPIO(N, 2) / { nvidia,dtsfilename = "tegra186-tx2i-cti-ASG006-IMX274-6CAM.dts"; gpio@2200000 { camera-control-output-low { gpio-hog; output-low; gpios = ; label = "cam0-rst", "cam0-pwdn", "cam1-rst", "cam1-pwdn"; }; }; /**********************SENSORS******************************************************************/ i2c@3180000 { //set this to correct i2c bus tca9546@70{ i2c@0{ //cam_i2c/Mux@70/I2C_A #address-cells = <1>; #size-cells = <0>; imx274_a@1a { compatible = "nvidia,imx274"; reg = <0x1a>; devnode = "video0"; /* Physical dimensions of sensor */ physical_w = "3.674"; physical_h = "2.738"; clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>, <&tegra_car TEGRA186_CLK_PLLP_OUT0>; clock-names = "extperiph1", "pllp_grtba"; mclk = "extperiph1"; sensor_model = "imx274"; delayed_gain = "true"; reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>; vana-supply = <&battery_reg>; vif-supply = <&battery_reg>; vdig-supply = <&battery_reg>; avdd-reg = "vana"; iovdd-reg = "vif"; dvdd-reg = "vdig"; mode0 { mclk_khz = "24000"; num_lanes = "2"; tegra_sinterface = "serial_a"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; phy_mode = "DPHY"; active_w = "3840"; active_h = "2160"; mode_type = "bayer"; pixel_phase = "rggb"; csi_pixel_bit_depth = "10"; readout_orientation = "90"; line_length = "4208"; inherent_gain = "1"; mclk_multiplier = "24"; pix_clk_hz = "576000000"; gain_factor = "1000000"; min_gain_val = "1000000"; max_gain_val = "44400000"; step_gain_val = "1"; default_gain = "1000000"; min_hdr_ratio = "1"; max_hdr_ratio = "1"; framerate_factor = "1000000"; min_framerate = "1500000"; max_framerate = "60000000"; step_framerate = "1"; default_framerate= "60000000"; exposure_factor = "1000000"; min_exp_time = "44"; max_exp_time = "478696"; step_exp_time = "1"; default_exp_time = "16667";/* us */ //embedded_metadata_height = "1"; }; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; imx274_out0: endpoint { port-index = <0>; bus-width = <2>; remote-endpoint = <&csi_in0>; }; }; }; }; pca9570_a@24 { compatible = "nvidia,pca9570"; reg = <0x24>; channel = "a"; drive_ic= "DRV8838"; }; }; i2c@1{ //cam_i2c/Mux@70/I2C_B #address-cells = <1>; #size-cells = <0>; imx274_b@1a { compatible = "nvidia,imx274"; reg = <0x1a>; devnode = "video1"; /* Physical dimensions of sensor */ physical_w = "3.674"; physical_h = "2.738"; clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>, <&tegra_car TEGRA186_CLK_PLLP_OUT0>; clock-names = "extperiph1", "pllp_grtba"; mclk = "extperiph1"; sensor_model = "imx274"; delayed_gain = "true"; reset-gpios = <&tegra_main_gpio CAM1_RST_L GPIO_ACTIVE_HIGH>; vana-supply = <&battery_reg>; vif-supply = <&battery_reg>; vdig-supply = <&battery_reg>; avdd-reg = "vana"; iovdd-reg = "vif"; dvdd-reg = "vdig"; mode0 { mclk_khz = "24000"; num_lanes = "2"; tegra_sinterface = "serial_b"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; phy_mode = "DPHY"; active_w = "3840"; active_h = "2160"; mode_type = "bayer"; pixel_phase = "rggb"; csi_pixel_bit_depth = "10"; readout_orientation = "90"; line_length = "4208"; inherent_gain = "1"; mclk_multiplier = "24"; pix_clk_hz = "576000000"; gain_factor = "1000000"; min_gain_val = "1000000"; max_gain_val = "44400000"; step_gain_val = "1"; default_gain = "1000000"; min_hdr_ratio = "1"; max_hdr_ratio = "1"; framerate_factor = "1000000"; min_framerate = "1500000"; max_framerate = "60000000"; step_framerate = "1"; default_framerate= "60000000"; exposure_factor = "1000000"; min_exp_time = "44"; max_exp_time = "478696"; step_exp_time = "1"; default_exp_time = "16667";/* us */ //embedded_metadata_height = "1"; }; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; imx274_out1: endpoint { port-index = <1>; bus-width = <2>; remote-endpoint = <&csi_in1>; }; }; }; }; pca9570_b@24 { compatible = "nvidia,pca9570"; reg = <0x24>; channel = "b"; drive_ic= "DRV8838"; }; }; i2c@2 { //cam_i2c/Mux@70/I2C_C #address-cells = <1>; #size-cells = <0>; imx274_c@1a { compatible = "nvidia,imx274"; reg = <0x1a>; devnode = "video2"; /* 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 */ clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH2>, <&tegra_car TEGRA186_CLK_PLLP_OUT0>; clock-names = "extperiph2", "pllp_grtba"; mclk = "extperiph2"; reset-gpios = <&gpio_i2c_0_74 1 GPIO_ACTIVE_HIGH>; vana-supply = <&battery_reg>; vif-supply = <&battery_reg>; vdig-supply = <&battery_reg>; avdd-reg = "vana"; iovdd-reg = "vif"; dvdd-reg = "vdig"; mode0 { mclk_khz = "24000"; num_lanes = "2"; tegra_sinterface = "serial_c"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; phy_mode = "DPHY"; active_w = "3840"; active_h = "2160"; mode_type = "bayer"; pixel_phase = "rggb"; csi_pixel_bit_depth = "10"; readout_orientation = "90"; line_length = "4208"; inherent_gain = "1"; mclk_multiplier = "24"; pix_clk_hz = "576000000"; gain_factor = "1000000"; min_gain_val = "1000000"; max_gain_val = "44400000"; step_gain_val = "1"; default_gain = "1000000"; min_hdr_ratio = "1"; max_hdr_ratio = "1"; framerate_factor = "1000000"; min_framerate = "1500000"; max_framerate = "60000000"; step_framerate = "1"; default_framerate= "60000000"; exposure_factor = "1000000"; min_exp_time = "44"; max_exp_time = "478696"; step_exp_time = "1"; default_exp_time = "16667";/* us */ //embedded_metadata_height = "1"; }; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; imx274_out2: endpoint { port-index = <2>; bus-width = <2>; remote-endpoint = <&csi_in2>; }; }; }; }; pca9570_c@24 { compatible = "nvidia,pca9570"; reg = <0x24>; channel = "c"; drive_ic= "DRV8838"; }; }; }; }; i2c@c240000 { tca9546@71{ i2c@0 { //gen_i2c_0/Mux@71/I2C_D #address-cells = <1>; #size-cells = <0>; imx274_d@1a { compatible = "nvidia,imx274"; reg = <0x1a>; devnode = "video3"; /* 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 */ clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH2>, <&tegra_car TEGRA186_CLK_PLLP_OUT0>; clock-names = "extperiph2", "pllp_grtba"; mclk = "extperiph2"; reset-gpios = <&gpio_i2c_0_74 3 GPIO_ACTIVE_HIGH>; vana-supply = <&battery_reg>; vif-supply = <&battery_reg>; vdig-supply = <&battery_reg>; /* Define any required hw resources needed by driver */ /* ie. clocks, io pins, power sources */ avdd-reg = "vana"; iovdd-reg = "vif"; dvdd-reg = "vdig"; mode0 { mclk_khz = "24000"; num_lanes = "2"; tegra_sinterface = "serial_d"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; phy_mode = "DPHY"; active_w = "3840"; active_h = "2160"; mode_type = "bayer"; pixel_phase = "rggb"; csi_pixel_bit_depth = "10"; readout_orientation = "90"; line_length = "4208"; inherent_gain = "1"; mclk_multiplier = "24"; pix_clk_hz = "576000000"; gain_factor = "1000000"; min_gain_val = "1000000"; max_gain_val = "44400000"; step_gain_val = "1"; default_gain = "1000000"; min_hdr_ratio = "1"; max_hdr_ratio = "1"; framerate_factor = "1000000"; min_framerate = "1500000"; max_framerate = "60000000"; step_framerate = "1"; default_framerate= "60000000"; exposure_factor = "1000000"; min_exp_time = "44"; max_exp_time = "478696"; step_exp_time = "1"; default_exp_time = "16667";/* us */ //embedded_metadata_height = "1"; }; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; imx274_out3: endpoint { port-index = <3>; bus-width = <2>; remote-endpoint = <&csi_in3>; }; }; }; }; pca9570_d@24 { compatible = "nvidia,pca9570"; reg = <0x24>; channel = "d"; drive_ic= "DRV8838"; }; }; i2c@1 { //gen_i2c_0/Mux@71/I2C_E #address-cells = <1>; #size-cells = <0>; imx274_e@1a { compatible = "nvidia,imx274"; reg = <0x1a>; devnode = "video4"; /* 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 */ clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>, <&tegra_car TEGRA186_CLK_PLLP_OUT0>; clock-names = "extperiph1", "pllp_grtba"; mclk = "extperiph1"; reset-gpios = <&gpio_i2c_0_74 5 GPIO_ACTIVE_HIGH>; vana-supply = <&battery_reg>; vif-supply = <&battery_reg>; vdig-supply = <&battery_reg>; /* Define any required hw resources needed by driver */ /* ie. clocks, io pins, power sources */ avdd-reg = "vana"; iovdd-reg = "vif"; dvdd-reg = "vdig"; mode0 { mclk_khz = "24000"; num_lanes = "2"; tegra_sinterface = "serial_e"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; phy_mode = "DPHY"; active_w = "3840"; active_h = "2160"; mode_type = "bayer"; pixel_phase = "rggb"; csi_pixel_bit_depth = "10"; readout_orientation = "90"; line_length = "4208"; inherent_gain = "1"; mclk_multiplier = "24"; pix_clk_hz = "576000000"; gain_factor = "1000000"; min_gain_val = "1000000"; max_gain_val = "44400000"; step_gain_val = "1"; default_gain = "1000000"; min_hdr_ratio = "1"; max_hdr_ratio = "1"; framerate_factor = "1000000"; min_framerate = "1500000"; max_framerate = "60000000"; step_framerate = "1"; default_framerate= "60000000"; exposure_factor = "1000000"; min_exp_time = "44"; max_exp_time = "478696"; step_exp_time = "1"; default_exp_time = "16667";/* us */ //embedded_metadata_height = "1"; }; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; imx274_out4: endpoint { port-index = <4>; bus-width = <2>; remote-endpoint = <&csi_in4>; }; }; }; }; pca9570_e@24 { compatible = "nvidia,pca9570"; reg = <0x24>; channel = "e"; drive_ic= "DRV8838"; }; }; i2c@2 { //gen_i2c_0/Mux@71/I2C_F #address-cells = <1>; #size-cells = <0>; imx274_f@1a { compatible = "nvidia,imx274"; reg = <0x1a>; devnode = "video5"; /* 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 */ clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH2>, <&tegra_car TEGRA186_CLK_PLLP_OUT0>; clock-names = "extperiph2", "pllp_grtba"; mclk = "extperiph2"; reset-gpios = <&gpio_i2c_0_74 7 GPIO_ACTIVE_HIGH>; vana-supply = <&battery_reg>; vif-supply = <&battery_reg>; vdig-supply = <&battery_reg>; /* Define any required hw resources needed by driver */ /* ie. clocks, io pins, power sources */ avdd-reg = "vana"; iovdd-reg = "vif"; dvdd-reg = "vdig"; mode0 { mclk_khz = "24000"; num_lanes = "2"; tegra_sinterface = "serial_f"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; phy_mode = "DPHY"; active_w = "3840"; active_h = "2160"; mode_type = "bayer"; pixel_phase = "rggb"; csi_pixel_bit_depth = "10"; readout_orientation = "90"; line_length = "4208"; inherent_gain = "1"; mclk_multiplier = "24"; pix_clk_hz = "576000000"; gain_factor = "1000000"; min_gain_val = "1000000"; max_gain_val = "44400000"; step_gain_val = "1"; default_gain = "1000000"; min_hdr_ratio = "1"; max_hdr_ratio = "1"; framerate_factor = "1000000"; min_framerate = "1500000"; max_framerate = "60000000"; step_framerate = "1"; default_framerate= "60000000"; exposure_factor = "1000000"; min_exp_time = "44"; max_exp_time = "478696"; step_exp_time = "1"; default_exp_time = "16667";/* us */ //embedded_metadata_height = "1"; }; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; imx274_out5: endpoint { port-index = <5>; bus-width = <2>; remote-endpoint = <&csi_in5>; }; }; }; }; pca9570_f@24 { compatible = "nvidia,pca9570"; reg = <0x24>; channel = "f"; drive_ic= "DRV8838"; }; }; }; }; /**********************VI******************************************************************/ host1x { vi@15700000 { num-channels = <6>; //set number of channels status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; status = "okay"; vi_in0: endpoint { status = "okay"; port-index = <0>; bus-width = <2>; remote-endpoint = <&csi_out0>; }; }; port@1 { reg = <1>; status = "okay"; vi_in1: endpoint { status = "okay"; port-index = <1>; bus-width = <2>; remote-endpoint = <&csi_out1>; }; }; port@2 { reg = <2>; status = "okay"; vi_in2: endpoint { status = "okay"; port-index = <2>; bus-width = <2>; remote-endpoint = <&csi_out2>; }; }; port@3 { reg = <3>; status = "okay"; vi_in3: endpoint { status = "okay"; port-index = <3>; bus-width = <2>; remote-endpoint = <&csi_out3>; }; }; port@4 { reg = <4>; status = "okay"; vi_in4: endpoint { status = "okay"; port-index = <4>; bus-width = <2>; remote-endpoint = <&csi_out4>; }; }; port@5 { reg = <5>; status = "okay"; vi_in5: endpoint { status = "okay"; port-index = <5>; bus-width = <2>; remote-endpoint = <&csi_out5>; }; }; }; }; /**********************CSI******************************************************************/ nvcsi@150c0000 { num-channels = <6>; channel@0 { status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; status = "okay"; csi_in0: endpoint@0 { port-index = <0>; bus-width = <2>; remote-endpoint = <&imx274_out0>; //should be sensor port under i2c endpoint status = "okay"; }; }; port@1 { reg = <1>; status = "okay"; csi_out0: endpoint@1 { status = "okay"; remote-endpoint = <&vi_in0>; }; }; }; }; channel@1 { status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; status = "okay"; csi_in1: endpoint@2 { port-index = <1>; bus-width = <2>; remote-endpoint = <&imx274_out1>; //should be sensor port under i2c endpoint status = "okay"; }; }; port@1 { reg = <1>; status = "okay"; csi_out1: endpoint@3 { status = "okay"; remote-endpoint = <&vi_in1>; }; }; }; }; channel@2 { status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; status = "okay"; csi_in2: endpoint@4 { port-index = <2>; bus-width = <2>; remote-endpoint = <&imx274_out2>; //should be sensor port under i2c endpoint status = "okay"; }; }; port@1 { reg = <1>; status = "okay"; csi_out2: endpoint@5 { status = "okay"; remote-endpoint = <&vi_in2>; }; }; }; }; channel@3 { status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; status = "okay"; csi_in3: endpoint@6 { port-index = <3>; bus-width = <2>; remote-endpoint = <&imx274_out3>; //should be sensor port under i2c endpoint status = "okay"; }; }; port@1 { reg = <1>; status = "okay"; csi_out3: endpoint@7 { status = "okay"; remote-endpoint = <&vi_in3>; }; }; }; }; channel@4 { status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; status = "okay"; csi_in4: endpoint@8 { port-index = <4>; bus-width = <2>; remote-endpoint = <&imx274_out4>; //should be sensor port under i2c endpoint status = "okay"; }; }; port@1 { reg = <1>; status = "okay"; csi_out4: endpoint@9 { status = "okay"; remote-endpoint = <&vi_in4>; }; }; }; }; channel@5 { status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; status = "okay"; csi_in5: endpoint@10 { port-index = <5>; bus-width = <2>; remote-endpoint = <&imx274_out5>; //should be sensor port under i2c endpoint status = "okay"; }; }; port@1 { reg = <1>; status = "okay"; csi_out5: endpoint@11 { status = "okay"; remote-endpoint = <&vi_in5>; }; }; }; }; }; }; lens_imx274@A6V26 { min_focus_distance = "0.0"; hyper_focal = "0.0"; focal_length = "5.00"; f_number = "2.0"; aperture = "2.2"; }; /**********************CAMERA PLATFORM*************************************************************/ 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 * Set this to the highest pix_clk_hz out of all available modes. * * 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 = <12>; max_lane_speed = <1500000>; min_bits_per_pixel = <10>; vi_peak_byte_per_pixel = <2>; vi_bw_margin_pct = <25>; max_pixel_rate = <750000>; 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 { module0 { badge = "imx274_topright_A6V26"; position = "topright"; orientation = "0"; status = "okay"; drivernode0 { status = "okay"; pcl_id = "v4l2_sensor"; devname = "imx274 30-001a"; proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@0/imx274_a@1a"; }; drivernode1 { status = "okay"; pcl_id = "v4l2_lens"; proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/"; }; }; module1 { badge = "imx274_bottomright_A6V26"; position = "bottomright"; orientation = "0"; status = "okay"; drivernode0 { status = "okay"; pcl_id = "v4l2_sensor"; devname = "imx274 31-001a"; proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@1/imx274_b@1a"; }; drivernode1 { status = "okay"; pcl_id = "v4l2_lens"; proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/"; }; }; module2 { badge = "imx274_centerleft_A6V26"; position = "centerleft"; orientation = "0"; status = "okay"; drivernode0 { status = "okay"; pcl_id = "v4l2_sensor"; devname = "imx274 32-001a"; proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@2/imx274_c@1a"; }; drivernode1 { status = "okay"; pcl_id = "v4l2_lens"; proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/"; }; }; module3 { badge = "imx274_centerright_A6V26"; position = "centerright"; orientation = "0"; status = "okay"; drivernode0 { status = "okay"; pcl_id = "v4l2_sensor"; devname = "imx274 34-001a"; proc-device-tree = "/proc/device-tree/i2c@c240000/tca9546@71/i2c@0/imx274_d@1a"; }; drivernode1 { status = "okay"; pcl_id = "v4l2_lens"; proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/"; }; }; module4 { badge = "imx274_topleft_A6V26"; position = "topleft"; orientation = "0"; status = "okay"; drivernode0 { status = "okay"; pcl_id = "v4l2_sensor"; devname = "imx274 35-001a"; proc-device-tree = "/proc/device-tree/i2c@c240000/tca9546@71/i2c@1/imx274_e@1a"; }; drivernode1 { status = "okay"; pcl_id = "v4l2_lens"; proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/"; }; }; module5 { badge = "imx274_bottomleft_A6V26"; position = "bottomleft"; orientation = "0"; status = "okay"; drivernode0 { status = "okay"; pcl_id = "v4l2_sensor"; devname = "imx274 36-001a"; proc-device-tree = "/proc/device-tree/i2c@c240000/tca9546@71/i2c@2/imx274_f@1a"; }; drivernode1 { status = "okay"; pcl_id = "v4l2_lens"; proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/"; }; }; }; }; };