From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/3] Tegra114: fdt: Update DT files with I2C info for T114/Dalmore
Date: Tue, 12 Feb 2013 11:10:48 -0700 [thread overview]
Message-ID: <511A85A8.40402@wwwdotorg.org> (raw)
In-Reply-To: <CA+m5__KM6PhA0775=TZSgoVOP3-NKHD41Jf01Rz=CjC=ntMU6g@mail.gmail.com>
On 02/12/2013 10:40 AM, Tom Warren wrote:
> Laxman,
>
> On Tue, Feb 12, 2013 at 5:02 AM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
>> On Friday 08 February 2013 11:34 PM, Stephen Warren wrote:
>>>
>>> On 02/08/2013 10:25 AM, Tom Warren wrote:
>>>>
>>>> T114, like T30, does not have a separate/different DVC (power I2C)
>>>> controller like T20 - all 5 I2C controllers are identical, but
>>>> I2C5 is used to designate the controller intended for power
>>>> control (PWR_I2C in the schematics). PWR_I2C is set to 400KHz.
>>>> diff --git a/board/nvidia/dts/tegra114-dalmore.dts
>>>> b/board/nvidia/dts/tegra114-dalmore.dts
>>>> + aliases {
>>>> + };
>>>> +
>>>
>>> There's no point adding an empty aliases node here. Feel free to fix
>>> that up when you apply it rather than reposting if you want.
>>>
>>> I'd like too see Laxman sign-off on the "*2" question he had earlier
>>> before actually checking this in.
>>>
>> We do not require *2 as the i2c clock divider is DIVU16 type. There was bug
>> in early code on kernel also which we fixed in dowstream long back. Possibly
>> uboot have not fixed this yet.
>
> Yeah, the Tegra I2C driver in U-Boot has always doubled the rate
> before calling the clock set routine.
Perhaps it's related to some dividers being U7.1 (i.e. the LSB of the
divider represents 1/2 not 1)? However, as Laxman points out, this isn't
the case for I2C clocks; they have a U16 divider, so the LSB represents
1 not 1/2.
> But the important thing is that
> the actual I2C clock is 100KHz (or 400KHz for I2C5) as measured at the
> test points on the board.
>
> I'll look into the Tegra U-Boot clock routine idiosyncrasies later
> when I get some more bandwidth.
Just a few minutes of investigation points at clk_get_divider() being buggy.
It assumes that all dividers have a built-in *2 clock multiplier on the
front of them:
u64 divider = parent_rate * 2;
(the name for that variable is wrong; it should be something more like
parent_rate or divider_input_rate)
This (presence of a *2 pre-multiplier) is true for U7.1 dividers, since
this is required for the LSB of the divider to represent 1/2 not 1.
Hence, I assume that e.g. the SPI driver doesn't do this "* 2" on the
clock rate; it actually has a U7.1 divider.
However, this is not true for U16 dividers, since the HW doesn't need to
multiply up the rate before dividing, since the LSB is 1 not 1/2.
The solution here is to fix clk_get_divider() to return both a field
width and a flag (or width) indicating whether a fractional part of the
divider is present, and then pass that on to adjust_periph_pll() so that
it can only optionally perform this initial "* 2".
So at least that explains it.
I would strongly recommend just fixing this now. However, if you don't
please do file a bug so that we don't forget about this.
next prev parent reply other threads:[~2013-02-12 18:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-08 17:25 [U-Boot] [PATCH v3 0/3] Add I2C driver for T114 Dalmore Tom Warren
2013-02-08 17:25 ` [U-Boot] [PATCH v3 1/3] Tegra: I2C: Add T114 clock support to tegra_i2c driver Tom Warren
2013-02-08 17:25 ` [U-Boot] [PATCH v3 2/3] Tegra114: fdt: Update DT files with I2C info for T114/Dalmore Tom Warren
2013-02-08 18:04 ` Stephen Warren
2013-02-12 12:02 ` Laxman Dewangan
2013-02-12 17:40 ` Tom Warren
2013-02-12 18:10 ` Stephen Warren [this message]
2013-02-12 19:07 ` Tom Warren
2013-02-14 22:40 ` Tom Warren
2013-02-08 17:25 ` [U-Boot] [PATCH v3 3/3] Tegra114: I2C: Enable I2C driver on Dalmore E1611 eval board Tom Warren
2013-02-12 18:15 ` [U-Boot] [PATCH v3 0/3] Add I2C driver for T114 Dalmore Simon Glass
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=511A85A8.40402@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.