public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shinya Kuribayashi <skuribay@pobox.com>
To: mika.westerberg@linux.intel.com
Cc: christian.ruppert@abilis.com, linux-i2c@vger.kernel.org,
	wsa@the-dreams.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] i2c-designware: make *CNT values configurable
Date: Fri, 12 Jul 2013 16:56:49 +0900	[thread overview]
Message-ID: <51DFB6C1.4040001@pobox.com> (raw)
In-Reply-To: <20130711101330.GP4898@intel.com>

On 7/11/13 7:13 PM, Mika Westerberg wrote:
> On Thu, Jul 11, 2013 at 10:36:00AM +0300, Mika Westerberg wrote:
>> On Wed, Jul 10, 2013 at 06:56:35PM +0200, Christian Ruppert wrote:
>>> On Wed, Jul 10, 2013 at 01:52:15PM +0300, Mika Westerberg wrote:
>>>> On Tue, Jul 09, 2013 at 06:19:28PM +0200, Christian Ruppert wrote:
>>>>> What I meant is the following: The clock cycle time Tc is composed of
>>>>> the four components
>>>>>
>>>>>    Tc = Th + Tf + Tl + Tr
>>>>>
>>>>> where
>>>>>    Th: Time during which the signal is high
>>>>>    Tf: Falling edge transition time
>>>>>    Tl: Time during which the signal is low
>>>>>    Tr: Rising edge transition time
>>>>>
>>>>> The I2C specification specifies a minimum for Tl and Th and a range (or
>>>>> maximum) for Tr and Tf. A maximum frequency is specified as the
>>>>> frequency obtained by adding the minima for Th and Tl to the maxima of
>>>>> Tr ant Tf.
>>>>> Since as you said, transition times are very much PCB dependent, one way
>>>>> to guarantee the max. frequency constraint (and to achieve a constant
>>>>> frequency at its max) is to define the constants
>>>>> Th' = Th + Tf := Th_min + Tf_max
>>>>> Tl' = Tl + Tr := Tl_min + Tr_max
>>>>>
>>>>> and to calculate the variables
>>>>> Th = Th' - Tf
>>>>> Tl = Tl' - Tr
>>>>> in function of Tf and Tr of the given PCB.
>>>>
>>>> If I understand the above, it leaves Tf and Tr to be PCB specific and then
>>>> these values are passed to the core driver from platform data, right?
>>>
>>> That would be the idea: Calculate Th' and Tl' in function of the desired
>>> clock frequency and duty cycle and then adapt these values using
>>> measured transition times. What prevented me from implementing this
>>> rather academic approach are the following comments in
>>> i2c-designware-core.c:

When we talk about I2C timing specs, we should not bring up "clock speed"
things.  All we have to do is to strictly meet timing constraints of
tHIGH, tLOW, tHD;SATA, tr, tf, etc.  The resulting "clock speed" is not
a goal.

>>> /*
>>>   * DesignWare I2C core doesn't seem to have solid strategy to meet
>>>   * the tHD;STA timing spec.  Configuring _HCNT based on tHIGH spec
>>>   * will result in violation of the tHD;STA spec.
>>>   */
>>>
>>> /* ...
>>>   * This is just experimental rule; the tHD;STA period
>>>   * turned out to be proportinal to (_HCNT + 3).  With this setting,
>>>   * we could meet both tHIGH and tHD;STA timing specs.
>>>   * ...
>>>   */
>>>
>>> If I interpret this right, the slow down of the clock is intentional to
>>> meet tHD;STA timing constraints.

Correct.

>> Yeah, looks like so. tHD;STA is the SDA hold time. I wonder if the above
>> comments apply to some earlier version of the IP that didn't have the SDA
>> hold register?

If I remember DesignWare APB I2C spec correctly, SDA hold time register
doesn't help to meet tHD;STA spec.  Could someone confirm it really so
with a real hardware, please?

   Shinya

> Scratch that.
>
> I re-read the spec and tHD;STA is hold time for (repeated) start. There is
> a constraint that says that the device must internally provide a hold time
> of at least 300ns for the SDA signal. Maybe that's the constraint the
> comment above is referring to?
>


  reply	other threads:[~2013-07-12  7:56 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 11:45 [PATCH 1/2] i2c-designware: make *CNT values configurable Mika Westerberg
2013-07-08 11:45 ` [PATCH 2/2] i2c-designware: configure *CNT values from ACPI Mika Westerberg
2013-07-10 13:01   ` Mika Westerberg
2013-07-08 13:42 ` [PATCH 1/2] i2c-designware: make *CNT values configurable Christian Ruppert
2013-07-09  8:44   ` Mika Westerberg
2013-07-09 16:19     ` Christian Ruppert
2013-07-10 10:52       ` Mika Westerberg
2013-07-10 16:56         ` Christian Ruppert
2013-07-11  7:36           ` Mika Westerberg
2013-07-11 10:13             ` Mika Westerberg
2013-07-12  7:56               ` Shinya Kuribayashi [this message]
2013-07-12  8:51                 ` Mika Westerberg
2013-07-13  5:36                   ` Shinya Kuribayashi
2013-07-16 11:16                     ` Christian Ruppert
2013-07-17 14:39                       ` Shinya Kuribayashi
2013-07-22 13:17                         ` Christian Ruppert
2013-07-24 14:31                           ` Shinya Kuribayashi
2013-08-05  9:31                             ` Christian Ruppert
2013-08-05 10:02                               ` Wolfram Sang
2013-08-12  7:48                                 ` Christian Ruppert
2013-08-12 11:09                                   ` Wolfram Sang
2013-08-16  2:15                               ` Shinya Kuribayashi
2013-08-19 11:36                                 ` Mika Westerberg
2013-08-19 12:22                                   ` Shinya Kuribayashi
2013-08-21 14:39                                 ` Christian Ruppert
2013-08-24  4:58                                   ` Shinya Kuribayashi
2013-08-28 15:34                                     ` Christian Ruppert
2013-10-08 15:00                                       ` [PATCH 1/2] i2c designware make SCL and SDA falling time configurable Romain Baeriswyl
2013-10-09  7:55                                         ` Mika Westerberg
2013-10-10  0:54                                           ` Ryan Mallon
2013-10-13 11:36                                             ` Shinya Kuribayashi
2014-01-16 19:43                                               ` Wolfram Sang
2014-01-20 16:43                                                 ` [PATCH v2 " Romain Baeriswyl
2014-03-09  8:20                                                   ` Wolfram Sang
2013-10-08 15:00                                       ` [PATCH 2/2] i2c designware add support of I2C standard mode Romain Baeriswyl
2013-10-09  7:56                                         ` Mika Westerberg
2013-10-13 11:46                                           ` Shinya Kuribayashi
2014-01-16 19:33                                         ` Wolfram Sang
2014-01-20 16:45                                           ` [PATCH v2 " Romain Baeriswyl
2014-03-09  8:07                                             ` Wolfram Sang
2014-03-25 10:18                                               ` [PATCH V3 " Romain Baeriswyl
2013-08-19  6:39                       ` [PATCH 1/2] i2c-designware: make *CNT values configurable Mika Westerberg

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=51DFB6C1.4040001@pobox.com \
    --to=skuribay@pobox.com \
    --cc=christian.ruppert@abilis.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=wsa@the-dreams.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