[U-Boot] No network in Linux on Olimex SAM9_L9260 (Atmel AT91SAM9260EK)

Hi, I'm using an Olimex SAM9_L9260 based board here, which currently uses an U-Boot 1.2 delivered by Olimex. Sadly this U-Boot version always marks it's enviroment area as bad block on each write (probably it is patched by Olimex to work with an old Atmel Sam-Ba version, that has the same error and is a different story). So I've decided to compile a new U-Boot.
My Toolchain is Codesourcery 2010q1 on a 32 bit Slackware Linux and I've used U-Boot 2010.03 sources. The board runs a 2.6.24-rt kernel with patch for Olimex support.
As the Olimex board is heavily based on the Atmel AT91SAM9260EK board I've decided to build U-Boot for this one. I only had to tweak the machine type so that Linux can be started. On Linux bootup I've noticed that the board is not able to get an IP via DHCP with the new bootloader. On my research for the problem I've found out that U-Boot won't detect any PHY.
Google search returned that I have to modify board/atmel/at91sam9260ek/at91sam9260ek.c for the PHY on the Olimex board: from rc = macb_eth_initialize(0, (void *)AT91SAM9260_BASE_EMAC, 0x00); to rc = macb_eth_initialize(0, (void *)AT91SAM9260_BASE_EMAC, 0x01);
After that U-Boot detects a "macb" but still no DHCP answer in Linux. I've tried the old 1.2 bootloader again and DHCP works fine.
So my questions for now are: 1. Does U-Boot have to detect the PHY and initialize it or is it just needed for network bootup? 2. After endless compile sessions (I never compiled u-boot before) I'm completely out of any idea what I can try now to get network in Linux working. Any suggestions? :-)
It would be really great to receive some help because this board has already driven me mad because of the Atmel Sam-Ba flas tool bugs I've mentioned before. ;-)
Thanks in advance.

Hi,
Le 28/05/2010 10:29, Thorsten Mühlfelder a écrit :
- After endless compile sessions (I never compiled u-boot before) I'm
completely out of any idea what I can try now to get network in Linux working. Any suggestions? :-)
are you sure the PHY is wired the same way as on the eval board ? It can be either MII or RMII which makes a big difference.
Eric

Am Friday 28 May 2010 10:45:39 schrieb Eric Bénard:
Hi,
Le 28/05/2010 10:29, Thorsten Mühlfelder a écrit :
- After endless compile sessions (I never compiled u-boot before) I'm
completely out of any idea what I can try now to get network in Linux working. Any suggestions? :-)
are you sure the PHY is wired the same way as on the eval board ? It can be either MII or RMII which makes a big difference.
Eric
Thank you very much, you made my day!! :-)
I've checked the include/configs/at91sam9260ek.h file for ethernet settings. There was "#define CONFIG_RMII 1" set. I've changed the section to:
/* Ethernet */ #define CONFIG_MACB 1 #undef CONFIG_RMII #define CONFIG_NET_MULTI 1 #define CONFIG_NET_RETRY_COUNT 20 #define CONFIG_RESET_PHY_R 1
And now it works!
Yesterday I've wasted my whole day on this issue but today evening I'll have a beer on you ;-) Cheers!

Hi Thorsten,
2010/5/28 Thorsten Mühlfelder muehlfelder@enertex.de:
So I've decided to compile a new U-Boot.
My Toolchain is Codesourcery 2010q1 on a 32 bit Slackware Linux and I've used U-Boot 2010.03 sources. The board runs a 2.6.24-rt kernel with patch for Olimex support.
As the Olimex board is heavily based on the Atmel AT91SAM9260EK board I've decided to build U-Boot for this one. I only had to tweak the machine type so that Linux can be started.
I've done the same on earlier occasions, although I can't remember if it worked or not.
However, in my latest project, I've used U-Boot 2009.08, together with a selected sets of the patches from Olimex. http://www.olimex.com/dev/soft/arm/SAM9/u-boot-olimex-patches-20090717.tgz
It shouldn't be too hard to apply them to a later U-Boot-version, although minor changes might be needed.
In such a way, I've no problems at all using the PHY from U-Boot.
On Linux bootup I've noticed that the board is not able to get an IP via DHCP with the new bootloader. On my research for the problem I've found out that U-Boot won't detect any PHY.
No problems here either. (And I've been running most kernels between 2.6.27 and 2.6.32 on the board).
If you don't go for the Olimex patches, take Eric's advise and check the MII and RMII settings.
Regards, Anders

Am Friday 28 May 2010 11:05:58 schrieben Sie:
Hi Thorsten,
2010/5/28 Thorsten Mühlfelder muehlfelder@enertex.de:
So I've decided to compile a new U-Boot.
My Toolchain is Codesourcery 2010q1 on a 32 bit Slackware Linux and I've used U-Boot 2010.03 sources. The board runs a 2.6.24-rt kernel with patch for Olimex support.
As the Olimex board is heavily based on the Atmel AT91SAM9260EK board I've decided to build U-Boot for this one. I only had to tweak the machine type so that Linux can be started.
I've done the same on earlier occasions, although I can't remember if it worked or not.
However, in my latest project, I've used U-Boot 2009.08, together with a selected sets of the patches from Olimex. http://www.olimex.com/dev/soft/arm/SAM9/u-boot-olimex-patches-20090717.tgz
It shouldn't be too hard to apply them to a later U-Boot-version, although minor changes might be needed.
Hey, I've found these patches, too. But I had problems compiling a patched U-Boot, even if I tried older U-Boot versions and older toolchain versions. I could fix some compiler errors, but not all of them.
But I should have taken a closer look to the patch set, because...
If you don't go for the Olimex patches, take Eric's advise and check the MII and RMII settings.
It's clearly stated in the patch, that I had to #undef CONFIG_RMII but I just did not see it. Probably it was to late in the evening yesterday :-D
Regards, Anders
Regards Thorsten
participants (3)
-
Anders Darander
-
Eric Bénard
-
Thorsten Mühlfelder