Reload sn65dsi83 after crc error

Problem Description:

Hardware:

  • Kernel 5.15.148-6.7.0+git.bfdbfb2c85fb
  • IMX8MM Verdin SOM Module
  • LVDS Display
  • Bridge: sn65dsi83 MIPI to LVDS converter
  • Same setup as on the Dahlia Eval Board

Issue:

  • After an ESD test on the device’s enclosure, the sn65dsi83 reports an error, and the display turns off.
  • The following command results in:
i2cget -f -y 3 0x2c 0xE5 ==> 0x31 (CRC Error, ECC Error)

Actions attempted without success:

  • Unloading the ti_sn65dsi83 module:
rmmod ti_sn65dsi83
  • Re-loading the module:
modprobe ti_sn65dsi83
  • After these actions, the i2cget command fails to execute:
i2cget -f -y 3 0x2c 0xE5 ==> Error: Read failed
  • All other devices on I2C-3 are reachable.

Question: How can we get the sn65dsi83 back to working condition without needing a full system reboot?

## tdx-info
***********************************
Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.148-6.7.0+git.bfdbfb2c85fb #1-TorizonCore SMP PREEMPT Thu Jun 20 15:59:41 UTC 2024
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.0/torizon/aefdbf26b2299d24fad7c82f17f83c6c0395443e4aa03467de2dcac3874518e5/0
Distro name:              NAME="TorizonCore"
Distro version:           VERSION_ID=6.7.0-build.18
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-imx8mm-15035141
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Mini on XXXXX Baseboard
Toradex version:          0057 V1.1B
Serial number:            15035141
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

I’m sorry to hear about the issues you’re experiencing with the sn65dsi83 MIPI to LVDS converter after the ESD test. Let’s explore some software-based solutions to reset the device without needing a full system reboot:

  1. Use I2C Tools for Reset: If the sn65dsi83 has a reset register, you can attempt to reset it using the i2cset command. For example:

    i2cset -f -y 3 0x2c <register> <value>
    

    Replace <register> and <value> with the appropriate values for your device. This can sometimes clear error states.

  2. Check for Updated Drivers or Firmware: Ensure that you are using the latest drivers and firmware for the sn65dsi83. Updates can sometimes resolve issues related to error handling.

  3. Review System Logs: Examine the system logs for any additional error messages that might provide more insight into the issue. This can help identify if there are other underlying problems.

These steps focus on software solutions that might help reset the device. If the issue persists, further investigation into the system’s configuration or environment might be necessary.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Backlight installed but not working.

Does anyone have an idea? Unfortunately, the problem still persists.

Hello @Sire,

What does the kernel logs related to i2c show? You can check it with the command:
dmesg | grep i2c

Also, what is the output that you have on i2cdetect -y 3

If you have another verdin iMX8MM module with you, could you please test it on this carrier board? This way we will know if something went wrong with the i2c on the carrier board.

After the ESD test, I can still access the SN65DSI83. The status register reports this error:

  • i2cget -f -y 3 0x2c 0xE5 ==> 0x31 (CRC Error, ECC Error)

Only after unloading and reloading the kernel module “ti_sn65dsi83” (0x2c) using rmmod and modprobe can I no longer access it.

  • i2cget -f -y 3 0x2c 0xE5 ==> Error: Read failed

The touch controller (0x41), which is running on the same I2C-3 bus, still works fine.

  • i2cget -f -y 3 0x41 ==> 0x80 still works.

It seems that I2C-3 is functioning.

Is there a way to reset the SN65DSI83 without unloading the kernel module? So far, nothing has helped, and only a reboot resolves the issue. However, a reboot is not feasible for our use case.

Hello @Sire,

You can try unbinding / binding the module. This forces the firmware to be reloaded:

cd /sys/bus/platform/drivers/imx-i2c
echo 30a50000.i2c >unbind
echo 30a50000.i2c >bind

You can then check the output of dmesg to make sure the firmware was reloaded. Please let me know if this solves the issue.

Unfortunately, this does not work. Even after the bind/unbind, the error flags in register 0x5E are still set. My assumption is that it is not directly related to the sn65dsi83 but that incorrect mipi-dsi values are sent after the ESD test. So the mipi-dsi driver has to reinitialize.

Also tried:

  • cd /sys/bus/platform/drivers/imx-i2c; echo 30a50000.i2c >unbind; echo 30a50000.i2c >bind
  • cd /sys/bus/platform/drivers/imx-i2c; echo 30a50000.i2c >unbind; echo 30a50000.i2c >bind
  • cd /sys/bus/platform/drivers/imx_sec_dsim_drv; echo 32e10000.mipi_dsi >unbind; echo 32e10000.mipi_dsi >bind
  • cd /sys/bus/platform/drivers/panel-lvds; echo panel-lvds >unbind; echo panel-lvds >bind

Unfortunately, nothing works. The error is still present.

i2cget -f -y 3 0x2c 0xE5 ==> 0x31 (CRC Error, ECC Error)

Hello @Sire,

Thanks for the update!

I just checked how to reset the DSI bridge without rebooting the device. You can put the module to deep sleep - which would reset the bridge (controlled by CTRL_SLEEP_MOCI signal that goes to the pin 59 on the adapter for DSI_1_PWR_EN). I could verify this on my end. In my test, I used the suspend to RAM state with the wakeup with RTC alarm:

# echo +5 > /sys/class/rtc/rtc1/wakealarm; echo deep > /sys/power/mem_sleep; echo mem > /sys/power/state

Could you please confirm if this solves the issue for you?

Now we’ve been able to test it! The workaround works. Great, thank you!

1 Like