Hi all,
I’m using a setup with Jetson AGX Orin and 4 cameras AR0820 cameras GMSL2 - MIPI CSI2, i configured the device tree for tegra-capture-vi and NVCSI and sensor modules, but i’m finding an issue related to the nvcsi port, each camera is a 4-lanes camera
I’m using the configuration below
CSI AB (port index 0) ==> VI (port index 0) ==> Working fine
CSI CD (port index 2) ==> VI (port index 2) ==> Working fine
CSI AB (port index 4) ==> VI (port index 4) ==> Working fine
CSI AB (port index 6) ==> VI (port index 5) ==> Invalid NVCSI stream Id
You check the logs below
jetson@jetson-desktop:~$ sudo dmesg | grep tegra-camrtc
[ 4.675399] tegra-camrtc-capture-vi tegra-capture-vi: capture_vi_probe: tegra-camrtc-capture-vi probe
[ 4.675494] tegra-camrtc-capture-vi tegra-capture-vi: csi_vi_get_mapping_table: csi-stream to vi-instance mapping table size: 6
[ 4.675496] tegra-camrtc-capture-vi tegra-capture-vi: csi_vi_get_mapping_table: vi_instance_table[0] = 0
[ 4.675498] tegra-camrtc-capture-vi tegra-capture-vi: csi_vi_get_mapping_table: vi_instance_table[1] = 0
[ 4.675500] tegra-camrtc-capture-vi tegra-capture-vi: csi_vi_get_mapping_table: vi_instance_table[2] = 1
[ 4.675501] tegra-camrtc-capture-vi tegra-capture-vi: csi_vi_get_mapping_table: vi_instance_table[3] = 1
[ 4.675503] tegra-camrtc-capture-vi tegra-capture-vi: csi_vi_get_mapping_table: vi_instance_table[4] = 0
[ 4.675505] tegra-camrtc-capture-vi tegra-capture-vi: csi_vi_get_mapping_table: vi_instance_table[5] = 1
[ 4.677080] tegra-camrtc-capture-vi tegra-capture-vi: stream Id = 0
[ 4.683525] tegra-camrtc-capture-vi tegra-capture-vi: stream Id = 2
[ 4.689957] tegra-camrtc-capture-vi tegra-capture-vi: stream Id = 4
[ 4.696380] tegra-camrtc-capture-vi tegra-capture-vi: stream Id = 255
[ 4.702993] tegra-camrtc-capture-vi tegra-capture-vi: Invalid NVCSI stream Id
[ 4.710620] tegra-camrtc-capture-vi tegra-capture-vi: cannot find remote port parent
[ 8.158159] tegra-camrtc-capture-vi tegra-capture-vi: subdev 13e40000.host1x:nvcsi@15a00000- bound
[ 8.167404] tegra-camrtc-capture-vi tegra-capture-vi: subdev 13e40000.host1x:nvcsi@15a00000- bound
[ 8.176639] tegra-camrtc-capture-vi tegra-capture-vi: subdev 13e40000.host1x:nvcsi@15a00000- bound
[ 11.153461] tegra-camrtc-capture-vi tegra-capture-vi: subdev ar0820 30-0010 bound
[ 11.851248] tegra-camrtc-capture-vi tegra-capture-vi: subdev ar0820 31-0010 bound
[ 12.763681] tegra-camrtc-capture-vi tegra-capture-vi: subdev ar0820 32-0010 bound
There is the device tree for the tegra-capture vi
tegra-capture-vi {
status = "okay";
num-channels = <4>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
ar0820_vi_in0: endpoint {
status = "okay";
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ar0820_csi_out0>;
};
};
port@1 {
status = "okay";
reg = <1>;
ar0820_vi_in1: endpoint {
status = "okay";
port-index = <2>;
bus-width = <4>;
remote-endpoint = <&ar0820_csi_out1>;
};
};
port@2 {
status = "okay";
reg = <2>;
ar0820_vi_in2: endpoint {
status = "okay";
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&ar0820_csi_out2>;
};
port@3 {
status = "okay";
reg = <3>;
ar0820_vi_in3: endpoint {
status = "okay";
port-index = <5>;
bus-width = <4>;
remote-endpoint = <&ar0820_csi_out3>;
};
};
};
};
};
And there is the device tree for NVCSI
host1x@13e00000 {
nvcsi@15a00000 {
num-channels = <4>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
channel@0 {
status = "okay";
reg = <0>;
ports {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
ar0820_csi_in0: endpoint@0 {
status = "okay";
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ar0820_ar0820_out0>;
};
};
port@1 {
status = "okay";
reg = <1>;
ar0820_csi_out0: endpoint@1 {
status = "okay";
remote-endpoint = <&ar0820_vi_in0>;
};
};
};
};
channel@1 {
status = "okay";
reg = <1>;
ports {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
ar0820_csi_in1: endpoint@2 {
status = "okay";
port-index = <2>;
bus-width = <4>;
remote-endpoint = <&ar0820_ar0820_out1>;
};
};
port@1 {
status = "okay";
reg = <1>;
ar0820_csi_out1: endpoint@3 {
status = "okay";
remote-endpoint = <&ar0820_vi_in1>;
};
};
};
};
channel@2 {
status = "okay";
reg = <2>;
ports {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
ar0820_csi_in2: endpoint@4 {
status = "okay";
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&ar0820_ar0820_out2>;
};
};
port@1 {
status = "okay";
reg = <1>;
ar0820_csi_out2: endpoint@5 {
status = "okay";
remote-endpoint = <&ar0820_vi_in2>;
};
};
};
};
channel@3 {
status = "okay";
reg = <3>;
ports {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
ar0820_csi_in3: endpoint@6 {
status = "okay";
port-index = <6>;
bus-width = <4>;
remote-endpoint = <&ar0820_ar0820_out3>;
};
};
port@1 {
status = "okay";
reg = <1>;
ar0820_csi_out3: endpoint@7 {
status = "okay";
remote-endpoint = <&ar0820_vi_in3>;
};
};
};
};
};
Can you please tell why the port index is taking the 255 and not 6 ?
[ 4.696380] tegra-camrtc-capture-vi tegra-capture-vi: stream Id = 255
[ 4.702993] tegra-camrtc-capture-vi tegra-capture-vi: Invalid NVCSI stream Id
[ 4.710620] tegra-camrtc-capture-vi tegra-capture-vi: cannot find remote port parent
Also why the MAX_NVCSI is limited to 5 in this function in fact that we can use the port 6 with AGX Orin/Xavier
struct device *vi_csi_stream_to_nvhost_device(
struct platform_device *pdev,
uint32_t csi_stream_id)
{
struct tegra_capture_vi_data *info = platform_get_drvdata(pdev);
uint32_t vi_inst_id = 0;
dev_info(&pdev->dev, "stream Id = %d\n", csi_stream_id);
if (csi_stream_id >= MAX_NVCSI_STREAM_IDS) {
dev_err(&pdev->dev, "Invalid NVCSI stream Id\n");
return NULL;
}
vi_inst_id = info->vi_instance_table[csi_stream_id];
return &info->vi_pdevices[vi_inst_id]->dev;
}
Thanks