This page is only for experienced users. It requires knowledge and experience about the following topics:
Kernel development
Devicetree syntax
The Nvidia forum and its documentation about the Jetson family is a good way to get started with those kinds of work. You may start with taking a look at the Camera Adaption Guide from Nvidia.
Auvidea can also provide a quote, if you need a custom devicetree for your CSI camera on the J20, if needed. Contact sales@auvidea.eu or support@auvidea.eu for more information.
Implementing GPIO extender
The GPIO expander populated on the J20 is used to control the mclock and power-down GPIO's on each CSI connector. Auvidea recommends implementing this chip in the Devicetree as GPIO-Chip in order to use those GPIO's directly as reset-gpio in the camera device node.
GPIO
Note
P15
CAM_A_PWDN
P14
CAM_B_PWDN
P13
CAM_A_MCLK
P12
CAM_B_MCLK
P11
CAM_C_PWDN
P10
CAM_D_PWDN
P9
CAM_C_MCLK
P8
CAM_D_MCLK
P7
CAM_E_PWDN
P6
CAM_F_PWDN
P5
CAM_E_MCLK
P4
CAM_F_MCLK
P3
Not connected
P2
Not connected
P1
Not connected
P0
LED_GPIO
Represented in the device tree for the AGX Orin would look like this:
j20_port_extender.dtsi
/* * Copyright (c) 2023, AUVIDEA. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or any * later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. *// { i2c@3180000 { tca6416_cam: cam_gpio_expander@20 { compatible ="ti,tca6416"; reg =<0x20>; gpio-controller; #gpio-cells =<2>; led { gpio-hog; gpios =<00>; output-low; line-name ="led"; }; cam_g_rst { gpio-hog; gpios =<60>; output-high; line-name ="cam_g_mclk"; }; cam_g_pwdn { gpio-hog; gpios =<40>; output-low; line-name ="cam_g_pwdn"; }; cam_e_rst { gpio-hog; gpios =<70>; output-high; line-name ="cam_e_mclk"; }; cam_e_pwdn { gpio-hog; gpios =<50>; output-low; line-name ="cam_e_pwdn"; }; cam_d_rst { gpio-hog; gpios =<100>; output-high; line-name ="cam_d_mclk"; }; cam_d_pwdn { gpio-hog; gpios =<80>; output-low; line-name ="cam_d_pwdn"; }; cam_c_rst { gpio-hog; gpios =<110>; output-high; line-name ="cam_c_mclk"; }; cam_c_pwdn { gpio-hog; gpios =<90>; output-low; line-name ="cam_c_pwdn"; }; cam_b_rst { gpio-hog; gpios =<140>; output-high; line-name ="cam_b_mclk"; }; cam_b_pwdn { gpio-hog; gpios =<120>; output-low; line-name ="cam_b_pwdn"; }; cam_a_rst { gpio-hog; gpios =<150>; output-high; line-name ="cam_a_mclk"; }; cam_a_pwdn { gpio-hog; gpios =<130>; output-low; line-name ="cam_a_pwdn"; }; }; };};
Each camera node (if the driver supports this feature) contains a reset-gpio that can be assinged to one of the implemented GPIO's in the code above. An example usage of one of those GPIO's can be found in the following code in the reset-gpio property.
imx219.dtsi
[...] i2c@31e0000 { rbpcv2_imx219_a@10 { status="okay"; compatible ="sony,imx219"; reg =<0x10>; // Here is the GPIO of the gpio epander used as reset-gpio reset-gpios =<&tca6416_cam 15 GPIO_ACTIVE_HIGH>; devnode ="video0"; physical_w ="3.680"; physical_h ="2.760"; sensor_model ="imx219"; use_sensor_mode_id ="true"; mode0 { // IMX219_MODE_3280x2464_21FPS // mclk_khz ="24000"; num_lanes ="2"; tegra_sinterface ="serial_a";[...]
The following documentation assumes that you are comfortable with the CSI/VI interface from the Nvidia Jetson family
Example CSI/VI implementation
The following example CSI/VI devicetree would implement the J20 on the AGX Orin Devkit
The TX1-Devkit uses a different CSI-Lanes than the AGX-Xavier and AGX-Orin Devkit as shown above.
-> There might be some differences in the Devicetree implementation for the AGX-Orin Devkit.