IDE:jeston 36.0
JetPack6.0
core board:orin Nano4GB
board:Jetson Orin Nano Developer Kit
kernel source: Jetson Linux 36.3 | NVIDIA Developer
rootfs source: Basic Flavor Root File System Root File System — NVIDIA Jetson Linux Developer Guide 1 documentation
我是一个新手,可能问题过于低级,希望谅解,初次使用orin nano4G,在项目上需要添加imx415摄像头,参照 传感器软件驱动程序编程 — NVIDIA Jetson Linux 开发者指南 1 文档,感觉还是无从下手。有几个疑问,希望得到解到:
一、主板上有2个csi接口,分别对应i2c9 和i2c10,请问在自己编写设备树中,我该如何关联到对应的i2c接口,i2c9 和i2c10 他们在设备树中如何体现,如何命名,如何应用?
二、主板上有两个csi接口,我在编写自己的设备树时候,如何对应上我使用的csi接口,他们设备树节点又是什么样子?
三、主板上csi接口中有CAM0_PWDN这个管脚,我在设备树中引用这个节点以后,我在驱动中如何获取该管脚,驱动如何对这个管脚进行操作?
四、 传感器软件驱动程序编程 — NVIDIA Jetson Linux 开发者指南 1 文档这个例程我看得有点懵,不知道如何下手。这个例程我自己总结了一下操作步骤:
1.在内核源代码树中找到或创建一个设备树节点
我在创建第一个设备树节点/hardware/nvidia/t23x/nv-public/overlay/tegra234-camera-imx415-a00.dtsi
这个节点创建完成以后,我是否还需要添加到Makefile中才能进行编译?
2.tegra234-camera-imx415-a00.dtsi中添加内容:
tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
modules {
module0 {
badge = "imx415_bottom_liimx415";
position = "bottom";
orientation = "0";
drivernode0 {
pcl_id = "v4l2_sensor";
sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9546@70/i2c@0/imx415_a@1a";
};
};
};
};
imx415_a@1a {
compatible = "sony,imx415";
reg = <0x1a>;
physical_w = "15.0";
physical_h = "12.5";
sensor_model ="imx415";
post_crop_frame_drop = "0";
use_decibel_gain = "true";
delayed_gain = "true";
use_sensor_mode_id = "true";
mode0 {
mclk_khz = "37125";
num_lanes = "4";
tegra_sinterface = "serial_a";
phy_mode = "DPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
dynamic_pixel_bit_depth = "12";
csi_pixel_bit_depth = "12";
mode_type = "bayer";
pixel_phase = "rggb";
active_w = "1920";
active_h = "1080";
readout_orientation = "0";
line_length = "2200";
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";
max_framerate = "30000000"; /* 30 */
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>;
liimx415_imx415_out0: endpoint {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&liimx415_csi_in0>;
};
};
};
};
tegra-capture-vi {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
liimx415_vi_in0: endpoint {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&liimx415_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>;
liimx415_csi_in0: endpoint@0 {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&liimx415_imx415_out0>;
};
};
port@1 {
reg = <1>;
liimx415_csi_out0: endpoint@1 {
remote-endpoint = <&liimx415_vi_in0>;
};
};
};
};
};
};
其中sysfs-device-tree = “/sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9546@70/i2c@0/imx415_a@1a”;表示什么意思呢?我的理解是不是这个对应的是i2c9这个节点?还是说在这个节点下面生成了一个imx415_a@1a节点?
我是初次使用这款开发平台,之前有使用过zynq cs实现摄像头显示。不知道是否有更详细的操作步骤或案例,能帮我完成摄像头显示。