linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Elie De Brauwer <eliedebrauwer@gmail.com>
To: linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: i2c on P2020 based boards faulty prescale selection
Date: Fri, 18 Mar 2011 15:31:51 +0100	[thread overview]
Message-ID: <4D836CD7.4060203@gmail.com> (raw)

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

                 reply	other threads:[~2011-03-18 14:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D836CD7.4060203@gmail.com \
    --to=eliedebrauwer@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).