From 1f88db9cc1451b2518b99a012ee480cdd7a061d0 Mon Sep 17 00:00:00 2001 From: Dmitry Perchanov Date: Fri, 2 Aug 2024 12:00:51 +0300 Subject: [PATCH 1/2] Jp6 - dual camera configuration Signed-off-by: Dmitry Perchanov --- apply_patches.sh | 2 +- build_all.sh | 2 +- ...rlay-enable-d4xx-camera-for-Orin-jp6.patch | 7 +- .../tegra234-camera-d4xx-overlay-dual.dts | 877 ++++++++++++++++++ 4 files changed, 883 insertions(+), 5 deletions(-) create mode 100644 hardware/realsense/tegra234-camera-d4xx-overlay-dual.dts diff --git a/apply_patches.sh b/apply_patches.sh index 74415bc..51c457f 100755 --- a/apply_patches.sh +++ b/apply_patches.sh @@ -66,7 +66,7 @@ if [ $1 = 'apply' ]; then cp $DEVDIR/kernel/realsense/d4xx.c $DEVDIR/sources_$JETPACK_VERSION/${D4XX_SRC_DST}/drivers/media/i2c/ if [[ "$JETPACK_VERSION" == "6.0" ]]; then # jp6 overlay - cp $DEVDIR/hardware/realsense/tegra234-camera-d4xx-overlay.dts $DEVDIR/sources_$JETPACK_VERSION/hardware/nvidia/t23x/nv-public/overlay/ + cp $DEVDIR/hardware/realsense/tegra234-camera-d4xx-overlay*.dts $DEVDIR/sources_$JETPACK_VERSION/hardware/nvidia/t23x/nv-public/overlay/ else cp $DEVDIR/hardware/realsense/$JP5_D4XX_DTSI $DEVDIR/sources_$JETPACK_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-camera-d4xx.dtsi fi diff --git a/build_all.sh b/build_all.sh index 82837da..5a85ded 100755 --- a/build_all.sh +++ b/build_all.sh @@ -73,7 +73,7 @@ if [[ "$JETPACK_VERSION" == "6.0" ]]; then make ARCH=arm64 dtbs mkdir -p $TEGRA_KERNEL_OUT/rootfs/boot/dtb cp $SRCS/nvidia-oot/device-tree/platform/generic-dts/dtbs/tegra234-p3737-0000+p3701-0000-nv.dtb $TEGRA_KERNEL_OUT/rootfs/boot/dtb/ - cp $SRCS/nvidia-oot/device-tree/platform/generic-dts/dtbs/tegra234-camera-d4xx-overlay.dtbo $TEGRA_KERNEL_OUT/rootfs/boot/ + cp $SRCS/nvidia-oot/device-tree/platform/generic-dts/dtbs/tegra234-camera-d4xx-overlay*.dtbo $TEGRA_KERNEL_OUT/rootfs/boot/ export INSTALL_MOD_PATH=$TEGRA_KERNEL_OUT/rootfs/ make ARCH=arm64 install -C kernel make ARCH=arm64 modules_install diff --git a/hardware/nvidia/t23x/nv-public/6.0/0001-overlay-enable-d4xx-camera-for-Orin-jp6.patch b/hardware/nvidia/t23x/nv-public/6.0/0001-overlay-enable-d4xx-camera-for-Orin-jp6.patch index 8177aef..69452b8 100644 --- a/hardware/nvidia/t23x/nv-public/6.0/0001-overlay-enable-d4xx-camera-for-Orin-jp6.patch +++ b/hardware/nvidia/t23x/nv-public/6.0/0001-overlay-enable-d4xx-camera-for-Orin-jp6.patch @@ -5,18 +5,19 @@ Subject: [PATCH] overlay: enable d4xx camera for Orin jp6 Signed-off-by: Dmitry Perchanov --- - overlay/Makefile | 1 + - 1 file changed, 1 insertion(+) + overlay/Makefile | 2 ++ + 1 file changed, 2 insertion(+) diff --git a/overlay/Makefile b/overlay/Makefile index c88bbe2..3f6354e 100644 --- a/overlay/Makefile +++ b/overlay/Makefile -@@ -60,6 +60,7 @@ dtbo-y += tegra234-p3767-camera-p3768-imx219-A.dtbo +@@ -60,6 +60,8 @@ dtbo-y += tegra234-p3767-camera-p3768-imx219-A.dtbo dtbo-y += tegra234-p3767-camera-p3768-imx219-imx477.dtbo dtbo-y += tegra234-p3767-camera-p3768-imx477-C.dtbo dtbo-y += tegra234-p3767-camera-p3768-imx477-A.dtbo +dtbo-y += tegra234-camera-d4xx-overlay.dtbo ++dtbo-y += tegra234-camera-d4xx-overlay-dual.dtbo ifneq ($(dtb-y),) dtb-y := $(addprefix $(makefile-path)/,$(dtb-y)) diff --git a/hardware/realsense/tegra234-camera-d4xx-overlay-dual.dts b/hardware/realsense/tegra234-camera-d4xx-overlay-dual.dts new file mode 100644 index 0000000..9a776d7 --- /dev/null +++ b/hardware/realsense/tegra234-camera-d4xx-overlay-dual.dts @@ -0,0 +1,877 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2018-2023, INTEL CORPORATION. All rights reserved. + +/dts-v1/; +/plugin/; + +#include +#include +#include + +#define CAM0_RST_L TEGRA234_MAIN_GPIO(H, 3) +#define CAMERA_I2C_MUX_BUS(x) (0x1E + x) + +/* camera control gpio definitions */ +/ { + overlay-name = "Jetson RealSense Camera D457 dual"; + jetson-header-name = "Jetson AGX CSI Connector"; + compatible = JETSON_COMPATIBLE; + + fragment@0 { + target-path = "/"; + __overlay__ { + tegra-capture-vi { + num-channels = <8>; + ports { + status = "okay"; + port@0 { + status = "okay"; + d4xx_vi_in0: endpoint { + status = "okay"; + vc-id = <0>; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_out0>; + }; + }; + port@1 { + status = "okay"; + d4xx_vi_in1: endpoint { + status = "okay"; + vc-id = <1>; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_out1>; + }; + }; + port@2 { + status = "okay"; + d4xx_vi_in2: endpoint { + status = "okay"; + vc-id = <2>; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_out2>; + }; + }; + port@3 { + status = "okay"; + d4xx_vi_in3: endpoint { + status = "okay"; + vc-id = <3>; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_out3>; + }; + }; + port@4 { + status = "okay"; + d4xx_vi_in4: endpoint { + status = "okay"; + vc-id = <2>; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_out4>; + }; + }; + port@5 { + status = "okay"; + d4xx_vi_in5: endpoint { + status = "okay"; + vc-id = <3>; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_out5>; + }; + }; + port@6 { + status = "okay"; + d4xx_vi_in6: endpoint { + status = "okay"; + vc-id = <0>; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_out6>; + }; + }; + port@7 { + status = "okay"; + d4xx_vi_in7: endpoint { + status = "okay"; + vc-id = <1>; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_out7>; + }; + }; + + }; + }; + tegra-camera-platform { + modules { + status = "okay"; + module0 { + status = "okay"; + badge = "d4xx_depth"; + position = "bottomleft"; + orientation = "1"; + drivernode0 { + status = "okay"; + /* Declare PCL support driver (classically known as guid) */ + pcl_id = "v4l2_sensor"; + /* Declare the device-tree hierarchy to driver instance */ + sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9548@72/i2c@0/d4m@1a"; + }; + }; + module1 { + status = "okay"; + badge = "d4xx_rgb"; + position = "bottomright"; + orientation = "1"; + drivernode0 { + status = "okay"; + /* Declare PCL support driver (classically known as guid) */ + pcl_id = "v4l2_sensor"; + /* Declare the device-tree hierarchy to driver instance */ + sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9548@72/i2c@1/d4m@1a"; + }; + }; + module2 { + status = "okay"; + badge = "d4xx_y8"; + position = "centerleft"; + orientation = "1"; + drivernode0 { + status = "okay"; + /* Declare PCL support driver (classically known as guid) */ + pcl_id = "v4l2_sensor"; + sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9548@72/i2c@2/d4m@1a"; + }; + }; + module3 { + status = "okay"; + badge = "d4xx_imu"; + position = "centerright"; + orientation = "1"; + drivernode0 { + status = "okay"; + /* Declare PCL support driver (classically known as guid) */ + pcl_id = "v4l2_sensor"; + /* Declare the device-tree hierarchy to driver instance */ + sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9548@72/i2c@3/d4m@1a"; + }; + }; + module4 { + status = "okay"; + badge = "d4xx_b_depth"; + position = "bottomleft"; + orientation = "1"; + drivernode0 { + status = "okay"; + /* Declare PCL support driver (classically known as guid) */ + pcl_id = "v4l2_sensor"; + /* Declare the device-tree hierarchy to driver instance */ + sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9548@72/i2c@4/d4m@1b"; + }; + }; + module5 { + status = "okay"; + badge = "d4xx_b_rgb"; + position = "bottomright"; + orientation = "1"; + drivernode0 { + status = "okay"; + /* Declare PCL support driver (classically known as guid) */ + pcl_id = "v4l2_sensor"; + /* Declare the device-tree hierarchy to driver instance */ + sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9548@72/i2c@5/d4m@1b"; + }; + }; + module6 { + status = "okay"; + badge = "d4xx_b_y8"; + position = "centerleft"; + orientation = "1"; + drivernode0 { + status = "okay"; + /* Declare PCL support driver (classically known as guid) */ + pcl_id = "v4l2_sensor"; + sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9548@72/i2c@6/d4m@1b"; + }; + }; + module7 { + status = "okay"; + badge = "d4xx_b_imu"; + position = "centerright"; + orientation = "1"; + drivernode0 { + status = "okay"; + /* Declare PCL support driver (classically known as guid) */ + pcl_id = "v4l2_sensor"; + /* Declare the device-tree hierarchy to driver instance */ + sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9548@72/i2c@7/d4m@1b"; + }; + }; + }; + }; + bus@0 { + host1x@13e00000 { + nvcsi@15a00000 { + num-channels = <8>; + channel@0 { + status = "okay"; + ports { + status = "okay"; + port@0 { + status = "okay"; + d4xx_csi_in0: endpoint@0 { + status = "okay"; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4m0_out>; + }; + }; + port@1 { + status = "okay"; + d4xx_csi_out0: endpoint@1 { + status = "okay"; + remote-endpoint = <&d4xx_vi_in0>; + }; + }; + }; + }; + channel@1 { + status = "okay"; + ports { + status = "okay"; + port@0 { + status = "okay"; + d4xx_csi_in1: endpoint@2 { + status = "okay"; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4m1_out>; + }; + }; + port@1 { + status = "okay"; + d4xx_csi_out1: endpoint@3 { + status = "okay"; + remote-endpoint = <&d4xx_vi_in1>; + }; + }; + }; + }; + channel@2 { + status = "okay"; + ports { + status = "okay"; + port@0 { + status = "okay"; + d4xx_csi_in2: endpoint@4 { + status = "okay"; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4m2_out>; + }; + }; + port@1 { + status = "okay"; + d4xx_csi_out2: endpoint@5 { + status = "okay"; + remote-endpoint = <&d4xx_vi_in2>; + }; + }; + }; + }; + channel@3 { + status = "okay"; + ports { + status = "okay"; + port@0 { + status = "okay"; + d4xx_csi_in3: endpoint@6 { + status = "okay"; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4m3_out>; + }; + }; + port@1 { + status = "okay"; + d4xx_csi_out3: endpoint@7 { + status = "okay"; + remote-endpoint = <&d4xx_vi_in3>; + }; + }; + }; + }; + channel@4 { + status = "okay"; + ports { + status = "okay"; + port@0 { + status = "okay"; + d4xx_csi_in4: endpoint@8 { + status = "okay"; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4m4_out>; + }; + }; + port@1 { + status = "okay"; + d4xx_csi_out4: endpoint@9 { + status = "okay"; + remote-endpoint = <&d4xx_vi_in4>; + }; + }; + }; + }; + channel@5 { + status = "okay"; + ports { + status = "okay"; + port@0 { + status = "okay"; + d4xx_csi_in5: endpoint@10 { + status = "okay"; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4m5_out>; + }; + }; + port@1 { + status = "okay"; + d4xx_csi_out5: endpoint@11 { + status = "okay"; + remote-endpoint = <&d4xx_vi_in5>; + }; + }; + }; + }; + channel@6 { + status = "okay"; + ports { + status = "okay"; + port@0 { + status = "okay"; + d4xx_csi_in6: endpoint@12 { + status = "okay"; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4m6_out>; + }; + }; + port@1 { + status = "okay"; + d4xx_csi_out6: endpoint@13 { + status = "okay"; + remote-endpoint = <&d4xx_vi_in6>; + }; + }; + }; + }; + channel@7 { + status = "okay"; + ports { + status = "okay"; + port@0 { + status = "okay"; + d4xx_csi_in7: endpoint@14 { + status = "okay"; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4m7_out>; + }; + }; + port@1 { + status = "okay"; + d4xx_csi_out7: endpoint@15 { + status = "okay"; + remote-endpoint = <&d4xx_vi_in7>; + }; + }; + }; + }; + }; + }; + i2c@3180000 { + clock-frequency = <100000>; + tca9548@72 { + status = "okay"; + reg = <0x72>; + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + skip_mux_detect = "yes"; + vcc-supply = <&vdd_1v8_ls>; + /*vcc-pullup-supply = <&battery_reg>;*/ + force_bus_start = ; + vcc_lp = "vcc"; + i2c@0 { + reg = <0>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + + dser: max9296@48 { + status = "okay"; + reg = <0x48>; + compatible = "maxim,max9296"; + csi-mode = "2x4"; + max-src = <2>; + reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_HIGH>; + }; + + ser_prim: max9295_prim@40 { + status = "okay"; + reg = <0x40>; + compatible = "maxim,max9295"; + is-prim-ser; + }; + + ser_a: max9295_a@42 { + status = "okay"; + compatible = "maxim,max9295"; + reg = <0x42>; + maxim,gmsl-dser-device = <&dser>; + }; + + ser_b: max9295_b@60 { + status = "okay"; + compatible = "maxim,max9295"; + reg = <0x60>; + maxim,gmsl-dser-device = <&dser>; + }; + + d4m0: d4m@1a { + status = "okay"; + def-addr = <0x10>; + reg = <0x1a>; + compatible = "intel,d4xx"; + use_sensor_mode_id = "true"; + vcc-supply = <&vdd_1v8_ls>; + cam-type = "Depth"; + nvidia,gmsl-ser-device = <&ser_a>; + nvidia,gmsl-dser-device = <&dser>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + d4m0_out: endpoint { + vc-id = <0>; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_in0>; + }; + }; + }; + mode0 { + pixel_t = "grey_y16"; + num_lanes = "2"; + csi_pixel_bit_depth = "16"; + active_w = "1280"; + active_h = "720"; + tegra_sinterface = "serial_a"; + mclk_khz = "24000"; + pix_clk_hz = "74250000"; + line_length = "1280"; /* 2200 */ + embedded_metadata_height = "1"; + }; + gmsl-link { + src-csi-port = "b"; + dst-csi-port = "a"; + serdes-csi-link = "a"; + csi-mode = "1x4"; + st-vc = <0>; + vc-id = <0>; + num-lanes = <2>; + }; + }; + }; + + i2c@1 { + status = "okay"; + reg = <1>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + + d4m1: d4m@1a { + status = "okay"; + def-addr = <0x10>; + reg = <0x1a>; + compatible = "intel,d4xx"; + use_sensor_mode_id = "true"; + vcc-supply = <&vdd_1v8_ls>; + cam-type = "RGB"; + nvidia,gmsl-ser-device = <&ser_a>; + nvidia,gmsl-dser-device = <&dser>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + d4m1_out: endpoint { + port-index = <1>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_in1>; + }; + }; + }; + mode0 { + pixel_t = "grey_y16"; + num_lanes = "2"; + csi_pixel_bit_depth = "16"; + active_w = "1920"; + active_h = "1080"; + tegra_sinterface = "serial_e"; + mclk_khz = "24000"; + pix_clk_hz = "74250000"; + line_length = "1280"; /* 2200 */ + embedded_metadata_height = "1"; + }; + gmsl-link { + src-csi-port = "b"; + dst-csi-port = "a"; + serdes-csi-link = "a"; + csi-mode = "1x4"; + st-vc = <0>; + vc-id = <1>; + num-lanes = <2>; + }; + }; + }; + i2c@2 { + status = "okay"; + reg = <2>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + + d4m2: d4m@1a { + status = "okay"; + def-addr = <0x10>; + reg = <0x1a>; + compatible = "intel,d4xx"; + use_sensor_mode_id = "true"; + vcc-supply = <&vdd_1v8_ls>; + cam-type = "Y8"; + nvidia,gmsl-ser-device = <&ser_a>; + nvidia,gmsl-dser-device = <&dser>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + d4m2_out: endpoint { + port-index = <2>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_in2>; + }; + }; + }; + /* mode0: Y8, mode1: depth D16 */ + mode0 { + pixel_t = "grey_y16"; + num_lanes = "2"; + csi_pixel_bit_depth = "16"; + active_w = "1280"; + active_h = "720"; + tegra_sinterface = "serial_b"; + mclk_khz = "24000"; + pix_clk_hz = "74250000"; + line_length = "1280"; /* 2200 */ + embedded_metadata_height = "0"; + }; + gmsl-link { + src-csi-port = "b"; + dst-csi-port = "a"; + serdes-csi-link = "a"; + csi-mode = "1x4"; + st-vc = <0>; + vc-id = <2>; + num-lanes = <2>; + }; + }; + }; + i2c@3 { + status = "okay"; + reg = <3>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + + d4m3: d4m@1a { + status = "okay"; + def-addr = <0x10>; + reg = <0x1a>; + compatible = "intel,d4xx"; + use_sensor_mode_id = "true"; + vcc-supply = <&vdd_1v8_ls>; + cam-type = "IMU"; + nvidia,gmsl-ser-device = <&ser_a>; + nvidia,gmsl-dser-device = <&dser>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + d4m3_out: endpoint { + port-index = <3>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_in3>; + }; + }; + }; + mode0 { + pixel_t = "grey_y16"; + num_lanes = "2"; + csi_pixel_bit_depth = "16"; + active_w = "640"; + active_h = "480"; + tegra_sinterface = "serial_b"; + mclk_khz = "24000"; + pix_clk_hz = "74250000"; + line_length = "1280"; /* 2200 */ + embedded_metadata_height = "0"; + }; + gmsl-link { + src-csi-port = "b"; + dst-csi-port = "a"; + serdes-csi-link = "a"; + csi-mode = "1x4"; + st-vc = <0>; + vc-id = <3>; + num-lanes = <2>; + }; + }; + }; +// dual + i2c@4 { + status = "okay"; + reg = <4>; + #address-cells = <0x1>; + i2c-mux,deselect-on-exit; + #size-cells = <0x0>; + + d4m4: d4m@1b { + status = "ok"; + def-addr = <0x10>; + reg = <0x1b>; + compatible = "intel,d4xx"; + use_sensor_mode_id = "true"; + vcc-supply = <&vdd_1v8_ls>; + cam-type = "Depth"; + nvidia,gmsl-ser-device = <&ser_b>; + nvidia,gmsl-dser-device = <&dser>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + d4m4_out: endpoint { + port-index = <4>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_in4>; + }; + }; + }; + mode0 { + pixel_t = "grey_y16"; + num_lanes = "2"; + csi_pixel_bit_depth = "16"; + active_w = "1280"; + active_h = "720"; + tegra_sinterface = "serial_a"; + mclk_khz = "24000"; + pix_clk_hz = "74250000"; + line_length = "1280"; /* 2200 */ + embedded_metadata_height = "1"; + }; + gmsl-link { + src-csi-port = "b"; + dst-csi-port = "a"; + serdes-csi-link = "b"; + csi-mode = "1x4"; + st-vc = <0>; + vc-id = <2>; + num-lanes = <2>; + }; + }; + }; + + i2c@5 { + status = "okay"; + reg = <5>; + #address-cells = <0x1>; + i2c-mux,deselect-on-exit; + #size-cells = <0x0>; + + d4m5: d4m@1b { + status = "ok"; + def-addr = <0x10>; + reg = <0x1b>; + compatible = "intel,d4xx"; + use_sensor_mode_id = "true"; + vcc-supply = <&vdd_1v8_ls>; + cam-type = "RGB"; + nvidia,gmsl-ser-device = <&ser_b>; + nvidia,gmsl-dser-device = <&dser>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + d4m5_out: endpoint { + port-index = <5>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_in5>; + }; + }; + }; + mode0 { + pixel_t = "grey_y16"; + num_lanes = "2"; + csi_pixel_bit_depth = "16"; + active_w = "1920"; + active_h = "1080"; + tegra_sinterface = "serial_e"; + mclk_khz = "24000"; + pix_clk_hz = "74250000"; + line_length = "1280"; /* 2200 */ + embedded_metadata_height = "1"; + }; + gmsl-link { + src-csi-port = "b"; + dst-csi-port = "a"; + serdes-csi-link = "b"; + csi-mode = "1x4"; + st-vc = <0>; + vc-id = <3>; + num-lanes = <2>; + }; + }; + }; + + i2c@6 { + status = "okay"; + reg = <6>; + #address-cells = <0x1>; + i2c-mux,deselect-on-exit; + #size-cells = <0x0>; + + d4m6: d4m@1b { + status = "ok"; + def-addr = <0x10>; + reg = <0x1b>; + compatible = "intel,d4xx"; + use_sensor_mode_id = "true"; + vcc-supply = <&vdd_1v8_ls>; + cam-type = "Y8"; + nvidia,gmsl-ser-device = <&ser_b>; + nvidia,gmsl-dser-device = <&dser>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + d4m6_out: endpoint { + port-index = <6>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_in6>; + }; + }; + }; + /* mode0: Y8, mode1: depth D16 */ + mode0 { + pixel_t = "grey_y16"; + num_lanes = "2"; + csi_pixel_bit_depth = "16"; + active_w = "1280"; + active_h = "720"; + tegra_sinterface = "serial_b"; + mclk_khz = "24000"; + pix_clk_hz = "74250000"; + line_length = "1280"; /* 2200 */ + embedded_metadata_height = "0"; + }; + gmsl-link { + src-csi-port = "b"; + dst-csi-port = "a"; + serdes-csi-link = "b"; + csi-mode = "1x4"; + st-vc = <0>; + vc-id = <0>; + num-lanes = <2>; + }; + }; + }; + i2c@7 { + status = "okay"; + reg = <7>; + #address-cells = <0x1>; + i2c-mux,deselect-on-exit; + #size-cells = <0x0>; + + d4m7: d4m@1b { + status = "ok"; + def-addr = <0x10>; + reg = <0x1b>; + compatible = "intel,d4xx"; + use_sensor_mode_id = "true"; + vcc-supply = <&vdd_1v8_ls>; + cam-type = "IMU"; + nvidia,gmsl-ser-device = <&ser_b>; + nvidia,gmsl-dser-device = <&dser>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + d4m7_out: endpoint { + port-index = <7>; + bus-width = <2>; + remote-endpoint = <&d4xx_csi_in7>; + }; + }; + }; + mode0 { + pixel_t = "grey_y16"; + num_lanes = "2"; + csi_pixel_bit_depth = "16"; + active_w = "640"; + active_h = "480"; + tegra_sinterface = "serial_b"; + mclk_khz = "24000"; + pix_clk_hz = "74250000"; + line_length = "1280"; /* 2200 */ + embedded_metadata_height = "0"; + }; + gmsl-link { + src-csi-port = "b"; + dst-csi-port = "a"; + serdes-csi-link = "b"; + csi-mode = "1x4"; + st-vc = <0>; + vc-id = <1>; + num-lanes = <2>; + }; + }; + }; + }; + }; + }; + }; + }; +}; From 6f284d46015be8d36830931a03bfa555b00576a6 Mon Sep 17 00:00:00 2001 From: Dmitry Perchanov Date: Sun, 4 Aug 2024 12:25:58 +0300 Subject: [PATCH 2/2] JP6 dual camera configuration documentation. Signed-off-by: Dmitry Perchanov --- README_JP6.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 7 deletions(-) diff --git a/README_JP6.md b/README_JP6.md index bb7429e..6e142e9 100644 --- a/README_JP6.md +++ b/README_JP6.md @@ -93,6 +93,7 @@ Note: dev_dbg() log support will be enabled by default. If not needed, run the ` - kernel image (not modified if `--no-dev-dbg` option is used while building): `images/6.0/rootfs/boot/Image` - dtb: `images/6.0/rootfs/boot/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb` - dtb overlay: `images/6.0/rootfs/boot/tegra234-camera-d4xx-overlay.dtbo` +- dtb dual camera overlay: `images/6.0/rootfs/boot/tegra234-camera-d4xx-overlay-dual.dtbo` - nvidia-oot modules: `images/6.0/rootfs/lib/modules/5.15.136-tegra/updates` - kernel modules: `images/6.0/rootfs/lib/modules/5.15.136-tegra/extra` @@ -119,17 +120,20 @@ Following steps required: 1. Copy entire directory `images/6.0/rootfs/lib/modules/5.15.136-tegra/updates` from host to `/lib/modules/5.15.136-tegra/` on Orin target 2. Copy entire directory `images/6.0/rootfs/lib/modules/5.15.136-tegra/extra` from host to `/lib/modules/5.15.136-tegra/` on Orin target 3. Copy `tegra234-camera-d4xx-overlay.dtbo` from host to `/boot/tegra234-camera-d4xx-overlay.dtbo` on Orin target -4. Copy `tegra234-p3737-0000+p3701-0000-nv.dtb` from host to `/boot/` on Orin -5. Copy `Image` from host to `/boot/` on Orin -6. Run $ `sudo /opt/nvidia/jetson-io/jetson-io.py` +4. For dual camera, copy `tegra234-camera-d4xx-overlay-dual.dtbo` from host to `/boot/tegra234-camera-d4xx-overlay-dual.dtbo` on Orin target +5. Copy `tegra234-p3737-0000+p3701-0000-nv.dtb` from host to `/boot/` on Orin +6. Copy `Image` from host to `/boot/` on Orin +7. Run $ `sudo /opt/nvidia/jetson-io/jetson-io.py` 1. Configure Jetson AGX CSI Connector 2. Configure for compatible hardware - 3. Jetson RealSense Camera D457 + 3. Choose appropriate configuration: + 1. Jetson RealSense Camera D457 + 2. Jetson RealSense Camera D457 dual 4. Enable depmod scan for "extra" modules $ `sudo sed -i 's/search updates/search extra updates/g' /etc/depmod.d/ubuntu.conf` 5. $ `sudo depmod` 6. $ `echo "d4xx" | sudo tee /etc/modules-load.d/d4xx.conf` -7. Verify bootloader configuration +8. Verify bootloader configuration ``` cat /boot/extlinux/extlinux.conf @@ -142,7 +146,7 @@ Following steps required: OVERLAYS /boot/tegra234-camera-d4xx-overlay.dtbo -------- ``` -7. Reboot +9. Reboot ## Deploy build results on Jetson target On build host, copy build results to the right places. @@ -167,9 +171,12 @@ sudo cp -r ~/updates /lib/modules/$(uname -r)/ sudo cp ~/boot/tegra234-camera-d4xx-overlay.dtbo /boot/ sudo cp ./boot/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb /boot/tegra234-p3737-0000+p3701-0000-nv.dtb sudo cp ./boot/Image /boot/Image -# Enable d4xx overlay: +# Enable d4xx overlay for single camera: sudo /opt/nvidia/jetson-io/config-by-hardware.py -n 2="Jetson RealSense Camera D457" +# For dual camera setup: +# sudo /opt/nvidia/jetson-io/config-by-hardware.py -n 3="Jetson RealSense Camera D457 dual" + # Enable d4xx autoload: echo "d4xx" | sudo tee /etc/modules-load.d/d4xx.conf # Enable depmod scan for "extra" modules @@ -211,4 +218,57 @@ nvidia@ubuntu:~$ sudo dmesg | grep d4xx [ 10.044759] d4xx 14-001a: D4XX Sensor: IMU, firmware build: 5.15.1.0 ``` + +### Known issues +- Camera not recognized +Verify I2C MUX detected. If "probe failed" reported, replace extension board adapter (LI-JTX1-SUB-ADPT). +``` +nvidia@ubuntu:~$ sudo dmesg | grep pca954x +[ 3.933113] pca954x 2-0072: probe failed +``` + +- Configuration with jetson-io tool system fail to boot with message "couldn't find root partition" +Verfiy bootloader configuration +`/boot/extlinux/extlinux.conf` +Sometimes configuration tool missing APPEND parameters. Duplicate `primary` section `APPEND` line to `JetsonIO` `APPEND` section, verify it's similar. + +Exaple Bad: +``` +LABEL primary + MENU LABEL primary kernel + LINUX /boot/Image + INITRD /boot/initrd + APPEND ${cbootargs} root=PARTUUID=634b7e44-aacc-4dd9-a769-3a664b83b159 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0 nv-auto-config + +LABEL JetsonIO + MENU LABEL Custom Header Config: + LINUX /boot/Image + FDT /boot/dtb/kernel_tegra234-p3737-0000+p3701-0000-nv.dtb + INITRD /boot/initrd + APPEND ${cbootargs} + OVERLAYS /boot/tegra234-camera-d4xx-overlay-dual.dtbo +``` +Exaple Good: +``` +LABEL primary + MENU LABEL primary kernel + LINUX /boot/Image + INITRD /boot/initrd + APPEND ${cbootargs} root=PARTUUID=634b7e44-aacc-4dd9-a769-3a664b83b159 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0 nv-auto-config + +LABEL JetsonIO + MENU LABEL Custom Header Config: + LINUX /boot/Image + FDT /boot/dtb/kernel_tegra234-p3737-0000+p3701-0000-nv.dtb + INITRD /boot/initrd + APPEND ${cbootargs} root=PARTUUID=634b7e44-aacc-4dd9-a769-3a664b83b159 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0 nv-auto-config + OVERLAYS /boot/tegra234-camera-d4xx-overlay-dual.dtbo +``` +- Configuration tool jetson-io terminates without configuration menu. +verify that `/boot/dtb` has only one dtb file +``` +nvidia@ubuntu:~$ ls /boot/dtb/ +kernel_tegra234-p3737-0000+p3701-0000-nv.dtb +``` + ---