From: Sascha Hauer <s.hauer@pengutronix.de>
To: Bryan Wu <bryan.wu@canonical.com>
Cc: gerg@uclinux.org, amit.kucheria@canonical.com,
	kernel-team@lists.ubuntu.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, w.sang@pengutronix.de
Subject: Re: [PATCH] netdev/fec.c: add phylib supporting to enable carrier detection
Date: Wed, 31 Mar 2010 09:57:46 +0200	[thread overview]
Message-ID: <20100331075746.GO2241@pengutronix.de> (raw)
In-Reply-To: <1269597052-10104-1-git-send-email-bryan.wu@canonical.com>
On Fri, Mar 26, 2010 at 05:50:52PM +0800, Bryan Wu wrote:
> BugLink: http://bugs.launchpad.net/bugs/457878
> 
>  - removed old MII phy control code
>  - add phylib supporting
>  - add ethtool interface to make user space NetworkManager works
> 
> Tested on Freescale i.MX51 Babbage board.
> 
> This patch is based on a patch from Frederic Rodo <fred.rodo@gmail.com>
> 
Hi Bryan,
The MII speed is calculated twice with this patch applied, one time
in fec_enet_mii_init and one time in fec_enet_init.
The patch didn't work for me because the calculation is wrong (which of
course is not your fault, it was wrong before).
According to the Datasheet the MII clock is clk_get_rate() / (MII * 2).
When we want to have a clock of 2.5MHz we have to do:
clk_get_rate() / 5000000
With rounding this would be:
(clk_get_rate() + 4999999) / 5000000
So you might want to add the following to your patch:
	fep->phy_speed = ((clk_get_rate(fep->clk) + 4999999) / 5000000) << 1;
Otherwise the patch looks good to me.
Sascha
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
next prev parent reply	other threads:[~2010-03-31  7:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26  9:50 [PATCH] netdev/fec.c: add phylib supporting to enable carrier detection Bryan Wu
2010-03-26 10:29 ` Amit Kucheria
2010-03-31  8:12   ` Sascha Hauer
2010-03-26 14:47 ` Wolfram Sang
2010-03-27 12:57 ` Wolfram Sang
2010-03-29  8:40   ` Bryan Wu
2010-03-31  3:06     ` Wolfram Sang
2010-03-31  3:07       ` Bryan Wu
2010-03-31  2:49 ` Bryan Wu
2010-03-31  7:57 ` Sascha Hauer [this message]
2010-03-31  8:10   ` Wolfram Sang
2010-03-31  8:15     ` Sascha Hauer
2010-03-31 12:11     ` Bryan Wu
2010-04-21  5:42 ` Greg Ungerer
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=20100331075746.GO2241@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=amit.kucheria@canonical.com \
    --cc=bryan.wu@canonical.com \
    --cc=gerg@uclinux.org \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=w.sang@pengutronix.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).