Jetpack-5.1.2 - Disable CRC check

Hi @JerryChang,

I modified the patch I found in another discussion :

diff --git a/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c b/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c
index b104ab3eb..dbcded818 100644
--- a/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c
+++ b/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c
@@ -219,8 +219,10 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        struct CAPTURE_CONTROL_MSG msg;
        struct nvcsi_brick_config brick_config;
        struct nvcsi_cil_config cil_config;
+       struct nvcsi_error_config error_config;
        u32 phy_mode = read_phy_mode_from_dt(chan);
        bool is_cphy = (phy_mode == CSI_PHY_MODE_CPHY);
+
        dev_dbg(csi->dev, "%s: stream_id=%u, csi_port=%u\n",
                __func__, stream_id, csi_port);
 
@@ -290,6 +292,11 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        else
                cil_config.mipi_clock_rate = csi->clk_freq / 1000;
 
+       /* Error config */
+       memset(&error_config, 0, sizeof(error_config));
+       error_config.stream_intr_mask = 0x3;
+       error_config.status2vi_notify_mask = 0xFFFF;
+
        /* Set NVCSI stream config */
        memset(&msg, 0, sizeof(msg));
        msg.header.msg_id = CAPTURE_CSI_STREAM_SET_CONFIG_REQ;
@@ -298,6 +305,8 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        msg.csi_stream_set_config_req.csi_port = csi_port;
        msg.csi_stream_set_config_req.brick_config = brick_config;
        msg.csi_stream_set_config_req.cil_config = cil_config;
+       msg.csi_stream_set_config_req.error_config = error_config;
+       msg.csi_stream_set_config_req.config_flags = NVCSI_CONFIG_FLAG_BRICK | NVCSI_CONFIG_FLAG_CIL | NVCSI_CONFIG_FLAG_ERROR;
 
        if (tegra_chan->valid_ports > 1)
                vi_port = (stream_id > 0) ? 1 : 0;
(END)
+
        dev_dbg(csi->dev, "%s: stream_id=%u, csi_port=%u\n",
                __func__, stream_id, csi_port);
 
@@ -290,6 +292,11 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        else
                cil_config.mipi_clock_rate = csi->clk_freq / 1000;
 
+       /* Error config */
+       memset(&error_config, 0, sizeof(error_config));
+       error_config.stream_intr_mask = 0x3;
+       error_config.status2vi_notify_mask = 0xFFFF;
+
        /* Set NVCSI stream config */
        memset(&msg, 0, sizeof(msg));
        msg.header.msg_id = CAPTURE_CSI_STREAM_SET_CONFIG_REQ;
@@ -298,6 +305,8 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        msg.csi_stream_set_config_req.csi_port = csi_port;
        msg.csi_stream_set_config_req.brick_config = brick_config;
        msg.csi_stream_set_config_req.cil_config = cil_config;
+       msg.csi_stream_set_config_req.error_config = error_config;
+       msg.csi_stream_set_config_req.config_flags = NVCSI_CONFIG_FLAG_BRICK | NVCSI_CONFIG_FLAG_CIL | NVCSI_CONFIG_FLAG_ERROR;
 
        if (tegra_chan->valid_ports > 1)
                vi_port = (stream_id > 0) ? 1 : 0;

However, there’s still a small incompatibility with Jetpack-5.1.2, it introduced following compilation error :

/devel/RTR/SW/nvidia-jetson-orin-based-camera-driver-v2-next-test/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c: In function 'csi5_stream_set_config':
/devel/RTR/SW/nvidia-jetson-orin-based-camera-driver-v2-next-test/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c:297:15: error: 'struct nvcsi_error_config' has no member named 'stream_intr_mask'; did you mean 'stream_intr_mask_lic'?
  297 |  error_config.stream_intr_mask = 0x3;
      |               ^~~~~~~~~~~~~~~~
      |               stream_intr_mask_lic
make[7]: *** [drivers/media/platform/tegra/camera/nvcsi/csi5_fops.o] Error 1
make[6]: *** [drivers/media/platform/tegra/camera/nvcsi] Error 2
make[5]: *** [drivers/media/platform/tegra/camera] Error 2
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [drivers/media/platform/tegra] Error 2
make[3]: *** [drivers/media/platform] Error 2
make[2]: *** [drivers/media] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [drivers] Error 2
make: *** [__sub-make] Error 2

Can you help to unblock (i.e. to select btw stream_intr_mask_lic or stream_intr_mask_hsm instead of stream_intr_mask), please ?

Best Regards,
Khang