Using I2C Driver model with u-boot

we have I2C devices behind a PCA9548A I2C mux. It works from Linux, but I would also want to access the I2C devices from U-boot. In the u-boot .conf the TI PCA954x driver can be enabled, but this driver uses the driver model for I2C devices (CONFIG_DM_I2S), which seems to be incompatible with CONFIG_SYS_I2C.

make shows:
error: #error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
 #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"

CONFIG_SYS_I2C is defined in some toradex specific files like /board/toradex/apalis_imx6/apalis_imx6.c. It also seems to be required by pf0100.c (“The following is needed during production”).

What is your suggestion how to proceed? Will CONFIG_DM_I2S be supported?

I enabled:
Device-Tree Control → Run-ime configuration via Devicetree
Device Drivers->I2C Support->Enable Driver Model for I2C drivers
Device Drivers->I2C Support->Enable I2C compatibility layer
Device Drivers->I2C Support-> Support for I2C multiplexers
Device Drivers->I2C Support-> TI PCA954x I2C Mux/switch

I am on aca804c9ddadbf34a8ff82779e5598ec5e319f23 of 2016.11-toradex u-boot


May I recommend using mainline U-Boot which comes with Driver Model I2C integration readily available. You may also wait for our upcoming BSP 3.0b2 release where we adopted U-Boot 2019.07 for all our modules.

Thank you. I think I will wait for your 3.0b2 release for u-boot. Will this version of u-boot be able to boot the older 2.7 linux without problems?

Hi @mkock

Usually we are releasing a complete Bsp with a specific Uboot version and Linux Kernel version. This complete version of Bsp is tested.
You are free to change Bsp according to your needs. So usually the kernel from Bsp 2.7 should work with new UBoot.

Please Note, Bsp 2.7 is not supported anymore. You should update to Bsp 2.8 at yours earliest convenience.

Best regards,