[U-Boot] Support for several I2C interfaces in the same board.

I read a discussion about this subject in the past but it didn't arrive to a conclusion. What would be necessary for supporting two I2C interfaces? Maybe an i2c command that supports changing active interface or something similar?

Hello javier,
javier Martin wrote:
I read a discussion about this subject in the past but it didn't arrive to a conclusion. What would be necessary for supporting two I2C interfaces? Maybe an i2c command that supports changing active interface or something similar?
What do you mean with two I2C interfaces? If you mean 2 with one hardware interface (for example fsl_i2c.c) this is possible with actual code. Search for i2c_set_bus_num(), i2c_get_bus_num() ...
If you need two different hardware interfaces, there is an approach, see:
http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=shortlog;h=refs/heads/multibus...
I ported (hopefully all) hardware i2c drivers to this new approach, but didn;t find the time to test this again from scratch, I just hold it in sync with mainline, and if I find time for testing it again and it works, I vote for including it in mainline ...
But testers are welcome :-)
bye Heiko

If you need two different hardware interfaces, there is an approach, see:
http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=shortlog;h=refs/heads/multibus...
I ported (hopefully all) hardware i2c drivers to this new approach, but didn;t find the time to test this again from scratch, I just hold it in sync with mainline, and if I find time for testing it again and it works, I vote for including it in mainline ...
Thank you this is what I meant.
But testers are welcome :-)
Sure, count on me for that; as soon as I have finished i.mx27 i2c driver I will integrate it in your tree and test it.

Hello javier,
javier Martin wrote:
If you need two different hardware interfaces, there is an approach, see:
http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=shortlog;h=refs/heads/multibus...
I ported (hopefully all) hardware i2c drivers to this new approach, but didn;t find the time to test this again from scratch, I just hold it in sync with mainline, and if I find time for testing it again and it works, I vote for including it in mainline ...
Thank you this is what I meant.
But testers are welcome :-)
Sure, count on me for that; as soon as I have finished i.mx27 i2c driver I will integrate it in your tree and test it.
Great!
Hmm.. there is a driver/i2c/mxc_i2c.c driver for i.mx31, maybe the i.mx27 is similiar to this? Can you check this?
bye Heiko

Hmm.. there is a driver/i2c/mxc_i2c.c driver for i.mx31, maybe the i.mx27 is similiar to this? Can you check this?
Yes, I2C registers are the same in both chips. The only things that I must change are: - i2c clock management. - i2c base addresses.
My current approach is trying to make this driver work for imx27/imx31 using CONFIG_MX27/CONFIG_MX31 defines. I don't know if you have a better suggestion for this.
Thank you.

Hello javier,
javier Martin wrote:
Hmm.. there is a driver/i2c/mxc_i2c.c driver for i.mx31, maybe the i.mx27 is similiar to this? Can you check this?
Yes, I2C registers are the same in both chips. The only things that I must change are:
- i2c clock management.
- i2c base addresses.
Ok.
My current approach is trying to make this driver work for imx27/imx31 using CONFIG_MX27/CONFIG_MX31 defines. I don't know if you have a better suggestion for this.
Sounds good to me. Maybe you talk with Sascha Hauer s.hauer@pengutronix.de added to cc, as he is the original writer of this code.
bye Heiko
participants (2)
-
Heiko Schocher
-
javier Martin