Multimaster I2C-0 Controller Time out and Recovery


#1

Hi,

I have an Arria 10 board running Linux on the HPS kernel version 4.1.22 ltsi. I am receiving a i2c_designware ffc02200.i2c: controller timed out kernel message when another master communicates on the bus. The SDA and SCL lines will remain high and there will be no output. If I run the reboot command, the i2c controller seems to be reset and the i2c works again. As a temporary solution until I figure out how to prevent this error from occurring I want to be able to reset i2c from user-land.
I tried using mmap() to access the HPS registers (tried i2c-0 and other registers), but I receive a “No such device” error. I have been able to use mmap() before to access peripherals in both the lw-bridge and HPS2FPGA bridge. Is access to the registers blocked from the user-side?
I am able to access these registers in uboot using md or mw.

Thank you


#2

After some more research I found that I should not be able to access the register addresses in user-land since that defeats the purpose of having Kernel. I need to write a Kernel module to access the registers. Does this sound correct? However, I am still not sure if I can reset the i2c controller since there is not reset register. Currently the only way for me to recover after another master communicates on the bus is to do a power cycle or reboot in Linux.