Question: how to modify dts for YUV sensor ??

dear,

My Settings are as follows, but kernel crashed

mode_type = "yuv";
                                                 pixel_phase = "yuyv";
                                                 csi_pixel_bit_depth = "8";
                                                 dynamic_pixel_bit_depth = "8";

hello JiaZW,

may I know which JetPack release you’re currently working with.
could you please share the kernel failure messages.
BTW, you should use MMAPIs for launching YUV sensors, please also refer to Topic 1043986 for details.
thanks

dear JerryChang,

i use  JetPack  4.2 (newest)

kernel log as follow:

[    7.859297] tegra-pcie-dw 141a0000.pcie: PCIe link is not up...!
[    7.915405] tegra-cbb 14040000.cv-noc: noc_secure_irq = 94, noc_nonsecure_irq = 93>
[    8.095220] tegra194-isp5 14800000.isp: initialized
[    8.352803] tegra194-vi5 15c10000.vi: initialized
[    8.405700] tegra194-vi5 15c10000.vi: subdev ar0231 1-0048 bound
[    8.405725] tegra194-vi5 15c10000.vi: subdev 15a00000.nvcsi--1 bound
[    8.405963] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[    8.405964] Mem abort info:
[    8.405965]   ESR = 0x96000005
[    8.405967]   Exception class = DABT (current EL), IL = 32 bits
[    8.405968]   SET = 0, FnV = 0
[    8.405969]   EA = 0, S1PTW = 0
[    8.405970] Data abort info:
[    8.405971]   ISV = 0, ISS = 0x00000005
[    8.405972]   CM = 0, WnR = 0
[    8.405980] [0000000000000000] user address but active_mm is swapper
[    8.405983] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[    8.405988] Modules linked in:
[    8.405992] CPU: 1 PID: 18 Comm: kworker/1:0 Not tainted 4.9.140 #11
[    8.405993] Hardware name: jetson-xavier (DT)
[    8.406005] Workqueue: events deferred_probe_work_func
[    8.406007] task: ffffffc3ee3f5400 task.stack: ffffffc3ed80c000
[    8.406013] PC is at camera_common_g_fmt+0x44/0xc8
[    8.406014] LR is at camera_common_g_fmt+0x30/0xc8
[    8.406016] pc : [<ffffff8008b1b704>] lr : [<ffffff8008b1b6f0>] pstate: 20800045
[    8.406018] sp : ffffffc3ed80f6e0
[    8.406029] x29: ffffffc3ed80f6e0 x28: ffffffc3ec0ffc20 
[    8.406035] x27: ffffffc3ececa518 x26: 0000000000000038 
[    8.406037] x25: 0000000000000001 x24: ffffffc3ececa758 
[    8.406039] x23: ffffffc3ea832050 x22: ffffffc3ea832050 
[    8.406042] x21: ffffffc3ea832018 x20: 0000000000000000 
[    8.406044] x19: ffffffc3ed80f7b0 x18: 0000000000000001 
[    8.406047] x17: 0000000000016fef x16: 0000000000358592 
[    8.406049] x15: ffffffffffffffff x14: ffffffc3ed80f6e0 
[    8.406051] x13: ffffffc3ed80f5e5 x12: ffffffc3ececa018 
[    8.406054] x11: ffffffc3ea832190 x10: ffffff8009034cf0 
[    8.406075] x9 : 0000000000000002 x8 : 0000000000000002 
[    8.406077] x7 : ffffff8008f86e48 x6 : 0000000000000090 
[    8.406080] x5 : 000000000000008d x4 : 0000000000000001 
[    8.406082] x3 : 0000000000010000 x2 : 0000000000000000 
[    8.406085] x1 : ffffffc3ee3f5400 x0 : 0000000000000001 
[    8.406085] 
[    8.406087] Process kworker/1:0 (pid: 18, stack limit = 0xffffffc3ed80c000)
[    8.406089] Call trace:
[    8.406092] [<ffffff8008b1b704>] camera_common_g_fmt+0x44/0xc8
[    8.406095] [<ffffff8008b1fcf0>] v4l2sd_get_fmt+0x28/0x38
[    8.406100] [<ffffff8008b09cfc>] tegra_channel_fmts_bitmap_init+0x12c/0x238
[    8.406102] [<ffffff8008b0be8c>] tegra_channel_init_subdevices+0x15c/0x738
[    8.406105] [<ffffff8008b0d1b0>] tegra_vi_graph_notify_complete+0x500/0x688
[    8.406109] [<ffffff8008af13f8>] v4l2_async_test_notify+0x108/0x120
[    8.406112] [<ffffff8008af153c>] v4l2_async_notifier_register+0x12c/0x1a0
[    8.406114] [<ffffff8008b0de68>] tegra_vi_graph_init+0x210/0x290
[    8.406117] [<ffffff8008b07fb8>] tegra_vi_media_controller_init+0x1a0/0x1d8
[    8.406121] [<ffffff8008550758>] vi5_priv_late_probe+0x118/0x130
[    8.406124] [<ffffff800855083c>] vi5_probe+0xcc/0xd0
[    8.406127] [<ffffff8008759710>] platform_drv_probe+0x60/0xc8
[    8.406129] [<ffffff8008756cd8>] driver_probe_device+0xd0/0x3f8
[    8.406132] [<ffffff80087571dc>] __device_attach_driver+0xb4/0x160
[    8.406134] [<ffffff80087548f4>] bus_for_each_drv+0x6c/0xa8
[    8.406136] [<ffffff8008756a4c>] __device_attach+0xcc/0x160
[    8.406139] [<ffffff8008757304>] device_initial_probe+0x24/0x30
[    8.406141] [<ffffff8008755bc8>] bus_probe_device+0xa0/0xa8
[    8.406164] [<ffffff80087561f8>] deferred_probe_work_func+0x90/0xe0
[    8.406169] [<ffffff80080d4e58>] process_one_work+0x1e8/0x490
[    8.406171] [<ffffff80080d533c>] worker_thread+0x23c/0x4c0
[    8.406175] [<ffffff80080dbb28>] kthread+0xd8/0xf0
[    8.406193] [<ffffff8008083850>] ret_from_fork+0x10/0x40
[    8.406196] ---[ end trace 7617342a49be5612 ]---
[    8.412384] Unable to handle kernel paging request at virtual address ffffffffffffffd8
[    8.412385] Mem abort info:
[    8.412386]   ESR = 0x96000005
[    8.412387]   Exception class = DABT (current EL), IL = 32 bits
[    8.412388]   SET = 0, FnV = 0
[    8.412389]   EA = 0, S1PTW = 0
[    8.412390] Data abort info:
[    8.412406]   ISV = 0, ISS = 0x00000005
[    8.412407]   CM = 0, WnR = 0
[    8.412409] swapper pgtable: 4k pages, 39-bit VAs, pgd = ffffff800a163000
[    8.412412] [ffffffffffffffd8] *pgd=0000000000000000, *pud=0000000000000000
[    8.412414] Internal error: Oops: 96000005 [#2] PREEMPT SMP
[    8.412416] Modules linked in:
[    8.412419] CPU: 1 PID: 18 Comm: kworker/1:0 Tainted: G      D         4.9.140 #11
[    8.412420] Hardware name: jetson-xavier (DT)
[    8.412457] task: ffffffc3ee3f5400 task.stack: ffffffc3ed80c000
[    8.412464] PC is at kthread_data+0x24/0x30
[    8.412482] LR is at wq_worker_sleeping+0x20/0xd0
[    8.412485] pc : [<ffffff80080dc74c>] lr : [<ffffff80080d5ff0>] pstate: 804000c5
[    8.412485] sp : ffffffc3ed80f2e0
[    8.412488] x29: ffffffc3ed80f2e0 x28: ffffffc3ee3f5400 
[    8.412491] x27: ffffff80080eb93c x26: ffffffc3ffe46cc0 
[    8.412493] x25: ffffffc3ee3f5ad0 x24: 0000000000000000 
[    8.412496] x23: ffffff80097c5000 x22: ffffffc3ee3f5400 
[    8.412498] x21: ffffff8009df8000 x20: ffffff80097d0000 
[    8.412500] x19: ffffffc3ee3f5400 x18: 000000000000000e 
[    8.412502] x17: 0000000000000007 x16: 0000000000000001 
[    8.412505] x15: 0000000000000019 x14: 0000000000000033 
[    8.412507] x13: 000000000000004c x12: 0000000000000068 
[    8.412510] x11: 00000000007f7cd6 x10: 0000000000802463 
[    8.412512] x9 : 00000000007f7cbe x8 : 0000000000000400 
[    8.412515] x7 : 0000000000000000 x6 : 0000000000000400 
[    8.412517] x5 : ffffffc3ee3f54c0 x4 : 000000000000a000 
[    8.412519] x3 : 0000000000000000 x2 : 0000000000000000 
[    8.412522] x1 : ffffffc3ffe46cc0 x0 : 0000000000000000 
[    8.412522] 
[    8.412524] Process kworker/1:0 (pid: 18, stack limit = 0xffffffc3ed80c000)
[    8.412525] Call trace:
[    8.412528] [<ffffff80080dc74c>] kthread_data+0x24/0x30
[    8.412534] [<ffffff8008f1c758>] __schedule+0x4f8/0x770
[    8.412540] [<ffffff80080eb93c>] do_task_dead+0x74/0x78
[    8.412545] [<ffffff80080b9bdc>] do_exit+0x5c4/0x9d8
[    8.412548] [<ffffff800808c438>] die+0x188/0x1a0
[    8.412552] [<ffffff80080a3628>] __do_kernel_fault.isra.1+0x140/0x218
[    8.412555] [<ffffff80080a39b4>] do_page_fault+0x1d4/0x4c0
[    8.412558] [<ffffff80080a3d0c>] do_translation_fault+0x6c/0x80
[    8.412560] [<ffffff8008080954>] do_mem_abort+0x54/0xb0
[    8.412562] [<ffffff8008082904>] el1_da+0x24/0xb4
[    8.412565] [<ffffff8008b1fcf0>] v4l2sd_get_fmt+0x28/0x38
[    8.412568] [<ffffff8008b09cfc>] tegra_channel_fmts_bitmap_init+0x12c/0x238
[    8.412584] [<ffffff8008b0be8c>] tegra_channel_init_subdevices+0x15c/0x738
[    8.412587] [<ffffff8008b0d1b0>] tegra_vi_graph_notify_complete+0x500/0x688
[    8.412590] [<ffffff8008af13f8>] v4l2_async_test_notify+0x108/0x120
[    8.412593] [<ffffff8008af153c>] v4l2_async_notifier_register+0x12c/0x1a0
[    8.412595] [<ffffff8008b0de68>] tegra_vi_graph_init+0x210/0x290
[    8.412597] [<ffffff8008b07fb8>] tegra_vi_media_controller_init+0x1a0/0x1d8
[    8.412600] [<ffffff8008550758>] vi5_priv_late_probe+0x118/0x130
[    8.412602] [<ffffff800855083c>] vi5_probe+0xcc/0xd0
[    8.412605] [<ffffff8008759710>] platform_drv_probe+0x60/0xc8
[    8.412607] [<ffffff8008756cd8>] driver_probe_device+0xd0/0x3f8
[    8.412610] [<ffffff80087571dc>] __device_attach_driver+0xb4/0x160
[    8.412612] [<ffffff80087548f4>] bus_for_each_drv+0x6c/0xa8
[    8.412614] [<ffffff8008756a4c>] __device_attach+0xcc/0x160
[    8.412616] [<ffffff8008757304>] device_initial_probe+0x24/0x30
[    8.412618] [<ffffff8008755bc8>] bus_probe_device+0xa0/0xa8
[    8.412621] [<ffffff80087561f8>] deferred_probe_work_func+0x90/0xe0
[    8.412623] [<ffffff80080d4e58>] process_one_work+0x1e8/0x490
[    8.412625] [<ffffff80080d533c>] worker_thread+0x23c/0x4c0
[    8.412627] [<ffffff80080dbb28>] kthread+0xd8/0xf0
[    8.412630] [<ffffff8008083850>] ret_from_fork+0x10/0x40
[    8.412632] ---[ end trace 7617342a49be5613 ]---

hello JiaZW,

there’s kernel panic while accessing a NULL pointer.
according to your call stack reporting, could you please narrow down the issue by checking below function. please also check which property reporting NULL and crash the kernel.
thanks

int camera_common_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf)
{
        struct camera_common_data *s_data = to_camera_common_data(sd->dev);
        const struct camera_common_colorfmt *fmt = s_data->colorfmt;

        dev_dbg(sd->dev, "%s++\n", __func__);

        mf->code        = fmt->code;
        mf->colorspace  = fmt->colorspace;
        mf->width       = s_data->fmt_width;
        mf->height      = s_data->fmt_height;
        mf->field       = V4L2_FIELD_NONE;
        mf->xfer_func = fmt->xfer_func;
        mf->ycbcr_enc = fmt->ycbcr_enc;
        mf->quantization = fmt->quantization;

        return 0;
}

dear JerryChang,

The above crash is mainly caused by the modification of DTS as follows;

Besides these, what else should I modify, such as (sensor_common and camera_common )?
mode_type = "yuv";
    pixel_phase = "yuyv";
    csi_pixel_bit_depth = "8";
    dynamic_pixel_bit_depth = "8";

hello JiaZW,

you will need to update both camera_common.c and sensor_common.c,
please check below two kernel functions and extend the default support formats.
for example,

<i>$l4t-r32.1/kernel_src/kernel/nvidia/drivers/media/platform/tegra/camera/camera_common.c</i>
static const struct camera_common_colorfmt camera_common_color_fmts[] = {...}

<i>$l4t-r32.1/kernel_src/kernel/nvidia/drivers/media/platform/tegra/camera/sensor_common.c</i>
static int extract_pixel_format(const char *pixel_t, u32 *format){...}