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

Joakim Tjernlund joakim.tjernlund at transmode.se
Thu Sep 10 17:53:38 CEST 2009



Timur Tabi <timur at freescale.com> wrote on 10/09/2009 17:26:29:
>
> Joakim Tjernlund wrote:
>
> > Looking a bit harder at the table I don't understand some entries, where does
> > the entries with dfsr != 1 come from? They don't look like any table in AN2919
>
> They're all calculated.  I entered the algorithm into a spreadsheet and
> determined every possible combination of DFSR and FDR.  The values of DFSR==22
> are for frequencies that are normally not published.

This calculation does not seem to match AN2919.

Suppose one used only Table 7(almost what we have if you exclude dfsr!= 1)
Table 7 is valid for 1 <= dfsr <=5 so how about replacing the current dfsr
with:
#ifdef __PPC__
			u8 dfsr;
			dfsr = (5*(i2c_clk/1000))/(100000);
			if (dfsr > 5)
				dfsr = 5;
			if (!dfsr)
				dfsr = 1;
			debug("i2c_clk:%d, dfsr:%d\n", i2c_clk, dfsr);
			writeb(dfsr, &dev->dfsrr);	/* set default filter */
#endif



More information about the U-Boot mailing list