My tests are incomplete, still thought of posting the status here.
Setting embedded data line in DT did bring some change to behavior.
There are no timeouts for VGA & HD and frames are successfully dumped.
However, it seems , instead 10-bit, 12-bit data is dumped (I need to confirm settings at my end too, so no conclusions at the moment).
And for other resolutions like 4K, the issue remains same. For the resolutions which have issue, my below point (posted earlier as well) stands true. Anyone else observed this?
One observation:
For 3280x2464 resolution, we expect VIDIOC_QUERYBUF to allocate 3296*2462*2 (10-bit RAW data) = 16242688 bytes (3296 considering the 64-bit alignment). This was the case with TX1.
However, in TX2, 16400384 bytes are allocated, which is 154KB more than what is expected. Is this OK? BTW, there is no such issue in resolutions like 1640x1232.
We are wondering if this is a problem with 4 lanes sensors because we have two lanes sensors working. For the cases that it is failing for you, are you using 4 lanes? Have you been able to capture something with 4 lanes?
Is this topic still active? I have a similar problem. Porting driver code for Imx 477 from TX1 to TX2 which works well on TX1. But on TX2 platform I get the following log:
Thanks for your quick response. I have applied the patch from #38. I also do the test adding or removing ‘embedded_metadata_height = “1”’ from my dtsi file. But I get the same log.
The following code section is my dtsi file. Is there anything wrong?
#include "dt-bindings/clock/tegra186-clock.h"
/ {
host1x {
vi_base: vi@15700000 {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vi_prot0: port@0 {
status = "okay";
reg = <0>;
j20_vi_in0: endpoint {
status = "okay";
csi-port = <2>;
bus-width = <2>;
remote-endpoint = <&j20_csi_out0>;
};
};
};
};
csi_base: nvcsi@150c0000 {
num-channels = <1>;
#address-cells = <1>;
#size-cells = <0>;
csi_chan0: channel@0 {
reg = <0>;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
csi_chan0_port0: port@0 {
reg = <0>;
status = "okay";
imx477_csi_in0: endpoint@0 {
status = "okay";
csi-port = <2>;
bus-width = <2>;
remote-endpoint = <&imx477_out0>;
};
};
csi_chan0_port1: port@1 {
reg = <1>;
status = "okay";
j20_csi_out0: endpoint@1 {
status = "okay";
remote-endpoint = <&j20_vi_in0>;
};
};
};
};
};
};
i2c@3180000 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
imx477_c@10 {
compatible = "nvidia,imx477";
/* I2C device address */
reg = <0x10>;
/* V4L2 device node location */
//devnode = "video0";
/* Sensor Model */
sensor_model ="imx477";
/* Physical dimensions of sensor */
physical_w = "5.095";
physical_h = "4.930";
/* Define any required hw resources needed by driver */
/* ie. clocks, io pins, power sources */
//avdd-reg = "vana";
//iovdd-reg = "vif";
clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>,
<&tegra_car TEGRA186_CLK_PLLP_OUT0>;
clock-names = "extperiph1", "pllp_grtba";
mclk = "extperiph1";
clock-frequency = <24000000>;
/**
* 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 { // IMX477_MODE_1920X1080
mclk_khz = "24000";
mclk_multiplier = "25";
pix_clk_hz = "170000000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
cil_settletime = "0";
pixel_t = "bayer_rggb";
readout_orientation = "90";
inherent_gain = "1";
active_w = "1920";
active_h = "1080";
line_length = "4375";
dpcm_enable = "false";
min_gain_val = "0";
max_gain_val = "252";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "30";
max_framerate = "30";
min_exp_time = "13";
max_exp_time = "683709";
embedded_metadata_height = "1";
};
mode1 { // IMX477_MODE_2028X1520
mclk_khz = "24000";
mclk_multiplier = "25";
pix_clk_hz = "170000000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
cil_settletime = "0";
pixel_t = "bayer_rggb";
readout_orientation = "90";
inherent_gain = "1";
active_w = "2028";
active_h = "1520";
line_length = "4375";
dpcm_enable = "false";
min_gain_val = "0";
max_gain_val = "252";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "30";
max_framerate = "30";
min_exp_time = "13";
max_exp_time = "683709";
embedded_metadata_height = "1";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
imx477_out0: endpoint {
status = "okay";
csi-port = <2>;
bus-width = <2>;
remote-endpoint = <&imx477_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 = <750000>;
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 {
cam_module0: module0 {
status = "okay";
badge = "imx477_front";
position = "front";
orientation = "1";
cam_module0_drivernode0: drivernode0 {
status = "okay";
/* Declare PCL support driver (classically known as guid) */
pcl_id = "v4l2_sensor";
/* Driver v4l2 device name */
devname = "imx477 2-0010";
/* Declare the device-tree hierarchy to driver instance */
proc-device-tree = "/proc/device-tree/i2c@3180000/imx477_c@10";
};
};
};
};
};
@moonrising
You need to make sure your sensor have output embedded data to modify this value, If the sensors have output the
embedded data then you remove the device tree is useless.
@ShaneCCC
Thanks for your reply. I will check it’s configuration referred to the spec for IMX477. And I will do much more check both hardware and software.
@ShaneCCC
Could you please tell me what’s the mean of embedded meta data ? I ask the same question to a FAE of Sony, and he is also not very sure about it’s meaning. The reference manual of IMX477 mentions a concept called Embedded data line, which means
2 data lines after FS sync code of a image frame containing contents of certain i2c registers. Does the embedded_meta_data_height equal to embedded data lines here ?
a image frame containing contents of certain i2c registers.
correct, the embedded meta data we talked about was embedded data line.
embedded data line contains several settings of the frame.
this would be helpful for reducing algorithm calculation of extracting register settings.
in the r27.1 sensor device tree settings.
you should mention correct embedded data line height, since we’ll need this to separate embedded meta data and effective pixels. thanks
@JerryChang
Thanks for your quick reply. I change the embedded_meta_data setting and do a new test just now, but I still get the same error log. I think I should do much more check.
@all
Has anybody tested using Auvidea J20 on TX2 EVB? I try raspberry Pi camera V2.1(which carries imx219 ) using J20 as adapter board and get i2c error sometimes.
@ShaneCCC,
Thanks for your reply. I don’t known how to post pictures on the forum, but I think the picture you posted is very similar to the picture which illustrates the embedded data line in reference manual of IMX477.
I applied the patch several days ago, and I checked this patch again yesterday. I think this patch can be divided into two parts, one is for C source code,the other is for dtsi file. The part for dtsi file is not used in my dts, But the part for C source code apply well. I have tried to write a dtsi file for ov5693 in the same way as imx477. Ov5693 works well.
The method I used to writing dtsi file for IMX477:
copy the content of “tegra186-quill-p3310-1000-a00-00-base.dts” into a new file
remove #include <t18x-common-platforms/tegra186-quill-camera-modules.dtsi> & #include <t18x-common-plugin-manager/tegra186-quill-camera-plugin-manager.dtsi>
3.add dtsi file for imx477 the content of which is in my posts above.
Does the part for dtsi file cause the error log? I think it’s for IMX185, does it affect other sensor?
@moonrising
The key changes are those 5 patch locate the kernel-4.4 folder. Try to print some message to make sure all of them are apply to your kernel Image.