On Thu, Sep 15, 2011 at 3:39 AM, Marek Vasut <marek.va...@gmail.com> wrote: > On Friday, July 29, 2011 08:55:14 AM Jason Hui wrote: >> Hi, Marek, >> >> On Thu, Jul 14, 2011 at 5:58 AM, Marek Vasut <marek.va...@gmail.com> wrote: >> > Rewrite the mxc_i2c driver. >> > * This version is much closer to Linux implementation. >> > * Fixes IPG_PERCLK being incorrectly used as clock source >> > * Fixes behaviour of the driver on iMX51 >> > * Clean up coding style a bit ;-) >> >> why you change i2c clock from IPG_PERCLK to IPG_CLK? >> >> [...] > > Ok, I investigated a bit deeper and I suspect the clock.c is the culprit. > > Apparently, the PERCLK doesn't run at the frequency the clock.c reports it > runs > on. Therefore, the i2c miscalculates the divider etc -- falling crap model > (waterfall model).
But apparently, the i2c function clock should be IPG_PERCLK not IPG clock. And Linux also fix it already. commit 9d73242458d9a2fe26e2e240488063d414eacb1c Author: Lothar Waßmann <l...@karo-electronics.de> Date: Mon Jul 4 15:52:17 2011 +0200 mach-mx5: fix the I2C clock parents The clock from which the I2C timing is derived is the ipg_perclk not ipg_clk. I2C bus frequency was lower by a factor of ~8 due to the clock divider calculation being based on 66.5MHz IPG clock while the bus actually uses 8MHz ipg_perclk. Kernel version: 3.0.0-rc2 branch 'imx-for-next' of git://git.pengutronix.de/git/imx/linux-2.6 Signed-off-by: Lothar Waßmann <l...@karo-electronics.de> Signed-off-by: Sascha Hauer <s.ha...@pengutronix.de> > > Anyway, Jason, can you look into that clock problem? I think there are more > than > just perclk miscalculated. OK, I will check that part. Jason > > Cheers > _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot