From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id E4E18B70A0 for ; Sun, 7 Jun 2009 08:27:15 +1000 (EST) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.237]) by ozlabs.org (Postfix) with ESMTP id 291F0DDD0C for ; Sun, 7 Jun 2009 08:27:14 +1000 (EST) Received: by rv-out-0506.google.com with SMTP id f9so900636rvb.9 for ; Sat, 06 Jun 2009 15:27:13 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090606221618.701E0832E416@gemini.denx.de> References: <1241641262-5202-1-git-send-email-wd@denx.de> <1241641262-5202-6-git-send-email-wd@denx.de> <4b73d43f0905071909v6e6e8b2el9eb6d4a1b9038f45@mail.gmail.com> <20090606221618.701E0832E416@gemini.denx.de> Date: Sat, 6 Jun 2009 16:27:13 -0600 Message-ID: <4b73d43f0906061527p7ca1b301ybcfc576870a168d5@mail.gmail.com> Subject: Re: [PATCH 05/04] *** NOT FOR RELEASE *** HACK *** Work around MII clock issue *** From: John Rigby To: Wolfgang Denk Content-Type: multipart/alternative; boundary=000e0cd14690bccee8046bb582b5 Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --000e0cd14690bccee8046bb582b5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I noticed the latest BSP from Freescale has this patch: From: Chen Hongjun Date: Thu, 16 Apr 2009 20:22:52 +0800 Subject: [PATCH] Fixed FEC bug for bluestone board. Signed-off-by: Chen Hongjun --- drivers/net/fs_enet/mii-fec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c index 13a7d66..53d01a8 100644 --- a/drivers/net/fs_enet/mii-fec.c +++ b/drivers/net/fs_enet/mii-fec.c @@ -208,7 +208,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev, if (!fec->fecp) goto out_fec; - fec->mii_speed = ((ppc_proc_freq + 4999999) / 5000000) << 1; + fec->mii_speed = ((((ppc_proc_freq + 4999999) / 2500000) / 2) & 0x3F) << 1; setbits32(&fec->fecp->fec_r_cntrl, FEC_RCNTRL_MII_MODE); setbits32(&fec->fecp->fec_ecntrl, FEC_ECNTRL_PINMUX | -- 1.5.4 On Sat, Jun 6, 2009 at 4:16 PM, Wolfgang Denk wrote: > Dear John, > > In message <4b73d43f0905071909v6e6e8b2el9eb6d4a1b9038f45@mail.gmail.com> > you wrote: > > > > I think the fec's parent clock is the ipb clock not the ppc core clock. > > Could that be the problem? > > I don't think so. > > When debugging, I printed the actual clock frequencies, and they > looked as expected. And "arch/powerpc/platforms/512x/clock.c" has > this: > > 385 static struct clk fec_clk = { > 386 .name = "fec_clk", > 387 .flags = CLK_HAS_CTRL, > 388 .reg = 0, > 389 .bit = 13, > 390 .calc = unity_clk_calc, > 391 .parent = &ips_clk, > 392 }; > > which looks OK to me. > > Best regards, > > Wolfgang Denk > > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de > The human mind ordinarily operates at only ten percent of its > capacity. The rest is overhead for the operating system. > --000e0cd14690bccee8046bb582b5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I noticed the latest BSP from Freescale has this patch:

From: Chen H= ongjun <Hong-jun.chen@free= cale.com>
Date: Thu, 16 Apr 2009 20:22:52 +0800
Subject: [PATC= H] Fixed FEC bug for bluestone board.

Signed-off-by: Chen Hongjun <Hong-jun.chen@freecale.com>
---
=A0drivers/net/fs_enet/= mii-fec.c |=A0=A0=A0 2 +-
=A01 files changed, 1 insertions(+), 1 deletio= ns(-)

diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fe= c.c
index 13a7d66..53d01a8 100644
--- a/drivers/net/fs_enet/mii-fec.c=
+++ b/drivers/net/fs_enet/mii-fec.c
@@ -208,7 +208,7 @@ static int _= _devinit fs_enet_mdio_probe(struct of_device *ofdev,
=A0=A0=A0=A0=A0=A0=A0 if (!fec->fecp)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 goto out_fec;
=A0
-=A0=A0=A0=A0=A0=A0 fec->mii_spe= ed =3D ((ppc_proc_freq + 4999999) / 5000000) << 1;
+=A0=A0=A0=A0= =A0=A0 fec->mii_speed =3D ((((ppc_proc_freq + 4999999) / 2500000) / 2) &= amp; 0x3F) << 1;
=A0
=A0=A0=A0=A0=A0=A0=A0 setbits32(&fec->fecp->fec_r_cntrl, F= EC_RCNTRL_MII_MODE);
=A0=A0=A0=A0=A0=A0=A0 setbits32(&fec->fecp-&= gt;fec_ecntrl, FEC_ECNTRL_PINMUX |
--
1.5.4


On Sat, Jun 6, 2009 at 4:16 PM, Wolfgang Denk <wd@denx.de> wrote:
Dear John,

In message <4b73d43f0905071909v6e6e8b2el9eb6d4a1b9038f45@mail.gmail.= com> you wrote:
>
> I think the fec's parent clock is the ipb clock not the ppc core c= lock.
> Could that be the problem?

I don't think so.

When debugging, I printed the actual clock frequencies, and they
looked as expected. And "arch/powerpc/platforms/512x/clock.c" has=
this:

385 static struct clk fec_clk =3D {
386 =A0 =A0 =A0 =A0 .name =3D "fec_clk",
387 =A0 =A0 =A0 =A0 .flags =3D CLK_HAS_CTRL,
388 =A0 =A0 =A0 =A0 .reg =3D 0,
389 =A0 =A0 =A0 =A0 .bit =3D 13,
390 =A0 =A0 =A0 =A0 .calc =3D unity_clk_calc,
391 =A0 =A0 =A0 =A0 .parent =3D &ips_clk,
392 };

which looks OK to me.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, =A0 =A0 MD: Wolfgang Denk & Detlev Zund= el
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The human mind =A0ordinarily =A0operates =A0at =A0only =A0ten =A0perc= ent =A0of =A0its
capacity. The rest is overhead for the operating system.

--000e0cd14690bccee8046bb582b5--