From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V3+] I2C: mxc_i2c rework
Date: Thu, 15 Sep 2011 06:07:45 +0200 [thread overview]
Message-ID: <201109150607.45241.marek.vasut@gmail.com> (raw)
In-Reply-To: <CAFQ4atTup-yNkChaOxVWbLULy3Nw=fOdVKkvVzQfX-gRo3S0DA@mail.gmail.com>
On Thursday, September 15, 2011 04:26:17 AM Jason Hui wrote:
> On Thu, Sep 15, 2011 at 10:07 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > On Thursday, September 15, 2011 03:43:42 AM Jason Hui wrote:
> >> On Thu, Sep 15, 2011 at 3:39 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> >> > On Friday, July 29, 2011 08:55:14 AM Jason Hui wrote:
> >> >> Hi, Marek,
> >> >>
> >> >> On Thu, Jul 14, 2011 at 5:58 AM, Marek Vasut <marek.vasut@gmail.com>
wrote:
> >> >> > Rewrite the mxc_i2c driver.
> >> >> > * This version is much closer to Linux implementation.
> >> >> > * Fixes IPG_PERCLK being incorrectly used as clock source
> >> >> > * Fixes behaviour of the driver on iMX51
> >> >> > * Clean up coding style a bit ;-)
> >> >>
> >> >> why you change i2c clock from IPG_PERCLK to IPG_CLK?
> >> >>
> >> >> [...]
> >> >
> >> > Ok, I investigated a bit deeper and I suspect the clock.c is the
> >> > culprit.
> >> >
> >> > Apparently, the PERCLK doesn't run at the frequency the clock.c
> >> > reports it runs on. Therefore, the i2c miscalculates the divider etc
> >> > -- falling crap model (waterfall model).
> >>
> >> But apparently, the i2c function clock should be IPG_PERCLK not IPG
> >> clock. And Linux also fix it already.
> >
> > Then there's bulls**t in your mx51 and mx53 datasheet or what ?
>
> Please refer to MCIMX51RM.PDF, page 305,
> Table 7-41. PERCLK-dependent Module Clock Sources
> PERCLK-dependent Module Clocks Associated CCGR Register
> uart1_perclk
> CCGR1
> uart2_perclk
> uart3_perclk
> i2c1 clocks
> i2c2 clocks
> epit1_highfreq
> CCGR2
> epit2_highfreq
> pwm1_highfreq
> pwm2_highfreq
> gpt_highfreq
> owire clocks
You see ... I'm starting to understand what is actually going wrong. The
lowlevel_init.S is bloated with crap (why? why can't that be in cpu init C code
?) and there is this one part, where CBCDR is overwritten with a configurable
value instead of hardcoded value.
No documentation about that at all, but it's there ... and that's -- amongst
other bugs -- my problem I assume. So I need to set this CONFIG_SYS_CLKTL_CBCDR
to another magic value, now I get it.
>
> > besides, PERCLK
> > is faster than IPGCLK on MX51 so it makes even less sense!
>
> I don't think PERCLK is always faster than IPG clock, it's configurable.
> please refer to MCIMX51RM.PDF, page 307.
Yea ... it's configurable via some undocumented macro in assembler code. Damn.
Can you please comment on the other patches?
Thanks
>
> >Can you please talk
> >
> > to the HW guys or whatever to clear this once and for all ? I smell noone
> > really knows where the clock are sourced from and all this crap is just
> > blind guessing.
>
> I have asked the IC module owner again. It confirms that I2C function
> clock is ipg_perclk.
>
> Jason
next prev parent reply other threads:[~2011-09-15 4:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-13 21:58 [U-Boot] [PATCH V3+] I2C: mxc_i2c rework Marek Vasut
2011-07-14 9:04 ` Heiko Schocher
2011-07-28 14:29 ` Wolfgang Denk
2011-07-14 13:55 ` Albert ARIBAUD
2011-07-14 14:35 ` Marek Vasut
2011-07-14 14:45 ` Albert ARIBAUD
2011-07-29 6:55 ` Jason Hui
2011-07-29 9:35 ` Marek Vasut
2011-07-29 9:42 ` Stefano Babic
2011-09-14 19:39 ` Marek Vasut
2011-09-15 1:43 ` Jason Hui
2011-09-15 2:07 ` Marek Vasut
2011-09-15 2:26 ` Jason Hui
2011-09-15 4:07 ` Marek Vasut [this message]
2011-08-30 10:48 ` Stefano Babic
-- strict thread matches above, loose matches on Subject: below --
2011-07-13 21:05 [U-Boot] [PATCH V3] " Marek Vasut
2011-07-13 21:34 ` Wolfgang Denk
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=201109150607.45241.marek.vasut@gmail.com \
--to=marek.vasut@gmail.com \
--cc=u-boot@lists.denx.de \
/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