Using I2C1 on Extension header of Ixora board with T30

I would like to use the I2C1 from the Ixora Extension Header X27 for a SMBus communication with a smart battery. I2C1 is not listed in sys/class/i2c-dev.
In the Apalis T30 Datasheet I2C1 is listed as a generic I2C. Is it possible to use the I2C1 on the Ixora board with a Apalis T30 ?

I2C1 aka the regular generic I2C bus should be available as i2c-0 as per the following article on our developer website:

https://developer.toradex.com/knowledge-base/i2c-(linux)

Hi @Dr_E_Brown

Yes, on the Apalis iMX6 you have the possibility to change the frequency with the device tree. How to change the device tree is described in this article. After that, you can mount your target to your host system using the UMS feature described in this article and replace the device tree by copying the built device tree blob (.dtb file) from the host and replace the existing one on the target.

Hi @Dr_E_Brown

Thank you for the call today. You raised the question on how to change the clock of this i2c bus.

In order to change the clock frequency from 400 kHz to anything else (probably 100 kHz), you need to change the static struct tegra_i2c_platform_data apalis_t30_i2c1_platform_data in the file arch/arm/mach-tegra/board-apalis_t30.cat line 622 as follows:

static struct tegra_i2c_platform_data apalis_t30_i2c1_platform_data = {
        .adapter_nr     = 0,
        .arb_recovery   = arb_lost_recovery,
        .bus_clk_rate   = {100000, 0},    //changed from 400000 to 100000
        .bus_count      = 1,
        .scl_gpio       = {I2C1_SCL, 0},
        .sda_gpio       = {I2C1_SDA, 0},
        .slave_addr     = 0x00FC,
};

After that, the kernel needs to be recompiled.

Best regards
Diego

Is it possible to change the clock frequency on an Apalis iMX6 modul without recompiling the kernel ?

Hi @Dr_E_Brown

Yes, with the Apalis iMX6 it is possible to change this value without the need of recompiling the kernel. With the Apalis iMX6 you have the possibility to change the frequency in the device tree. How to change a value there and do the compilation of this file is described in this article. When you have the device tree blob (.dtb file), you can activate the ums feature in u-boot on the target (the target is then accessable like a USB stick from the host) and exchange the existing device tree on the target with the new built one.

Best regards
Diego