Hi,
I use Orin NX devkit with JP5.1.3 and followed the steps in the camera sensor programming - port binding. I executed the media-ctl for verification on the target.
output:
/boot/dtb$ sudo media-ctl -p -d /dev/media0
Media controller API version 5.10.192
Media device information
driver tegra-camrtc-ca
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 5.10.192
Device topology
entity 1: 13e40000.host1x:nvcsi@15a00000- (2 pads, 0 link)
type V4L2 subdev subtype Unknown flags 0
pad0: Sink
pad1: Source
The target’s final device tree converted into source:
kernel_tegra234-p3767-0000-p3768-0000-a0.txt (411.8 KB)
The steps I’ve taken were:
Add include for my sensor and remove includes for other sensors in
cvb/tegra234-p3768-0000-a0.dtsi
on the host:
//include “tegra234-p3768-camera-rbpcv3-imx477.dtsi”
//include “tegra234-p3768-camera-rbpcv2-imx219.dtsi”
include “tegra234-camera-des960.dtsi”
Built the tegra234-p3767-0000-p3768-0000-a0.dtb on the host
Copied it into the target as /boot/dtb/kernel_tegra234-p3767-0000-p3768-0000-a0.dtb
The nodes in tegra234-camera-des960.dtsi are:
/{
tegra-capture-vi {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
des960_vi_in0: endpoint {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&des960_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>;
port@0 {
reg = <0>;
des960_csi_in0: endpoint@0 {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&des960_out0>;
};
};
port@1 {
reg = <1>;
des960_csi_out0: endpoint@1 {
remote-endpoint = <&des960_vi_in0>;
};
};
};
};
};
};
cam_i2cmux {
i2c@0 {
des960_cam0: des960_a@3d {
compatible = "nvidia,des960";
status = "okay";
.
.
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
des960_out0: endpoint {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&des960_csi_in0>;
};
};
};
};
};
};
};
For some reason the vi and nvcsi nodes are different on the final dtb and not include the port bindings I set on my .dtsi
Don’t support 24bits.
csi_pixel_bit_depth = "24";
dynamic_pixel_bit_depth = "24";
Thanks @ShaneCCC ,
I removed these properties but still get the same result (media device information as I posted)
This is the final dtb in source form:
tegra234-p3767-0000-p3768-0000-a0.txt (411.7 KB)
This is my .dtsi:
/{
tegra-capture-vi {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
des960_vi_in0: endpoint {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&des960_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>;
port@0 {
reg = <0>;
des960_csi_in0: endpoint@0 {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&des960_out0>;
};
};
port@1 {
reg = <1>;
des960_csi_out0: endpoint@1 {
remote-endpoint = <&des960_vi_in0>;
};
};
};
};
};
};
cam_i2cmux {
i2c@0 {
des960_cam0: des960_a@3d {
compatible = "nvidia,des960";
status = "okay";
/* I2C device address */
reg = <0x3d>;
/* V4L2 device node location */
devnode = "video0";
/* Physical dimensions of sensor */
physical_w = "10.0";
physical_h = "10.5";
sensor_model = "des960"; //change to ti_des_960
/**
* ==== 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
*
* lane_polarity
* Based on the camera connector pin.
* CSIx_D0 | CSIx_D1 | CSI(X+1)_D0 | CSI(X+1)CSIx_D1
* LSB | BIT1 | BIT2 | MSB
* if there is a polarity swap on any lane, the bit corrsponding
* to the lane should be set
* e.g. polarity swap on CSIx_D0 only -> lane_polarity = "1"; 0001
* e.g. polarity swap on CSIx_D1 and CSI(X+1)_D0 -> lane_polarity = "6"; 0110
*
* == 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 { // ds960_640x480_60fps
num_lanes = "2";
tegra_sinterface = "serial_a";
phy_mode = "DPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "640";
active_h = "480";
mode_type = "bayer";
pixel_phase = "rggb";
line_length = "1920";
inherent_gain = "1";
mclk_multiplier = "2";
pix_clk_hz = "45357902";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
des960_out0: endpoint {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&des960_csi_in0>;
};
};
};
};
};
};
};
/ {
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 = <7500000>;
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 {
badge = "des960_front_a";
position = "front";
orientation = "1";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "des960 9-003d";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/des960_a@3d";
};
};
};
};
};
The setup is ti_des_960 connected to the orin nx via 2 lanes mipi.
It acts as pattern generator
You can’t just remove it. You need modify to correct value like 10bit or 12bit bayer output.
OH. I see. Thanks.
The des generates pattern in RGB 8bit so we thought its total 24bit per pixel.
I tried both options: 10 and 12 bit but still facing the same problem. The media-ctl doesn’t recognise the des-csi-vi pipe.
Final dts:
tegra234-p3767-0000-p3768-0000-a0.txt (411.8 KB)
The mode0 looks like incomplete. Please reference to any of reference dts to add complete it.
Also, the port-index should be 1 instead of 0 due to vi/csi are 1
ports {
#address-cells = <0x01>;
#size-cells = <0x00>;
port@0 {
reg = <0x00>;
endpoint {
port-index = <0x00>;
bus-width = <0x02>;
remote-endpoint = <0x2c3>;
phandle = <0x286>;
};
};
};
};
rbpcv2_imx219_a@10 {
We have port-index property in 3 nodes:
tegra-capture-vi
nvcsi@15a00000
port@0
In my .dtsi all of them are 0.
Should I change all of them to 1 or only the port@0 port-index you mentioned here?
OH I see the problem.
In the final .dts the vi/csi port index is 1. the port0@0 is 0. But that’s the problem: for some reason the final dtb “ignores” the vi/csi nodes from my .dtsi . In my .dtsi these ports are 0 and not 1.
It takes the mode0 properites from its node for example but ignores the csi/vi nodes.
Still have the same problems:
The media-ctl output is not as expected
The final dtb ignores the vi/csi nodes from my .dtsi but takes the mode0 node.
Final dts:
tegra234-p3767-0000-p3768-0000-a0.txt (412.5 KB)
(I modified port index to 1 and completed mode0 properties from imx477 reference)
Dump the device tree to confirm.
sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree
Hi @ShaneCCC ,
I executed the command and this is the resulted dts:
extracted_proc.txt (409.4 KB)
I don’t know if its related to the problem but after reboot when I execute i2cdetect I see the des is occasionally listed in different i2c bus (but always the same slave addr). Can this cause our problem?
I am sorry! What’s your expect for the media-ctl?
Why you sorry?
I’m expecting an output like mentioned in the devguide (“To verify the port binding result”):
https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/SD/CameraDevelopment/SensorSoftwareDriverProgramming.html#to-verify-the-port-binding-result
My output is not good according to the dev guide (we dont see the sensor->csi->vi pipe)
OK, do you check the video node?
If not, that tell the sensor probe failed to generate the video* in the /dev that would cause the different.
ls /dev/video*
I don’t have a /dev/video0* device since I didn’t write the driver yet. As I understood from the devguide, I can verify the device tree ports bindings prior to writing the new sensor driver (kernel module).
I do have a /dev/media0 file
You can have a dummy sensor driver to verify the binding.
Thanks
I try using my own kernel module.
Currently its not working but you help me with that in another thread:
Hi @ShaneCCC ,
I don’t want to build the kernel each time I build the kernel module.
I tried a little bit more and succefully built the module on the host and loaded it on the target without receving the errors mentioned before:
no symbol version for module_layout
module verification failed: signature and/or required key missing - tainting kernel
Now I have another problem. For some reason my driver’s probe function isn’t execuing.
I used proper compatible fields in both my device tree a…
So I close this one
system
Closed
June 19, 2024, 10:15am
21
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.