Git Product home page Git Product logo

sdi-mipi-bridge's Introduction

SDI to MIPI CSI-2 bridge

Copyright (c) 2020-2023 Antmicro

Overview

This repository contains the documentation and submodules with all components of Antmicro's open source SDI to MIPI CSI-2 bridge. This device enables connecting industrial and filmmaking cameras and video accessories to edge AI platforms which often include the MIPI CSI-2 interface.

Repository structure

The structure of this repository along with its submodules is

License

Apache-2.0

sdi-mipi-bridge's People

Contributors

jkrzyska avatar kgugala avatar robertszczepanski avatar tmichalak avatar umarcor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdi-mipi-bridge's Issues

Problem with connecting to the Jetson AGX Orin

Hello! Thank you for such great open source project!

Jetson AGX Orin
agx-csi-adapter Rev 1.0.0 7/2022
sdi-mipi-bridge Rev 1.3.0 02/2021

We have integrated drivers code from sdi-mipi-bridge repo into Jetson Linux 35.1
We use this device tree

#include <dt-bindings/media/camera.h>

#define CAMERA_I2C_MUX_BUS(x) (0x1E + x)


/ {
	tegra-capture-vi {
		num-channels = <1>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				gs2971a_vi_in0: endpoint {
					port-index = <4>;
					bus-width = <2>;
					remote-endpoint = <&gs2971a_csi_out0>;
				};
			};
		};
	};


	host1x@13e00000 {
		nvcsi@15a00000 {
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					sdi_mipi_csi_chan0_port0: port@0 {
						reg = <0>;
						gs2971a_csi_in0: endpoint@0 {
							port-index = <4>;
							bus-width = <2>;
							remote-endpoint = <&gs2971a_out0>;
						};
					};
					sdi_mipi_csi_chan0_port1: port@1 {
						reg = <1>;
						gs2971a_csi_out0: endpoint@1 {
							remote-endpoint = <&gs2971a_vi_in0>;
						};
					};
				};
			};
		};
	};

	i2c@3180000 {
		pca9547: pca9547@70 {
			compatible = "nxp,pca9547";
			status = "okay";
			reg = <0x70>;
			#address-cells = <1>;
			#size-cells = <0>;
			vcc-supply = <&battery_reg>;
			force_bus_start = <CAMERA_I2C_MUX_BUS(0)>;

			i2c@3 {
				reg = <3>;
				i2c-mux,deselect-on-exit;
				#address-cells = <1>;
				#size-cells = <0>;
				sc18is603: sc18is603@28 {
					compatible = "nxp,sc18is602b";
					reg = <0x28>;

					#address-cells = <1>;
					#size-cells = <0>;

					nxp,spi-cs-as-gpios = <0 0 1 0>;
					gpio-controller;
					#gpio-cells = <2>;

					gs2971a@0 {
						status = "okay";
						devnode = "video0";
						compatible = "semtech,gs2971a";
						reg = <0x0>;
						spi-max-frequency = <20000000>;

						ports {
							#address-cells = <1>;
							#size-cells = <0>;
							port@0 {
								reg = <0>;
								gs2971a_out0: endpoint {
									port-index = <4>;
									bus-width = <2>;
									remote-endpoint = <&gs2971a_csi_in0>;
								};
							};
						};

						mode0 {
							num_lanes = "2";
							tegra_sinterface = "serial_c";
							discontinuous_clk = "no";
							cil_settletime = "0";
							embedded_metadata_height = "0";

							/* not verified: */
							mclk_khz = "24000";
							phy_mode = "DPHY";
							dpcm_enable = "false";

							active_w = "1280";
							active_h = "720";
							pixel_t = "yuv_uyvy16";
							readout_orientation = "0";
							line_length = "5488";
							inherent_gain = "1";
							mclk_multiplier = "31.25";
							pix_clk_hz = "750000000";

							gain_factor = "16";
							framerate_factor = "1000000";
							exposure_factor = "1000000";
							min_gain_val = "16"; /* 1.0 */
							max_gain_val = "256"; /* 16.0 */
							step_gain_val = "1"; /* 0.125 */
							min_hdr_ratio = "1";
							max_hdr_ratio = "64";
							min_framerate = "1500000"; /* 1.5 */
							max_framerate = "30000000"; /* 30 */
							step_framerate = "1";
							min_exp_time = "34"; /* us */
							max_exp_time = "550385"; /* us */
							step_exp_time = "1";
						};
					};
				};
				fpga0: lattice-crosslink@40 {
					compatible = "lattice,crosslink-fpga-mgr";
					reg = <0x40>;
					reset-gpios = <&sc18is603 2 GPIO_ACTIVE_LOW>;
				};
			};
		};
	};
};

/ {
	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 = <2>;
		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 {
			module0 {
				status = "okay";
				badge = "gs2971a_0";
				position = "front";
				orientation = "1";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "gs2971a 0 2-003c";
					proc-device-tree = "/proc/device-tree/i2c@3180000/gs2971a@3c";
				};
				drivernode1 {
					pcl_id = "v4l2_lens";
				};
			};
		};
	};
};

Problem:
After system load sudo dmesg show these errors

[    8.985232] pca954x 2-0070: supply vcc-pullup not found, using dummy regulator
[    8.992814] pca954x 2-0070: pca954x_probe: forcing device bus number, start 30.
[    9.000887] i2c i2c-2: Added multiplexed i2c bus 30
[    9.006321] i2c i2c-2: Added multiplexed i2c bus 31
[    9.011743] i2c i2c-2: Added multiplexed i2c bus 32
[    9.017754] gs2971a spi8.0: Probing simple sensor
[    9.022662] gs2971a spi8.0: sensor_common_parse_signal_props:csi_pixel_bit_depth property missing.
[    9.031934] gs2971a spi8.0: Failed to read mode0 signal props
[    9.037876] gs2971a spi8.0: Could not initialize sensor properties.
[    9.044356] gs2971a spi8.0: Failed to initialize tegra common!
[    9.050388] gs2971a: probe of spi8.0 failed with error -61
[    9.056976] sc18is602: probe of 33-0028 failed with error -121
[    9.063097] crosslink-i2c 33-0040: Failed to get CRESET_B GPIO: -517
[    9.069681] i2c i2c-2: Added multiplexed i2c bus 33
[    9.075116] i2c i2c-2: Added multiplexed i2c bus 34
[    9.080579] i2c i2c-2: Added multiplexed i2c bus 35
[    9.086000] i2c i2c-2: Added multiplexed i2c bus 36
[    9.091435] i2c i2c-2: Added multiplexed i2c bus 37
[    9.096482] pca954x 2-0070: registered 8 multiplexed busses for I2C mux pca9547

We have tried to use these sdi-mipi configurations
1.
R37 R38 R39 R40 - placed
R41 R42 R85 R86 R87 R94 - not placed
2.
R39 R40 R41 R42 R85 R86 - placed
R37 R38 - not placed
3.
R39 R40 R41 R42 R85 R86 R87 R94 - placed
R37 R38 - not placed

We think that problem in SC18IS602 initialization. For some reason probing of this IC starts when pca9547 probing is not ended. Can you help to resolve this issue?

Also we can confirm that if sdi-mipi is not connected - errors in logs are the same

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.