From 18001ea0456b7dcde182f8a6ef0f08fba0d4d3e9 Mon Sep 17 00:00:00 2001 From: "ariel@h-squad-pc" Date: Tue, 7 May 2024 11:21:24 +0300 Subject: [PATCH 1/2] fix: root issues and subprocess erro fixed: execution of commands that previously required root access - also fixes output so no root is required to move files fixed: subprocess popen would fail because of output size --- avt_build/jetson_build/deploy.py | 6 +++--- avt_build/jetson_build/prepare.py | 2 +- avt_build/jetson_build/tools.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/avt_build/jetson_build/deploy.py b/avt_build/jetson_build/deploy.py index eb6ed8ed52..5e99ea519f 100644 --- a/avt_build/jetson_build/deploy.py +++ b/avt_build/jetson_build/deploy.py @@ -277,7 +277,7 @@ def install_modules(args, board): t = tools.tools(args) env = { **os.environ, 'ARCH': 'arm64', 'CROSS_COMPILE': common.common_dir(args) / 'gcc/bin/aarch64-linux-gnu-', 'LANG': 'C' } kernel_build_dir=common.common_dir(args) / "kernel" - t.execute(['sudo', 'make', f'O={kernel_build_dir}', f'INSTALL_MOD_PATH={board.build_dir / "Linux_for_Tegra/kernel/avt/kernel/debian/out"}', 'modules_install'], cwd=build.kernel_source_dir(args), env=env) + t.execute(['make', f'O={kernel_build_dir}', f'INSTALL_MOD_PATH={board.build_dir / "Linux_for_Tegra/kernel/avt/kernel/debian/out"}', 'modules_install'], cwd=build.kernel_source_dir(args), env=env) def get_dtb_names(args, board): @@ -287,7 +287,7 @@ def get_dtb_names(args, board): def copy_device_trees(args, board, subdir): logging.info(f"Copying device tree blobs"); t = tools.tools(args) - t.execute(["sudo", "cp"] + get_dtb_names(args, board) + [board.build_dir / subdir]) + t.execute(["cp"] + get_dtb_names(args, board) + [board.build_dir / subdir]) def sign_device_trees(args,board,subdir): t = tools.tools(args) @@ -298,7 +298,7 @@ def sign_device_trees(args,board,subdir): def copy_kernel_image(args, board): t = tools.tools(args) logging.info(f"Copying kernel image"); - t.execute(["sudo", "cp", common.common_dir(args) / "kernel/arch/arm64/boot/Image", board.build_dir / "Linux_for_Tegra/kernel"]) + t.execute(["cp", common.common_dir(args) / "kernel/arch/arm64/boot/Image", board.build_dir / "Linux_for_Tegra/kernel"]) def copy_files_to_l4t(args, board): diff --git a/avt_build/jetson_build/prepare.py b/avt_build/jetson_build/prepare.py index 5afa8a533d..526c42869f 100644 --- a/avt_build/jetson_build/prepare.py +++ b/avt_build/jetson_build/prepare.py @@ -13,7 +13,7 @@ def prepare(args, board): t = tools.tools(args) logging.info(f"Preparing {board.name} in {board.build_dir}") logging.info("Extracting driver package") - t.extract(board.files.driver_package, board.build_dir, sudo=True) + t.extract(board.files.driver_package, board.build_dir) #logging.info("Extracting rootfs") #t.extract(board.files.rootfs, board.build_dir / 'Linux_for_Tegra/rootfs', sudo=True) logging.warning("Extracting public_sources DISABLED") diff --git a/avt_build/jetson_build/tools.py b/avt_build/jetson_build/tools.py index 41fa3ebffd..824d50357d 100644 --- a/avt_build/jetson_build/tools.py +++ b/avt_build/jetson_build/tools.py @@ -50,7 +50,7 @@ def execute(args, **kwargs): outfile = kwargs.get('outfile', subprocess.PIPE) - sub = subprocess.Popen(args, bufsize=1, stdout=outfile, stderr=subprocess.PIPE, cwd=kwargs.get('cwd', None), env=kwargs.get('env', None)) + sub = subprocess.Popen(args, stdout=outfile, stderr=subprocess.PIPE, cwd=kwargs.get('cwd', None), env=kwargs.get('env', None)) logging.verbose(f"Executing `{' '.join(str(x) for x in args)}`") From fa2af87aa45e283a69f9b05a6757e57837169ab8 Mon Sep 17 00:00:00 2001 From: "ariel@h-squad-pc" Date: Tue, 7 May 2024 13:30:11 +0300 Subject: [PATCH 2/2] 2cams via mux --- ...p2822-0000-camera-avt-csi2-14375-2cam.dtsi | 821 ++++++++++++------ 1 file changed, 564 insertions(+), 257 deletions(-) diff --git a/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-camera-avt-csi2-14375-2cam.dtsi b/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-camera-avt-csi2-14375-2cam.dtsi index ad07d66d34..bf0babfa5d 100644 --- a/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-camera-avt-csi2-14375-2cam.dtsi +++ b/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-camera-avt-csi2-14375-2cam.dtsi @@ -1,346 +1,567 @@ -/* - * Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . +/** + * 4-cam device tree for AlliedVision sensors + * Supports following series: + * - 1800C -507c + * - 1500C -500c */ -#include "dt-bindings/clock/tegra194-clock.h" -#define CAM0_RST_L TEGRA194_MAIN_GPIO(H, 3) -#define CAM0_PWDN TEGRA194_MAIN_GPIO(H, 6) -#define CAM1_RST_L TEGRA194_MAIN_GPIO(T, 6) -#define CAM1_PWDN TEGRA194_MAIN_GPIO(T, 5) -#define CAMERA_I2C_MUX_BUS(x) (0x1E + x) + / { + /** + * i2c-mux @72 + * CAM A --> 4 lanes (VI port-index = 0) + * CAM C --> 4 lanes (VI port-index = 2) + * + * i2c-mux @70 + * CAM E --> 4 lanes (VI port-index = 4) + * CAM F --> 4 lanes (VI port-index = 5) + */ -/ { - gpio@2200000 { - camera-control-output-low { - gpio-hog; - output-low; - gpios = ; - label = "cam0-rst", "cam0-pwdn", - "cam1-rst", "cam1-pwdn"; - }; - }; - - -tegra-capture-vi { - status = "okay"; - num-channels = <2>; + tegra-capture-vi { + num-channels = <4>; + status="okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { - status ="okay"; reg = <0>; - avt_csi2_vi_in0: endpoint { - status = "okay"; + status="okay"; + avt_csi2_vi_in0: endpoint { + status="okay"; port-index = <0>; bus-width = <4>; remote-endpoint = <&avt_csi2_csi_out0>; }; }; + port@1 { - status ="okay"; reg = <1>; - avt_csi2_vi_in1: endpoint { - status = "okay"; + status="okay"; + avt_csi2_vi_in2: endpoint { + status="okay"; port-index = <2>; bus-width = <4>; - remote-endpoint = <&avt_csi2_csi_out1>; + remote-endpoint = <&avt_csi2_csi_out2>; + }; + }; + + port@2 { + reg = <2>; + status="okay"; + avt_csi2_vi_in4: endpoint { + status="okay"; + port-index = <4>; + bus-width = <4>; + remote-endpoint = <&avt_csi2_csi_out4>; + }; + }; + + port@3 { + reg = <3>; + status="okay"; + avt_csi2_vi_in5: endpoint { + status="okay"; + port-index = <5>; + bus-width = <4>; + remote-endpoint = <&avt_csi2_csi_out5>; }; }; + }; }; + host1x@13e00000 { nvcsi@15a00000 { - status = "okay"; - num-channels = <2>; + num-channels = <4>; #address-cells = <1>; #size-cells = <0>; + status="okay"; + channel@0 { - status = "okay"; + status="okay"; reg = <0>; ports { - #address-cells = <1>; + status="okay"; + #address-cells = <1>; #size-cells = <0>; port@0 { - status = "okay"; reg = <0>; + status="okay"; avt_csi2_csi_in0: endpoint@0 { - status = "okay"; + status="okay"; port-index = <0>; bus-width = <4>; - remote-endpoint = <&avt_csi2_out0>; + remote-endpoint = <&avt_csi2_cam_out0>; }; }; port@1 { - status = "okay"; + status="okay"; reg = <1>; avt_csi2_csi_out0: endpoint@1 { - status = "okay"; + status="okay"; remote-endpoint = <&avt_csi2_vi_in0>; }; }; }; }; - + channel@1 { - status = "okay"; + status="okay"; reg = <1>; ports { - #address-cells = <1>; + status="okay"; + #address-cells = <1>; #size-cells = <0>; port@0 { - status = "okay"; reg = <0>; - avt_csi2_csi_in1: endpoint@0 { - status = "okay"; + status="okay"; + avt_csi2_csi_in2: endpoint@2 { + status="okay"; port-index = <2>; bus-width = <4>; - remote-endpoint = <&avt_csi2_out1>; + remote-endpoint = <&avt_csi2_cam_out2>; + }; + }; + port@1 { + status="okay"; + reg = <1>; + avt_csi2_csi_out2: endpoint@3 { + status="okay"; + remote-endpoint = <&avt_csi2_vi_in2>; + }; + }; + }; + }; + + channel@2 { + status="okay"; + reg = <2>; + ports { + status="okay"; + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + status="okay"; + avt_csi2_csi_in4: endpoint@4 { + status="okay"; + port-index = <4>; + bus-width = <4>; + remote-endpoint = <&avt_csi2_cam_out4>; + }; + }; + port@1 { + status="okay"; + reg = <1>; + avt_csi2_csi_out4: endpoint@5 { + status="okay"; + remote-endpoint = <&avt_csi2_vi_in4>; + }; + }; + }; + }; + + channel@3 { + status="okay"; + reg = <3>; + ports { + status="okay"; + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + status="okay"; + avt_csi2_csi_in5: endpoint@6 { + status="okay"; + port-index = <6>; + bus-width = <4>; + remote-endpoint = <&avt_csi2_cam_out5>; }; }; port@1 { - status = "okay"; + status="okay"; reg = <1>; - avt_csi2_csi_out1: endpoint@1 { - status = "okay"; - remote-endpoint = <&avt_csi2_vi_in1>; + avt_csi2_csi_out5: endpoint@7 { + status="okay"; + remote-endpoint = <&avt_csi2_vi_in5>; }; }; }; }; + }; }; - tegra-camera-platform { - compatible = "nvidia, tegra-camera-platform"; + /**I2C2*/ + i2c@c240000 { + pinctrl-names = "default"; + pinctrl-0 = <&gen8_i2c_pinctrl>; + status = "okay"; - /** - * 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 = <8>; - max_lane_speed = <1500000>; - min_bits_per_pixel = <8>; - vi_peak_byte_per_pixel = <2>; - vi_bw_margin_pct = <25>; - max_pixel_rate = <160000>; - isp_peak_byte_per_pixel = <5>; - isp_bw_margin_pct = <25>; + + tca9544@72 { + compatible = "nxp,pca9544"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + skip_mux_detect = "yes"; - /** - * 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 { - status = "okay"; - module0 { - status = "okay"; - badge = "avt_csi2"; - position = "front"; - orientation = "1"; - drivernode0 { + vif-supply = <&p2822_vdd_1v8_cvb>; + vcc-supply = <&p2822_vdd_1v8_cvb>; + + vcc_lp = "vcc"; + force_bus_start = <0x1A>; + status = "okay"; + i2c@0 { + reg = <0>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + + avt_csi2_a@3c { status = "okay"; - /* Declare PCL support driver (classically known as guid) */ - pcl_id = "v4l2_sensor"; - /* Driver v4l2 device name */ - devname = "avt_csi2 2-003c"; - /* Declare the device-tree hierarchy to driver instance */ - proc-device-tree = "/proc/device-tree/i2c@3180000/avt_csi2@3c"; + + clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>, + <&bpmp_clks TEGRA194_CLK_PLLP_OUT0>; + clock-names = "extperiph1", "pllp_grtba"; + mclk = "extperiph1"; + + devnode = "video0"; + compatible = "alliedvision,avt_csi2"; + reg = <0x3c>; + + mode0 { + num_lanes = "4"; + tegra_sinterface = "serial_a"; + discontinuous_clk = "no"; + cil_settletime = "0"; + embedded_metadata_height = "0"; + + /* not verified: */ + mclk_khz = "24000"; + phy_mode = "DPHY"; + dpcm_enable = "false"; + + active_w = "5488"; + active_h = "4112"; + pixel_t = "bayer_bggr"; + readout_orientation = "0"; + line_length = "5488"; + inherent_gain = "1"; + mclk_multiplier = "31.25"; + pix_clk_hz = "750000000"; + csi_pixel_bit_depth = "4"; + gain_factor = "16"; + framerate_factor = "1000000"; + exposure_factor = "1000000"; + min_gain_val = "16"; /* 1.0 */ + max_gain_val = "256"; /* 16.0 */ + step_gain_val = "1"; /* 0.125 */ + min_hdr_ratio = "1"; + max_hdr_ratio = "64"; + min_framerate = "1500000"; /* 1.5 */ + max_framerate = "30000000"; /* 30 */ + step_framerate = "1"; + min_exp_time = "34"; /* us */ + max_exp_time = "550385"; /* us */ + step_exp_time = "1"; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + avt_csi2_cam_out0: endpoint { + port-index = <0>; + bus-width = <4>; + remote-endpoint = <&avt_csi2_csi_in0>; + }; + }; + }; }; - }; + }; - module1 { - status = "okay"; - badge = "avt_csi2"; - position = "back"; - orientation = "1"; - drivernode0 { + i2c@2 { + reg = <2>; + i2c-mux,deselect-on-exit; + #address-cells = <2>; + #size-cells = <0>; + + avt_csi2_c@3c { status = "okay"; - /* Declare PCL support driver (classically known as guid) */ - pcl_id = "v4l2_sensor"; - /* Driver v4l2 device name */ - devname = "avt_csi2 7-003c"; - /* Declare the device-tree hierarchy to driver instance */ - proc-device-tree = "/proc/device-tree/i2c@c250000/avt_csi2@3c"; - }; - }; - }; - }; - i2c@3180000 { - avt_csi2@3c { - status = "okay"; - clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>, - <&bpmp_clks TEGRA194_CLK_PLLP_OUT0>; - clock-names = "extperiph1", "pllp_grtba"; - mclk = "extperiph1"; + clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>, + <&bpmp_clks TEGRA194_CLK_PLLP_OUT0>; + clock-names = "extperiph1", "pllp_grtba"; + mclk = "extperiph1"; + + devnode = "video2"; + compatible = "alliedvision,avt_csi2"; + reg = <0x3c>; - devnode = "video0"; - compatible = "alliedvision,avt_csi2"; - reg = <0x3c>; + mode0 { + num_lanes = "4"; + tegra_sinterface = "serial_c"; + discontinuous_clk = "no"; + cil_settletime = "0"; + embedded_metadata_height = "0"; - ports { - #address-cells = <1>; - #size-cells = <0>; + /* not verified: */ + mclk_khz = "24000"; + phy_mode = "DPHY"; + dpcm_enable = "false"; - port@0 { - reg = <0>; - avt_csi2_out0: endpoint { - port-index = <0>; - bus-width = <4>; - remote-endpoint = <&avt_csi2_csi_in0>; + active_w = "5488"; + active_h = "4112"; + pixel_t = "bayer_bggr"; + readout_orientation = "0"; + line_length = "5488"; + inherent_gain = "1"; + mclk_multiplier = "31.25"; + pix_clk_hz = "750000000"; + csi_pixel_bit_depth = "4"; + gain_factor = "16"; + framerate_factor = "1000000"; + exposure_factor = "1000000"; + min_gain_val = "16"; /* 1.0 */ + max_gain_val = "256"; /* 16.0 */ + step_gain_val = "1"; /* 0.125 */ + min_hdr_ratio = "1"; + max_hdr_ratio = "64"; + min_framerate = "1500000"; /* 1.5 */ + max_framerate = "30000000"; /* 30 */ + step_framerate = "1"; + min_exp_time = "34"; /* us */ + max_exp_time = "550385"; /* us */ + step_exp_time = "1"; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + avt_csi2_cam_out2: endpoint { + port-index = <2>; + bus-width = <4>; + remote-endpoint = <&avt_csi2_csi_in2>; + }; + }; }; }; - }; + }; + }; + + tca9544@70 { + compatible = "nxp,pca9544"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + skip_mux_detect = "yes"; + /* + vif-supply = <&p2822_vdd_3v3_cvb>; + vcc-supply = <&p2822_vdd_3v3_cvb>; + */ + vif-supply = <&p2822_vdd_1v8_cvb>; + vcc-supply = <&p2822_vdd_1v8_cvb>; - mode0 { - num_lanes = "4"; - tegra_sinterface = "serial_a"; - discontinuous_clk = "no"; - cil_settletime = "0"; - embedded_metadata_height = "0"; - - /* not verified: */ - mclk_khz = "24000"; - phy_mode = "DPHY"; - dpcm_enable = "false"; - - active_w = "5488"; - active_h = "4112"; - pixel_t = "bayer_bggr"; - readout_orientation = "0"; - line_length = "5488"; - inherent_gain = "1"; - mclk_multiplier = "31.25"; - pix_clk_hz = "750000000"; - csi_pixel_bit_depth = "4"; - gain_factor = "16"; - framerate_factor = "1000000"; - exposure_factor = "1000000"; - min_gain_val = "16"; /* 1.0 */ - max_gain_val = "256"; /* 16.0 */ - step_gain_val = "1"; /* 0.125 */ - min_hdr_ratio = "1"; - max_hdr_ratio = "64"; - min_framerate = "1500000"; /* 1.5 */ - max_framerate = "30000000"; /* 30 */ - step_framerate = "1"; - min_exp_time = "34"; /* us */ - max_exp_time = "550385"; /* us */ - step_exp_time = "1"; - }; - }; - }; + vcc_lp = "vcc"; + force_bus_start = <0x1E>; + status = "okay"; - i2c@c250000 { + i2c@0 { + reg = <1>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + + avt_csi2_e@3c { + status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&gen8_i2c_pinctrl>; + clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>, + <&bpmp_clks TEGRA194_CLK_PLLP_OUT0>; + clock-names = "extperiph1", "pllp_grtba"; + mclk = "extperiph1"; + + devnode = "video4"; + compatible = "alliedvision,avt_csi2"; + reg = <0x3c>; - avt_csi2@3c { - status = "okay"; - clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>, - <&bpmp_clks TEGRA194_CLK_PLLP_OUT0>; - clock-names = "extperiph1", "pllp_grtba"; - mclk = "extperiph1"; + mode0 { + num_lanes = "4"; + tegra_sinterface = "serial_e"; + discontinuous_clk = "no"; + cil_settletime = "0"; + embedded_metadata_height = "0"; - devnode = "video1"; - compatible = "alliedvision,avt_csi2"; - reg = <0x3c>; + /* not verified: */ + mclk_khz = "24000"; + phy_mode = "DPHY"; + dpcm_enable = "false"; - ports { - #address-cells = <1>; - #size-cells = <0>; + active_w = "5488"; + active_h = "4112"; + pixel_t = "bayer_bggr"; + readout_orientation = "0"; + line_length = "5488"; + inherent_gain = "1"; + mclk_multiplier = "31.25"; + pix_clk_hz = "750000000"; + csi_pixel_bit_depth = "4"; + gain_factor = "16"; + framerate_factor = "1000000"; + exposure_factor = "1000000"; + min_gain_val = "16"; /* 1.0 */ + max_gain_val = "256"; /* 16.0 */ + step_gain_val = "1"; /* 0.125 */ + min_hdr_ratio = "1"; + max_hdr_ratio = "64"; + min_framerate = "1500000"; /* 1.5 */ + max_framerate = "30000000"; /* 30 */ + step_framerate = "1"; + min_exp_time = "34"; /* us */ + max_exp_time = "550385"; /* us */ + step_exp_time = "1"; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; - port@0 { - reg = <0>; - avt_csi2_out1: endpoint { - port-index = <0>; - bus-width = <4>; - remote-endpoint = <&avt_csi2_csi_in1>; + port@0 { + reg = <0>; + avt_csi2_cam_out4: endpoint { + port-index = <4>; + bus-width = <4>; + remote-endpoint = <&avt_csi2_csi_in4>; + }; + }; }; }; - }; + }; - mode0 { - num_lanes = "4"; - tegra_sinterface = "serial_c"; - discontinuous_clk = "no"; - cil_settletime = "0"; - embedded_metadata_height = "0"; - - /* not verified: */ - mclk_khz = "24000"; - phy_mode = "DPHY"; - dpcm_enable = "false"; - - active_w = "5488"; - active_h = "4112"; - pixel_t = "bayer_bggr"; - readout_orientation = "0"; - line_length = "5488"; - inherent_gain = "1"; - mclk_multiplier = "31.25"; - pix_clk_hz = "750000000"; - csi_pixel_bit_depth = "4"; - gain_factor = "16"; - framerate_factor = "1000000"; - exposure_factor = "1000000"; - min_gain_val = "16"; /* 1.0 */ - max_gain_val = "256"; /* 16.0 */ - step_gain_val = "1"; /* 0.125 */ - min_hdr_ratio = "1"; - max_hdr_ratio = "64"; - min_framerate = "1500000"; /* 1.5 */ - max_framerate = "30000000"; /* 30 */ - step_framerate = "1"; - min_exp_time = "34"; /* us */ - max_exp_time = "550385"; /* us */ - step_exp_time = "1"; - }; - }; + i2c@1 { + reg = <2>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + + avt_csi2_f@3c { + status = "okay"; + + clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>, + <&bpmp_clks TEGRA194_CLK_PLLP_OUT0>; + clock-names = "extperiph1", "pllp_grtba"; + mclk = "extperiph1"; + + devnode = "video5"; + compatible = "alliedvision,avt_csi2"; + reg = <0x3c>; + + mode0 { + num_lanes = "4"; + tegra_sinterface = "serial_g"; + discontinuous_clk = "no"; + cil_settletime = "0"; + embedded_metadata_height = "0"; + + /* not verified: */ + mclk_khz = "24000"; + phy_mode = "DPHY"; + dpcm_enable = "false"; + + active_w = "5488"; + active_h = "4112"; + pixel_t = "bayer_bggr"; + readout_orientation = "0"; + line_length = "5488"; + inherent_gain = "1"; + mclk_multiplier = "31.25"; + pix_clk_hz = "750000000"; + csi_pixel_bit_depth = "4"; + gain_factor = "16"; + framerate_factor = "1000000"; + exposure_factor = "1000000"; + min_gain_val = "16"; /* 1.0 */ + max_gain_val = "256"; /* 16.0 */ + step_gain_val = "1"; /* 0.125 */ + min_hdr_ratio = "1"; + max_hdr_ratio = "64"; + min_framerate = "1500000"; /* 1.5 */ + max_framerate = "30000000"; /* 30 */ + step_framerate = "1"; + min_exp_time = "34"; /* us */ + max_exp_time = "550385"; /* us */ + step_exp_time = "1"; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + avt_csi2_cam_out5: endpoint { + port-index = <6>; + bus-width = <4>; + remote-endpoint = <&avt_csi2_csi_in5>; + }; + }; + }; + }; + }; + }; }; + + /**I2C3*/ + i2c@3180000 { + clock-frequency = <100000>; + tca9539_74: tca9539@74 { + compatible = "ti,tca9539"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x74>; + vcc-supply = <&p2822_vdd_1v8_cvb>; + status = "okay"; + tca9539_74_outlow { + /* + * GPIO-A : + * GPIO-B : + * GPIO-C : + * GPIO-D : + * GPIO-E : + * GPIO-F : + * GPIO-G : Derived from dip switch + * GPIO-H : Not used + */ + gpio-hog; + gpios = <0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0>; + output-high; + label = "tca9539_74_outlow_0", + "tca9539_74_outlow_1", + "tca9539_74_outlow_2", + "tca9539_74_outlow_3", + "tca9539_74_outlow_4", + "tca9539_74_outlow_5", + "tca9539_74_outlow_6", + "tca9539_74_outlow_7", + "tca9539_74_outlow_8", + "tca9539_74_outlow_9", + "tca9539_74_outlow_10", + "tca9539_74_outlow_11", + "tca9539_74_outlow_12", + "tca9539_74_outlow_13"; + }; + tca9539_74_outhigh { + status= "disabled"; + }; + tca9539_74_input { + status = "disabled"; + }; + }; + }; pinmux@2430000 { gen8_i2c_pinctrl: gen8_i2c_pinctrl { @@ -365,3 +586,89 @@ tegra-capture-vi { }; }; }; + + + +/ { + tegra-camera-platform { + compatible = "nvidia, tegra-camera-platform"; + num_csi_lanes = <18>; + max_lane_speed = <1500000>; + min_bits_per_pixel = <8>; + vi_peak_byte_per_pixel = <2>; + vi_bw_margin_pct = <25>; + max_pixel_rate = <160000>; + 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 { + status = "okay"; + badge = "avt_csi2_0"; + position = "top"; + orientation = "1"; + drivernode0 { + pcl_id = "v4l2_sensor"; + devname = "avt_csi2 0 26-003c"; + proc-device-tree = "/proc/device-tree/i2c@c240000/tca9544@72/i2c@0/avt_csi2_a@3c"; + }; + drivernode1 { + pcl_id = "v4l2_lens"; + }; + }; + + module1 { + status = "okay"; + badge = "avt_csi2_2"; + position = "bottom"; + orientation = "1"; + drivernode0 { + pcl_id = "v4l2_sensor"; + devname = "avt_csi2 2 28-003c"; + proc-device-tree = "/proc/device-tree/i2c@c240000/tca9544@72/i2c@2/avt_csi2_c@3c"; + }; + drivernode1 { + pcl_id = "v4l2_lens"; + }; + }; + + module2 { + status = "okay"; + badge = "avt_csi2_4"; + position = "center-right"; + orientation = "1"; + drivernode0 { + pcl_id = "v4l2_sensor"; + devname = "avt_csi2 4 30-003c"; + proc-device-tree = "/proc/device-tree/i2c@c240000/tca9544@70/i2c@0/avt_csi2_e@3c"; + }; + drivernode1 { + pcl_id = "v4l2_lens"; + }; + }; + + module3 { + status = "okay"; + badge = "avt_csi2_5"; + position = "topright"; + orientation = "1"; + drivernode0 { + pcl_id = "v4l2_sensor"; + devname = "avt_csi2 5 31-003c"; + proc-device-tree = "/proc/device-tree/i2c@c240000/tca9544@70/i2c@1/avt_csi2_f@3c"; + }; + drivernode1 { + pcl_id = "v4l2_lens"; + }; + }; + }; + }; +}; \ No newline at end of file