linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* i2c on P2020 based boards faulty prescale selection
@ 2011-03-18 14:31 Elie De Brauwer
  0 siblings, 0 replies; only message in thread
From: Elie De Brauwer @ 2011-03-18 14:31 UTC (permalink / raw)
  To: linuxppc-dev list

Hello list,

A whole bunch of dts file such a p2020ds.dts, p2020rdb.dts and probably 
lots of other variants as well (haven't checked the manuals of the 
others). Claim their i2c controller to be 'fsl-i2c'

If you then look in i2c/busses/i2c.mpc.c this will end up calling 
mpc_i2c_setup_8xxx() in fsl_i2c_probe() with a prescale value of 0 which 
goes to mpc_i2c_get_fdr_8xxx() here prescale gets set to one and the 
divider value gets calculated.

The problem is that the P2020 datasheet mentions: "The serial bit clock 
frequency of SCL is equal to one half the platform (CCB) clock divided 
by the designated divider. Note that the frequency divider value can be 
changed at any point in a program." Implying that the factor two is not 
taken into account. For this to function correctly the prescale value 
should be set to a value two.

Which could be solved by adding another mpc_i2c_data for this type or by 
using the mpc_i2c_data_8543 which also has a prescaler value of two. Or 
to define an alternative structure for the p2020 alike system. However 
at this point I don't know how this varies between the different px0x0 
systems since I have only a p2020 at my disposal. So I would appreciate 
it if somebody with a broader view on this SoCs can up with a usable 
solution.

This issue will only propagate if the dts sets the clock-frequency field 
for the i2c controller in question is set.


gr
E.
-- 
Elie De Brauwer

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-18 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18 14:31 i2c on P2020 based boards faulty prescale selection Elie De Brauwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).