Kernel can not boot after enable camera

Kernel version is R32.4.4Sources.
I would use camera module. After I change status from “disabled” to “okay” in the file tegra194-p2822-camera-modulels.dtsi, kernel can not boot.
The log and the code is in the attachment.
What is the reason?
or anything else should be configured,too? What is that?

hello ycl,

there’s a main device tree file for tegra camera modules; we normally using plugin-manager or sensor device tree to overwrite the VI port status while it’s valid for using.

may I know which camera module you’re working with.
please also refer to Sensor Software Driver Programming Guide for driver development.
thanks

We use max96712 deserial sensor, which is close to max9296 that was supportted by NVIDIA already.

According to “Sensor Software Driver Programming Guide”, our camera has no onboard EEPROM, so we have to use " Main Platform Device Tree"

hello ycl,

please create another dtsi file to maintain your own sensor device tree.

as you can see from tegra194-p2822-camera-modules.dtsi,
there’re several camera module device trees has been included; while you modify the VI port status you’ll also overwrite the overall behavior.
thanks

JerryChang:
/dev/video0 still not exist.
Infile graph.c, tegra_channel_csi_init function calls tegra_vi_get_port_info.
The param chan, chan->video is NULL. Why? Is this the root reason of “/dev/video0 still not exist” ?

I find that function tegra_vi_graph_notify_complete calls tegra_channel_init_video which malloc memory:
chan->video = video_device_alloc()
and then function tegra_vi_graph_notify_complete calls video_register_device which create “/dev/video0”.

But tegra_vi_graph_notify_complete is not called at all.

Should function tegra_vi_graph_notify_complete be called?
Why did my program not call function tegra_vi_graph_notify_complete?

Thanks

tegra194-p2888-0001-p2822-0000.dts (254.8 KB)

hello ycl,

please also refer to below two kernel device trees for the implementation of IMX390 with SerDes chip,
for example,
$L4T_Sources/r32.4.4/Linux_for_Tegra/source/public/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-camera-imx390-a00.dtsi
$L4T_Sources/r32.4.4/Linux_for_Tegra/source/public/hardware/nvidia/platform/t19x/common/kernel-dts/t19x-common-modules/tegra194-camera-imx390-a00.dtsi

you may also access Jetson Virtual Channel with GMSL Framework Guide for the details of software programming framework, and configuration info including virtual channel programming.
thanks

I did refer to the dtsi files. But /dev/video0 device node was not created.
Can you help me?

static int tegra_vi_graph_notify_complete(struct v4l2_async_notifier *notifier)
{
struct tegra_channel *chan =
container_of(notifier, struct tegra_channel, notifier);
struct tegra_vi_graph_entity *entity;
int ret;

dev_dbg(chan->vi->dev, "notify complete, all subdevs registered\n");
pr_err("tegra_vi_graph_notify_complete    --- byd ---    \n");

/* Allocate video_device */
ret = tegra_channel_init_video(chan);
if (ret < 0) {
	dev_err(&chan->video->dev, "failed to allocate video device %s\n",
		chan->video->name);
	return ret;
}

ret = video_register_device(chan->video, VFL_TYPE_GRABBER, -1);
if (ret < 0) {
	dev_err(&chan->video->dev, "failed to register %s\n",
		chan->video->name);
	goto register_device_error;
}

… …

Is this function useful? Why not be called in my program?
I think “video_register_device” in this function create /dev/video0, right?

hello ycl,

please deep dive the VI driver, it’s tegra_camera_device_register() to register camera driver as video device.
you may also refer to Tutorials page; please check [V4L2 Sensor Driver Development Tutorial] training video for sensor driver developments.
thanks

int vi5_priv_late_probe(struct platform_device *pdev)
{
struct tegra_camera_dev_info vi_info;
struct nvhost_device_data *info = platform_get_drvdata(pdev);
struct host_vi5 *vi5 = info->private_data;
int err;

pr_err("vi5_priv_late_probe    --- byd ---    \n");

memset(&vi_info, 0, sizeof(vi_info));
vi_info.pdev = pdev;
vi_info.hw_type = HWTYPE_VI;
vi_info.ppc = NUM_PPC;
vi_info.overhead = VI_OVERHEAD;
err = tegra_camera_device_register(&vi_info, vi5);
if (err)
	goto device_release;

err = vi_channel_drv_register(pdev, &vi5_channel_drv_ops);
if (err)
	goto device_release;

vi5_init_debugfs(vi5);

vi5->vi_common.mc_vi.vi = &vi5->vi_common;
vi5->vi_common.mc_vi.fops = &vi5_fops;
err = tegra_vi_media_controller_init(&vi5->vi_common.mc_vi, pdev);
if (err) {
	dev_warn(&pdev->dev, "media controller init failed\n");
	err = 0;
}

return 0;

device_release:
nvhost_client_device_release(pdev);

return err;

}

In vi5_priv_late_probe, tegra_camera_device_register is executed successfully, err result is 0.
And I can not find /dev/video0 device node on target xavier linux system when power on.

vi5_probe
-> vi5_priv_late_probe [tegra_camera_device_register is called in this func]
-> tegra_vi_media_controller_init
-> tegra_vi_graph_init
-> chan->notifier.complete = tegra_vi_graph_notify_complete
In tegra_vi_graph_notify_complete, video_register_device is called.
But tegra_vi_graph_notify_complete is not called.

hello ycl,

please review your Port Binding, you should have correct definition of the port binding for VI, NvCSI, and sensor modules.
thanks

After change dtsi and imx390 driver code, video0 and video1 appear in /dev dir. But when I try to preview using command “nvgstcapture-1.0 --prev-res=3”, error occured at the last line:
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:557 No cameras available

log.txt (81.9 KB) tegra194-p2888-0001-p2822-0000.dts (253.7 KB)

hello ycl,

there’re still some errors from camera stack that cause camera device did not register correctly.
could you please refer to Applications Using V4L2 IOCTL Directly, by using V4L2 IOCTL to verify basic functionality during sensor bring-up.
thanks

JerryChang:
using v4l2-ctl, I get the following error, which IO should I focus on?

byd@byd-desktop:~ byd@byd-desktop:~ v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=1 -d /dev/video0
VIDIOC_STREAMON: failed: Remote I/O error
byd@byd-desktop:~$

this one, VIDIOC_STREAMON.
you may also looking into kernel message for more clues.
thanks