Hello,
We have developed a video card based on TX2 :
Our video pipeline is like this :
-
Channel 1: ADV7604 (Analog UXGA signal to parallel RGB888) => FPGA (Parallel RGB888 to CSI-2 Format ) => CSI0 (4 Lane configuration)
-
Channel 2: ADV7604 (Analog UXGA signal to parallel RGB888) => FPGA (Parallel RGB888 to CSI-2 Format ) => CSI2 (4 Lane configuration)
I compiled ADV7604 driver as it is in the kernel source code as a module. you can find the ADV 7604 driver here: ADV7604 Driver . Made some changes in the device tree for the ADV7604 as mentioned in the attached snippet:
i2c@3180000 { //set this to correct i2c bus
tca9546@70 {
i2c@0{ //cam_i2c/Mux@70/I2C_A
#address-cells = <1>;
#size-cells = <0>;
adv7604_a@20 {/* VD: Earlier it was imx185_a@1a*/
/*VD: Changed for ADV7604 Driver */
/* compatible = "nvidia,imx185"; */
compatible = "adv,adv7611";
/* VD: Updated as decoder IO Map I2C address is 0x40: For detail please refer ADV7604 H/W manual*/
/* reg = <0x1a>; */
/* VD: We have taken 8-Bit address as ADV driver uses 8-Bit addressing. Note: Rest of the I2C addresses are 7-Bit */
reg = <0x20>, <0x42>, <0x40>, <0x3e>, <0x38>, <0x3c>, <0x26>, <0x32>, <0x36>, <0x34>, <0x30>, <0x22>, <0x24>;
/* VD: New property added as 13 address map is in ADV7604 */
reg-names = "io", "avlink", "cec", "infoframe", "esdp", "epp", "afe", "rep", "edid", "hdmi", "test", "cp", "vdp";
/* VD: devnode Kept same as imx185 */
devnode = "video0";
/* VD: Physical dimensions of sensor so no need to include in our ADV7604 case */
/* physical_w = "15.0"; */
/* physical_h = "12.5"; */
/*VD: Clock same as for imx185 used by CTI*/
clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>,
<&tegra_car TEGRA186_CLK_PLLP_OUT0>;
/* VD: Same clock name used */
clock-names = "extperiph1", "pllp_grtba";
/* VD: mclk is not used by ADV7604. However it is kept same as it is an output on ASG006 P17A/P17B and not used on DHV-AVSRD */
mclk = "extperiph1";
/* VD: Sensor model changed earlier it was imx185*/
sensor_model = "adv7604";
/* VD: Same delayed gain used. However not known how it is used */
delayed_gain = "true";
/*VD: Changed because we are using CAM2_CNTRL_RST and making it board reset. SoC GPIO is not used for Rest in DHV-AVSRD*/
reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
/* VD: Unknown property. However enabling as CSI driver may be using */
post_crop_frame_drop = "0";
use_decibel_gain = "true";
/* VD: New property added for ADV7604 driver */
default-input = <0>;
/* VD: Keeping these property as it is because looks like configuring the CSI-2 */
mclk_khz = "37125";
num_lanes = "4";
tegra_sinterface = "serial_a"; /* VD: ? */
phy_mode = "DPHY";
discontinuous_clk = "no"; /* VD: ? */
dpcm_enable = "false"; /* VD: ? */
cil_settletime = "0"; /* VD: ? */
dynamic_pixel_bit_depth = "12"; /* VD: ? */
csi_pixel_bit_depth = "12"; /* VD: ? */
mode_type = "bayer"; /* VD: ? */
pixel_phase = "rggb"; /* VD: ? */
active_w = "1920";
active_h = "1080";
readout_orientation = "0"; /* VD: ? */
line_length = "2200"; /* VD: ? */
inherent_gain = "1";
mclk_multiplier = "2";
pix_clk_hz = "74250000";
gain_factor = "10";
min_gain_val = "0"; /* 0dB */
max_gain_val = "480"; /* 48dB */
step_gain_val = "3"; /* 0.3 */
default_gain = "0";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "1500000"; /* 1.5 */
max_framerate = "30000000"; /* 30 */
step_framerate = "1";
default_framerate = "30000000";
exposure_factor = "1000000";
min_exp_time = "30"; /* us */
max_exp_time = "660000"; /* us */
step_exp_time = "1";
default_exp_time = "33334";/* us */
embedded_metadata_height = "1";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
adv7604_out0: endpoint {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&csi_in0>;
};
};
};
};
};
Error seen in the dmesg is:
[ 5.117686] Internal error: Accessing user space memory outside uaccess.h routines: 96000005 [#1] PREEMPT SMP
[ 5.127688] Modules linked in: adv7604(+) nvgpu bluedroid_pm ip_tables x_tables
[ 5.135185] CPU: 2 PID: 3110 Comm: systemd-udevd Not tainted 4.9.140-tegra-tegra #7
[ 5.142879] Hardware name: quill (DT)
[ 5.146564] task: ffffffc1e3101c00 task.stack: ffffffc1dc910000
[ 5.152533] PC is at adv76xx_probe+0xb4/0xd40 [adv7604]
[ 5.157808] LR is at adv76xx_probe+0xac/0xd40 [adv7604]
[ 5.163061] pc : [] lr : [] pstate: 40400045
[ 5.170488] sp : ffffffc1dc913a10
[ 5.173825] x29: ffffffc1dc913a10 x28: 0000000000000018
[ 5.179207] x27: 00000000000001c1 x26: 0000000000000030
[ 5.184581] x25: 0000000000000000 x24: ffffff80011b1ef0
[ 5.189949] x23: ffffffc1e6892800 x22: ffffffc1e6892820
[ 5.195326] x21: 00000000ffffffff x20: 00000000ffffffea
[ 5.200703] x19: ffffffc1e68bc018 x18: 0000000000000001
[ 5.206084] x17: 0000000000000000 x16: 0000000000000000
[ 5.211456] x15: ffffffffffffffff x14: ffffffc1dd4bee8a
[ 5.216830] x13: ffffffc1dd4bee89 x12: 0000000000000018
[ 5.222202] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
[ 5.227571] x9 : 01fefefeff303035 x8 : 7f7f7f7f7f7f7f7f
[ 5.232939] x7 : 367563602b756360 x6 : 0000008080808000
[ 5.238310] x5 : 0000000000000000 x4 : 0000000000000000
[ 5.243678] x3 : ffffff80011b1c10 x2 : ffffffc1e6892800
[ 5.249048] x1 : 0000000000000000 x0 : 0000000000000000
[ 5.255920] Process systemd-udevd (pid: 3110, stack limit = 0xffffffc1dc910000)
[ 5.263260] Call trace:
[ 5.265743] [] adv76xx_probe+0xb4/0xd40 [adv7604]
[ 5.272046] [] i2c_device_probe+0x144/0x258
[ 5.277824] [] driver_probe_device+0xd8/0x408
[ 5.283774] [] __driver_attach+0xdc/0x128
[ 5.289374] [] bus_for_each_dev+0x5c/0xa8
[ 5.294974] [] driver_attach+0x30/0x40
[ 5.300314] [] bus_add_driver+0x20c/0x2a8
[ 5.305915] [] driver_register+0x6c/0x110
[ 5.311520] [] i2c_register_driver+0x4c/0xb0
[ 5.317393] [] adv76xx_driver_init+0x14/0x30 [adv7604]
[ 5.324128] [] do_one_initcall+0x44/0x130
[ 5.329730] [] do_init_module+0x64/0x1a8
[ 5.335246] [] load_module+0x10a4/0x12d8
[ 5.340762] [] SyS_finit_module+0xd8/0xf0
[ 5.346371] [] __sys_trace_return+0x0/0x4
[ 5.351972] —[ end trace 0f00039bbf0b8608 ]—
Please guide me to resolve this problem as i am very new to the device tree.
Thanks and Regards,
Vikas Dwivedi