I try use TX2 grad data from XILINX FPGA CSI-TX。
Change DTB file close plugin maneger and use main platform device tree file like this and I try ov5693 module work fine.
i2c@3180000 {
status = "okay";
ov5693_c@36 {
compatible = "nvidia,ov5693";
/* I2C device address */
reg = <0x36>;
status = "okay";
/* V4L2 device node location */
devnode = "video0";
/* Physical dimensions of sensor */
physical_w = "3.674";
physical_h = "2.738";
/* Define any required hw resources needed by driver */
/* ie. clocks, io pins, power sources */
avdd-reg = "vana";
iovdd-reg = "vif";
/* Sensor output flip settings */
vertical-flip = "true";
/**
* A modeX node is required to support v4l2 driver
* implementation with NVIDIA camera software stack
*
* mclk_khz = "";
* Standard MIPI driving clock, typically 24MHz
*
* num_lanes = "";
* Number of lane channels sensor is programmed to output
*
* tegra_sinterface = "";
* The base tegra serial interface lanes are connected to
*
* discontinuous_clk = "";
* The sensor is programmed to use a discontinuous clock on MIPI lanes
*
* dpcm_enable = "true";
* The sensor is programmed to use a DPCM modes
*
* cil_settletime = "";
* MIPI lane settle time value.
* A "0" value attempts to autocalibrate based on mclk_multiplier
*
*
*
*
* active_w = "";
* Pixel active region width
*
* active_h = "";
* Pixel active region height
*
* pixel_t = "";
* The sensor readout pixel pattern
*
* readout_orientation = "0";
* Based on camera module orientation.
* Only change readout_orientation if you specifically
* Program a different readout order for this mode
*
* line_length = "";
* Pixel line length (width) for sensor mode.
* This is used to calibrate features in our camera stack.
*
* mclk_multiplier = "";
* Multiplier to MCLK to help time hardware capture sequence
* TODO: Assign to PLL_Multiplier as well until fixed in core
*
* pix_clk_hz = "";
* Sensor pixel clock used for calculations like exposure and framerate
*
*
*
*
* inherent_gain = "";
* Gain obtained inherently from mode (ie. pixel binning)
*
* min_gain_val = ""; (floor to 6 decimal places)
* max_gain_val = ""; (floor to 6 decimal places)
* Gain limits for mode
*
* min_exp_time = ""; (ceil to integer)
* max_exp_time = ""; (ceil to integer)
* Exposure Time limits for mode (us)
*
*
* min_hdr_ratio = "";
* max_hdr_ratio = "";
* HDR Ratio limits for mode
*
* min_framerate = "";
* max_framerate = "";
* Framerate limits for mode (fps)
*/
mode0 { // OV5693_MODE_2592X1944
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1944";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "2688";
inherent_gain = "1";
mclk_multiplier = "6.67";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.816577";
max_framerate = "30";
min_exp_time = "34";
max_exp_time = "550385";
};
mode1 { //OV5693_MODE_2592X1458
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1458";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "2688";
inherent_gain = "1";
mclk_multiplier = "6.67";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.816577";
max_framerate = "30";
min_exp_time = "34";
max_exp_time = "550385";
};
mode2 { //OV5693_MODE_1280X720
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1280";
active_h = "720";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "1752";
inherent_gain = "1";
mclk_multiplier = "6.67";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "2.787078";
max_framerate = "120";
min_exp_time = "22";
max_exp_time = "358733";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
status = "okay";
e3326_ov5693_out0: endpoint {
csi-port = <2>;
bus-width = <2>;
status = "okay";
remote-endpoint = <&e3326_csi_in0>;
};
};
};
};
};
e3326_lens_ov5693@P5V27C {
min_focus_distance = "0.0";
hyper_focal = "0.0";
focal_length = "2.67";
f_number = "2.0";
aperture = "2.0";
};
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 = <160000>;
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 vender.
*/
modules {
module0 {
badge = "e3326_bottom_P5V27C";
position = "bottom";
orientation = "1";
status = "okay";
drivernode0 {
/* Declare PCL support driver (classically known as guid) */
pcl_id = "v4l2_sensor";
/* Driver v4l2 device name */
devname = "ov5693 2-0036";
/* Declare the device-tree hierarchy to driver instance */
proc-device-tree = "/proc/device-tree/i2c@3180000/ov5693_c@36";
};
drivernode1 {
/* Declare PCL support driver (classically known as guid) */
pcl_id = "v4l2_lens";
proc-device-tree = "/proc/device-tree/e3326_lens_ov5693@P5V27C/";
};
};
};
};
};
Then I modify OV5693.c,skip some OTP fuction,so kernel can load the driver.
I use the ./v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=BG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1
the display
VIDIOC_DQBUF: failed: Input/output error
I try use
echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo > /sys/kernel/debug/tracing/trace
cat /sys/kernel/debug/tracing/trace
and back
# tracer: nop
#
# entries-in-buffer/entries-written: 23/23 #P:4
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
kworker/5:1-115 [005] ...1 115.380869: rtos_queue_peek_from_isr_failed: tstamp:3938792831 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 115.380874: rtcpu_start: tstamp:3938795071
kworker/5:1-115 [005] ...1 115.380876: rtcpu_vinotify_handle_msg: tstamp:3938843291 tag:CSIMUX_STREAM channel:0xff frame:0 vi_tstamp:3938842805 data:0x00000100
kworker/5:1-115 [005] ...1 115.432891: rtcpu_vinotify_handle_msg: tstamp:3940125403 tag:CSIMUX_FRAME channel:0x00 frame:3110 vi_tstamp:3940124947 data:0x000000a2
kworker/5:1-115 [005] ...1 115.432895: rtcpu_vinotify_handle_msg: tstamp:3940245922 tag:CHANSEL_PXL_SOF channel:0x00 frame:3111 vi_tstamp:3940245341 data:0x00000001
kworker/5:1-115 [005] ...1 115.432897: rtcpu_vinotify_handle_msg: tstamp:3940246138 tag:ATOMP_FS channel:0x00 frame:3111 vi_tstamp:3940245348 data:0x00000000
kworker/5:1-115 [005] ...1 115.432900: rtcpu_vinotify_handle_msg: tstamp:3940248944 tag:CHANSEL_LOAD_FRAMED channel:0x04 frame:3111 vi_tstamp:3940248515 data:0x08000000
kworker/5:1-115 [005] ...1 115.432902: rtcpu_vinotify_handle_msg: tstamp:3941173455 tag:CHANSEL_PXL_EOF channel:0x00 frame:3111 vi_tstamp:3941173002 data:0x04370002
kworker/5:1-115 [005] ...1 115.432904: rtcpu_vinotify_handle_msg: tstamp:3941178322 tag:CSIMUX_FRAME channel:0x00 frame:3111 vi_tstamp:3941177709 data:0x000000a2
kworker/5:1-115 [005] ...1 115.432907: rtcpu_vinotify_handle_msg: tstamp:3941178561 tag:ATOMP_FE channel:0x00 frame:3111 vi_tstamp:3941177712 data:0x00000000
kworker/5:1-115 [005] ...1 115.536943: rtos_queue_peek_from_isr_failed: tstamp:3943793811 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 115.693126: rtos_queue_peek_from_isr_failed: tstamp:3948794490 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 115.848889: rtos_queue_peek_from_isr_failed: tstamp:3953794996 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 116.005006: rtos_queue_peek_from_isr_failed: tstamp:3958795312 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 116.161025: rtos_queue_peek_from_isr_failed: tstamp:3963796012 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 116.316960: rtos_queue_peek_from_isr_failed: tstamp:3968796523 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 116.472925: rtos_queue_peek_from_isr_failed: tstamp:3973797026 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 116.628889: rtos_queue_peek_from_isr_failed: tstamp:3978797530 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 116.784916: rtos_queue_peek_from_isr_failed: tstamp:3983798039 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 116.992903: rtos_queue_peek_from_isr_failed: tstamp:3988798540 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 117.148892: rtos_queue_peek_from_isr_failed: tstamp:3993799045 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 117.304906: rtos_queue_peek_from_isr_failed: tstamp:3998799561 queue:0x0b4a3c58
kworker/5:1-115 [005] ...1 117.408967: rtos_queue_peek_from_isr_failed: tstamp:4003031962 queue:0x0b4a3c58
It’s look fine,but dmesg fome kernel
[ 115.420325] tegra-vi4 15700000.vi: Status: 2 channel:00 frame:0C27
[ 115.426642] tegra-vi4 15700000.vi: timestamp sof 126087850912 eof 126117686688 data 0x000000a2
[ 115.436126] tegra-vi4 15700000.vi: capture_id 1 stream 2 vchan 0
[ 116.389050] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 117.393147] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!