From: Wolfram Sang <wsa@the-dreams.de>
To: Christian Ruppert <christian.ruppert@abilis.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
linux-i2c@vger.kernel.org,
"Ben Dooks (embedded platforms)" <ben-linux@fluff.org>,
Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
Rob Landley <rob@landley.net>,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Vineet Gupta <Vineet.Gupta1@synopsys.com>,
Pierrick Hascoet <pierrick.hascoet@abilis.com>
Subject: Re: [PATCH REBASE] i2c-designware: make SDA hold time configurable
Date: Wed, 19 Jun 2013 17:20:59 +0200 [thread overview]
Message-ID: <20130619152058.GA2951@katana> (raw)
In-Reply-To: <20130619135855.GB16483@ab42.lan>
[-- Attachment #1: Type: text/plain, Size: 4602 bytes --]
Hi Christian,
> > So, I looked around and found:
> > http://www.maximintegrated.com/app-notes/index.mvp/id/3268
> >
> > which after thinking further about it gives me the following
> > conclusions:
> >
> > - sda-hold-time is a property/requirement of a device not following
> > the I2C spec. It is not a property of the master!
>
> Actually, in a protocol like I2C, every device on the bus must respect
> timing constraints like hold time etc. These parameters apply at the
> same time to the master and to all slaves.
Yes. What I meant is: the flaw of one a specific device on the bus
imposes the timing on the whole bus.
>
> > - It should not be encoded in the devicetree, since the flaw is implicit
> > to the device, so only the driver needs to know about it. I wonder
> > about something like this in the i2c slave driver:
> >
> > ret = i2c_request_sda_hold_time(client);
> >
> > The core then can collect the requests and forward them to the host
> > driver. This driver then can set up the hardware or return -EOPNOTSUPP
> > and we can even warn the user that there might be problems ahead.
>
> This might be a solution but given that many I2C drivers are written as
> an afterthought by device manufacturers and are released under more or
> less open terms of licensing into the wild I doubt this would work very
> well in practise.
Hrmgl, the design looks much better to me, though. Once a driver is
identified to need this, the core is able to report this requirement to
a user who might even be unaware of the issue. The dt property has a bit
of "try this if things don't work, you may be lucky" taste to it. Need
to think about it. If PCB design also has an influence, then my idea
won't work, though.
> > - I wonder if we really need to have a parameter time-in-ns? The
> > specs cleary say 300ns, so I'd think this is the value we should
> > always use. This is from a theorhetical pov though, maybe your
> > practical experience is different. What values do you need?
>
> In reality, the I2C specification is more subtle than that: The "data
> hold time" is specified as 0ns with a footnote [3] stating that devices
> "must internally provide a hold time of at least 300ns for the SDA
> signal...".
>
> Revision 5 contains a relatively understandable explanation about how to
> interpret this but earlier versions are less helpful. I think this
> confusion is at the root of many timing issues encountered with I2C (and
> the reason why Synopsys made this configurable). In fact, especially
> earlier specs are _all but_ clear in this point and we cannot assume
> that all peripherals were designed after Revision 5 was released in
> October 2012.
OK, agreed. Still surprised that I never encountered such a device,
probably I was just lucky.
>
> > > In the case of the Designware block, the parameter both changes SDA and
> > > START hold times, however, and you'll find lots of data sheets for
> > > hardware with START hold time requirements on the net, e.g.
> > > http://ww1.microchip.com/downloads/en/DeviceDoc/21805B.pdf
> >
> > What I couldn't find is a reference manual for a designware IP that
> > supports sda hold time? I found some spear SoC which do not have that
> > register, so that should surely be reflected in the patchset, too.
>
> If you have access to DesignWare documentation, check out the
> "DesignWare DW_apb_i2c Databook" Version 1.17a from March 2012.
I don't have, and I do have a hard time finding information about it
otherwise :(
> Unluckily, I clearly don't have the right to share this document with
> you. Do you know the version of the blocks in the spear SoC which do not
> support this register?
ST Spear300 and 600 have 0x3130352a in the version reg according to the
refman.
> > > The empirical solution in the function i2c_dw_scl_hcnt does not seem to
> > > work in all cases: Our lab guys confirmed that we have several PCB
> > > designs which do not work without adjusting the sda-hold-time parameter
> > > to an appropriate value. The value seems to be different for different
> > > PCBs.
> >
> > I'd hope that 300ns is a safe value for all PCBs?
>
> Not according to our PCB guys. The highest value I have found in a quick
> check of our device trees is 650ns with others being just slightly above
> 300ns.
Thanks for sharing your results \o/ This helps me a lot. Can you find
out/guess if this value is solely dependend on a slave or is it also
dependend on PCB layout?
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-06-19 15:20 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20130327084158.GB11010@ab42.lan>
[not found] ` <1364373760-12469-1-git-send-email-christian.ruppert@abilis.com>
[not found] ` <1364373760-12469-1-git-send-email-christian.ruppert-ux6zf3SgZrrQT0dZR+AlfA@public.gmane.org>
2013-05-14 11:07 ` [PATCH v7] i2c-designware: make SDA hold time configurable Mika Westerberg
[not found] ` <20130514110745.GA10906-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-05-14 13:04 ` [PATCH REBASE] " Christian Ruppert
2013-06-10 15:29 ` Wolfram Sang
2013-06-12 14:47 ` Christian Ruppert
2013-06-17 8:23 ` Mika Westerberg
2013-06-19 9:45 ` Wolfram Sang
2013-06-19 13:58 ` Christian Ruppert
2013-06-19 15:20 ` Wolfram Sang [this message]
2013-06-20 8:44 ` Christian Ruppert
2013-06-17 20:55 ` Rob Herring
[not found] ` <51BF77C2.70004-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-06-18 7:44 ` [PATCH v8] " Christian Ruppert
2013-06-20 20:04 ` Wolfram Sang
2013-06-20 20:37 ` Wolfram Sang
2013-06-21 9:53 ` [PATCH v9] " Christian Ruppert
2013-06-25 16:39 ` Wolfram Sang
2013-06-26 4:23 ` Vineet Gupta
2013-06-26 8:55 ` [PATCH v10] " Christian Ruppert
[not found] ` <1372236906-6933-1-git-send-email-christian.ruppert-ux6zf3SgZrrQT0dZR+AlfA@public.gmane.org>
2013-06-26 8:57 ` Vineet Gupta
2013-06-26 14:07 ` Wolfram Sang
2013-07-03 11:43 ` Arnd Bergmann
[not found] ` <201307031343.11647.arnd-r2nGTMty4D4@public.gmane.org>
2013-07-03 13:29 ` Christian Ruppert
[not found] ` <20130703132905.GC3929-7oYq3qWSd+k@public.gmane.org>
2013-07-03 14:20 ` Arnd Bergmann
[not found] ` <201307031620.03785.arnd-r2nGTMty4D4@public.gmane.org>
2013-07-03 14:38 ` Christian Ruppert
[not found] ` <20130703143835.GD3929-7oYq3qWSd+k@public.gmane.org>
2013-07-03 14:42 ` Arnd Bergmann
[not found] ` <201307031642.30380.arnd-r2nGTMty4D4@public.gmane.org>
2013-07-03 14:44 ` Arnd Bergmann
2013-07-03 14:59 ` Christian Ruppert
2013-07-03 15:07 ` Stehle Vincent-B46079
[not found] ` <F7C43F8B2814514CA05F3436BC68046EF379F0-RL0Hj/+nBVCMXPU/2EZmt64g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2013-07-03 15:26 ` Arnd Bergmann
2013-06-18 10:32 ` [PATCH REBASE] " Andy Shevchenko
2013-05-17 8:29 ` [PATCH v7] " Wolfram Sang
2013-05-17 8:44 ` Mika Westerberg
2013-05-17 8:56 ` Wolfram Sang
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=20130619152058.GA2951@katana \
--to=wsa@the-dreams.de \
--cc=Vineet.Gupta1@synopsys.com \
--cc=ben-linux@fluff.org \
--cc=christian.ruppert@abilis.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-doc@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=pierrick.hascoet@abilis.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
/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).