AnsweredAssumed Answered

I2C on i.mx28 EVK - cannot switch to 400KHz

Question asked by Artem Kamshilin on Aug 23, 2012
Latest reply on Sep 11, 2012 by Artem Kamshilin

Hi everyone,

 

I'm stuck trying to switch i.mx28 board to 400 KHz mode. I patched the following file:

 

drivers/i2c/busses/i2c-mxs.c

 

to set HW_I2C_TIMING0 register to 0x000F0007 as recommended by the MX28 Reference Manual. However, something resets it all the time to its default value of 0x00780030, and the bus falls back to 100 KHz mode. Worst yet, it happens while a I2C transfer is under way:

 

(line 328 of the above file):

    printk("Timing reg 3: 0x%08x\n", __raw_readl(dev->regbase + HW_I2C_TIMING0));

    err = wait_for_completion_interruptible_timeout(&dev->cmd_complete,
                            msecs_to_jiffies(1000)
        );

    printk("Timing reg 4: 0x%08x\n", __raw_readl(dev->regbase + HW_I2C_TIMING0));

outputs:

Timing reg 3: 0x000f0007
Timing reg 4: 0x00780030

I grep'ped through the kernel source trying to find any reference to HW_I2C_TIMING0 register (and change it) - but found none except for its definition in a header file.

 

Does HW_I2C_TIMING0 reset itself to default values somehow? How do I make my changes stick? Anything helps... thanks in advance.

 

Regards,

Arty

Outcomes