From: Valentin Longchamp <valentin.longchamp@keymile.com>
To: Scott Wood <scottwood@freescale.com>
Cc: "Boschung, Rainer" <Rainer.Boschung@keymile.com>,
Linux device trees <devicetree@vger.kernel.org>,
"Brunck, Holger" <Holger.Brunck@keymile.com>,
Linux PowerPC Kernel <linuxppc-dev@lists.ozlabs.org>,
Linux I2C <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH] i2c-qoriq: modified compatibility for correct prescaler
Date: Wed, 29 Oct 2014 09:59:49 +0100 [thread overview]
Message-ID: <5450AC85.40302@keymile.com> (raw)
In-Reply-To: <1414537731.23458.120.camel@snotra.buserror.net>
On 10/29/2014 12:08 AM, Scott Wood wrote:
> On Fri, 2014-10-17 at 11:27 +0200, Valentin Longchamp wrote:
>> With "fsl-i2c" compatibility the i2c frequency is not set
>> correctly, because it sets no prescaler. According to the AN2919 from
>> Freescale and the QorIQ (P2041) documentation, the source clock is 1/2
>> the platform clock. This implies that a prescaler of 2 must be used.
>>
>> This changes the compatibility of the qoriq-i2c .dtsi files to pick the
>> mpc8543, which uses the same driver but sets the correct prescaler.
>>
>> Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> ---
>>
>> arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi | 4 ++--
>> arch/powerpc/boot/dts/fsl/qoriq-i2c-1.dtsi | 4 ++--
>> 2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi
>> index 5f9bf7d..aa6c366 100644
>> --- a/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi
>> +++ b/arch/powerpc/boot/dts/fsl/qoriq-i2c-0.dtsi
>> @@ -36,7 +36,7 @@ i2c@118000 {
>> #address-cells = <1>;
>> #size-cells = <0>;
>> cell-index = <0>;
>> - compatible = "fsl-i2c";
>> + compatible = "fsl,mpc8543-i2c", "fsl-i2c";
>> reg = <0x118000 0x100>;
>> interrupts = <38 2 0 0>;
>> dfsrr;
>> @@ -46,7 +46,7 @@ i2c@118100 {
>> #address-cells = <1>;
>> #size-cells = <0>;
>> cell-index = <1>;
>> - compatible = "fsl-i2c";
>> + compatible = "fsl,mpc8543-i2c", "fsl-i2c";
>> reg = <0x118100 0x100>;
>> interrupts = <38 2 0 0>;
>> dfsrr;
>
> Are all chips that use this dtsi 100% compatible with mpc8543's i2c, or
> just in ways the Linux driver cares about?
I have just looked briefly at the mpc8548 RM (covers mpc8543) and its i2c
controller looks the same as the qoriq's. I cannot however state if they are
100% compatible.
If we wanted to be on the safe side and strict (since we are not sure that the
hardware is 100% compatible), we maybe should add a fsl,qoriq-i2c compatible to
the driver that does the same as mpc8543-i2c.
>
> What about fsl,mpc8544-i2c, which has additional special handling in the
> driver, but is only used in socrates.dts (not mpc8544ds.dts)?
From the mpc8544 RM, this controller looks the same as the above 2, except for
the prescaler from the driver which is set to 3. As to why it is only used in
the socrates.dts, I cannot comment about it.
The prescaler is confirmed to be 3 by default by the Table 3 of the AN-219 for
the mpc8544.
>
> What about pq3-i2c-*.dtsi?
>
This is also interesting: from the AN-219 Table 4, some pq3 have a 2:1
(mcpc8536/43/45/47/48/67/68/72, plus p2020) prescaler where some don't
(mpc8533/44, where it can be 3:1 -default- or 2:1). However pq3-i2c-*.dtsi
defines no prescaler.
Now if I look at what files include these pq3-i2c-*.dtsi, I see some that are in
the the 2:1 list:
arch/powerpc/boot/dts/fsl/mpc8536si-post.dtsi
arch/powerpc/boot/dts/fsl/mpc8548si-post.dtsi
arch/powerpc/boot/dts/fsl/mpc8568si-post.dtsi
arch/powerpc/boot/dts/fsl/mpc8572si-post.dtsi
arch/powerpc/boot/dts/fsl/p2020si-post.dtsi
I don't have any hardware to do some tests with these, but from my measurements
on our qoriq based system (P2041 SoC) I think that the generated I2C clocks for
the above SoC currently are not correct because of the ignored prescaler.
Valentin
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
next prev parent reply other threads:[~2014-10-29 8:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-17 9:27 [PATCH] i2c-qoriq: modified compatibility for correct prescaler Valentin Longchamp
[not found] ` <1413538026-15739-1-git-send-email-valentin.longchamp-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
2014-10-28 23:08 ` Scott Wood
2014-10-29 8:59 ` Valentin Longchamp [this message]
[not found] ` <5450AC85.40302-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
2014-11-06 21:58 ` Scott Wood
2014-11-13 0:34 ` Wolfram Sang
2014-11-14 7:43 ` Valentin Longchamp
[not found] ` <5465B285.7070005-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
2014-11-14 8:28 ` Wolfram Sang
2014-11-18 1:28 ` Scott Wood
[not found] ` <1416274083.15957.96.camel-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-11-25 18:13 ` Wolfram Sang
2014-11-26 1:41 ` Scott Wood
[not found] ` <1416966097.15957.171.camel-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-11-30 4:30 ` Danielle Costantino
[not found] ` <CAAVjN7fJyOh64p5UGRmv-UTnF47cERDfbHyHTuzQmQj8xTDEOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-01 17:23 ` Wolfram Sang
2014-12-11 13:44 ` Valentin Longchamp
[not found] ` <54899FB4.9010207-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
2014-12-23 13:23 ` Valentin Longchamp
[not found] ` <54996CB5.8030808-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
2014-12-23 13:49 ` Wolfram Sang
2014-12-27 2:43 ` Scott Wood
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=5450AC85.40302@keymile.com \
--to=valentin.longchamp@keymile.com \
--cc=Holger.Brunck@keymile.com \
--cc=Rainer.Boschung@keymile.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=scottwood@freescale.com \
/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).