How do i modify camera device tree configuration(ov5693) on tx2?

HI,

I’d like to modify camera device tree configuration(ov5693) on tx2.
So i modified tegra186-camera-e3326-a00.dtsi according to below sequences.
But my modification was not applied from dmesg.

  1. modify tegra186-camera-e3326-a00.dtsi
    ./hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-modules/tegra186-camera-e3326-a00.dtsi

  2. build device tree

#!/bin/bash

export CROSS_COMPILE=aarch64-unknown-linux-gnu-
export TEGRA_KERNEL_OUT=./out
export ARCH=arm64
make O=$TEGRA_KERNEL_OUT dtbs

  1. copy dtb files to Linux_for_Tegra/kernel/dtb
    cp ./out/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb ~/1.work/1.al/0.nvidia/3.package/r28.1/Lin ux_for_Tegra/kernel/dtb

cp ./out/arch/arm64/boot/dts/tegra186-quill-p3310-1000-a00-00-base.dtb ~/1.work/1.al/0.nvidia/3.package/r28.1/Lin ux_for_Tegra/kernel/dtb

cp ./out/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-dp.dtb ~/1.work/1.al/0.nvidia/3.package/r2 8.1/Linux_for_Tegra/kernel/dtb

  1. flashing
    sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1

If there is any mistake, plz let me know.

Thanks,
Doohan93

You might want to flash that same exact command again, but log it, e.g.:

sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1 2>&1 | tee tree_log.txt

Then post the log (or post the output of “grep dtb tree_log.txt”…a full log is probably better).

When you say from dmesg it wasn’t applied, do you mean you were looking for something and it did not show up, or do you mean you got a message that said the change was rejected? If the latter, can you post a copy of this?

EDIT: You might also mention what the change was. Then explore “/proc/device-tree/” and post what it actually ended up as. You can put this directory in source form via:

dtc -I fs -O dts -o extracted.dts /proc/device-tree

Hi Linuxdev,

Thanks for your response.

I means i modified “./hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-modules/tegra186-camera-e3326-a00.dtsi”

We have made camera board to change sensor, and our csi sensor needs 4 csi lanes.

So i modified like belows, but dmesg log always show csi-port(2) !!

csi-port = <0>;
csi-port = <4>;

And i’ll check according to your guide.

dtc -I fs -O dts -o extracted.dts /proc/device-tree

Thanks,
Doohan93

One reason for looking at a repeated log of dtb flash is to know which dtb was used (there may be a different dtb depending on carrier board or other details…perhaps even just from a revision). You could reverse compile those dtb and see which has the change you added…if none have that change, then you know it was your change in the dtsi which didn’t propagate (versus flash of the resultant dtb). To reverse compile a dtb to dts:

dtc -I dtb -O dts -o reversed.dts whatever_dtb_you want.dtb

Hi linuxdev,

I posted 2 weeks ago because imx185_probe(camera i2c device driver, imx185.c) function not called during kernel booting.
So i resolved by ways as below, and called imx185_probe,

But below errors(mclk not in DT) happened in imx185_parse_dt function.

err = of_property_read_string(np, "mclk",
			      &board_priv_pdata->mclk_name);
if (err)
	dev_err(&client->dev, "mclk not in DT\n");

tegra186-quill-camera-li-mipi-adpt-a00.dtsi contained mclk like below

51 imx185_a@1a {
52 /* Define any required hw resources needed by driver /
53 /
ie. clocks, io pins, power sources */
54 clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>,
55 <&tegra_car TEGRA186_CLK_PLLP_OUT0>;
56 clock-names = “extperiph1”, “pllp_grtba”;
57 mclk = “extperiph1”;
58 reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
59 };

Why didn’t parsing from dtb??

Thanks,
Doohan93

#######################################################################3

  1. removed ov5693 sensor board on TX2

  2. modified tegra186-quill-p3310-1000-a00-00-base.dts
    ./hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dts

16 #include <t18x-common-platforms/tegra186-quill-common-p3310-1000-a00.dtsi>
17 #include <t18x-common-platforms/tegra186-quill-power-tree-p3310-1000-a00-00.dtsi>
18 //#include <t18x-common-platforms/tegra186-quill-camera-modules.dtsi> // commented
19 #include <t18x-common-platforms/tegra186-quill-camera-li-mipi-adpt-a00.dtsi> // added
20 #include <t18x-common-modules/tegra186-display-e3320-1000-a00.dtsi>
21
22 /* comms dtsi file should be included after gpio dtsi file */
23 #include <t18x-common-platforms/tegra186-quill-comms.dtsi>
24 #include <t18x-common-plugin-manager/tegra186-quill-p3310-1000-a00-plugin-manager.dtsi>
25 #include <t18x-common-modules/tegra186-super-module-e2614-p2597-1000-a00.dtsi>
26 #include <t18x-common-plugin-manager/tegra186-quill-display-plugin-manager.dtsi>
27 #include <t18x-common-prod/tegra186-priv-quill-p3310-1000-a00-prod.dtsi>
28 //#include <t18x-common-plugin-manager/tegra186-quill-camera-plugin-manager.dtsi> // commented

  1. modified tegra186-quill-camera-modules.dtsi
    ./hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-camera-modules.dtsi

261 tca9546_70: tca9546@70 {
262 status = “okay”;
263 i2c@0 {
264 imx185_cam0: imx185_a@1a {
266 status = “okay”;
267 };
268 };
269 };

  1. i check imx185_probe log using dmesg

##############################################################################3

I lack knowledge of the specific hardware setup, but the answer will probably depend on which release you are using, e.g., R28.1 or R28.2 (see “head -n 1 /etc/nv_tegra_release”).

When you change values in the kernel source for device tree you may need to build the “dtbs” target to see those changes. Once you have the “.dtb” files it is a good idea to find the one you believe is the correct binary, reverse compile this, and check if your changes actually show up. Then find the file in the “Linux_for_Tegra/kernel/dtb/” directory which you believe should be replaced…reverse compile this and verify this contains what you are modifying. After you back up the original and put your modification in log the flash of the dtb (or full flash if not just dtb) and verify in the log of the flash the file you actually wanted to flash was indeed flashed.

There are a lot of little things which can go wrong in terms of making sure your change goes into the file you expect and then actually arrives in the Jetson. Once it is there, reverse compile the running Jetson’s device tree and verify it actually has what you want…if not, then use dmesg to see if there were device tree errors or some other rejection note about the tree:

sudo apt-get install device-tree-compiler
dtc -I fs -O dts -o extracted.dts /proc/device-tree/

Are you certain your change was flashed?