* [BUGFIX][PATCH] fix the parent of i2c[12]_clk
@ 2011-07-01 13:02 Lothar Waßmann
2011-07-01 14:01 ` Fabio Estevam
0 siblings, 1 reply; 5+ messages in thread
From: Lothar Waßmann @ 2011-07-01 13:02 UTC (permalink / raw)
To: linux-arm-kernel
The clock from which the I2C timing is derived is the ipg_perclk not ipg_clk.
I2C bus frequency was too low by a factor of ~8 due to the clock divider
calculation being based on 66.5MHz IPG clock while the bus actually
uses 8MHz ipg_perclk.
Kernel version: 3.0.0-rc2 branch 'imx-for-next' of git://git.pengutronix.de/git/imx/linux-2.6
Signed-off-by: Lothar Wa?mann <LW@KARO-electronics.de>
---
arch/arm/mach-mx5/clock-mx51-mx53.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index 699b0d2..fe977d0 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -1282,9 +1282,9 @@ DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET,
/* I2C */
DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET,
- NULL, NULL, &ipg_clk, NULL);
+ NULL, NULL, &ipg_perclk, NULL);
DEFINE_CLOCK(i2c2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG10_OFFSET,
- NULL, NULL, &ipg_clk, NULL);
+ NULL, NULL, &ipg_perclk, NULL);
DEFINE_CLOCK(hsi2c_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
NULL, NULL, &ipg_clk, NULL);
DEFINE_CLOCK(i2c3_mx53_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
--
1.5.6.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [BUGFIX][PATCH] fix the parent of i2c[12]_clk
2011-07-01 13:02 [BUGFIX][PATCH] fix the parent of i2c[12]_clk Lothar Waßmann
@ 2011-07-01 14:01 ` Fabio Estevam
2011-07-04 13:41 ` Lothar Waßmann
0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2011-07-01 14:01 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jul 1, 2011 at 10:02 AM, Lothar Wa?mann <LW@karo-electronics.de> wrote:
> The clock from which the I2C timing is derived is the ipg_perclk not ipg_clk.
>
> I2C bus frequency was too low by a factor of ~8 due to the clock divider
> calculation being based on 66.5MHz IPG clock while the bus actually
> uses 8MHz ipg_perclk.
>
> Kernel version: 3.0.0-rc2 branch 'imx-for-next' of git://git.pengutronix.de/git/imx/linux-2.6
>
> Signed-off-by: Lothar Wa?mann <LW@KARO-electronics.de>
> ---
> ?arch/arm/mach-mx5/clock-mx51-mx53.c | ? ?4 ++--
> ?1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
> index 699b0d2..fe977d0 100644
> --- a/arch/arm/mach-mx5/clock-mx51-mx53.c
> +++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
> @@ -1282,9 +1282,9 @@ DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET,
>
> ?/* I2C */
> ?DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET,
> - ? ? ? NULL, NULL, &ipg_clk, NULL);
> + ? ? ? NULL, NULL, &ipg_perclk, NULL);
> ?DEFINE_CLOCK(i2c2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG10_OFFSET,
> - ? ? ? NULL, NULL, &ipg_clk, NULL);
> + ? ? ? NULL, NULL, &ipg_perclk, NULL);
> ?DEFINE_CLOCK(hsi2c_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
> ? ? ? ?NULL, NULL, &ipg_clk, NULL);
> ?DEFINE_CLOCK(i2c3_mx53_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
Shouldn't i2c3_mx53_clk have the same change applied?
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 5+ messages in thread
* [BUGFIX][PATCH] fix the parent of i2c[12]_clk
2011-07-01 14:01 ` Fabio Estevam
@ 2011-07-04 13:41 ` Lothar Waßmann
2011-07-04 13:52 ` [BUGFIX][PATCH] mach-mx5: fix the I2C clock parents Lothar Waßmann
0 siblings, 1 reply; 5+ messages in thread
From: Lothar Waßmann @ 2011-07-04 13:41 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Fabio Estevam writes:
> On Fri, Jul 1, 2011 at 10:02 AM, Lothar Wa?mann <LW@karo-electronics.de> wrote:
> > The clock from which the I2C timing is derived is the ipg_perclk not ipg_clk.
> >
> > I2C bus frequency was too low by a factor of ~8 due to the clock divider
> > calculation being based on 66.5MHz IPG clock while the bus actually
> > uses 8MHz ipg_perclk.
> >
> > Kernel version: 3.0.0-rc2 branch 'imx-for-next' of git://git.pengutronix.de/git/imx/linux-2.6
> >
> > Signed-off-by: Lothar Wa?mann <LW@KARO-electronics.de>
> > ---
> > ?arch/arm/mach-mx5/clock-mx51-mx53.c | ? ?4 ++--
> > ?1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
> > index 699b0d2..fe977d0 100644
> > --- a/arch/arm/mach-mx5/clock-mx51-mx53.c
> > +++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
> > @@ -1282,9 +1282,9 @@ DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET,
> >
> > ?/* I2C */
> > ?DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET,
> > - ? ? ? NULL, NULL, &ipg_clk, NULL);
> > + ? ? ? NULL, NULL, &ipg_perclk, NULL);
> > ?DEFINE_CLOCK(i2c2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG10_OFFSET,
> > - ? ? ? NULL, NULL, &ipg_clk, NULL);
> > + ? ? ? NULL, NULL, &ipg_perclk, NULL);
> > ?DEFINE_CLOCK(hsi2c_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
> > ? ? ? ?NULL, NULL, &ipg_clk, NULL);
> > ?DEFINE_CLOCK(i2c3_mx53_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
>
> Shouldn't i2c3_mx53_clk have the same change applied?
>
You are right. I'll resend the patch.
Actually also the HSI2C clock is incomplete. The IPG clock only drives
the IP bus interface. The serial clock is derived from either of the
PLLs or the LP_APM clock.
But since Freescale discourages the use of the HS-I2C controller on
the i.MX51 (which AFAIK currently is the only processor that
implements it) in the Processor Reference Manual[*], I doubt that it
makes sense to implement the clock logic for it at all for now.
[*]
| 39.1 Introduction
[...]
| NOTE
| Due to limited functionality, Freescale does not recommend users
| incorporate the HS-I2C module in future designs. For details on the
| limitations, refer to the MX51 IC Errata. Users should consider using the
| two standard I2C modules, which have no errata.
Lothar Wa?mann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* [BUGFIX][PATCH] mach-mx5: fix the I2C clock parents
2011-07-04 13:41 ` Lothar Waßmann
@ 2011-07-04 13:52 ` Lothar Waßmann
2011-07-04 14:48 ` Sergei Shtylyov
0 siblings, 1 reply; 5+ messages in thread
From: Lothar Waßmann @ 2011-07-04 13:52 UTC (permalink / raw)
To: linux-arm-kernel
The clock from which the I2C timing is derived is the ipg_perclk not ipg_clk.
I2C bus frequency was lower by a factor of ~8 due to the clock divider
calculation being based on 66.5MHz IPG clock while the bus actually
uses 8MHz ipg_perclk.
Kernel version: 3.0.0-rc2 branch 'imx-for-next' of git://git.pengutronix.de/git/imx/linux-2.6
Signed-off-by: Lothar Wa?mann <LW@KARO-electronics.de>
---
arch/arm/mach-mx5/clock-mx51-mx53.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index 699b0d2..ff16d86 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -1282,13 +1282,13 @@ DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET,
/* I2C */
DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET,
- NULL, NULL, &ipg_clk, NULL);
+ NULL, NULL, &ipg_perclk, NULL);
DEFINE_CLOCK(i2c2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG10_OFFSET,
- NULL, NULL, &ipg_clk, NULL);
+ NULL, NULL, &ipg_perclk, NULL);
DEFINE_CLOCK(hsi2c_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
NULL, NULL, &ipg_clk, NULL);
DEFINE_CLOCK(i2c3_mx53_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
- NULL, NULL, &ipg_clk, NULL);
+ NULL, NULL, &ipg_perclk, NULL);
/* FEC */
DEFINE_CLOCK(fec_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG12_OFFSET,
--
1.5.6.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [BUGFIX][PATCH] mach-mx5: fix the I2C clock parents
2011-07-04 13:52 ` [BUGFIX][PATCH] mach-mx5: fix the I2C clock parents Lothar Waßmann
@ 2011-07-04 14:48 ` Sergei Shtylyov
0 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2011-07-04 14:48 UTC (permalink / raw)
To: linux-arm-kernel
Lothar Wa?mann wrote:
> The clock from which the I2C timing is derived is the ipg_perclk not ipg_clk.
> I2C bus frequency was lower by a factor of ~8 due to the clock divider
> calculation being based on 66.5MHz IPG clock while the bus actually
> uses 8MHz ipg_perclk.
> Kernel version: 3.0.0-rc2 branch 'imx-for-next' of git://git.pengutronix.de/git/imx/linux-2.6
Shouldn't this info be specified rather after the --- tear-line?
> Signed-off-by: Lothar Wa?mann <LW@KARO-electronics.de>
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-07-04 14:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-01 13:02 [BUGFIX][PATCH] fix the parent of i2c[12]_clk Lothar Waßmann
2011-07-01 14:01 ` Fabio Estevam
2011-07-04 13:41 ` Lothar Waßmann
2011-07-04 13:52 ` [BUGFIX][PATCH] mach-mx5: fix the I2C clock parents Lothar Waßmann
2011-07-04 14:48 ` Sergei Shtylyov
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).