From: Sascha Hauer <s.hauer@pengutronix.de>
To: Kamel BOUHARA <k.bouhara@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: FEC Not working with imx27 based board
Date: Wed, 20 Jul 2011 09:04:36 +0200 [thread overview]
Message-ID: <20110720070436.GR20587@pengutronix.de> (raw)
In-Reply-To: <CAM9uW_6-dGAXi0vKp8Ghg5gXhQ_0ORy2x3mDOTK4-T8LOmMELg@mail.gmail.com>
On Tue, Jul 19, 2011 at 06:33:26PM +0200, Kamel BOUHARA wrote:
> Yes I've set the correct adress and it's why I don't have fffff like on the
> phytec.
> But in fact I had to change the fec_get_hwadrr() to make it work with my
> board :
>
> static int fec_get_hwaddr(struct eth_device *dev, unsigned char *mac)
>
> {
>
> int i;
>
> int uninitialized = 0;
>
>
> > for (i=0;i<6;i++) {
>
> mac[6-1-i] = readl(&IIM_BANK_REG(0,(IIM0_MAC+i)));
>
> }
>
>
> > /* uninitialized if all 00 */
>
> if ((mac[0] == 0) && (mac[1] == 0) && (mac[2] == 0) &&
>
> (mac[3] == 0) && (mac[4] == 0) && (mac[5] == 0))
>
> uninitialized = 1;
>
>
> > /* uninitialized if all FF (could be safe) */
>
> if ((mac[0] == 0xff) && (mac[1] == 0xff) && (mac[2] == 0xff) &&
>
> (mac[3] == 0xff) && (mac[4] == 0xff) && (mac[5] == 0xff))
>
> uninitialized = 1;
>
>
> > return uninitialized;
>
> }
Please generate proper diffs. I can't really read this.
>
>
> Before this change it wasn't the case, I had no mac adress in barebox
> start...
fec_get_hwaddr error value in which case the core will generate a random
mac address. Looking at the code the driver seems to do this wihtout
changes.
> I also added a specific reset :
>
> void fec_reset()
> {
> int i=0;
> /* FEC RESET */
> imx_gpio_mode(CFG_ETHPHY_RST | GPIO_OUT | GPIO_PUEN | GPIO_GPIO);
> printf("Before PHY reset\n");
> GPIO_CLEAR(CFG_ETHPHY_RST);
> udelay(200);
> GPIO_SET(CFG_ETHPHY_RST);
> printf("After PHY reset\n");
>
> }
>
> And then I call it in the fec_probe() to ensure the fec is reset properly
> before settings.
> I already tested the fec on u-boot and it works fine, so i tought it can
> help me with barebox but it seems there are some differences between codes.
>
> For now Im trying to see if it can be a cpu frequence problem because I have
> an errata on the pll that shifts all my frequencies and so I have to adjust
> them in the lowlevelinit...
>
> So I would like to know if the clock initialization is taking effect if I
> boot from RAM ? Do I have t boot from flash ?
the pll setup code is in your board, so it's in your hands.
Some PLL settings are safer to run from Flash or internal RAM instead of
SDRAM.
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 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2011-07-20 7:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-11 15:14 Kamel BOUHARA
2011-07-12 13:54 ` Sascha Hauer
2011-07-12 13:58 ` Sascha Hauer
[not found] ` <CAM9uW_4_d1NcZZYvfFpTW2g=pjeM1nQ0Ohf3RXiYX7fhK6tseA@mail.gmail.com>
2011-07-15 10:13 ` Fwd: " Kamel BOUHARA
2011-07-19 16:33 ` Kamel BOUHARA
2011-07-20 7:04 ` Sascha Hauer [this message]
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=20110720070436.GR20587@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=k.bouhara@gmail.com \
/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