mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Eric Bénard" <eric@eukrea.com>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 5/5] net: fec_imx: configure FEC for 10Mbit when necessary
Date: Tue, 24 Jan 2012 16:38:15 +0100	[thread overview]
Message-ID: <20120124163815.479a3059@eb-e6520> (raw)
In-Reply-To: <1327413231-17495-6-git-send-email-w.sang@pengutronix.de>

Hi Wolfram,

Le Tue, 24 Jan 2012 14:53:51 +0100,
Wolfram Sang <w.sang@pengutronix.de> a écrit :

> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> ---
>  drivers/net/fec_imx.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
> index 45af78f..653b488 100644
> --- a/drivers/net/fec_imx.c
> +++ b/drivers/net/fec_imx.c
> @@ -373,6 +373,17 @@ static int fec_open(struct eth_device *edev)
>  		ret = miidev_wait_aneg(&fec->miidev);
>  		if (ret)
>  			return ret;
> +
> +		ret = miidev_get_status(&fec->miidev);
> +		if (ret < 0)
> +			return ret;
> +
> +		if (ret & MIIDEV_STATUS_IS_10MBIT) {
> +			u32 rcntl = readl(fec->regs + FEC_R_CNTRL);
> +			rcntl |= FEC_R_CNTRL_RMII_10T;
> +			writel(rcntl, fec->regs + FEC_R_CNTRL);
> +		}
> +
>  		miidev_print_status(&fec->miidev);
>  	}
>  

I didn't check the code where this patch is inserted but if the fec is
similar to the MX25 one, you need to set this bit only when wired in
RMII so maybe you need a test for the way the PHY is wired.

Here is what is in the kernel for the i.MX25 :
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=8d82f219c2d476811cd3157a39c7b5c1f045ebc3;hp=25cecd7e355bf90b8fea039bd06947bb3234e77d

Eric

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-01-24 15:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-24 13:53 [PATCH 0/5] fec_imx & miidev: support for 10 MBit connections Wolfram Sang
2012-01-24 13:53 ` [PATCH 1/5] net: fec_imx: small cleanups Wolfram Sang
2012-01-24 13:53 ` [PATCH 2/5] net: fec_imx: refactor R_CNTRL setup Wolfram Sang
2012-01-24 13:53 ` [PATCH 3/5] net: fec_imx: enable payload length check and pause frames Wolfram Sang
2012-01-24 13:53 ` [PATCH 4/5] net: miidev: factor out miidev_get_status() Wolfram Sang
2012-01-24 13:53 ` [PATCH 5/5] net: fec_imx: configure FEC for 10Mbit when necessary Wolfram Sang
2012-01-24 15:38   ` Eric Bénard [this message]
2012-01-24 15:40     ` Wolfram Sang

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=20120124163815.479a3059@eb-e6520 \
    --to=eric@eukrea.com \
    --cc=barebox@lists.infradead.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