linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Dan Malek <dan@embeddededge.com>
To: Jean-Denis Boyer <jdboyer@mediatrix.com>
Cc: "'Pavel Bartusek'" <pba@sysgo.de>, linuxppc-embedded@lists.linuxppc.org
Subject: Re: MDIO clock speed computation
Date: Mon, 22 Jul 2002 15:51:15 -0400	[thread overview]
Message-ID: <3D3C6233.3090007@embeddededge.com> (raw)
In-Reply-To: 2702075D4DE2B043BF5EB82E9CFAD45B093B0D@mail1.mediatrix.com


Jean-Denis Boyer wrote:

> However, your fix seems incomplete.
> If I have a frequency of 82,5MHz, for example,
> it yields exactly to the same result before and after your patch,
> that is an MDIO clock of 2.58MHz.

The MII clock is not derived from the core speed, but rather the
system/bus clock speed.  Up to this point, I don't believe there are
any 8xx parts that are qualified to run beyond a 50 MHz CPU/bus
speed, so the software is just fine.  If you are running something
faster than a 50 MHz bus, you may want to look into this.


>
> Since the divisor is 2 * MDCLOCK,
> I would suggest something like:
>
>   (((bd->bi_intfreq + (2 * 2500000 - 1 )) / 2500000 / 2) & 0x3F) << 1;

The proper fix would be to change this from 'bi_intfreq' to 'bi_busfreq'.

What is actually happening is you are running much slower than 2.5 MHz
because you are computing on a clock that is running much faster than
the actual supplied clock to the MII (i.e. your divisor is too large).
Also, the 2.5 MHz is a suggestion, I think all PHYs run much faster, you
will have to check the data sheet.  The Motorola manual used to indicate
this as a suggested maximum for their parts, further that it would
run faster than this and maximum was still being qualified.

The only thing that will happen if this speed is out of spec for either
side is you will have problems configuring or detecting the PHY (the exchange
of control/status messages).  It has nothing to do with data transfer.


	-- Dan


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2002-07-22 19:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-22 18:19 MDIO clock speed computation Jean-Denis Boyer
2002-07-22 19:51 ` Dan Malek [this message]
2002-07-22 20:12   ` Dan Malek
2002-07-22 20:15   ` Wolfgang Denk
2002-07-23 10:22   ` Pavel Bartusek
2002-07-23 15:01     ` Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2002-07-23 19:41 Jean-Denis Boyer
2002-07-24  7:38 ` Pavel Bartusek
2002-07-23 15:47 Jean-Denis Boyer
2002-07-23 17:34 ` Dan Malek
2002-07-22 20:54 Jean-Denis Boyer
2002-07-22 17:19 Pavel Bartusek

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=3D3C6233.3090007@embeddededge.com \
    --to=dan@embeddededge.com \
    --cc=jdboyer@mediatrix.com \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=pba@sysgo.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).