Can not boot up after update dtb

Hi forum,

I’m using jetson xavier, jetpack version is 4.4.

I tried to enable imx390 camera driver on xavier to support 8 cameras. Our hardware did not use mux. (So I did not find any example to modify the dtsi) And I tried to make it as a loadable module. But it just stuck after reading the dtb I replaced, which has a error, FDT_ERR_BADSTURCTURE.

[0009.204] I> Validate kernel-dtb ...
[0009.204] I> T19x: Authenticate kernel-dtb (bin_type: 38), max size 0x400000
[0009.207] E> digest on binary did not match!!
[0009.208] C> OEM authentication of kernel-dtb payload failed!
[0009.208] W> Failed to validate kernel-dtb binary (err=1077936152, fail=0)
[0009.209] W> Security fuse not burned, ignore validation failure
[0009.212] I> Loading ramdisk from rootfs ...
[0009.216] I> rootfs path: /sdmmc_user/boot/initrd
[0009.274] I> Kernel hdr @0xa4ac0000
[0009.275] I> Kernel dtb @0x90000000
[0009.275] I> decompressor handler not found
[0009.275] I> Copying kernel image (34334736 bytes) from 0xa4ac0000 to 0x80080000 ... [0009.285] I> Done
[0009.286] W> "bpmp" doesn't exist, creating
[0009.287] I> Updated bpmp info to DTB
[0009.287] W> "chosen" doesn't exist, creating
[0009.288] I> Ramdisk: Base: 0x91000000; Size: 0x54ecaf
[0009.288] I> Updated initrd info to DTB
[0009.290] W> WARN: Fail to override "console=none" in commandline
[0009.296] E> tegrabl_linuxboot_add_disp_param, du 1 failed to get display params
[0009.303] E> tegrabl_linuxboot_add_disp_param, du 1 failed to get display params
[0009.310] W> No valid slot number is found in scratch register
[0009.316] W> Return default slot: _a
[0009.319] I> Active slot suffix: 
[0009.322] I> add_boot_slot_suffix: slot_suffix = 
[0009.327] I> Linux Cmdline: video=tegrafb no_console_suspend=1 earlycon=tegra_comb_uart,mmio32,0x0c168000 gpt tegra_fbmem=0x800000@0xa069c000 lut_mem=0x2008@0xa0696000 usbcore.old_scheme_first=1 tegraid=19.1.2.0.0 maxcpus=8 boot.slot_suffix= boot.ratchetvalues=0.4.2 vpr_resize sdhci_tegra.en_boot_part_access=1 
[0009.355] I> Updated bootarg info to DTB
[0009.358] W> MAC addr invalid!
[0009.361] E> Failed to get WIFI MAC address
[0009.365] W> MAC addr invalid!
[0009.368] E> Failed to get Bluetooth MAC address
[0009.373] I> eeprom_get_mac_addr: MAC (type: 2): 48:b0:2d:13:4c:69
[0009.379] W> "plugin-manager" doesn't exist, creating
[0009.384] I> Adding /chosen/plugin-manager/cvm
[0009.388] W> "chip-id" doesn't exist, creating
[0009.392] I> Adding /chosen/plugin-manager/chip-id
[0009.397] W> "configs" doesn't exist, creating
[0009.401] I> Adding /chosen/plugin-manager/configs
[0009.406] W> "ids" doesn't exist, creating
[0009.410] I> Adding /chosen/plugin-manager/ids
[0009.414] W> "odm-data" doesn't exist, creating
[0009.419] I> Adding /chosen/plugin-manager/odm-data
[0009.425] W> "memory" doesn't exist, creating
[0009.427] I> [0] START: 0x80000000, END: 0xac000000
[0009.432] I> [1] START: 0xac004000, END: 0xf09d0000
[0009.437] I> [2] START: 0xf09dc000, END: 0xf09e0000
[0009.441] I> dram_block larger than 80000000
[0009.446] I> [3] START: 0x100000000, END: 0x880000000
[0009.450] I> added [base:0x80000000, size:0x2c000000] to /memory
[0009.456] I> added [base:0xac200000, size:0x44600000] to /memory
[0009.462] I> added [base:0x100000000, size:0x780000000] to /memory
[0009.469] I> Updated memory info to DTB
[0009.472] W> "reserved-memory" doesn't exist, creating
[0009.477] W> "fb0_carveout" doesn't exist, creating
[0009.482] E> add_disp_param: failed to get display params for du=1
[0009.488] W> "reset" doesn't exist, creating
[0009.492] W> "cpus" doesn't exist, creating
[0009.496] E> Couldn't find #address-cells for /cpus
[0009.500] E> tegrabl_linuxboot_update_dtb: 0xa063e0f4 failed
[0009.506] E> Error (724238349) extracting the kernel DTB
[0009.511] E> kernel boot failed

I changed the name of the module, because I don’t want to modify the Image, but only modify dtb.

Do anyone have ideas about how to modify the dtsi?

For now, I am testing my modification based only on 2 cams. I modified my dtsi as this : tegra194-p2822-0000-camera-imx996-a00.dtsi

#include <t19x-common-modules/tegra194-camera-imx996-a00.dtsi>
#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)

/ {

i2c@3180000 {
	imx996_a@41 {
		def-addr = <0x1a>;
		clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>,
				<&bpmp_clks TEGRA194_CLK_EXTPERIPH1>;
		clock-names = "extperiph1", "pllp_grtba";
		mclk = "extperiph1";
		reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
		pwdn-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
		vana-supply = <&p2822_avdd_cam_2v8>;
		vif-supply = <&p2822_vdd_1v8_cvb>;
	};
	imx996_b@42 {
		def-addr = <0x1a>;
		clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>,
				<&bpmp_clks TEGRA194_CLK_EXTPERIPH1>;
		clock-names = "extperiph1", "pllp_grtba";
		mclk = "extperiph1";
		reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
		pwdn-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
		vana-supply = <&p2822_avdd_cam_2v8>;
		vif-supply = <&p2822_vdd_1v8_cvb>;
	};
};
};

and the tegra194-camera-imx996-a00.dtsi

/ {
host1x {
	vi@15c10000 {
		num-channels = <2>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				imx996_vi_in0: endpoint {
					vc-id = <0>;
					port-index = <0>;
					bus-width = <4>;
					remote-endpoint = <&imx996_csi_out0>;
				};
			};
			port@1 {
				reg = <1>;
				imx996_vi_in1: endpoint {
					vc-id = <1>;
					port-index = <0>;
					bus-width = <4>;
					remote-endpoint = <&imx996_csi_out1>;
				};
			};
		};
	};

	nvcsi@15a00000 {
		num-channels = <2>;
		#address-cells = <1>;
		#size-cells = <0>;
		channel@0 {
			reg = <0>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx996_csi_in0: endpoint@0 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx996_imx996_out0>;
					};
				};
				port@1 {
					reg = <1>;
					imx996_csi_out0: endpoint@1 {
						remote-endpoint = <&imx996_vi_in0>;
					};
				};
			};
		};
		channel@1 {
			reg = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx996_csi_in1: endpoint@2 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx996_imx996_out1>;
					};
				};
				port@1 {
					reg = <1>;
					imx996_csi_out1: endpoint@3 {
						remote-endpoint = <&imx996_vi_in1>;
					};
				};
			};
		};
	};
};

i2c@3180000 {
    imx996_a@41 {
	compatible = "nvidia,imx996";
	/* I2C device address */
	reg = <0x41>;

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

	/* Physical dimensions of sensor */
	physical_w = "3.674";
	physical_h = "2.738";

	sensor_model = "imx390";

	delayed_gain = "true";
	mode0 { // imx996_MODE_1920X1080
		mclk_khz = "24000";
		num_lanes = "4";
		tegra_sinterface = "serial_a";
		phy_mode = "DPHY";
		vc_id = "0";
		discontinuous_clk = "no";
		dpcm_enable = "false";
		cil_settletime = "0";
		dynamic_pixel_bit_depth = "12";
		csi_pixel_bit_depth = "12";
		mode_type = "bayer";
		pixel_phase = "rggb";

		active_w = "1936";
		active_h = "1100";
		readout_orientation = "0";
		line_length = "2200";
		inherent_gain = "1";
		mclk_multiplier = "25";
		pix_clk_hz = "74250000";
		serdes_pix_clk_hz = "833333333";

		gain_factor = "10";
		min_gain_val = "0"; /* dB */
		max_gain_val = "300"; /* dB */
		step_gain_val = "3"; /* 0.3 */
		default_gain = "0";
		min_hdr_ratio = "1";
		max_hdr_ratio = "1";
		framerate_factor = "1000000";
		min_framerate = "30000000";
		max_framerate = "30000000";
		step_framerate = "1";
		default_framerate = "30000000";
		exposure_factor = "1000000";
		min_exp_time = "10"; /*us, 2 lines*/
		max_exp_time = "33333";
		step_exp_time = "1";
		default_exp_time = "33333";/* us */
		embedded_metadata_height = "1";
	};
	ports {
		#address-cells = <1>;
		#size-cells = <0>;
		port@0 {
			reg = <0>;
			imx996_imx996_out0: endpoint {
				vc-id = <0>;
				port-index = <0>;
				bus-width = <4>;
				remote-endpoint = <&imx996_csi_in0>;
				};
			};
		};
	};
	imx996_b@42 {
	compatible = "nvidia,imx996";
	/* I2C device address */
	reg = <0x42>;

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

	/* Physical dimensions of sensor */
	physical_w = "3.674";
	physical_h = "2.738";

	sensor_model = "imx390";
	delayed_gain = "true";
	
	mode0 { // imx996_MODE_1920X1080
		mclk_khz = "24000";
		num_lanes = "4";
		tegra_sinterface = "serial_a";
		phy_mode = "DPHY";
		vc_id = "1";
		discontinuous_clk = "no";
		dpcm_enable = "false";
		cil_settletime = "0";
		dynamic_pixel_bit_depth = "12";
		csi_pixel_bit_depth = "12";
		mode_type = "bayer";
		pixel_phase = "rggb";

		active_w = "1936";
		active_h = "1100";
		readout_orientation = "0";
		line_length = "2200";
		inherent_gain = "1";
		mclk_multiplier = "25";
		pix_clk_hz = "74250000";
		serdes_pix_clk_hz = "833333333";

		gain_factor = "10";
		min_gain_val = "0"; /* dB */
		max_gain_val = "300"; /* dB */
		step_gain_val = "3"; /* 0.3 */
		default_gain = "0";
		min_hdr_ratio = "1";
		max_hdr_ratio = "1";
		framerate_factor = "1000000";
		min_framerate = "30000000";
		max_framerate = "30000000";
		step_framerate = "1";
		default_framerate = "30000000";
		exposure_factor = "1000000";
		min_exp_time = "10"; /*us, 2 lines*/
		max_exp_time = "33333";
		step_exp_time = "1";
		default_exp_time = "33333";/* us */
		embedded_metadata_height = "1";
	};
	ports {
		#address-cells = <1>;
		#size-cells = <0>;
		port@0 {
			reg = <0>;
			imx996_imx996_out1: endpoint {
				vc-id = <1>;
				port-index = <0>;
				bus-width = <4>;
				remote-endpoint = <&imx996_csi_in1>;
				};
			};
		};
	};
};
};



/ {

tegra-camera-platform {
	compatible = "nvidia, tegra-camera-platform";
	
	num_csi_lanes = <4>;
	max_lane_speed = <2000000>;
	min_bits_per_pixel = <10>;
	vi_peak_byte_per_pixel = <2>;
	vi_bw_margin_pct = <25>;
	max_pixel_rate = <750000>;
	isp_peak_byte_per_pixel = <5>;
	isp_bw_margin_pct = <25>;

	modules {
		module0 {
			badge = "imx996_rear_liimx996";
			position = "rear";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "imx996 2-0041";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx996_a@41";
			};
		};
		module2 {
			badge = "imx996_topright_liimx996";
			position = "topright";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "imx996 2-0043";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx996_c@43";
			};
		};
	};
    };

hello 346842280,

may I know what’s your use-case,
according to CSI and USB Camera Features, there’s maximum to enable 6-cam preview stream running simultaneously. it’s due to Port Index, there’s only having six stream index of the Video Input unit.

you may also refer to CSI Connectivity for the maximum number of sensor connections supported on each Jetson platform.
if you had Aggregator with ISP, the maximum supported number of camera can increase to 16.
thanks

Hi Jerry. Thanks for the reply

We want to use 8 cameras to cover 360 fov. For now 6 camera is also fine. But I stuck at 2 camera test version, did I miss something in dtsi?

hello 346842280,

are you going to enable virtual channel support?
it looks like you’re having definition to assign two camera to use same CSI port.
for example,

	imx996_a@41 {
		mode0 { // imx996_MODE_1920X1080
			tegra_sinterface = "serial_a";
...
	imx996_b@42 {
		mode0 { // imx996_MODE_1920X1080
			tegra_sinterface = "serial_a";

Hi Jerry.

Yes, I am going to enable virtual channel support

hello 346842280,

I see, here’s developer guide you may refer to, Jetson Virtual Channel with GMSL Camera Framework
thanks

Thanks Jerry.

I managed to make it work, by adding

imx996_a@56 {
		def-addr = <0x1a>;
		/* Define any required hw resources needed by driver */
		/* ie. clocks, io pins, power sources */
		clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>,
				<&bpmp_clks TEGRA194_CLK_EXTPERIPH1>;
		clock-names = "extperiph1", "pllp_grtba";
		mclk = "extperiph1";
        status = "okay"; //what I added
        reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
	};

I don’t know why it worked. I don’t need this line in previous version using i2c mux.

If you guys know why, please do share with me

hello 346842280,

it should be later included device tree to modify the status property,
you may examine the finalize device tree binary, by disassembler the dtb file into text file for confirmation.
thanks