* FEC Not working with imx27 based board
@ 2011-07-11 15:14 Kamel BOUHARA
2011-07-12 13:54 ` Sascha Hauer
0 siblings, 1 reply; 6+ messages in thread
From: Kamel BOUHARA @ 2011-07-11 15:14 UTC (permalink / raw)
To: barebox
[-- Attachment #1.1: Type: text/plain, Size: 1715 bytes --]
Hi,
Im trying to port barebox to my Armadeus apf27 board (based on the Freescale
imx27 with a 512MiB NAND and 1GB of SDRAM).
I've first tried the phytec imx27 configuration and I got it worked until
the Linux uncompressing task (the machine ID is bad so I didn't expect it
will boot fine :)).
So I just copied the phycard-imx27 board directory and I followed the
boards.dox in order to add support for my board.
But when I've tried to boot again it was not working anymore ...
There are somethings stranges with the FEC, here is the result of a memory
display with both phytec and my own board :
> barebox@Phytec phyCard-i.MX27:/ md -s /dev/phy0
>
> 00000000: ffffffff ffffffff ffffffff ffffffff ................
>
> 00000010: ffffffff ffffffff ffffffff ffffffff ................
>
> 00000020: ffffffff ffffffff ffffffff ffffffff ................
>
> 00000030: ffffffff ffffffff ffffffff ffffffff ................
>
> barebox@Phytec phyCard-i.MX27:/ boto
>
> Unknown command 'boto' - try 'help'
>
> barebox@Phytec phyCard-i.MX27:/ boot
>
> phy0: Link is up - 100/Full
>
> T T T T T
>
>
The fec is working fine on the phytec but the same o my board make it crash:
> barebox@armadeus APF27:/ md -s /dev/phy0
>
> 00000000: 78091000 c0c40007 000101e1 ffff0000 ...x............
>
> 00000010: ffffffff ffffffff ffffffff 0000ffff ................
>
> 00000020: 00000040 ffff00ff 00000000 00000000 @...............
>
> 00000030: ffffffff 00010000 00100000 00400000 ..............@.
>
Why I did'nt get the boad working with the same configuration ?
Regards.
__________________________________
*Kamel BOUHARA*
7 rue Jules César
02100 SAINT-QUENTIN
06.17.83.29.04
[-- Attachment #1.2: Type: text/html, Size: 2378 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: FEC Not working with imx27 based board
2011-07-11 15:14 FEC Not working with imx27 based board Kamel BOUHARA
@ 2011-07-12 13:54 ` Sascha Hauer
2011-07-12 13:58 ` Sascha Hauer
0 siblings, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2011-07-12 13:54 UTC (permalink / raw)
To: Kamel BOUHARA; +Cc: barebox
On Mon, Jul 11, 2011 at 05:14:54PM +0200, Kamel BOUHARA wrote:
> Hi,
>
> Im trying to port barebox to my Armadeus apf27 board (based on the Freescale
> imx27 with a 512MiB NAND and 1GB of SDRAM).
> I've first tried the phytec imx27 configuration and I got it worked until
> the Linux uncompressing task (the machine ID is bad so I didn't expect it
> will boot fine :)).
> So I just copied the phycard-imx27 board directory and I followed the
> boards.dox in order to add support for my board.
> But when I've tried to boot again it was not working anymore ...
>
> There are somethings stranges with the FEC, here is the result of a memory
> display with both phytec and my own board :
>
> > barebox@Phytec phyCard-i.MX27:/ md -s /dev/phy0
> >
> > 00000000: ffffffff ffffffff ffffffff ffffffff ................
> >
> > 00000010: ffffffff ffffffff ffffffff ffffffff ................
> >
> > 00000020: ffffffff ffffffff ffffffff ffffffff ................
> >
> > 00000030: ffffffff ffffffff ffffffff ffffffff ................
This means your phy is not configured correctly. Do you usse the correct
address (can be passed in platform_data).
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: FEC Not working with imx27 based board
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-19 16:33 ` Kamel BOUHARA
0 siblings, 2 replies; 6+ messages in thread
From: Sascha Hauer @ 2011-07-12 13:58 UTC (permalink / raw)
To: Kamel BOUHARA; +Cc: barebox
On Tue, Jul 12, 2011 at 03:54:43PM +0200, Sascha Hauer wrote:
> On Mon, Jul 11, 2011 at 05:14:54PM +0200, Kamel BOUHARA wrote:
> > Hi,
> >
> > Im trying to port barebox to my Armadeus apf27 board (based on the Freescale
> > imx27 with a 512MiB NAND and 1GB of SDRAM).
> > I've first tried the phytec imx27 configuration and I got it worked until
> > the Linux uncompressing task (the machine ID is bad so I didn't expect it
> > will boot fine :)).
> > So I just copied the phycard-imx27 board directory and I followed the
> > boards.dox in order to add support for my board.
> > But when I've tried to boot again it was not working anymore ...
> >
> > There are somethings stranges with the FEC, here is the result of a memory
> > display with both phytec and my own board :
> >
> > > barebox@Phytec phyCard-i.MX27:/ md -s /dev/phy0
> > >
> > > 00000000: ffffffff ffffffff ffffffff ffffffff ................
> > >
> > > 00000010: ffffffff ffffffff ffffffff ffffffff ................
> > >
> > > 00000020: ffffffff ffffffff ffffffff ffffffff ................
> > >
> > > 00000030: ffffffff ffffffff ffffffff ffffffff ................
>
> This means your phy is not configured correctly. Do you usse the correct
> address (can be passed in platform_data).
GPIO pins which hold the phy in reset are another thing which might go
wrong.
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Fwd: FEC Not working with imx27 based board
[not found] ` <CAM9uW_4_d1NcZZYvfFpTW2g=pjeM1nQ0Ohf3RXiYX7fhK6tseA@mail.gmail.com>
@ 2011-07-15 10:13 ` Kamel BOUHARA
0 siblings, 0 replies; 6+ messages in thread
From: Kamel BOUHARA @ 2011-07-15 10:13 UTC (permalink / raw)
To: barebox
[-- Attachment #1.1: Type: text/plain, Size: 4103 bytes --]
---------- Forwarded message ----------
From: Kamel BOUHARA <k.bouhara@gmail.com>
Date: 2011/7/12
Subject: Re: FEC Not working with imx27 based board
To: Sascha Hauer <s.hauer@pengutronix.de>
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;
}
Before this change it wasn't the case, I had no mac adress in barebox
start...
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 ?
Thanks again.
Here is what
2011/7/12 Sascha Hauer <s.hauer@pengutronix.de>
> On Tue, Jul 12, 2011 at 03:54:43PM +0200, Sascha Hauer wrote:
> > On Mon, Jul 11, 2011 at 05:14:54PM +0200, Kamel BOUHARA wrote:
> > > Hi,
> > >
> > > Im trying to port barebox to my Armadeus apf27 board (based on the
> Freescale
> > > imx27 with a 512MiB NAND and 1GB of SDRAM).
> > > I've first tried the phytec imx27 configuration and I got it worked
> until
> > > the Linux uncompressing task (the machine ID is bad so I didn't expect
> it
> > > will boot fine :)).
> > > So I just copied the phycard-imx27 board directory and I followed the
> > > boards.dox in order to add support for my board.
> > > But when I've tried to boot again it was not working anymore ...
> > >
> > > There are somethings stranges with the FEC, here is the result of a
> memory
> > > display with both phytec and my own board :
> > >
> > > > barebox@Phytec phyCard-i.MX27:/ md -s /dev/phy0
> > > >
> > > > 00000000: ffffffff ffffffff ffffffff ffffffff ................
> > > >
> > > > 00000010: ffffffff ffffffff ffffffff ffffffff ................
> > > >
> > > > 00000020: ffffffff ffffffff ffffffff ffffffff ................
> > > >
> > > > 00000030: ffffffff ffffffff ffffffff ffffffff ................
> >
> > This means your phy is not configured correctly. Do you usse the correct
> > address (can be passed in platform_data).
>
> GPIO pins which hold the phy in reset are another thing which might go
> wrong.
>
> 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 |
>
--
__________________________________
*Kamel BOUHARA*
7 rue Jules César
02100 SAINT-QUENTIN
06.17.83.29.04
--
__________________________________
*Kamel BOUHARA*
7 rue Jules César
02100 SAINT-QUENTIN
06.17.83.29.04
[-- Attachment #1.2: Type: text/html, Size: 10847 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: FEC Not working with imx27 based board
2011-07-12 13:58 ` Sascha Hauer
[not found] ` <CAM9uW_4_d1NcZZYvfFpTW2g=pjeM1nQ0Ohf3RXiYX7fhK6tseA@mail.gmail.com>
@ 2011-07-19 16:33 ` Kamel BOUHARA
2011-07-20 7:04 ` Sascha Hauer
1 sibling, 1 reply; 6+ messages in thread
From: Kamel BOUHARA @ 2011-07-19 16:33 UTC (permalink / raw)
To: barebox
[-- Attachment #1.1: Type: text/plain, Size: 3762 bytes --]
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;
}
Before this change it wasn't the case, I had no mac adress in barebox
start...
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 ?
Thanks again.
2011/7/12 Sascha Hauer <s.hauer@pengutronix.de>
> On Tue, Jul 12, 2011 at 03:54:43PM +0200, Sascha Hauer wrote:
> > On Mon, Jul 11, 2011 at 05:14:54PM +0200, Kamel BOUHARA wrote:
> > > Hi,
> > >
> > > Im trying to port barebox to my Armadeus apf27 board (based on the
> Freescale
> > > imx27 with a 512MiB NAND and 1GB of SDRAM).
> > > I've first tried the phytec imx27 configuration and I got it worked
> until
> > > the Linux uncompressing task (the machine ID is bad so I didn't expect
> it
> > > will boot fine :)).
> > > So I just copied the phycard-imx27 board directory and I followed the
> > > boards.dox in order to add support for my board.
> > > But when I've tried to boot again it was not working anymore ...
> > >
> > > There are somethings stranges with the FEC, here is the result of a
> memory
> > > display with both phytec and my own board :
> > >
> > > > barebox@Phytec phyCard-i.MX27:/ md -s /dev/phy0
> > > >
> > > > 00000000: ffffffff ffffffff ffffffff ffffffff ................
> > > >
> > > > 00000010: ffffffff ffffffff ffffffff ffffffff ................
> > > >
> > > > 00000020: ffffffff ffffffff ffffffff ffffffff ................
> > > >
> > > > 00000030: ffffffff ffffffff ffffffff ffffffff ................
> >
> > This means your phy is not configured correctly. Do you usse the correct
> > address (can be passed in platform_data).
>
> GPIO pins which hold the phy in reset are another thing which might go
> wrong.
>
> 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 |
>
--
__________________________________
*Kamel BOUHARA*
7 rue Jules César
02100 SAINT-QUENTIN
06.17.83.29.04
[-- Attachment #1.2: Type: text/html, Size: 10661 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: FEC Not working with imx27 based board
2011-07-19 16:33 ` Kamel BOUHARA
@ 2011-07-20 7:04 ` Sascha Hauer
0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2011-07-20 7:04 UTC (permalink / raw)
To: Kamel BOUHARA; +Cc: barebox
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-07-20 7:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 15:14 FEC Not working with imx27 based board 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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox