TX2 Mipi cal timeout

Hi,
I’m using the Toshiba tc358840 and am having difficulty getting a capture to succeed.

I have 4 other single lane sensors hooked up on CSI ports A, B, E, F.
I have the tc358840 on port C/D.

This works on the TX1 (release 24.1), then we switch to TX2 and can’t get the calibration or capture to work.

There are two problems I’m seeing.

  1. Mipi Calibration Failed
  2. tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11

My first concern is why mipi calibration fails. Can somebody enlighten me as to what happends during the calibration process? Is the attached camera required to output some sort of signal or is it just in LP11 state the whole time?

Is there something special required in the DTS to enable clocks to the mipi calibration block?

As for the DTS configuration, I’m basically copied the values from the git repository here (and modified the csi port index):
https://github.com/InES-HPMM/linux-l4t-4.4-hardware-t18x-quill/commit/67b165cf14e6a34ce3113ce41715fec688dd794c#diff-13c2f8e7d70213692efb084828d01740

Once again, this hardware has been verified as working with a TX1 system, and the signal has been verified as valid CSI using the following hardware:
Oscilloscope : Lecroy SDA 813Zi
Differential probes: Lecroy D1305PS

[   84.159165] tegra_mipi_cal 3990000.mipical: Mipi cal timeout,val:406651, lanes:c00000
[   84.167004] Fixed clk 68MHz
[   84.169807] tegra_mipi_cal 3990000.mipical: MIPI_CAL_CTRL                  0x04 0x2a000010
[   84.178079] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS            0x0c 0x00406651
[   84.186351] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS_2          0x10 0x00000000
[   84.194647] tegra_mipi_cal 3990000.mipical: CILA_MIPI_CAL_CONFIG           0x18 0x00000000
[   84.202910] tegra_mipi_cal 3990000.mipical: CILB_MIPI_CAL_CONFIG           0x1c 0x00000000
[   84.211169] tegra_mipi_cal 3990000.mipical: CILC_MIPI_CAL_CONFIG           0x20 0x00200000
[   84.219428] tegra_mipi_cal 3990000.mipical: CILD_MIPI_CAL_CONFIG           0x24 0x00200000
[   84.227691] tegra_mipi_cal 3990000.mipical: CILE_MIPI_CAL_CONFIG           0x28 0x00000000
[   84.235956] tegra_mipi_cal 3990000.mipical: CILF_MIPI_CAL_CONFIG           0x2c 0x00000000
[   84.244220] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG           0x3c 0x00000200
[   84.252482] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG           0x40 0x00000200
[   84.260752] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG           0x44 0x00000200
[   84.269056] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG           0x48 0x00000200
[   84.277345] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG0             0x5c 0x00000000
[   84.285642] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG1             0x60 0x00000000
[   84.293918] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG2             0x64 0x00010010
[   84.302199] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG_2         0x68 0x00000002
[   84.310474] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG_2         0x6c 0x00000002
[   84.318749] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG_2         0x74 0x00000002
[   84.327020] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG_2         0x78 0x00000002

I have also tried enabling additional debugging as suggested in other threads:

[root@MKXXXXXXXXXXXXX ~]# echo 1 > /sys/kernel/debug/tracing/tracing_on
[root@MKXXXXXXXXXXXXX ~]# echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
[root@MKXXXXXXXXXXXXX ~]# echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
[root@MKXXXXXXXXXXXXX ~]# echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
[root@MKXXXXXXXXXXXXX ~]# echo 2 > /sys/kernel/debug/camrtc/log-level
[root@MKXXXXXXXXXXXXX ~]# echo > /sys/kernel/debug/tracing/trace
[root@MKXXXXXXXXXXXXX ~]# yavta -c10 /dev/video0 -fUYVY -s1920x1080 -F/tmp/test.raw
Device /dev/video0 opened.
Device `vi-output, tc358840 2-001f' on `platform:15700000.vi:2' is a video capture device.
Video format set: UYVY (59565955) 1920x1080 (stride 3840) buffer size 4147200
Video format: UYVY (59565955) 1920x1080 (stride 3840) buffer size 4147200
8 buffers requested.
length: 4147200 offset: 0
Buffer 0 mapped at address 0x7f94171000.
length: 4147200 offset: 4149248
Buffer 1 mapped at address 0x7f93d7c000.
length: 4147200 offset: 8298496
Buffer 2 mapped at address 0x7f93987000.
length: 4147200 offset: 12447744
Buffer 3 mapped at address 0x7f93592000.
length: 4147200 offset: 16596992
Buffer 4 mapped at address 0x7f9319d000.
length: 4147200 offset: 20746240
Buffer 5 mapped at address 0x7f92da8000.
length: 4147200 offset: 24895488
Buffer 6 mapped at address 0x7f929b3000.
length: 4147200 offset: 29044736
Buffer 7 mapped at address 0x7f925be000.
0 (0) [-] 0 4147200 bytes -266658578408.-274870030 794.874438 -0.000 fps
1 (1) [-] 1 4147200 bytes -266658578408.-274870030 795.878658 0.000 fps
2 (2) [-] 2 4147200 bytes -266658578408.-274870030 796.882440 0.000 fps
3 (3) [-] 3 4147200 bytes -266658578408.-274870030 797.886412 0.000 fps
4 (4) [-] 4 4147200 bytes -266658578408.-274870030 798.890425 0.000 fps
5 (5) [-] 5 4147200 bytes -266658578408.-274870030 799.894421 0.000 fps
6 (6) [-] 6 4147200 bytes -266658578408.-274870030 800.898425 0.000 fps
7 (7) [-] 7 4147200 bytes -266658578408.-274870030 801.902604 0.000 fps
8 (0) [-] 8 4147200 bytes -266658578408.-274870030 802.906551 0.000 fps
9 (1) [-] 9 4147200 bytes -266658578408.-274870030 803.910461 0.000 fps
Captured 10 frames in 12.903930 seconds (0.774958 fps, 3213904.397920 B/s).
8 buffers released.
[root@MKXXXXXXXXXXXXX ~]# cat /sys/kernel/debug/tracing/trace                                   
# tracer: nop
#
# entries-in-buffer/entries-written: 96/96   #P:6
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
     kworker/1:1-104   [001] ...1   791.062701: rtos_queue_peek_from_isr_failed: tstamp:24947122701 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   791.062707: rtcpu_start: tstamp:24947124426
     kworker/1:1-104   [001] ...1   791.270712: rtos_queue_peek_from_isr_failed: tstamp:24952123571 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   791.426693: rtos_queue_peek_from_isr_failed: tstamp:24957124064 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   791.582698: rtos_queue_peek_from_isr_failed: tstamp:24962124580 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   791.745942: rtos_queue_peek_from_isr_failed: tstamp:24967125090 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   791.904540: rtos_queue_peek_from_isr_failed: tstamp:24972125581 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   792.058701: rtos_queue_peek_from_isr_failed: tstamp:24977126101 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   792.214700: rtos_queue_peek_from_isr_failed: tstamp:24982126606 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   792.370697: rtos_queue_peek_from_isr_failed: tstamp:24987127102 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   792.526700: rtos_queue_peek_from_isr_failed: tstamp:24992127623 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   792.682700: rtos_queue_peek_from_isr_failed: tstamp:24997128129 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   792.838694: rtos_queue_peek_from_isr_failed: tstamp:25002128636 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   792.994698: rtos_queue_peek_from_isr_failed: tstamp:25007129142 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   793.150695: rtos_queue_peek_from_isr_failed: tstamp:25012129637 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   793.306691: rtos_queue_peek_from_isr_failed: tstamp:25017130156 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   793.462690: rtos_queue_peek_from_isr_failed: tstamp:25022130660 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   793.670691: rtos_queue_peek_from_isr_failed: tstamp:25027131159 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   793.826699: rtos_queue_peek_from_isr_failed: tstamp:25032131675 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   793.982697: rtos_queue_peek_from_isr_failed: tstamp:25037132184 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   794.138696: rtos_queue_peek_from_isr_failed: tstamp:25042132680 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   794.294688: rtos_queue_peek_from_isr_failed: tstamp:25047133199 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   794.450699: rtos_queue_peek_from_isr_failed: tstamp:25052133706 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   794.606691: rtos_queue_peek_from_isr_failed: tstamp:25057134197 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   794.762690: rtos_queue_peek_from_isr_failed: tstamp:25062134719 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   794.918689: rtos_queue_peek_from_isr_failed: tstamp:25067135224 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   795.074691: rtos_queue_peek_from_isr_failed: tstamp:25072135720 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   795.230696: rtos_queue_peek_from_isr_failed: tstamp:25077136236 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   795.386695: rtos_queue_peek_from_isr_failed: tstamp:25082136745 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   795.542701: rtos_queue_peek_from_isr_failed: tstamp:25087137249 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   795.750693: rtos_queue_peek_from_isr_failed: tstamp:25092137746 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   795.906698: rtos_queue_peek_from_isr_failed: tstamp:25097138254 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   796.062693: rtos_queue_peek_from_isr_failed: tstamp:25102138771 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   796.218691: rtos_queue_peek_from_isr_failed: tstamp:25107139280 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   796.374693: rtos_queue_peek_from_isr_failed: tstamp:25112139772 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   796.530700: rtos_queue_peek_from_isr_failed: tstamp:25117140283 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   796.686691: rtos_queue_peek_from_isr_failed: tstamp:25122140789 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   796.842697: rtos_queue_peek_from_isr_failed: tstamp:25127141296 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   796.998699: rtos_queue_peek_from_isr_failed: tstamp:25132141814 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   797.154695: rtos_queue_peek_from_isr_failed: tstamp:25137142307 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   797.310698: rtos_queue_peek_from_isr_failed: tstamp:25142142815 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   797.466690: rtos_queue_peek_from_isr_failed: tstamp:25147143334 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   797.622695: rtos_queue_peek_from_isr_failed: tstamp:25152143838 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   797.830697: rtos_queue_peek_from_isr_failed: tstamp:25157144347 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   797.986696: rtos_queue_peek_from_isr_failed: tstamp:25162144853 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   798.142691: rtos_queue_peek_from_isr_failed: tstamp:25167145351 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   798.298697: rtos_queue_peek_from_isr_failed: tstamp:25172145867 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   798.454696: rtos_queue_peek_from_isr_failed: tstamp:25177146375 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   798.610698: rtos_queue_peek_from_isr_failed: tstamp:25182146868 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   798.766690: rtos_queue_peek_from_isr_failed: tstamp:25187147388 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   798.922688: rtos_queue_peek_from_isr_failed: tstamp:25192147898 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   799.078689: rtos_queue_peek_from_isr_failed: tstamp:25197148401 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   799.234699: rtos_queue_peek_from_isr_failed: tstamp:25202148898 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   799.390691: rtos_queue_peek_from_isr_failed: tstamp:25207149401 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   799.546700: rtos_queue_peek_from_isr_failed: tstamp:25212149910 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   799.702706: rtos_queue_peek_from_isr_failed: tstamp:25217150429 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   799.910692: rtos_queue_peek_from_isr_failed: tstamp:25222150936 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   800.066701: rtos_queue_peek_from_isr_failed: tstamp:25227151432 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   800.222699: rtos_queue_peek_from_isr_failed: tstamp:25232151949 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   800.378704: rtos_queue_peek_from_isr_failed: tstamp:25237152445 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   800.534700: rtos_queue_peek_from_isr_failed: tstamp:25242152963 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   800.690699: rtos_queue_peek_from_isr_failed: tstamp:25247153471 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   800.846706: rtos_queue_peek_from_isr_failed: tstamp:25252153963 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   801.002700: rtos_queue_peek_from_isr_failed: tstamp:25257154484 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   801.158708: rtos_queue_peek_from_isr_failed: tstamp:25262154988 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   801.314694: rtos_queue_peek_from_isr_failed: tstamp:25267155497 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   801.470696: rtos_queue_peek_from_isr_failed: tstamp:25272156006 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   801.626696: rtos_queue_peek_from_isr_failed: tstamp:25277156498 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   801.782694: rtos_queue_peek_from_isr_failed: tstamp:25282157019 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   801.990697: rtos_queue_peek_from_isr_failed: tstamp:25287157524 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   802.146690: rtos_queue_peek_from_isr_failed: tstamp:25292158032 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   802.302695: rtos_queue_peek_from_isr_failed: tstamp:25297158538 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   802.458692: rtos_queue_peek_from_isr_failed: tstamp:25302159043 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   802.614699: rtos_queue_peek_from_isr_failed: tstamp:25307159541 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   802.770690: rtos_queue_peek_from_isr_failed: tstamp:25312160057 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   802.926695: rtos_queue_peek_from_isr_failed: tstamp:25317160566 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   803.082695: rtos_queue_peek_from_isr_failed: tstamp:25322161066 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   803.238692: rtos_queue_peek_from_isr_failed: tstamp:25327161579 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   803.394702: rtos_queue_peek_from_isr_failed: tstamp:25332162087 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   803.550707: rtos_queue_peek_from_isr_failed: tstamp:25337162580 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   803.706702: rtos_queue_peek_from_isr_failed: tstamp:25342163100 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   803.862696: rtos_queue_peek_from_isr_failed: tstamp:25347163606 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   804.070698: rtos_queue_peek_from_isr_failed: tstamp:25352164114 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   804.226706: rtos_queue_peek_from_isr_failed: tstamp:25357164619 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   804.382701: rtos_queue_peek_from_isr_failed: tstamp:25362165115 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   804.538696: rtos_queue_peek_from_isr_failed: tstamp:25367165627 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   804.694700: rtos_queue_peek_from_isr_failed: tstamp:25372166140 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   804.850696: rtos_queue_peek_from_isr_failed: tstamp:25377166649 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   805.006697: rtos_queue_peek_from_isr_failed: tstamp:25382167154 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   805.162697: rtos_queue_peek_from_isr_failed: tstamp:25387167662 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   805.318709: rtos_queue_peek_from_isr_failed: tstamp:25392168159 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   805.474695: rtos_queue_peek_from_isr_failed: tstamp:25397168675 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   805.630702: rtos_queue_peek_from_isr_failed: tstamp:25402169183 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   805.786707: rtos_queue_peek_from_isr_failed: tstamp:25407169676 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   805.942705: rtos_queue_peek_from_isr_failed: tstamp:25412170196 queue:0x0b4a3c58
     kworker/1:1-104   [001] ...1   805.994706: rtos_queue_peek_from_isr_failed: tstamp:25413138614 queue:0x0b4a3c58

Any help would be greatly appreciated!
Thanks,
Paul

@phabsch

  1. The trace log shows CSI/VI didn’t get any validate frame from MIPI bus. Check the kernel message to make sure the tc358840 have configure will like below. You should get 1080p’s event

[ 1131.586670] tc358840 2-001f: tc358840_format_change: New format: 3840x2160p30.0 (4000x2215)

  1. Run below command before run the yavata
v4l2-ctl -d /dev/video0 --set-ctrl bypass_mode=0

Thanks for the reply.

It seems this was a hardware (flex cable) fault. Replaced component works fine.

Hello, if this was a hardware issue, how was it working on the TX1?