
Wolfgang Denk wrote:
Which exact driver are you referring to? If any driver has such a bug, it should be fixed.
drivers/i2c/fsl_i2c.c
The function is i2c_init(). I recently posted a patch that added this line of code:
i2c_bus_speed[0] = set_i2c_bus_speed(dev, gd->i2c1_clk, speed);
And this is what causes the problem. i2c_bus_speed[] is a global variable, and i2c_init() is called before relocation. Therefore, this function writes to flash the first time it's called.
This is not the way to go. Hushing up problems has never been a solution. Instead, let's find and fix the culprit.
I'm working on a patch that blocks i2c_init() from writing to global variables before relocation has occurred. But if you're saying that this patch should not be necessary, then that would be better.