All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Cc: "Lothar Waßmann"
	<LW-AvR2QvxeiV7DiMYJYoSAnRvVK+yQ3ZXh@public.gmane.org>,
	"Shawn Guo" <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Fabio Estevam"
	<fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] i2c: mxs: fix broken timing calculation
Date: Thu, 15 Aug 2013 23:30:12 +0200	[thread overview]
Message-ID: <201308152330.13123.marex@denx.de> (raw)
In-Reply-To: <20130815101252.GF2987@katana>

Dear Wolfram Sang,

> On Thu, Jul 18, 2013 at 01:18:48PM +0200, Lothar Waßmann wrote:
> > Hi,
> > 
> > > > Marek Vasut writes:
> > > > > > > btw offtopic, I will at least try to fix the PIO in the
> > > > > > > meantime.
> > > > > > 
> > > > > > Did you succeed at this? Because this is the real problem for the
> > > > > > DS1339 failing on our board. With DMA only transfers it works,
> > > > > > but other chips (TSC2007, PCA9554, SGTL5000) fail.
> > > > > 
> > > > > Is that correct to assume that even DMA fails? So far I got to a
> > > > > patch [1], which is almost an RFC, but please give it a go. I
> > > > > suspect I didn't CC you, I will CC you on V2.
> > > > 
> > > > I applied that patch and all the above mentioned devices seem to work
> > > > with it.
> > > > And with my patch the timing is also correct.
> > > 
> > > First, please accept my appology for the delay. I finally measured the
> > > bus. Without this patch, I see 107khz at 100kHz setting and 410kHz at
> > > 400kHz setting. With this patch I see 93kHz and 307kHz respectively.
> > > 
> > > I suspect the result really is board-dependent. Can you measure MX28EVK
> > > so we know what the result is there please? I don't have one here.
> > 
> > No, I don't have an EVK. Obviously the base clock from which the I2C
> > clock is derived must be different from 24MHz on your board.
> > 
> > Can you measure the high and low width of the SCL signal when setting
> > the HIGH_COUNT and LOW_COUNT to 1 and 10 (0x0a) successively?
> > 
> > I'm getting a LOW pulse with of:
> > 130ns, 520ns
> > and a HIGH pulse width of:
> > 330ns, 730ns
> > 
> > Thus the granularity of the timing setting is about 40ns which is
> > close the period of the 24MHz clock of 41.666ns that the SCL timing
> > generation is based on.
> 
> Ping, waiting for updates. Marek, any time for this?

I talked to Lothar OTR for a little, since the files with measurements were big. 
I think we can apply these as after this patch, the result on both M28EVK and 
MX23EVK is reasonably good.

Please add my Acked-by: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org> and apply.

> Haven't checked in detail if it is a similar issue, yet the designware
> people had some in-depth discussions about I2C timings and PCB
> influences...

Yes, that's what I am a little worried as the results of my measurements 
slightly differ on both boards. Maybe we should mull over this stuff a little 
longer, thanks for bringing this up. On the other hand, the results seems close 
enough to not cause trouble.

Best regards,
Marek Vasut

  parent reply	other threads:[~2013-08-15 21:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-05 16:28 [PATCH] i2c: mxs: fix broken timing calculation Lothar Waßmann
     [not found] ` <1373041680-26939-1-git-send-email-LW-bxm8fMRDkQLDiMYJYoSAnRvVK+yQ3ZXh@public.gmane.org>
2013-07-05 16:53   ` Marek Vasut
     [not found]     ` <201307051853.45786.marex-ynQEQJNshbs@public.gmane.org>
2013-07-05 17:28       ` Lothar Waßmann
     [not found]         ` <20951.550.818976.677404-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>
2013-07-05 17:37           ` Marek Vasut
     [not found]             ` <201307051937.10975.marex-ynQEQJNshbs@public.gmane.org>
2013-07-15 10:22               ` Lothar Waßmann
     [not found]                 ` <20963.52588.898163.953695-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>
2013-07-15 12:24                   ` Marek Vasut
     [not found]                     ` <201307151424.32248.marex-ynQEQJNshbs@public.gmane.org>
2013-07-16  8:10                       ` Lothar Waßmann
     [not found]                         ` <20965.3.293494.346855-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>
2013-07-17 17:54                           ` Marek Vasut
     [not found]                             ` <201307171954.59556.marex-ynQEQJNshbs@public.gmane.org>
2013-07-18 11:18                               ` Lothar Waßmann
     [not found]                                 ` <20967.53016.902909.282346-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>
2013-08-15 10:12                                   ` Wolfram Sang
2013-08-15 10:13                                     ` Wolfram Sang
2013-08-15 21:30                                     ` Marek Vasut [this message]
2013-08-16 16:10   ` 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=201308152330.13123.marex@denx.de \
    --to=marex-ynqeqjnshbs@public.gmane.org \
    --cc=LW-AvR2QvxeiV7DiMYJYoSAnRvVK+yQ3ZXh@public.gmane.org \
    --cc=fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
    /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.