Jetson Nano Platform with IRS1125 camera

Hello,

I am working on the IRS1125 Camera Sensor Driver Integration to Jetson Nano platform.
Note: IRS1125 Driver Source code borrowed it from Raspberry PI Kernel Source.

We have modified the IRS1125 driver and created separate “dtsi” files for the IRS1125 device ( Included in tegra210-porg-p3448-common.dtsi file ) to support with the Jetson Nano platform.
Attached the IRS1125 and common dtsi zip files for reference.
jetson-irs1125-dtsi.zip
(16.7 KB)
With the above changes, the platform is capable to call the probe function of the IRS1125 driver.
The “driver insmod” process throws a segmentation fault. ( Logs are captured in the text file Jetson-IRS1125-logs.txt )
Jetson-IRS1125-logs.txt (11.2 KB)
[ 4.010531] Internal error: Accessing user space memory outside uaccess.h routines: 96000005 [#1] PREEMPT SMP
[ 4.020440] Modules linked in: overlay irs1125(+) nvgpu bluedroid_pm ip_tables x_tables
[ 4.028494] CPU: 0 PID: 2965 Comm: systemd-udevd Not tainted 4.9.140-tegra #33
[ 4.035705] Hardware name: MISTRAL Neuron Base Board (DT)
[ 4.041095] task: ffffffc0efec9c00 task.stack: ffffffc0efdc8000
[ 4.047010] PC is at tegra_channel_fmts_bitmap_init+0x21c/0x268
[ 4.052921] LR is at tegra_channel_fmts_bitmap_init+0x1e0/0x268
[ 4.058828] pc : [] lr : [] pstate: 60400045
[ 4.066210] sp : ffffffc0efdcb780
**[ 4.069516] x29: ffffffc0efdcb780 x28: 0000000000000018 **
**[ 4.074834] x27: 00000000000000cb x26: 0000000000000002 **
**[ 4.080151] x25: 0000000000000038 x24: 0000000000000001 **
**[ 4.085468] x23: ffffffc0f39e7418 x22: ffffffc0f75741e8 **
**[ 4.090783] x21: ffffffc0f7574018 x20: ffffffc0f39e7418 **
**[ 4.096097] x19: 00000000ffffffff x18: 0000000000000000 **
**[ 4.101414] x17: 0000000000000001 x16: 0000000000000007 **
**[ 4.106730] x15: 0000000000000000 x14: 0000000000000000 **
**[ 4.112043] x13: 0000000000000000 x12: 0000000000000006 **
**[ 4.117358] x11: 0000000000000002 x10: 00000000000002ec **
**[ 4.122674] x9 : 0000000000000001 x8 : 0000000000000001 **
**[ 4.127988] x7 : 000000000000000b x6 : 0000000000000000 **
**[ 4.133303] x5 : 0000000000000000 x4 : 000000000000000c **
**[ 4.138616] x3 : ffffffc0f7574360 x2 : 00000000000005a0 **
**[ 4.143929] x1 : 0000000000000160 x0 : 0000000000000000 **

[ 4.150729] Process systemd-udevd (pid: 2965, stack limit = 0xffffffc0efdc8000)
[ 4.158024] Call trace:
[ 4.160467] [] tegra_channel_fmts_bitmap_init+0x21c/0x268
[ 4.167418] [] tegra_channel_init_subdevices+0x17c/0x790
[ 4.174281] [] tegra_vi_graph_notify_complete+0x2e8/0x6e0
[ 4.181231] [] v4l2_async_test_notify+0x104/0x120
[ 4.187487] [] v4l2_async_register_subdev+0x88/0x100
[ 4.194010] [] irs1125_probe+0x344/0x438 [irs1125]
[ 4.200354] [] i2c_device_probe+0x144/0x258
[ 4.206091] [] driver_probe_device+0xd8/0x408
[ 4.211999] [] __driver_attach+0xdc/0x128
[ 4.217561] [] bus_for_each_dev+0x5c/0xa8
[ 4.223121] [] driver_attach+0x30/0x40
[ 4.228422] [] bus_add_driver+0x20c/0x2a8
[ 4.233984] [] driver_register+0x6c/0x110
[ 4.239546] [] i2c_register_driver+0x4c/0xb0
[ 4.245373] [] irs1125_driver_init+0x18/0x30 [irs1125]
[ 4.252064] [] do_one_initcall+0x44/0x130
[ 4.257626] [] do_init_module+0x64/0x1a8
[ 4.263103] [] load_module+0x10a4/0x12d8
[ 4.268577] [] SyS_finit_module+0xd8/0xf0
[ 4.274137] [] __sys_trace_return+0x0/0x4
[ 4.279699] —[ end trace 7fbccff4c3e391e6 ]—

Our plan is to use the IRS1125 device under the standard V4L2 driver.
Could you please help us to understand and fix this issue?

Thanks in advance !
Regards,
Adish PV

Hi,

From driving porting point of view, your issue is very common. I suggest you may check the structure define in the driver first…

Best Regards,
Rich Li

hello adish.pv,

you’ve got failures while probing the IRS1125 sensor driver.
for example,

[ 4.158024] Call trace:
[ 4.160467] [] tegra_channel_fmts_bitmap_init+0x21c/0x268
[ 4.167418] [] tegra_channel_init_subdevices+0x17c/0x790
[ 4.174281] [] tegra_vi_graph_notify_complete+0x2e8/0x6e0
[ 4.181231] [] v4l2_async_test_notify+0x104/0x120
[ 4.187487] [] v4l2_async_register_subdev+0x88/0x100
[ 4.194010] [] irs1125_probe+0x344/0x438 [irs1125]
[ 4.200354] [] i2c_device_probe+0x144/0x258

you may review your sensor driver and also device tree properties,
please also check Sensor Software Driver Programming Guide for reference,
thanks

Hi @rich.libin / @JerryChang,

Below is the current device structure for IRS1125 camera sensor driver.

struct irs1125 {
struct v4l2_subdev sd;
struct media_pad pad;
/* the parsed DT endpoint info */
//struct v4l2_fwnode_endpoint ep;

struct clk *xclk;
struct v4l2_ctrl_handler ctrl_handler;

/* To serialize asynchronus callbacks */
struct mutex lock;

/* image data layout */
unsigned int num_seq;

/* reset pin */
struct gpio_desc *reset;

/* V4l2 Controls to grab */
struct v4l2_ctrl *ctrl_modplls;
struct v4l2_ctrl *ctrl_numseq;

int power_count;
bool mod_pll_init;

};

Is there anything which we are missing out, with respect to tegra platform driver ?

Regards,
Adish PV

hello adish.pv,

you should also look into the probing function,
there’s function call to parse DT settings for sensor driver initialization,
thanks

Hello @JerryChang,

Thanks for your time.
We are trying to use IRS1125 driver for raspberry pi. Attached is the reference driver.
irs1125.c (28.7 KB)
I have gone through Sensor Software Driver Programming Guide.
Our driver doesn’t fall into version 1.0 nor version 2.0. It doesn’t add the device as a tegra sub-device.
The device tree changes has been done with reference to imx219.
Is it necessary to port the driver to either version 1.0 or version 2.0 inorder to make it work with Jetson Nano ?

hello adish.pv,

ideally, both v4l2 version-1.0 and 2.0 should works.
suggest you should break-down the probing function to check which property parsing caused such failure.
thanks