* [PATCH 0/5] ARM: shmobile: sh73a0/r8a73a4: i2c-sh_mobile fixes @ 2014-11-06 11:52 Geert Uytterhoeven [not found] ` <1415274730-310-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> 0 siblings, 1 reply; 22+ messages in thread From: Geert Uytterhoeven @ 2014-11-06 11:52 UTC (permalink / raw) To: Wolfram Sang, Simon Horman, Magnus Damm Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven Hi Wolfram, Simon, Magnus, This patch series revives i2c on sh73a0/kzm9g (both legacy and reference), and on r8a73a4/ape6evm (reference). On these SoCs, the operating clock runs faster that on previous SoCs, and the internal SCL clock counter gets incremented every 2 clocks of the operating clock, just like on R-Car Gen2. But if this knowledge is not available to the driver, probing fails with e.g. 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 The series also updates the binding documentation to list the various SoC-specific compatible properties, to allow checkpatch to validate DTSes. This was tested on sh73a0/kzm9g (both legacy and reference). This was not tested on r8a73a4/ape6evm due to lack of hardware. Geert Uytterhoeven (5): ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 i2c: sh_mobile: Add support for r8a73a4 and sh73a0 i2c: sh_mobile: Document SoC-specific bindings ARM: shmobile: sh73a0 dtsi: Add SoC-specific IIC compatible properties ARM: shmobile: r8a73a4 dtsi: Add SoC-specific IIC compatible properties .../devicetree/bindings/i2c/i2c-sh_mobile.txt | 9 +++++++++ arch/arm/boot/dts/r8a73a4.dtsi | 18 +++++++++--------- arch/arm/boot/dts/sh73a0.dtsi | 10 +++++----- arch/arm/mach-shmobile/setup-sh73a0.c | 20 ++++++++++++++++++++ drivers/i2c/busses/i2c-sh_mobile.c | 14 ++++++++------ 5 files changed, 51 insertions(+), 20 deletions(-) -- 1.9.1 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.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 ^ permalink raw reply [flat|nested] 22+ messages in thread
[parent not found: <1415274730-310-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>]
* [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 [not found] ` <1415274730-310-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> @ 2014-11-06 11:52 ` Geert Uytterhoeven [not found] ` <1415274730-310-2-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> 2014-11-06 11:52 ` [PATCH 2/5] i2c: sh_mobile: Add support for r8a73a4 and sh73a0 Geert Uytterhoeven ` (3 subsequent siblings) 4 siblings, 1 reply; 22+ messages in thread From: Geert Uytterhoeven @ 2014-11-06 11:52 UTC (permalink / raw) To: Wolfram Sang, Simon Horman, Magnus Damm Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven 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 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-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> --- Note that the L/H values still differ from the Transfer Rate Settings example in Table 19.3 of the datasheet, which suggests 0x121/0xe7. arch/arm/mach-shmobile/setup-sh73a0.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index 2955a08a655d8889..179c2b65be9f6829 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c @@ -22,6 +22,7 @@ #include <linux/of_platform.h> #include <linux/delay.h> #include <linux/input.h> +#include <linux/i2c/i2c-sh_mobile.h> #include <linux/io.h> #include <linux/serial_sci.h> #include <linux/sh_dma.h> @@ -188,11 +189,18 @@ static struct resource i2c4_resources[] = { }, }; +static struct i2c_sh_mobile_platform_data i2c_platform_data = { + .clks_per_count = 2, +}; + static struct platform_device i2c0_device = { .name = "i2c-sh_mobile", .id = 0, .resource = i2c0_resources, .num_resources = ARRAY_SIZE(i2c0_resources), + .dev = { + .platform_data = &i2c_platform_data, + }, }; static struct platform_device i2c1_device = { @@ -200,6 +208,9 @@ static struct platform_device i2c1_device = { .id = 1, .resource = i2c1_resources, .num_resources = ARRAY_SIZE(i2c1_resources), + .dev = { + .platform_data = &i2c_platform_data, + }, }; static struct platform_device i2c2_device = { @@ -207,6 +218,9 @@ static struct platform_device i2c2_device = { .id = 2, .resource = i2c2_resources, .num_resources = ARRAY_SIZE(i2c2_resources), + .dev = { + .platform_data = &i2c_platform_data, + }, }; static struct platform_device i2c3_device = { @@ -214,6 +228,9 @@ static struct platform_device i2c3_device = { .id = 3, .resource = i2c3_resources, .num_resources = ARRAY_SIZE(i2c3_resources), + .dev = { + .platform_data = &i2c_platform_data, + }, }; static struct platform_device i2c4_device = { @@ -221,6 +238,9 @@ static struct platform_device i2c4_device = { .id = 4, .resource = i2c4_resources, .num_resources = ARRAY_SIZE(i2c4_resources), + .dev = { + .platform_data = &i2c_platform_data, + }, }; static const struct sh_dmae_slave_config sh73a0_dmae_slaves[] = { -- 1.9.1 ^ permalink raw reply related [flat|nested] 22+ messages in thread
[parent not found: <1415274730-310-2-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>]
* Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 [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 ` (2 more replies) 0 siblings, 3 replies; 22+ messages in thread From: Wolfram Sang @ 2014-11-07 5:24 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Simon Horman, Magnus Damm, linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 1103 bytes --] 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-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> Reviewed-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org> > --- > Note that the L/H values still differ from the Transfer Rate Settings > example in Table 19.3 of the datasheet, which suggests 0x121/0xe7. Is the formula different or is it rounding errors? Thanks, Wolfram [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 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 2 siblings, 0 replies; 22+ messages in thread From: Geert Uytterhoeven @ 2014-11-07 7:12 UTC (permalink / raw) To: Wolfram Sang Cc: Geert Uytterhoeven, Simon Horman, Magnus Damm, Linux I2C, devicetree@vger.kernel.org, Linux-sh list Hi Wolfram, On Fri, Nov 7, 2014 at 6:24 AM, Wolfram Sang <wsa@the-dreams.de> wrote: >> Note that the L/H values still differ from the Transfer Rate Settings >> example in Table 19.3 of the datasheet, which suggests 0x121/0xe7. > > Is the formula different or is it rounding errors? The formula is different. It doesn't use absolute tLOW, tHIGH, and tF values, but only the duty cycle of the clock. It's similar in the R-Car Gen2 docs. Except that on Gen2, there's no mention of using a duty cycle of 5/3 for High Speed like on AG5. 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 ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 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 2 siblings, 0 replies; 22+ messages in thread From: Simon Horman @ 2014-11-10 1:02 UTC (permalink / raw) To: Wolfram Sang Cc: Geert Uytterhoeven, Magnus Damm, linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA 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-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> > > Reviewed-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org> Thanks, I have queued this up. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 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 2 siblings, 1 reply; 22+ messages in thread From: Simon Horman @ 2014-11-12 1:44 UTC (permalink / raw) To: Wolfram Sang Cc: Geert Uytterhoeven, Magnus Damm, linux-i2c, devicetree, linux-sh 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> > > > --- > > Note that the L/H values still differ from the Transfer Rate Settings > > example in Table 19.3 of the datasheet, which suggests 0x121/0xe7. > > Is the formula different or is it rounding errors? Hi Geert, 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 i2c_shmobile support.") in v2.6.37. Without this fix i2c may not operate correctly on the sh73a0/kzm9g. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 2014-11-12 1:44 ` Simon Horman @ 2014-11-12 8:53 ` Geert Uytterhoeven 2014-11-12 8:55 ` Geert Uytterhoeven [not found] ` <CAMuHMdUUspG8-dYGiO7cmuECBLpfmQAYg=B8ZpajxRXhaEUJ2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 2 replies; 22+ messages in thread From: Geert Uytterhoeven @ 2014-11-12 8:53 UTC (permalink / raw) To: Simon Horman Cc: Wolfram Sang, Geert Uytterhoeven, Magnus Damm, Linux I2C, devicetree@vger.kernel.org, Linux-sh list 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 ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 2014-11-12 8:53 ` Geert Uytterhoeven @ 2014-11-12 8:55 ` Geert Uytterhoeven [not found] ` <CAMuHMdXoiX6CreDJNaDHcmsifX0C+TRRvTy4JWYBc2c-MVT_Qw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> [not found] ` <CAMuHMdUUspG8-dYGiO7cmuECBLpfmQAYg=B8ZpajxRXhaEUJ2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 1 sibling, 1 reply; 22+ messages in thread From: Geert Uytterhoeven @ 2014-11-12 8:55 UTC (permalink / raw) To: Simon Horman Cc: Wolfram Sang, Geert Uytterhoeven, Magnus Damm, Linux I2C, devicetree@vger.kernel.org, Linux-sh list On Wed, Nov 12, 2014 at 9:53 AM, Geert Uytterhoeven <geert@linux-m68k.org> wrote: >> i2c_shmobile support.") in v2.6.37. >> >> Without this fix i2c may not operate correctly on the sh73a0/kzm9g. > > Thanks, that's correct. git tag --contains b028f94b76319e1b8 says v2.6.38. Not that you're gonna backport it to ltsi-v2.6.37 ;-) 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 ^ permalink raw reply [flat|nested] 22+ messages in thread
[parent not found: <CAMuHMdXoiX6CreDJNaDHcmsifX0C+TRRvTy4JWYBc2c-MVT_Qw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 [not found] ` <CAMuHMdXoiX6CreDJNaDHcmsifX0C+TRRvTy4JWYBc2c-MVT_Qw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2014-11-12 9:05 ` Simon Horman 0 siblings, 0 replies; 22+ messages in thread From: Simon Horman @ 2014-11-12 9:05 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Wolfram Sang, Geert Uytterhoeven, Magnus Damm, Linux I2C, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux-sh list On Wed, Nov 12, 2014 at 09:55:58AM +0100, Geert Uytterhoeven wrote: > On Wed, Nov 12, 2014 at 9:53 AM, Geert Uytterhoeven > <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote: > >> i2c_shmobile support.") in v2.6.37. > >> > >> Without this fix i2c may not operate correctly on the sh73a0/kzm9g. > > > > Thanks, that's correct. > > git tag --contains b028f94b76319e1b8 says v2.6.38. > > Not that you're gonna backport it to ltsi-v2.6.37 ;-) Hopefully not! I'll update my description anyway. ^ permalink raw reply [flat|nested] 22+ messages in thread
[parent not found: <CAMuHMdUUspG8-dYGiO7cmuECBLpfmQAYg=B8ZpajxRXhaEUJ2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 1/5] ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2 [not found] ` <CAMuHMdUUspG8-dYGiO7cmuECBLpfmQAYg=B8ZpajxRXhaEUJ2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2014-11-12 9:04 ` Simon Horman 0 siblings, 0 replies; 22+ messages in thread From: Simon Horman @ 2014-11-12 9:04 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Wolfram Sang, Geert Uytterhoeven, Magnus Damm, Linux I2C, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux-sh list On Wed, Nov 12, 2014 at 09:53:27AM +0100, Geert Uytterhoeven wrote: > Hi Simon, > > On Wed, Nov 12, 2014 at 2:44 AM, Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org> 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-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> > >> > >> Reviewed-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org> > > > 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 Thanks. > > 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-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> > 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-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> > Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> > > But I couldn't find any patches on a public mailing list using the new > clks_per_count field... My understanding is that unfortunately Kuribayashi-san is no longer working for Renesas. But I can try to raise this with the BSP team if you like. ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 2/5] i2c: sh_mobile: Add support for r8a73a4 and sh73a0 [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 @ 2014-11-06 11:52 ` Geert Uytterhoeven [not found] ` <1415274730-310-3-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> 2014-11-06 11:52 ` [PATCH 3/5] i2c: sh_mobile: Document SoC-specific bindings Geert Uytterhoeven ` (2 subsequent siblings) 4 siblings, 1 reply; 22+ messages in thread From: Geert Uytterhoeven @ 2014-11-06 11:52 UTC (permalink / raw) To: Wolfram Sang, Simon Horman, Magnus Damm Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven Add support for r8a73a4 (R-Mobile APE6) and sh73a0 (SH-Mobile AG5). On these SoCs, the operating clock runs faster that on previous SoCs, and the internal SCL clock counter gets incremented every 2 clocks of the operating clock, just like on R-Car Gen2. Cfr. the "/2" in the calculation of ICCL/ICCH in section "I2C Bus Interface (IIC)", subsection "Transfer Rate" of the datasheets. Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> --- drivers/i2c/busses/i2c-sh_mobile.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 8b5e79cb4468a87f..8ac36e4ff40a09bb 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c @@ -626,17 +626,19 @@ static const struct sh_mobile_dt_config default_dt_config = { .clks_per_count = 1, }; -static const struct sh_mobile_dt_config rcar_gen2_dt_config = { +static const struct sh_mobile_dt_config fast_clock_dt_config = { .clks_per_count = 2, }; static const struct of_device_id sh_mobile_i2c_dt_ids[] = { { .compatible = "renesas,rmobile-iic", .data = &default_dt_config }, - { .compatible = "renesas,iic-r8a7790", .data = &rcar_gen2_dt_config }, - { .compatible = "renesas,iic-r8a7791", .data = &rcar_gen2_dt_config }, - { .compatible = "renesas,iic-r8a7792", .data = &rcar_gen2_dt_config }, - { .compatible = "renesas,iic-r8a7793", .data = &rcar_gen2_dt_config }, - { .compatible = "renesas,iic-r8a7794", .data = &rcar_gen2_dt_config }, + { .compatible = "renesas,iic-r8a73a4", .data = &fast_clock_dt_config }, + { .compatible = "renesas,iic-r8a7790", .data = &fast_clock_dt_config }, + { .compatible = "renesas,iic-r8a7791", .data = &fast_clock_dt_config }, + { .compatible = "renesas,iic-r8a7792", .data = &fast_clock_dt_config }, + { .compatible = "renesas,iic-r8a7793", .data = &fast_clock_dt_config }, + { .compatible = "renesas,iic-r8a7794", .data = &fast_clock_dt_config }, + { .compatible = "renesas,iic-sh73a0", .data = &fast_clock_dt_config }, {}, }; MODULE_DEVICE_TABLE(of, sh_mobile_i2c_dt_ids); -- 1.9.1 ^ permalink raw reply related [flat|nested] 22+ messages in thread
[parent not found: <1415274730-310-3-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>]
* Re: [PATCH 2/5] i2c: sh_mobile: Add support for r8a73a4 and sh73a0 [not found] ` <1415274730-310-3-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> @ 2014-11-07 17:53 ` Wolfram Sang 0 siblings, 0 replies; 22+ messages in thread From: Wolfram Sang @ 2014-11-07 17:53 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Simon Horman, Magnus Damm, linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 606 bytes --] On Thu, Nov 06, 2014 at 12:52:07PM +0100, Geert Uytterhoeven wrote: > Add support for r8a73a4 (R-Mobile APE6) and sh73a0 (SH-Mobile AG5). > On these SoCs, the operating clock runs faster that on previous SoCs, > and the internal SCL clock counter gets incremented every 2 clocks of > the operating clock, just like on R-Car Gen2. > > Cfr. the "/2" in the calculation of ICCL/ICCH in section "I2C Bus > Interface (IIC)", subsection "Transfer Rate" of the datasheets. > > Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> Applied to for-next, thanks! [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 3/5] i2c: sh_mobile: Document SoC-specific bindings [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 2014-11-06 11:52 ` [PATCH 2/5] i2c: sh_mobile: Add support for r8a73a4 and sh73a0 Geert Uytterhoeven @ 2014-11-06 11:52 ` Geert Uytterhoeven [not found] ` <1415274730-310-4-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> 2014-11-06 11:52 ` [PATCH 4/5] ARM: shmobile: sh73a0 dtsi: Add SoC-specific IIC compatible properties Geert Uytterhoeven 2014-11-06 11:52 ` [PATCH 5/5] ARM: shmobile: r8a73a4 " Geert Uytterhoeven 4 siblings, 1 reply; 22+ messages in thread From: Geert Uytterhoeven @ 2014-11-06 11:52 UTC (permalink / raw) To: Wolfram Sang, Simon Horman, Magnus Damm Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven Explicitly list the various SoC-specific compatible properties. This allows checkpatch to validate DTSes. Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> --- Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt b/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt index d2153ce36fa81404..c33e9a32d496ef10 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt @@ -2,6 +2,15 @@ Device tree configuration for Renesas IIC (sh_mobile) driver Required properties: - compatible : "renesas,iic-<soctype>". "renesas,rmobile-iic" as fallback + Examples with soctypes are: + - "renesas,iic-r8a73a4" (R-Mobile APE6) + - "renesas,iic-r8a7740" (R-Mobile A1) + - "renesas,iic-r8a7790" (R-Car H2) + - "renesas,iic-r8a7791" (R-Car M2-W) + - "renesas,iic-r8a7792" (R-Car V2H) + - "renesas,iic-r8a7793" (R-Car M2-N) + - "renesas,iic-r8a7794" (R-Car E2) + - "renesas,iic-sh73a0" (SH-Mobile AG5) - reg : address start and address range size of device - interrupts : interrupt of device - clocks : clock for device -- 1.9.1 ^ permalink raw reply related [flat|nested] 22+ messages in thread
[parent not found: <1415274730-310-4-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>]
* Re: [PATCH 3/5] i2c: sh_mobile: Document SoC-specific bindings [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 1 sibling, 0 replies; 22+ messages in thread From: Simon Horman @ 2014-11-07 4:17 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Wolfram Sang, Magnus Damm, linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA On Thu, Nov 06, 2014 at 12:52:08PM +0100, Geert Uytterhoeven wrote: > Explicitly list the various SoC-specific compatible properties. > This allows checkpatch to validate DTSes. > > Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> Acked-by: Simon Horman <horms+renesas-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org> > --- > Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt b/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt > index d2153ce36fa81404..c33e9a32d496ef10 100644 > --- a/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt > +++ b/Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt > @@ -2,6 +2,15 @@ Device tree configuration for Renesas IIC (sh_mobile) driver > > Required properties: > - compatible : "renesas,iic-<soctype>". "renesas,rmobile-iic" as fallback > + Examples with soctypes are: > + - "renesas,iic-r8a73a4" (R-Mobile APE6) > + - "renesas,iic-r8a7740" (R-Mobile A1) > + - "renesas,iic-r8a7790" (R-Car H2) > + - "renesas,iic-r8a7791" (R-Car M2-W) > + - "renesas,iic-r8a7792" (R-Car V2H) > + - "renesas,iic-r8a7793" (R-Car M2-N) > + - "renesas,iic-r8a7794" (R-Car E2) > + - "renesas,iic-sh73a0" (SH-Mobile AG5) > - reg : address start and address range size of device > - interrupts : interrupt of device > - clocks : clock for device > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sh" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 3/5] i2c: sh_mobile: Document SoC-specific bindings [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 1 sibling, 1 reply; 22+ messages in thread From: Wolfram Sang @ 2014-11-07 17:53 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Simon Horman, Magnus Damm, linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 352 bytes --] On Thu, Nov 06, 2014 at 12:52:08PM +0100, Geert Uytterhoeven wrote: > Explicitly list the various SoC-specific compatible properties. > This allows checkpatch to validate DTSes. > > Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> Applied to for-next, thanks! I guess the other patches go via Simon. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 3/5] i2c: sh_mobile: Document SoC-specific bindings 2014-11-07 17:53 ` Wolfram Sang @ 2014-11-10 1:05 ` Simon Horman 0 siblings, 0 replies; 22+ messages in thread From: Simon Horman @ 2014-11-10 1:05 UTC (permalink / raw) To: Wolfram Sang Cc: Geert Uytterhoeven, Magnus Damm, linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA On Fri, Nov 07, 2014 at 06:53:48PM +0100, Wolfram Sang wrote: > On Thu, Nov 06, 2014 at 12:52:08PM +0100, Geert Uytterhoeven wrote: > > Explicitly list the various SoC-specific compatible properties. > > This allows checkpatch to validate DTSes. > > > > Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> > > Applied to for-next, thanks! I guess the other patches go via Simon. Thanks, I have picked up patches 1, 4 and 5. ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 4/5] ARM: shmobile: sh73a0 dtsi: Add SoC-specific IIC compatible properties [not found] ` <1415274730-310-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> ` (2 preceding siblings ...) 2014-11-06 11:52 ` [PATCH 3/5] i2c: sh_mobile: Document SoC-specific bindings Geert Uytterhoeven @ 2014-11-06 11:52 ` Geert Uytterhoeven [not found] ` <1415274730-310-5-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> 2014-11-06 11:52 ` [PATCH 5/5] ARM: shmobile: r8a73a4 " Geert Uytterhoeven 4 siblings, 1 reply; 22+ messages in thread From: Geert Uytterhoeven @ 2014-11-06 11:52 UTC (permalink / raw) To: Wolfram Sang, Simon Horman, Magnus Damm Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven The IIC nodes used the generic compatible properties only. This causes the driver to fail when using Standard Speed, as the operational clock is driven by the 104 MHz HP clock: i2c-sh_mobile e6820000.i2c: timing values out of range: L/H=0x208/0x1bf i2c-sh_mobile: probe of e6820000.i2c failed with error -22 Add the SoC-specific compatible property to fix this. Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> --- arch/arm/boot/dts/sh73a0.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi index 030a5920312fa19b..d8def5a529da2882 100644 --- a/arch/arm/boot/dts/sh73a0.dtsi +++ b/arch/arm/boot/dts/sh73a0.dtsi @@ -138,7 +138,7 @@ i2c0: i2c@e6820000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-sh73a0", "renesas,rmobile-iic"; reg = <0xe6820000 0x425>; interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH 0 168 IRQ_TYPE_LEVEL_HIGH @@ -150,7 +150,7 @@ i2c1: i2c@e6822000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-sh73a0", "renesas,rmobile-iic"; reg = <0xe6822000 0x425>; interrupts = <0 51 IRQ_TYPE_LEVEL_HIGH 0 52 IRQ_TYPE_LEVEL_HIGH @@ -162,7 +162,7 @@ i2c2: i2c@e6824000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-sh73a0", "renesas,rmobile-iic"; reg = <0xe6824000 0x425>; interrupts = <0 171 IRQ_TYPE_LEVEL_HIGH 0 172 IRQ_TYPE_LEVEL_HIGH @@ -174,7 +174,7 @@ i2c3: i2c@e6826000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-sh73a0", "renesas,rmobile-iic"; reg = <0xe6826000 0x425>; interrupts = <0 183 IRQ_TYPE_LEVEL_HIGH 0 184 IRQ_TYPE_LEVEL_HIGH @@ -186,7 +186,7 @@ i2c4: i2c@e6828000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-sh73a0", "renesas,rmobile-iic"; reg = <0xe6828000 0x425>; interrupts = <0 187 IRQ_TYPE_LEVEL_HIGH 0 188 IRQ_TYPE_LEVEL_HIGH -- 1.9.1 ^ permalink raw reply related [flat|nested] 22+ messages in thread
[parent not found: <1415274730-310-5-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>]
* Re: [PATCH 4/5] ARM: shmobile: sh73a0 dtsi: Add SoC-specific IIC compatible properties [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 0 siblings, 1 reply; 22+ messages in thread From: Wolfram Sang @ 2014-11-07 5:25 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Simon Horman, Magnus Damm, linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 657 bytes --] On Thu, Nov 06, 2014 at 12:52:09PM +0100, Geert Uytterhoeven wrote: > The IIC nodes used the generic compatible properties only. > This causes the driver to fail when using Standard Speed, as the > operational clock is driven by the 104 MHz HP clock: > > i2c-sh_mobile e6820000.i2c: timing values out of range: L/H=0x208/0x1bf > i2c-sh_mobile: probe of e6820000.i2c failed with error -22 > > Add the SoC-specific compatible property to fix this. > > Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> Reviewed-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org> [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 4/5] ARM: shmobile: sh73a0 dtsi: Add SoC-specific IIC compatible properties 2014-11-07 5:25 ` Wolfram Sang @ 2014-11-10 1:04 ` Simon Horman 0 siblings, 0 replies; 22+ messages in thread From: Simon Horman @ 2014-11-10 1:04 UTC (permalink / raw) To: Wolfram Sang Cc: Geert Uytterhoeven, Magnus Damm, linux-i2c, devicetree, linux-sh On Fri, Nov 07, 2014 at 06:25:33AM +0100, Wolfram Sang wrote: > On Thu, Nov 06, 2014 at 12:52:09PM +0100, Geert Uytterhoeven wrote: > > The IIC nodes used the generic compatible properties only. > > This causes the driver to fail when using Standard Speed, as the > > operational clock is driven by the 104 MHz HP clock: > > > > i2c-sh_mobile e6820000.i2c: timing values out of range: L/H=0x208/0x1bf > > i2c-sh_mobile: probe of e6820000.i2c failed with error -22 > > > > Add the SoC-specific compatible property to fix this. > > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > > Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Thanks, I have queued this up. ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/5] ARM: shmobile: r8a73a4 dtsi: Add SoC-specific IIC compatible properties [not found] ` <1415274730-310-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> ` (3 preceding siblings ...) 2014-11-06 11:52 ` [PATCH 4/5] ARM: shmobile: sh73a0 dtsi: Add SoC-specific IIC compatible properties Geert Uytterhoeven @ 2014-11-06 11:52 ` Geert Uytterhoeven 2014-11-07 5:26 ` Wolfram Sang 4 siblings, 1 reply; 22+ messages in thread From: Geert Uytterhoeven @ 2014-11-06 11:52 UTC (permalink / raw) To: Wolfram Sang, Simon Horman, Magnus Damm Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven The IIC nodes used the generic compatible properties only. This may cause the driver to fail when using Standard Speed on IIC masters where the operational clock is driven by the 130 MHz HP clock. Add the SoC-specific compatible property to fix this. Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> --- Untested due to lack of hardware arch/arm/boot/dts/r8a73a4.dtsi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/boot/dts/r8a73a4.dtsi b/arch/arm/boot/dts/r8a73a4.dtsi index 7f57dc7f392aad30..5ac57babc3b95c99 100644 --- a/arch/arm/boot/dts/r8a73a4.dtsi +++ b/arch/arm/boot/dts/r8a73a4.dtsi @@ -106,7 +106,7 @@ i2c5: i2c@e60b0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; reg = <0 0xe60b0000 0 0x428>; interrupts = <0 179 IRQ_TYPE_LEVEL_HIGH>; @@ -205,7 +205,7 @@ i2c0: i2c@e6500000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; reg = <0 0xe6500000 0 0x428>; interrupts = <0 174 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; @@ -214,7 +214,7 @@ i2c1: i2c@e6510000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; reg = <0 0xe6510000 0 0x428>; interrupts = <0 175 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; @@ -223,7 +223,7 @@ i2c2: i2c@e6520000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; reg = <0 0xe6520000 0 0x428>; interrupts = <0 176 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; @@ -232,7 +232,7 @@ i2c3: i2c@e6530000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; reg = <0 0xe6530000 0 0x428>; interrupts = <0 177 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; @@ -241,7 +241,7 @@ i2c4: i2c@e6540000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; reg = <0 0xe6540000 0 0x428>; interrupts = <0 178 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; @@ -250,7 +250,7 @@ i2c6: i2c@e6550000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; reg = <0 0xe6550000 0 0x428>; interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; @@ -259,7 +259,7 @@ i2c7: i2c@e6560000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; reg = <0 0xe6560000 0 0x428>; interrupts = <0 185 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; @@ -268,7 +268,7 @@ i2c8: i2c@e6570000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a73a4", "renesas,rmobile-iic"; reg = <0 0xe6570000 0 0x428>; interrupts = <0 173 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; -- 1.9.1 ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 5/5] ARM: shmobile: r8a73a4 dtsi: Add SoC-specific IIC compatible properties 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 0 siblings, 1 reply; 22+ messages in thread From: Wolfram Sang @ 2014-11-07 5:26 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Simon Horman, Magnus Damm, linux-i2c, devicetree, linux-sh [-- Attachment #1: Type: text/plain, Size: 469 bytes --] On Thu, Nov 06, 2014 at 12:52:10PM +0100, Geert Uytterhoeven wrote: > The IIC nodes used the generic compatible properties only. > This may cause the driver to fail when using Standard Speed on IIC > masters where the operational clock is driven by the 130 MHz HP clock. > > Add the SoC-specific compatible property to fix this. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 5/5] ARM: shmobile: r8a73a4 dtsi: Add SoC-specific IIC compatible properties 2014-11-07 5:26 ` Wolfram Sang @ 2014-11-10 1:04 ` Simon Horman 0 siblings, 0 replies; 22+ messages in thread From: Simon Horman @ 2014-11-10 1:04 UTC (permalink / raw) To: Wolfram Sang Cc: Geert Uytterhoeven, Magnus Damm, linux-i2c, devicetree, linux-sh On Fri, Nov 07, 2014 at 06:26:16AM +0100, Wolfram Sang wrote: > On Thu, Nov 06, 2014 at 12:52:10PM +0100, Geert Uytterhoeven wrote: > > The IIC nodes used the generic compatible properties only. > > This may cause the driver to fail when using Standard Speed on IIC > > masters where the operational clock is driven by the 130 MHz HP clock. > > > > Add the SoC-specific compatible property to fix this. > > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > > Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Thanks, I have queued this up. ^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2014-11-12 9:05 UTC | newest] Thread overview: 22+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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
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).