#include "dt-bindings/clock/tegra186-clock.h" #include #include #define CAM0_IMX219_RST_L TEGRA_MAIN_GPIO(R, 0) / { /* set camera gpio direction to output */ gpio@2200000 { camera-control-output-low { status = "okay"; gpio-hog; output-low; gpios = < CAM0_IMX219_RST_L 0>; label = "cam0-rst"; }; }; }; / { host1x { //Define our video inputs (csi-port = camera location, bus-width = camera lanes needed) vi@15700000 { num-channels = <1>; ports { #address-cells = <1>; #size-cells = <0>; vi_port0: port@0 { status = "okay"; reg = <0>; vi_in0: endpoint { status = "okay"; port-index = <0>; bus-width = <4>; remote-endpoint = <&imx219_csi_out0>; }; }; }; }; }; }; / { host1x { nvcsi@150c0000 { status = "okay"; num-channels = <1>; #address-cells = <1>; #size-cells = <0>; channel@0 { reg = <0>; status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { status = "okay"; reg = <0>; imx219_csi_in0: endpoint@0 { status = "okay"; port-index = <0>; bus-width = <4>; remote-endpoint = <&imx219_phy_out0>; }; }; port@1 { status = "okay"; reg = <1>; imx219_csi_out0: endpoint@1 { status = "okay"; remote-endpoint = <&vi_in0>; }; }; }; }; }; }; }; / { // host1x { //Make seperate module i2c@c250000 { #address-cells = <1>; #size-cells = <0>; imx219_a@10 { //ADDED clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>; clock-names = "extperiph1"; mclk = "extperiph1"; reset-gpios = <&tegra_main_gpio CAM0_IMX219_RST_L GPIO_ACTIVE_LOW>; devnode = "video0"; compatible = "nvidia,imx219"; reg = <0x10>; use_sensor_mode_id = "true"; physical_w = "5.095"; physical_h = "4.930"; sensor_model ="imx219"; mode0 { // IMX219_MODE_1920X1080 mclk_khz = "24000"; //pix_clk_hz = "182400000"; pix_clk_hz = "302000000"; num_lanes = "4"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; cil_settletime = "0"; dynamic_pixel_bit_depth = "10"; csi_pixel_bit_depth = "10"; mode_type = "bayer"; pixel_phase = "rggb"; readout_orientation = "90"; inherent_gain = "1"; active_w = "1920"; active_h = "1080"; line_length = "2200"; dpcm_enable = "false"; framerate_factor = "1000000"; exposure_factor = "1000000"; gain_factor = "16"; step_framerate = "1"; step_exp_time = "1"; step_gain_val = "1"; default_framerate = "21000000"; default_exp_time = "2495";/* us */ min_gain_val = "16"; max_gain_val = "170"; default_gain = "16"; min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "2000000"; max_framerate = "21000000"; //min_exp_time = "33"; min_exp_time = "13"; max_exp_time = "683709"; embedded_metadata_height = "2"; }; mode1 { // IMX219_MODE_1280X720 mclk_khz = "24000"; //pix_clk_hz = "74250000"; //pix_clk_hz = "182400000"; //pix_clk_hz = "170000000"; pix_clk_hz = "302000000"; num_lanes = "4"; tegra_sinterface = "serial_a"; discontinuous_clk = "yes"; cil_settletime = "0"; //pixel_t = "bayer_rggb"; dynamic_pixel_bit_depth = "10"; csi_pixel_bit_depth = "10"; mode_type = "bayer"; pixel_phase = "rggb"; readout_orientation = "90"; inherent_gain = "1"; active_w = "1280"; active_h = "720"; line_length = "2200"; dpcm_enable = "false"; framerate_factor = "1000000"; exposure_factor = "1000000"; gain_factor = "16"; step_framerate = "1"; step_exp_time = "1"; default_framerate = "28000000"; default_exp_time = "2495";/* us */ min_gain_val = "16"; max_gain_val = "170"; step_gain_val = "1"; default_gain = "16"; min_hdr_ratio = "1"; max_hdr_ratio = "64"; min_framerate = "2000000"; max_framerate = "28000000"; min_exp_time = "11"; max_exp_time = "683710"; embedded_metadata_height = "2"; }; mode2 { // IMX219_MODE_640X480 mclk_khz = "24000"; //pix_clk_hz = "74250000"; //pix_clk_hz = "182400000"; //pix_clk_hz = "170000000"; pix_clk_hz = "302000000"; num_lanes = "4"; tegra_sinterface = "serial_a"; discontinuous_clk = "yes"; cil_settletime = "0"; //pixel_t = "bayer_rggb"; dynamic_pixel_bit_depth = "10"; csi_pixel_bit_depth = "10"; mode_type = "bayer"; pixel_phase = "rggb"; readout_orientation = "90"; inherent_gain = "1"; active_w = "640"; active_h = "480"; line_length = "2200"; dpcm_enable = "false"; framerate_factor = "1000000"; exposure_factor = "1000000"; gain_factor = "16"; step_framerate = "1"; step_exp_time = "1"; default_framerate = "30000000"; default_exp_time = "2495";/* us */ min_gain_val = "16"; max_gain_val = "170"; step_gain_val = "1"; default_gain = "16"; min_hdr_ratio = "1"; max_hdr_ratio = "64"; min_framerate = "2000000"; max_framerate = "30000000"; min_exp_time = "11"; max_exp_time = "358731"; embedded_metadata_height = "2"; }; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0x0>; imx219_phy_out0: endpoint { port-index = <0>; bus-width = <2>; remote-endpoint = <&imx219_csi_in0>; }; }; }; }; }; // }; }; /* camera control gpio definitions */ / { tegra-camera-platform { compatible = "nvidia, tegra-camera-platform"; num_csi_lanes = <4>; max_lane_speed = <1500000>; max_pixel_rate = <240000>; min_bits_per_pixel = <10>; vi_peak_byte_per_pixel = <2>; vi_bw_margin_pct = <25>; isp_peak_byte_per_pixel = <5>; isp_bw_margin_pct = <25>; modules { module0 { status = "okay"; badge = "imx219_bottom_liimx219"; position = "bottom"; orientation = "0"; drivernode0 { status = "okay"; pcl_id = "v4l2_sensor"; devname = "imx219 7-0010"; proc-device-tree = "/proc/device-tree/i2c@c250000/imx219_a@10"; }; }; }; }; };