From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Simon Horman <horms@verge.net.au>
Cc: Wolfram Sang <wsa@the-dreams.de>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Linux I2C <linux-i2c@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Linux-sh list <linux-sh@vger.kernel.org>
Subject: Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2
Date: Wed, 12 Nov 2014 09:53:27 +0100 [thread overview]
Message-ID: <CAMuHMdUUspG8-dYGiO7cmuECBLpfmQAYg=B8ZpajxRXhaEUJ2A@mail.gmail.com> (raw)
In-Reply-To: <20141112014450.GC11597@verge.net.au>
Hi Simon,
On Wed, Nov 12, 2014 at 2:44 AM, Simon Horman <horms@verge.net.au> wrote:
> On Fri, Nov 07, 2014 at 06:24:21AM +0100, Wolfram Sang wrote:
>> On Thu, Nov 06, 2014 at 12:52:06PM +0100, Geert Uytterhoeven wrote:
>> > On sh73a0/kzm9g-legacy, probing of the i2c masters fails with:
>> >
>> > i2c-sh_mobile i2c-sh_mobile.0: timing values out of range: L/H=0x208/0x1bf
>> > sh_mobile: probe of i2c-sh_mobile.0 failed with error -22
>>
>> Yay, so the warning I added found another bug \o/
>>
>> >
>> > According to the datasheet, the transfer rate is derived from the HP
>> > clock (which runs at 104 MHz) divided by two. Hence
>> > i2c_sh_mobile_platform_data.clks_per_count should be set to two.
>> >
>> > Now probing succeeds, and i2c works:
>> >
>> > i2c-sh_mobile i2c-sh_mobile.0: I2C adapter 0 with bus speed 100000 Hz (L/H=0x104/0xe0)
>> >
>> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>>
>> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> As this appears to be a bug fix I would like to accompany this patch with
> some text describing when the problem was introduced and what its effects
> are. In short a rough guide to if it should be applied to -stable. To that
> end I prepared the following which I would appreciate your feedback on.
>
> * ARM: shmobile: kzm9g legacy: Set i2c clks_per_count
>
> This problem appears to have been introduced when i2c shmobile support was
> added to the sh73a9 by b028f94b76319e1b8 ("ARM: mach-shmobile: sh73a0
sh73a0
> i2c_shmobile support.") in v2.6.37.
>
> Without this fix i2c may not operate correctly on the sh73a0/kzm9g.
Thanks, that's correct.
BTW, I guess Kuribayashi-san was aware of the problem:
commit ebd5ac165f2aaefb767c53112c2010b0ff3df688
Author: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Date: Wed Oct 24 19:58:10 2012 +0900
i2c: i2c-sh_mobile: support I2C hardware block with a faster operating clock
On newer SH-/R-Mobile SoCs, a clock supply to the I2C hardware block,
which is used to generate the SCL clock output, is getting faster than
before, while on the other hand, the SCL clock control registers, ICCH
and ICCL, stay unchanged in 9-bit-wide (8+1).
On such silicons, the internal SCL clock counter gets incremented every
2 clocks of the operating clock.
This patch makes it configurable through platform data.
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
But I couldn't find any patches on a public mailing list using the new
clks_per_count field...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2014-11-12 8:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 11:52 [PATCH 0/5] ARM: shmobile: sh73a0/r8a73a4: i2c-sh_mobile fixes Geert Uytterhoeven
[not found] ` <1415274730-310-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2014-11-06 11:52 ` [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 Geert Uytterhoeven
[not found] ` <1415274730-310-2-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2014-11-07 5:24 ` Wolfram Sang
2014-11-07 7:12 ` Geert Uytterhoeven
2014-11-10 1:02 ` Simon Horman
2014-11-12 1:44 ` Simon Horman
2014-11-12 8:53 ` Geert Uytterhoeven [this message]
2014-11-12 8:55 ` Geert Uytterhoeven
[not found] ` <CAMuHMdXoiX6CreDJNaDHcmsifX0C+TRRvTy4JWYBc2c-MVT_Qw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12 9:05 ` Simon Horman
[not found] ` <CAMuHMdUUspG8-dYGiO7cmuECBLpfmQAYg=B8ZpajxRXhaEUJ2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12 9:04 ` Simon Horman
2014-11-06 11:52 ` [PATCH 2/5] i2c: sh_mobile: Add support for r8a73a4 and sh73a0 Geert Uytterhoeven
[not found] ` <1415274730-310-3-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2014-11-07 17:53 ` Wolfram Sang
2014-11-06 11:52 ` [PATCH 3/5] i2c: sh_mobile: Document SoC-specific bindings Geert Uytterhoeven
[not found] ` <1415274730-310-4-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2014-11-07 4:17 ` Simon Horman
2014-11-07 17:53 ` Wolfram Sang
2014-11-10 1:05 ` Simon Horman
2014-11-06 11:52 ` [PATCH 4/5] ARM: shmobile: sh73a0 dtsi: Add SoC-specific IIC compatible properties Geert Uytterhoeven
[not found] ` <1415274730-310-5-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2014-11-07 5:25 ` Wolfram Sang
2014-11-10 1:04 ` Simon Horman
2014-11-06 11:52 ` [PATCH 5/5] ARM: shmobile: r8a73a4 " Geert Uytterhoeven
2014-11-07 5:26 ` Wolfram Sang
2014-11-10 1:04 ` Simon Horman
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='CAMuHMdUUspG8-dYGiO7cmuECBLpfmQAYg=B8ZpajxRXhaEUJ2A@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=horms@verge.net.au \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.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;
as well as URLs for NNTP newsgroup(s).