Hi!
I am working on connecting Raspberry Pi Camera to Jetson TX2 through Auvidea J106 board using CSI E port.
Following Sensor Software Driver Programming Guide I created device tree entry for this camera:
#include "dt-bindings/clock/tegra186-clock.h"
#include <dt-bindings/pinctrl/pinctrl-tegra.h>
#include <dt-bindings/gpio/tegra186-gpio.h>
#define CAM_RST_L TEGRA_MAIN_GPIO(R, 5)
/ {
gpio@2200000 {
camera-control-output-high {
status = "okay";
gpio-hog;
output-high;
gpios = < CAM_RST_L 0>;
label = "cam-rst";
};
};
};
/ {
host1x {
vi@15700000 {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
vi_in4: endpoint {
status = "okay";
port-index = <4>;
bus-width = <2>;
remote-endpoint = <&imx219_csi_out4>;
};
};
};
};
};
};
/ {
host1x {
nvcsi@150c0000 {
status = "okey";
num-channels = <1>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
imx219_csi_in4: endpoint@0 {
status = "okay";
port-index = <4>;
bus-width = <2>;
remote-endpoint = <&imx219_phy_out4>;
};
};
port@1 {
status = "okay";
reg = <1>;
imx219_csi_out4: endpoint@1 {
status = "okay";
remote-endpoint = <&vi_in4>;
};
};
};
};
};
};
};
/ {
i2c@c250000 {
imx219_e@10 {
#address-cells = <1>;
#size-cells = <0>;
reset-gpios = <&tegra_main_gpio CAM_RST_L GPIO_ACTIVE_LOW>;
devnode = "video4";
compatible = "nvidia,imx219";
reg = <0x10>;
physical_w = "3.680";
physical_h = "2.760";
sensor_model ="imx219";
use_sensor_mode_id = "true";
mode0 { // IMX219_MODE_1920X1080
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_e";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1920";
active_h = "1080";
pixel_t = "bayer_rggb";
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";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
imx219_phy_out4: endpoint {
port-index = <4>;
bus-width = <2>;
remote-endpoint = <&imx219_csi_in4>;
};
};
};
};
};
};
/* camera control gpio definitions */
/ {
tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <2>;
max_lane_speed = <1500000>;
max_pixel_rate = <240000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;
modules {
cam_module0: module0 {
status = "okay";
//badge = "imx185_bottom_liimx185";
//badge = "e3322_bottom_A815P2";
badge = "e3326_bottom_P5V27C";
position = "bottom";
orientation = "0";
cam_module0_drivernode0: drivernode0 {
status = "okay";
pcl_id = "v4l2_sensor";
devname = "imx219 7-0010";
proc-device-tree = "/proc/device-tree/i2c@c250000/imx219_e@10";
};
};
};
};
};
After Jetson start up camera is recognized on i2c bus:
[ 1.243627] i2c /dev entries driver
[ 1.245379] imx219 7-0010: tegracam sensor driver:imx219_v2.0.6
Also i got this message:
[ 1.577188] tegra-vi4 15700000.vi: subdev imx219 7-0010 bound
sudo media-ctl -v -p -d /dev/media0
gives me this output:
Opening media device /dev/media0
Enumerating entities
Found 1 entities
Enumerating pads and links
Media controller API version 0.1.0
Media device information
------------------------
driver tegra-vi4
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 0.0.0
Device topology
- entity 1: imx219 7-0010 (1 pad, 0 link)
type V4L2 subdev subtype Sensor flags 0
pad0: Source
v4l2_subdev_open: Failed to open subdev device node
v4l2_subdev_open: Failed to open subdev device node
v4l2_subdev_open: Failed to open subdev device node
Comparing this output to example given in Driver Programing Guide I am missing nvcsi and vi-output entity.
Does anyone have any idea why those entities are not listed in output from media-ctl
and how to fix it?