[U-Boot] fsl_i2c: increase I2C timeout values and make them configurable

Timur Tabi timur at freescale.com
Thu Sep 10 15:07:36 CEST 2009


Joakim Tjernlund wrote:

> BTW, the fdr and dfsr calculations appears totally bogus. It seems
> like the table is taken from some examples in AN2919 and it is pure luck
> that it works most of the time. For me it does not work 100%, instead I get
> random errors which hangs both the controller and the RTC device.

Well, the problem is that for a given frequency, there are several values of fdr/dfsr that theoretically work.  So I picked what I thought would be good values for dfsr, but maybe it's not possible to pick such values.

A while back, someone posted a version of this code that computed the values of fdr/dfsr.  I nack'd that patch because I thought the algorithm was too convoluted, but perhaps what we really need is a combination of sorts.  The code should read the value of DFSR from the register, and then calculate an appropriate FDR to go with it.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list