Gst-launch-1.0 nvarguscamerasrc can't get right GST_ARGUS: Available Sensor modes

we are useing 120 fps mode support removed for imx219 sensor
to make 120 fps and 180 fps for imx219, it’s working looks good for: v4l2-ctl --list-formats-ext command.
图片

but if use: gst-launch-1.0 nvarguscamerasrc ! fakesink command we got wrong avaliable Sensor modes, as below, it’s looks like imx219 drive still used old one.

gst-launch-1.0 nvarguscamerasrc not show 120 fps or 180 fps, but i’m sure kernel already rebuild imx219 driver sucessful

we modify:
1)hardware/nvidia/platform/t19x/jakku/kernel-dts/common/tegra194-camera-rbpcv2-imx219.dtsi
2)kernel/nvidia/drivers/media/i2c/imx219_mode_tbls.h
and rebuild kernel as well.

Does gst-launch-1.0 nvarguscamerasrc use different driver with v4l2-ctl --list-formats-ext?

Many thanks for your help

Hello @dylan2023 !

I understand that you modified these files:

  • hardware/nvidia/platform/t19x/jakku/kernel-dts/common/tegra194-camera-rbpcv2-imx219.dtsi
  • kernel/nvidia/drivers/media/i2c/imx219_mode_tbls.h

I have a couple of questions, to make sure that everything was properly updated after you modified those files:

  1. You mentioned that you rebuilt the kernel Image, did you also rebuilt the Device tree?
  2. Assuming that you built both kernel Image and device tree, how did you update these files on the Jetson? Did you flash the board again or did you copy the updated files to the /boot directory?

If you copied the files to /boot, you might want to specify the path to the updated device tree file to make sure that it is being used. To do so, you have to modify the file /boot/extlinux/extlinux.conf. Here you should see something like the following:

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet

Add the FDT variable followed by the path to the updated device tree:

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      FDT /boot/<name-of-my-dtb>.dtb
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet

Notice that I am assuming that the updated device tree file is in the /boot directory and you have to replace <name-of-my-dtb> with the actual name of the device tree file that you rebuilt.

Let me know if this helped you.

Alejandro Flores,
Embedded SW Engineer at RidgeRun

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

HI Alejandro,Thank you for your reply

  1. You mentioned that you rebuilt the kernel Image, did you also rebuilt the Device tree?
    Yes,we rebuild both kernel Image and device tree with kernel src 5.10.104-tegra. Here is my build shell file:
    buildKernel.sh (2.1 KB)
    As you can see in the rebuild shell, /lib/modules file also update by 5.10.104-tegra
2)Assuming that you built both kernel Image and device tree, how did you update these files on the Jetson? Did you flash the board again or did you copy the updated files to the /boot directory?

Yes, we modify the /boot/extlinux/extlinux.conf file:

for you to know, we use an extended SSD to run the kernel instead of emmc
you are right, the device tree must not working for gst-launch-1.0 nvarguscamerasrc, but we can’t figure out why FDT /boot/tegra194-p3668-all-p3509-0000-fps120.dtb not working in extlinux.conf file, if /boot/tegra194-p3668-all-p3509-0000-fps120.dtb not working well, why v4l2-ctl --list-formats-ext command working good .

Hi @dylan2023.

Some file (kernel Image or DTB) must not be updating right, hence the difference between nvarguscamerasrc and v4l2-ctl.

Another question:

  • Are you enabling the imx219 driver as built-in or as a Module?

I checked your file buildKernel.sh and I see that you have the following commands:

export LOCALVERSION=-fps120
sudo cp -R ${TEGRA_MODULES_OUT}/lib/modules/5.10.104-fps120 /lib/modules/5.10.104-tegra

You can check that there is no mismatch between the name of the modules directory and the kernel release name. Can you verify that these match by running the following commands? I am sharing my results on a Jetson nano as an example:

nvidia@ubuntu:~$ ls /lib/modules/
4.9.253-tegra
nvidia@ubuntu:~$ uname -r
4.9.253-tegra

You can also check the device tree that is being used by running the following command:

sudo dmesg | grep DTS

Regards,
Alejandro Flores,
Embedded SW Engineer at RidgeRun

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

Hi Alejandro ,

I checked your file `buildKernel.sh` and I see that you have the following commands:
export LOCALVERSION=-fps120
sudo cp -R ${TEGRA_MODULES_OUT}/lib/modules/5.10.104-fps120 /lib/modules/5.10.104-tegra

yes you are right, at very begining, I used sudo cp -R ${TEGRA_MODULES_OUT}/lib/modules/5.10.104-fps120 /lib/modules/5.10.104-fps120. but if I set like this, when I reboot system, all the modules are not working including WIFI, because /lib/modules/5.10.104-fps120 but uname -r still 5.10.104-tegra, not match kernel, so I changed to sudo cp -R ${TEGRA_MODULES_OUT}/lib/modules/5.10.104-fps120 /lib/modules/5.10.104-tegra. it’s working for v4l2-ctl --list-formats-ext command.

uname -r
sudo dmesg | grep DTS

It’s very useful, directly show me the problem, my command as below:


SO, dmesg command show me, system used work/l4t_kernel5_10/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-0001-p3509-0000.dts, I find this file only exist in this path, it’s kernel source file for rebuild kernel.
but my extLinux.conf file set

      FDT /boot/tegra194-p3668-all-p3509-0000-fps120.dtb
      INITRD /boot/initrd
      APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 nv-auto-config 

my dtb list:


looks like FDT /boot/tegra194-p3668-all-p3509-0000-fps120.dtb not working with unkonw reason or tegra194-p3668-all-p3509-0000-fps120 builded, but imx219 driver not as build.

Are you enabling the imx219 driver as built-in or as a Module?

Can I konw how to enable to build imx219 ? I just modify the 1)hardware/nvidia/platform/t19x/jakku/kernel-dts/common/tegra194-camera-rbpcv2-imx219.dtsi
2)kernel/nvidia/drivers/media/i2c/imx219_mode_tbls.h that two file, and run buildKernel.sh to rebuild the kernel, is there some other set file to inactive imx219 driver as built-in?

Dump the device tree to confirm the sensor mode was added.

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

thanks for your reply

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

dump file show clear enugth my device tree used not right.
the dump file show me dtb build time not right and camer no 120 mode.



we also used "dtc -I dtb -O dts -o " command to check my tegra194-p3668-all-p3509-0000-fps120.dtb , that looks good, have new mode for 120 pfs

so we succes to build new kernel and device-tree. but my /boot/extlinux/extlinux.conf not work for FDT /boot/tegra194-p3668-all-p3509-0000-fps120.dtb
system still used old defult dtb file.
my extlinux.conf:

this is very strange for /boot/extlinux/extlinux.conf not working, we used SSD load system instead of EMMC, Could this be the cause of the problem?

For your case may need to replace the dtb file in sdkmanager folder to flash by below command to apply the dtb

sudo ./flash -r -k jetson-agx-xavier-devkit mmcblk0p1

chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://media.digikey.com/pdf/Data%20Sheets/Seeed%20Technology/Flashing_Booting_the_Target_Device_NVIDIA_Docs.pdf

To answer to your question:

Can I konw how to enable to build imx219 ?

Run the following commands:

make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig
make ARCH=arm64 O=$TEGRA_KERNEL_OUT menuconfig

The last command should open a menu where you can enable or disable many drivers. You can use the “/” character to search for the imx219 driver, however, it is already enabled as we see in your most recent answer.

I agree with @ShaneCCC, it would be better to flash again instead of just replacing the DTB file, to make sure that your DTB is actually used. For this, I would recommend you to rename your custom file tegra194-p3668-all-p3509-0000-fps120.dtb to the name of the DTB file shown by the command sudo dmesg | grep DTS, to make sure that it is being replaced.

Regards,
Alejandro Flores,
Embedded SW Engineer at RidgeRun

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

Sorry my old post may not be correct for recent JP5 release. Just checked now with R35.2.1 and these patched files:

hardware/nvidia/platform/t19x/jakku/kernel-dts/common/tegra194-camera-rbpcv2-imx219.dtsi
/*
 * Copyright (c) 2018-2020, 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 <http://www.gnu.org/licenses/>.
 */
#include <dt-bindings/media/camera.h>

/ {
	tegra-capture-vi  {
		num-channels = <2>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			vi_port0: port@0 {
				reg = <0>;
				rbpcv2_imx219_vi_in0: endpoint {
					port-index = <0>;
					bus-width = <2>;
					remote-endpoint = <&rbpcv2_imx219_csi_out0>;
				};
			};
			vi_port1: port@1 {
				reg = <1>;
				rbpcv2_imx219_vi_in1: endpoint {
					port-index = <2>;
					bus-width = <2>;
					remote-endpoint = <&rbpcv2_imx219_csi_out1>;
				};
			};
		};
	};

	host1x@13e00000 {
		nvcsi@15a00000 {
			num-channels = <2>;
			#address-cells = <1>;
			#size-cells = <0>;
			csi_chan0: channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					csi_chan0_port0: port@0 {
						reg = <0>;
						rbpcv2_imx219_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&rbpcv2_imx219_out0>;
						};
					};
					csi_chan0_port1: port@1 {
						reg = <1>;
						rbpcv2_imx219_csi_out0: endpoint@1 {
							remote-endpoint = <&rbpcv2_imx219_vi_in0>;
						};
					};
				};
			};
			csi_chan1: channel@1 {
				reg = <1>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					csi_chan1_port0: port@0 {
						reg = <0>;
						rbpcv2_imx219_csi_in1: endpoint@2 {
							port-index = <2>;
							bus-width = <2>;
							remote-endpoint = <&rbpcv2_imx219_out1>;
						};
					};
					csi_chan1_port1: port@1 {
						reg = <1>;
						rbpcv2_imx219_csi_out1: endpoint@3 {
							remote-endpoint = <&rbpcv2_imx219_vi_in1>;
						};
					};
				};
			};
		};
	};

	cam_i2cmux {
		i2c_0:i2c@0 {
			imx219_cam0: rbpcv2_imx219_a@10 {
				compatible = "sony,imx219";
				/* I2C device address */
				reg = <0x10>;

				/* V4L2 device node location */
				devnode = "video0";

				/* Physical dimensions of sensor */
				physical_w = "3.680";
				physical_h = "2.760";

				sensor_model = "imx219";

				use_sensor_mode_id = "true";

				/**
				* ==== Modes ====
				* A modeX node is required to support v4l2 driver
				* implementation with NVIDIA camera software stack
				*
				* == Signal properties ==
				*
				* phy_mode = "";
				* PHY mode used by the MIPI lanes for this device
				*
				* tegra_sinterface = "";
				* CSI Serial interface connected to tegra
				* Incase of virtual HW devices, use virtual
				* For SW emulated devices, use host
				*
				* pix_clk_hz = "";
				* Sensor pixel clock used for calculations like exposure and framerate
				*
				* readout_orientation = "0";
				* Based on camera module orientation.
				* Only change readout_orientation if you specifically
				* Program a different readout order for this mode
				*
				* == Image format Properties ==
				*
				* active_w = "";
				* Pixel active region width
				*
				* active_h = "";
				* Pixel active region height
				*
				* pixel_t = "";
				* The sensor readout pixel pattern
				*
				* line_length = "";
				* Pixel line length (width) for sensor mode.
				*
				* == Source Control Settings ==
				*
				* Gain factor used to convert fixed point integer to float
				* Gain range [min_gain/gain_factor, max_gain/gain_factor]
				* Gain step [step_gain/gain_factor is the smallest step that can be configured]
				* Default gain [Default gain to be initialized for the control.
				*     use min_gain_val as default for optimal results]
				* Framerate factor used to convert fixed point integer to float
				* Framerate range [min_framerate/framerate_factor, max_framerate/framerate_factor]
				* Framerate step [step_framerate/framerate_factor is the smallest step that can be configured]
				* Default Framerate [Default framerate to be initialized for the control.
				*     use max_framerate to get required performance]
				* Exposure factor used to convert fixed point integer to float
				* For convenience use 1 sec = 1000000us as conversion factor
				* Exposure range [min_exp_time/exposure_factor, max_exp_time/exposure_factor]
				* Exposure step [step_exp_time/exposure_factor is the smallest step that can be configured]
				* Default Exposure Time [Default exposure to be initialized for the control.
				*     Set default exposure based on the default_framerate for optimal exposure settings]
				*
				* gain_factor = ""; (integer factor used for floating to fixed point conversion)
				* min_gain_val = ""; (ceil to integer)
				* max_gain_val = ""; (ceil to integer)
				* step_gain_val = ""; (ceil to integer)
				* default_gain = ""; (ceil to integer)
				* Gain limits for mode
				*
				* exposure_factor = ""; (integer factor used for floating to fixed point conversion)
				* min_exp_time = ""; (ceil to integer)
				* max_exp_time = ""; (ceil to integer)
				* step_exp_time = ""; (ceil to integer)
				* default_exp_time = ""; (ceil to integer)
				* Exposure Time limits for mode (sec)
				*
				* framerate_factor = ""; (integer factor used for floating to fixed point conversion)
				* min_framerate = ""; (ceil to integer)
				* max_framerate = ""; (ceil to integer)
				* step_framerate = ""; (ceil to integer)
				* default_framerate = ""; (ceil to integer)
				* Framerate limits for mode (fps)
				*
				* embedded_metadata_height = "";
				* Sensor embedded metadata height in units of rows.
				* If sensor does not support embedded metadata value should be 0.
				*/
				mode0 { /* IMX219_MODE_3280x2464_21FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "3280";
					active_h = "2464";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3448";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "182400000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "21000000"; /* 21.0 fps */
					step_framerate = "1";
					default_framerate = "21000000"; /* 21.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};
				mode1 { /* IMX219_MODE_3280x1848_28FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "3280";
					active_h = "1848";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3448";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "182400000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "28000000"; /* 28.0 fps */
					step_framerate = "1";
					default_framerate = "28000000"; /* 28.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};
				mode2 { /* IMX219_MODE_1920x1080_30FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "1920";
					active_h = "1080";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3448";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "182400000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "30000000"; /* 30.0 fps */
					step_framerate = "1";
					default_framerate = "30000000"; /* 30.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};

				mode3 { /* IMX219_MODE_1640x1232_30FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "1640";
					active_h = "1232";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3448";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "182400000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "30000000"; /* 60.0 fps */
					step_framerate = "1";
					default_framerate = "30000000"; /* 60.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};

				mode4 { /* IMX219_MODE_1280x720_60FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "1280";
					active_h = "720";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3448";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "182400000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "60000000"; /* 60.0 fps */
					step_framerate = "1";
					default_framerate = "60000000"; /* 60.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};
				
				mode5 {  /* IMX219_MODE_1280x720_120FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "1280";
					active_h = "720";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3560";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "169600000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; // 1.00x
					max_gain_val = "170"; // 10.66x
					step_gain_val = "1";
					default_gain = "16"; // 1.00x
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; // 2.0 fps
					max_framerate = "120000000"; // 120.0 fps
					step_framerate = "1";
					default_framerate = "120000000"; // 120.0 fps
					min_exp_time = "13"; // us
					max_exp_time = "683709"; // us
					step_exp_time = "1";
					default_exp_time = "2495"; // us

					embedded_metadata_height = "2";
				};
				

				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						rbpcv2_imx219_out0: endpoint {
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&rbpcv2_imx219_csi_in0>;
						};
					};
				};
			};
		};
		i2c_1: i2c@1 {
			imx219_cam1: rbpcv2_imx219_c@10 {
				compatible = "sony,imx219";
				/* I2C device address */
				reg = <0x10>;

				/* V4L2 device node location */
				devnode = "video1";

				/* Physical dimensions of sensor */
				physical_w = "3.680";
				physical_h = "2.760";

				sensor_model = "imx219";

				use_sensor_mode_id = "true";

				/**
				* ==== Modes ====
				* A modeX node is required to support v4l2 driver
				* implementation with NVIDIA camera software stack
				*
				* == Signal properties ==
				*
				* phy_mode = "";
				* PHY mode used by the MIPI lanes for this device
				*
				* tegra_sinterface = "";
				* CSI Serial interface connected to tegra
				* Incase of virtual HW devices, use virtual
				* For SW emulated devices, use host
				*
				* pix_clk_hz = "";
				* Sensor pixel clock used for calculations like exposure and framerate
				*
				* readout_orientation = "0";
				* Based on camera module orientation.
				* Only change readout_orientation if you specifically
				* Program a different readout order for this mode
				*
				* == Image format Properties ==
				*
				* active_w = "";
				* Pixel active region width
				*
				* active_h = "";
				* Pixel active region height
				*
				* pixel_t = "";
				* The sensor readout pixel pattern
				*
				* line_length = "";
				* Pixel line length (width) for sensor mode.
				*
				* == Source Control Settings ==
				*
				* Gain factor used to convert fixed point integer to float
				* Gain range [min_gain/gain_factor, max_gain/gain_factor]
				* Gain step [step_gain/gain_factor is the smallest step that can be configured]
				* Default gain [Default gain to be initialized for the control.
				*     use min_gain_val as default for optimal results]
				* Framerate factor used to convert fixed point integer to float
				* Framerate range [min_framerate/framerate_factor, max_framerate/framerate_factor]
				* Framerate step [step_framerate/framerate_factor is the smallest step that can be configured]
				* Default Framerate [Default framerate to be initialized for the control.
				*     use max_framerate to get required performance]
				* Exposure factor used to convert fixed point integer to float
				* For convenience use 1 sec = 1000000us as conversion factor
				* Exposure range [min_exp_time/exposure_factor, max_exp_time/exposure_factor]
				* Exposure step [step_exp_time/exposure_factor is the smallest step that can be configured]
				* Default Exposure Time [Default exposure to be initialized for the control.
				*     Set default exposure based on the default_framerate for optimal exposure settings]
				*
				* gain_factor = ""; (integer factor used for floating to fixed point conversion)
				* min_gain_val = ""; (ceil to integer)
				* max_gain_val = ""; (ceil to integer)
				* step_gain_val = ""; (ceil to integer)
				* default_gain = ""; (ceil to integer)
				* Gain limits for mode
				*
				* exposure_factor = ""; (integer factor used for floating to fixed point conversion)
				* min_exp_time = ""; (ceil to integer)
				* max_exp_time = ""; (ceil to integer)
				* step_exp_time = ""; (ceil to integer)
				* default_exp_time = ""; (ceil to integer)
				* Exposure Time limits for mode (sec)
				*
				* framerate_factor = ""; (integer factor used for floating to fixed point conversion)
				* min_framerate = ""; (ceil to integer)
				* max_framerate = ""; (ceil to integer)
				* step_framerate = ""; (ceil to integer)
				* default_framerate = ""; (ceil to integer)
				* Framerate limits for mode (fps)
				*
				* embedded_metadata_height = "";
				* Sensor embedded metadata height in units of rows.
				* If sensor does not support embedded metadata value should be 0.
				*/
				mode0 { /* IMX219_MODE_3280x2464_21FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_c";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "3280";
					active_h = "2464";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3448";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "182400000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "21000000"; /* 21.0 fps */
					step_framerate = "1";
					default_framerate = "21000000"; /* 21.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};
				mode1 { /* IMX219_MODE_3280x1848_28FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_c";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "3280";
					active_h = "1848";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3448";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "182400000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "28000000"; /* 28.0 fps */
					step_framerate = "1";
					default_framerate = "28000000"; /* 28.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};
				mode2 { /* IMX219_MODE_1920x1080_30FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_c";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "1920";
					active_h = "1080";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3448";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "182400000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "30000000"; /* 30.0 fps */
					step_framerate = "1";
					default_framerate = "30000000"; /* 30.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};
				mode3 { /* IMX219_MODE_1640x1232_30FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_c";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "1640";
					active_h = "1232";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3448";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "182400000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "30000000"; /* 60.0 fps */
					step_framerate = "1";
					default_framerate = "30000000"; /* 60.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};
				mode4 { /* IMX219_MODE_1280x720_60FPS */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_c";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "1280";
					active_h = "720";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3448";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "182400000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "60000000"; /* 60.0 fps */
					step_framerate = "1";
					default_framerate = "60000000"; /* 60.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};
				
				mode5 { // IMX219_MODE_1280x720_120FPS
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_c";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "1280";
					active_h = "720";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "3560";
					inherent_gain = "1";
					mclk_multiplier = "9.33";
					pix_clk_hz = "169600000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; // 1.00x
					max_gain_val = "170"; // 10.66x
					step_gain_val = "1";
					default_gain = "16"; // 1.00x
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; // 2.0 fps
					max_framerate = "120000000"; // 120.0 fps
					step_framerate = "1";
					default_framerate = "120000000"; // 120.0 fps
					min_exp_time = "13"; // us
					max_exp_time = "683709"; // us
					step_exp_time = "1";
					default_exp_time = "2495"; // us

					embedded_metadata_height = "2";
				};
				

				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						rbpcv2_imx219_out1: endpoint {
							status = "okay";
							port-index = <2>;
							bus-width = <2>;
							remote-endpoint = <&rbpcv2_imx219_csi_in1>;
						};
					};
				};
			};
		};
	};

	lens_imx219@RBPCV2 {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "3.04";
		f_number = "2.0";
		aperture = "0.0";
	};
};
/ {
	tcp: 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
		*
		* 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 = <4>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <240000>;
		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 vendor.
		 */
		modules {
			cam_module0: module0 {
				badge = "jakku_front_RBP194";
				position = "front";
				orientation = "1";
				cam_module0_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 9-0010";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10";
				};
				cam_module0_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/";
				};
			};
			cam_module1: module1 {
				badge = "jakku_rear_RBP194";
				position = "rear";
				orientation = "1";
				cam_module1_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 10-0010";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_imx219_c@10";
				};
				cam_module1_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/";
				};
			};
		};
	};
};
kernel/nvidia/drivers/media/i2c/imx219_mode_tbls.h
/*
 * imx219_tables.h - sensor mode tables for imx219 HDR sensor.
 *
 * Copyright (c) 2015-2022, NVIDIA CORPORATION & AFFILIATES.All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope 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 <http://www.gnu.org/licenses/>.
 */

#ifndef __IMX219_I2C_TABLES__
#define __IMX219_I2C_TABLES__

#define IMX219_TABLE_WAIT_MS	0
#define IMX219_TABLE_END	1

#define imx219_reg struct reg_8

static imx219_reg imx219_start_stream[] = {
	{0x0100, 0x01},
	{IMX219_TABLE_WAIT_MS, 3},
	{IMX219_TABLE_END, 0x00}
};

static imx219_reg imx219_stop_stream[] = {
	{0x0100, 0x00},
	{IMX219_TABLE_END, 0x00}
};

static imx219_reg imx219_mode_common[] = {
	/* software reset */
	{0x0103, 0x01},
	{IMX219_TABLE_WAIT_MS, 10},
	/* sensor config */
	{0x0114, 0x01}, /* D-Phy, 2-lane */
	{0x0128, 0x00},
	{0x012A, 0x18}, /* 24 MHz INCK */
	{0x012B, 0x00},
	/* access code - vendor addr. ranges */
	{0x30EB, 0x05},
	{0x30EB, 0x0C},
	{0x300A, 0xFF},
	{0x300B, 0xFF},
	{0x30EB, 0x05},
	{0x30EB, 0x09},
	/* cis tuning */
	{0x455E, 0x00},
	{0x471E, 0x4B},
	{0x4767, 0x0F},
	{0x4750, 0x14},
	{0x4540, 0x00},
	{0x47B4, 0x14},
	{0x4713, 0x30},
	{0x478B, 0x10},
	{0x478F, 0x10},
	{0x4793, 0x10},
	{0x4797, 0x0E},
	{0x479B, 0x0E},
	{IMX219_TABLE_END, 0x00}
};

static imx219_reg imx219_mode_3280x2464_21fps[] = {
	/* capture settings */
	{0x0157, 0x00}, /* ANALOG_GAIN_GLOBAL[7:0] */
	{0x015A, 0x09}, /* COARSE_INTEG_TIME[15:8] */
	{0x015B, 0xbd}, /* COARSE_INTEG_TIME[7:0] */
	/* format settings */
	{0x0160, 0x09}, /* FRM_LENGTH[15:8] */
	{0x0161, 0xC1}, /* FRM_LENGTH[7:0] */
	{0x0162, 0x0D}, /* LINE_LENGTH[15:8] */
	{0x0163, 0x78}, /* LINE_LENGTH[7:0] */
	{0x0164, 0x00},
	{0x0165, 0x00},
	{0x0166, 0x0C},
	{0x0167, 0xCF},
	{0x0168, 0x00},
	{0x0169, 0x00},
	{0x016A, 0x09},
	{0x016B, 0x9F},
	{0x016C, 0x0C},
	{0x016D, 0xD0},
	{0x016E, 0x09},
	{0x016F, 0xA0},
	{0x0170, 0x01},
	{0x0171, 0x01},
	{0x0174, 0x00},
	{0x0175, 0x00},
	{0x018C, 0x0A},
	{0x018D, 0x0A},
	/* clock dividers */
	{0x0301, 0x05},
	{0x0303, 0x01},
	{0x0304, 0x03},
	{0x0305, 0x03},
	{0x0306, 0x00},
	{0x0307, 0x39},
	{0x0309, 0x0A},
	{0x030B, 0x01},
	{0x030C, 0x00},
	{0x030D, 0x72},
	{IMX219_TABLE_END, 0x00}
};

static imx219_reg imx219_mode_3280x1848_28fps[] = {
	/* capture settings */
    {0x0157, 0x00}, /* ANALOG_GAIN_GLOBAL[7:0] */
	{0x015A, 0x07}, /* COARSE_INTEG_TIME[15:8] */
	{0x015B, 0x55}, /* COARSE_INTEG_TIME[7:0] */
	/* format settings */
    {0x0160, 0x07}, /* FRM_LENGTH[15:8] */
    {0x0161, 0x59}, /* FRM_LENGTH[7:0] */
    {0x0162, 0x0D}, /* LINE_LENGTH[15:8] */
    {0x0163, 0x78}, /* LINE_LENGTH[7:0] */
    {0x0164, 0x00},
    {0x0165, 0x00},
    {0x0166, 0x0C},
    {0x0167, 0xCF},
    {0x0168, 0x01},
    {0x0169, 0x34},
    {0x016A, 0x08},
    {0x016B, 0x6B},
    {0x016C, 0x0C},
    {0x016D, 0xD0},
    {0x016E, 0x07},
    {0x016F, 0x38},
    {0x0170, 0x01},
    {0x0171, 0x01},
    {0x0174, 0x00},
    {0x0175, 0x00},
    {0x018C, 0x0A},
    {0x018D, 0x0A},
	/* clocks dividers */
    {0x0301, 0x05},
    {0x0303, 0x01},
    {0x0304, 0x03},
    {0x0305, 0x03},
    {0x0306, 0x00},
    {0x0307, 0x39},
    {0x0309, 0x0A},
    {0x030B, 0x01},
    {0x030C, 0x00},
    {0x030D, 0x72},
	{IMX219_TABLE_END, 0x00}
};

static imx219_reg imx219_mode_1920x1080_30fps[] = {
	/* capture settings */
    {0x0157, 0x00}, /* ANALOG_GAIN_GLOBAL[7:0] */
	{0x015A, 0x06}, /* COARSE_INTEG_TIME[15:8] */
	{0x015B, 0xde}, /* COARSE_INTEG_TIME[7:0] */
	/* format settings */
    {0x0160, 0x06}, /* FRM_LENGTH[15:8] */
    {0x0161, 0xE2}, /* FRM_LENGTH[7:0] */
    {0x0162, 0x0D}, /* LINE_LENGTH[15:8] */
    {0x0163, 0x78}, /* LINE_LENGTH[7:0] */
    {0x0164, 0x02},
    {0x0165, 0xA8},
    {0x0166, 0x0A},
    {0x0167, 0x27},
    {0x0168, 0x02},
    {0x0169, 0xB4},
    {0x016A, 0x06},
    {0x016B, 0xEB},
    {0x016C, 0x07},
    {0x016D, 0x80},
    {0x016E, 0x04},
    {0x016F, 0x38},
    {0x0170, 0x01},
    {0x0171, 0x01},
    {0x0174, 0x00},
    {0x0175, 0x00},
    {0x018C, 0x0A},
    {0x018D, 0x0A},
	/* clocks dividers */
    {0x0301, 0x05},
    {0x0303, 0x01},
    {0x0304, 0x03},
    {0x0305, 0x03},
    {0x0306, 0x00},
    {0x0307, 0x39},
    {0x0309, 0x0A},
    {0x030B, 0x01},
    {0x030C, 0x00},
    {0x030D, 0x72},
	{IMX219_TABLE_END, 0x00}
};

static imx219_reg imx219_mode_1640x1232_30fps[] = {
	/* capture settings */
	{0x0157, 0x00}, /* ANALOG_GAIN_GLOBAL[7:0] */
	{0x015A, 0x06}, /* COARSE_INTEG_TIME[15:8] */
	{0x015B, 0xA8}, /* COARSE_INTEG_TIME[7:0] */
	/* format settings */
	{0x0160, 0x06}, /* FRM_LENGTH[15:8] */
	{0x0161, 0xE2}, /* FRM_LENGTH[7:0] */
	{0x0162, 0x0D}, /* LINE_LENGTH[15:8] */
	{0x0163, 0x78}, /* LINE_LENGTH[7:0] */
	{0x0164, 0x00},
	{0x0165, 0x00},
	{0x0166, 0x0C},
	{0x0167, 0xCF},
	{0x0168, 0x00},
	{0x0169, 0x00},
	{0x016A, 0x09},
	{0x016B, 0x9F},
	{0x016C, 0x06},
	{0x016D, 0x68},
	{0x016E, 0x04},
	{0x016F, 0xD0},
	{0x0170, 0x01},
	{0x0171, 0x01},
	{0x0174, 0x01},
	{0x0175, 0x01},
	{0x018C, 0x0A},
	{0x018D, 0x0A},
	/* clocks dividers */
	{0x0301, 0x05},
	{0x0303, 0x01},
	{0x0304, 0x03},
	{0x0305, 0x03},
	{0x0306, 0x00},
	{0x0307, 0x39},
	{0x0309, 0x0A},
	{0x030B, 0x01},
	{0x030C, 0x00},
	{0x030D, 0x72},
	{IMX219_TABLE_END, 0x00}
};

static imx219_reg imx219_mode_1280x720_60fps[] = {
	/* capture settings */
    {0x0157, 0x00}, /* ANALOG_GAIN_GLOBAL[7:0] */
	{0x015A, 0x03}, /* COARSE_INTEG_TIME[15:8] */
	{0x015B, 0x6c}, /* COARSE_INTEG_TIME[7:0] */
	/* format settings */
    {0x0160, 0x03}, /* FRM_LENGTH[15:8] */
    {0x0161, 0x70}, /* FRM_LENGTH[7:0] */
    {0x0162, 0x0D}, /* LINE_LENGTH[15:8] */
    {0x0163, 0x78}, /* LINE_LENGTH[7:0] */
    {0x0164, 0x01},
    {0x0165, 0x68},
    {0x0166, 0x0B},
    {0x0167, 0x67},
    {0x0168, 0x02},
    {0x0169, 0x00},
    {0x016A, 0x07},
    {0x016B, 0x9F},
    {0x016C, 0x05},
    {0x016D, 0x00},
    {0x016E, 0x02},
    {0x016F, 0xD0},
    {0x0170, 0x01},
    {0x0171, 0x01},
    {0x0174, 0x01},
    {0x0175, 0x01},
    {0x018C, 0x0A},
    {0x018D, 0x0A},
	/* clocks dividers */
    {0x0301, 0x05},
    {0x0303, 0x01},
    {0x0304, 0x03},
    {0x0305, 0x03},
    {0x0306, 0x00},
    {0x0307, 0x39},
    {0x0309, 0x0A},
    {0x030B, 0x01},
    {0x030C, 0x00},
    {0x030D, 0x72},
	{IMX219_TABLE_END, 0x00}
};


static imx219_reg imx219_mode_1280x720_120fps[] = {
	// capture settings
	{0x0157, 0x00}, // ANALOG_GAIN_GLOBAL[7:0]
	{0x015A, 0x01}, // COARSE_INTEG_TIME[15:8]
	{0x015B, 0x85}, // COARSE_INTEG_TIME[7:0]
	// format settings
	{0x0160, 0x01}, // FRM_LENGTH[15:8]
	{0x0161, 0x89}, // FRM_LENGTH[7:0]
	{0x0162, 0x0D}, // LINE_LENGTH[15:8]
	{0x0163, 0xE8}, // LINE_LENGTH[7:0]
	{0x0164, 0x01},
	{0x0165, 0x68},
	{0x0166, 0x0B},
	{0x0167, 0x67},
	{0x0168, 0x02},
	{0x0169, 0x00},
	{0x016A, 0x07},
	{0x016B, 0x9F},
	{0x016C, 0x05},
	{0x016D, 0x00},
	{0x016E, 0x02},
	{0x016F, 0xD0},
	{0x0170, 0x01},
	{0x0171, 0x01},
	{0x0174, 0x03},
	{0x0175, 0x03},
	{0x018C, 0x0A},
	{0x018D, 0x0A},
	// clocks dividers
	{0x0301, 0x05},
	{0x0303, 0x01},
	{0x0304, 0x03},
	{0x0305, 0x03},
	{0x0306, 0x00},
	{0x0307, 0x35},
	{0x0309, 0x0A},
	{0x030B, 0x01},
	{0x030C, 0x00},
	{0x030D, 0x66},
	{IMX219_TABLE_END, 0x00}
};

enum {
	IMX219_MODE_3280x2464_21FPS,
	IMX219_MODE_3280x1848_28FPS,
	IMX219_MODE_1920x1080_30FPS,
	IMX219_MODE_1640x1232_30FPS,
	IMX219_MODE_1280x720_60FPS,
	IMX219_MODE_1280x720_120FPS,

	IMX219_MODE_COMMON,
	IMX219_START_STREAM,
	IMX219_STOP_STREAM,
};

static imx219_reg *mode_table[] = {
	[IMX219_MODE_3280x2464_21FPS] = imx219_mode_3280x2464_21fps,
	[IMX219_MODE_3280x1848_28FPS] = imx219_mode_3280x1848_28fps,
	[IMX219_MODE_1920x1080_30FPS] = imx219_mode_1920x1080_30fps,
	[IMX219_MODE_1640x1232_30FPS] = imx219_mode_1640x1232_30fps,
	[IMX219_MODE_1280x720_60FPS] = imx219_mode_1280x720_60fps,
	[IMX219_MODE_1280x720_120FPS] = imx219_mode_1280x720_120fps,

	[IMX219_MODE_COMMON]  = imx219_mode_common,
	[IMX219_START_STREAM]  = imx219_start_stream,
	[IMX219_STOP_STREAM]  = imx219_stop_stream,
};

static const int imx219_21fps[] = {
	21,
};

static const int imx219_28fps[] = {
	28,
};

static const int imx219_30fps[] = {
	30,
};

static const int imx219_60fps[] = {
	60,
};

static const int imx219_120fps[] = {
	120,
};



/*
 * WARNING: frmfmt ordering need to match mode definition in
 * device tree!
 */
static const struct camera_common_frmfmt imx219_frmfmt[] = {
	{{3280, 2464},	imx219_21fps, 1, 0, IMX219_MODE_3280x2464_21FPS},
	/* Add modes with no device tree support after below */
	{{3280, 1848},	imx219_28fps, 1, 0, IMX219_MODE_3280x1848_28FPS},
	{{1920, 1080},	imx219_30fps, 1, 0, IMX219_MODE_1920x1080_30FPS},
	{{1640, 1232},	imx219_30fps, 1, 0, IMX219_MODE_1640x1232_30FPS},
	{{1280, 720},	imx219_60fps, 1, 0, IMX219_MODE_1280x720_60FPS},
	{{1280, 720},	imx219_120fps, 1, 0, IMX219_MODE_1280x720_120FPS},
};

#endif /* __IMX219_I2C_TABLES__ */

Another important point is that I have no idea why I was setting LOCAL_VERSION with env, but this doesn"t work for me now…So after

make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig

You would edit $TEGRA_KERNEL_OUT/.config, find LOCAL_VERSION and if it is an empty or different string set it to “-test” and rebuild kernel image, modules and dtb and reinstall these.

After rebooting into the test entry from extlinux.conf, you may check the running kernel and device-tree, and test from gstreamer or v4l2 only:

# Check running kernel
uname -a

# Check running device tree for new mode5
for curNode in `ls /proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10/mode5/*`;do echo $curNode; cat $curNode; echo; done

# Try from gstreamer with argus:
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),format=NV12,width=1280,height=720,framerate=120/1' ! queue ! fpsdisplaysink text-overlay=0 video-sink=fakesink -v

# Or just from V4L:
v4l2-ctl -d0 --set-ctrl=bypass_mode=0,sensor_mode=5 --set-fmt-video=width=1280,height=720,pixelformat=RG10 --stream-mmap

Hi Alejandro and ShaneCCC,
thank you so much for your detile reply, that help alot for us.
yes, first I did “I would recommend you to rename your custom file tegra194-p3668-all-p3509-0000-fps120.dtb to the name of the DTB file shown by the command sudo dmesg | grep DTS, to make sure that it is being replaced.”
I replaced the DTS in the original kernel source file, and then flashed into EMMC with NVIDIA SDK Manager, so that the new DTS can be used, but the system cannot find /dev/video0, I’m guessing this is because DTS not matched with new kernel. So that method does not work for us.
And we also try “sudo ./flash -r -k jetson-agx-xavier-devkit mmcblk0p1” our jetson is xavier NX, so we change command to sudo ./flash -r -k jetson-xavier-nx-devkit mmcblk0p1, but got error


after that we try other way
we will do following test:

  1. Update the latest NVIDIA SDK Manager and use jetpacked 5.1.1
  2. Do not modify the kernel source but only flash into Emmc
  3. copy DTS, image and /lib/modules/ in EMMC system with “120 fps mode support removed for imx219 sensor” guide
  4. if EMMC system 120 FPS for imx219 working
  5. Flash the system from EMMC to SSD.
    I will gave the feedback for this.

Sorry lost the kernel-dtb after -r parameter.
Should be like below.

sudo ./flash -r -k kernel-dtb jetson-xxxx mmcblk0p1

HI shaneCCC,
looks like "sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit mmcblk0p1
" still not wokring for us, we run this command on VMware ubuntu os, already install nvidia sdkManager, connected with USB from jetson, but this flash.sh stuck at a bad loop
图片
we also try rebuild kernel on EMMC, it’s still failed because not enught space.
I’m sure the system on EMMC is working,but we can’t rebuild kernel in there.

Hi Honey,
Many thanks for your reply, it’s aleay very useful for your " 120 fps mode support removed for imx219 sensor" guide .
my issue is device-tree not working on my SSD sysetem, that means on SSD sysetem extlinux.conf not working. but on EMMC extlinux.conf is working, but we can’t rebuild kernel on EMMC becuase the space issue !@_@!

My guide was for installing into eMMC from Linux running from eMMC. If you’re getting short in available disk room, you may also build the kernel and dtb into an external disk having a partition with ext4 filesystem, so you’ll just need room for kernel image and dtb in eMMC.

Also note if you’re booting linux from SSD through extinux.conf that in most cases (with JP5 it may be different if you’ve flashed into SSD) extlinux.conf is running from eMMC, so the /boot files in extlinux.conf are the ones from eMMC Linux partition.

I’d suggest that in eMMC linux you create at root a folder named boot.SSD that will host your SSD boot conf (the idea here is to keep /boot safe for always being able to boot from eMMC). You may try with just a copy of eMMC /boot directory.

Then you would install your custom test kernel image and dtb into eMMC /boot.SSD, adjust your eMMC extlinux.conf test entry to get kernel and dtb from /boot.SSD rather than /boot.
Modules would be copied into SSD /lib/modules directory (and would be found there by your kernel if ssd is specified as root in kernel boot args for your extlinux.conf entry).

hi Honey, it’s finally works.


图片

there is my step:

  1. first build kernel in SSD, in this case just use SSD space to build new kernel
  2. used Nvidia SDKManager flash system, let system working back to EMMC.
  3. used "sudo mount /dev/nvme0n1p1 /mnt " mount the SSD space, so we have the step 1 new kernel
  4. copy dtb and modules from SSD to EMMC, it’s better not change name or folder name, just replace old dtb and modules, after that flash this EMMC to SSD

many thanks for your help !
Honey , ShaneCCC, Alejandro

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.