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

Joakim Tjernlund joakim.tjernlund at transmode.se
Thu Sep 10 15:20:26 CEST 2009


Timur Tabi <timur at freescale.com> wrote on 10/09/2009 15:07:36:
>
> 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.

I don't think it is. The current values only works for good i2c buses.
Our have too high pullups so rise time is horrible. It will be fixed
but we need to handle the old boards too.

>
> 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

Not so sure about that, but I haven't tried to calc it generally.

> 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.

Yes, and a way to #define wanted DFSR. From there one can select
one of the 4 tables listed in AN2919. The sum of tabels will be rather big though
so I suspect it will less code to calculate the FDR/DFSR.

   Jocke



More information about the U-Boot mailing list