2010-07-15 23:41:51     U-Boot does not see the ether

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2010-07-15 23:41:51     U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91320   

 

Hi: after compiling and loading the U-Boot to the board, it does not detect the AX88180 chip. While there might be various reasons, the most likely to me seems to be MAC address misconfiguration. The MAC address is hardcoded in the board file (attached):

 

  #define CONFIG_ETHADDR   02:80:ad:20:31:b8

 

But this address makes it to U-Boot only half-way. In one place it is set correctly, in another it is not. The U-Boot starts like this:

 

U-Boot 2008.10 (ADI-2009R1.1-rc1) (Jul 15 2010 - 23:07:00)

 

CPU:   ADSP bf561-0.5 (Detected Rev: 0.5) (spi flash boot)

Board: BlackVME Rev. 0

Clock: VCO: 200 MHz, Core: 200 MHz, System: 100 MHz

RAM:   64 MB

In:    serial

Out:   serial

Err:   serial

Net:   No ethernet found.

MAC:   00:00:00:00:00:00

 

The bdinfo also shows the wrong MAC:

 

bfin> bdinfo

U-Boot      = U-Boot 2008.10 (ADI-2009R1.1-rc1) (Jul 15 2010 - 23:07:00)

CPU         = bf561-0.5

Board       = blackvme_rev0

VCO         =    200 MHz

CCLK        =    200 MHz

SCLK        =    100 MHz

boot_params = 0x00000000

memstart    = 0x00000000

memsize     = 0x04000000

flashstart  = 0x00000000

flashsize   = 0x00000000

flashoffset = 0x00000000

ethaddr     = 00:00:00:00:00:00

 

However, the printenev shows MAC, as intended:

 

bfin> printenv

bootargs=root=/dev/mtdblock0 rw earlyprintk=serial,uart0,57600 console=ttyBF0,57

600

bootcmd=run ramboot

bootdelay=5

baudrate=57600

loads_echo=1

ethaddr=02:80:ad:20:31:b8

 

When I am trying to use ping, the response is "No ethernet found":

 

bfin> ping 10.12.13.10

No ethernet found.

ping failed; host 10.12.13.10 is not alive

bfin>

 

The questions:

 

1. Can wrong MAC address cause ether detection to fail?

 

2. If so, then how to tell U-Boot what is the MAC? I thought I did the right thing in the board file (#define CONFIG_ETHADDR  ).

 

3. I would like to see the debug messages from the AX88180 driver u-boot/drivers/net/ax88180.c. There is a "debug" printing there. How can I activate it? I found no clue how I can activate those printouts.

 

Thank you for any hints -- Wojtek

 

blackvme_rev0_good_boot.h

QuoteReplyEditDelete

 

 

2010-07-15 23:51:32     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91321   

 

I attached a wrong board file, sorry for that. The correct one is attched here.

 

blackvme_rev0.h

QuoteReplyEditDelete

 

 

2010-07-16 11:26:32     Re: U-Boot does not see the ether

Mike Frysinger (UNITED STATES)

Message: 91350   

 

the missing mac has no bearing on the part detection.  fix the part detection and the mac handling should be fixed as a consequence.

 

debug() statements are generally controlled by putting '#define DEBUG' at the top of the relevant file.

QuoteReplyEditDelete

 

 

2010-07-16 14:10:51     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91359   

 

Mike: thanks for the hint.

 

I put #define DEBUG into u-boot/include/common.h, where the macro "debug" is defined. Nothing got printed by the ax88180.c.

 

Then I put printf into the function ax88180_phy_initial in the same file, because it is the only function which looks like init code for this chip. I just wanted to see that this function was entered. Nothing got echoed to the console, either.

 

It looks to me that either I do not know how printf works in U-Boot (should I see any printf output on serial port?), or this init function never gets called.

QuoteReplyEditDelete

 

 

2010-07-16 14:47:52     Re: U-Boot does not see the ether

Mike Frysinger (UNITED STATES)

Message: 91360   

 

did you actually call the ax88180 init code from your board_eth_init() ?  no driver code is called automatically for you.

 

please read the bf537-stamp code as an example

QuoteReplyEditDelete

 

 

2010-07-16 15:19:03     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91363   

 

Mike:

 

no, I did not call the ether init function in my board file. I actually used the blackstamp.c as an example code. There is no ether init there. I also looked at the bf533-stamp.c. There is no ether init there either, as far as I can tell.

 

I am now totally confused. The bf537 is indeed doing some ether init, while neither blackstamp nor bf533-stamp do.

 

What is going on?

QuoteReplyEditDelete

 

 

2010-07-16 15:38:45     Re: U-Boot does not see the ether

Mike Frysinger (UNITED STATES)

Message: 91364   

 

your code base is out of date.  non-multi drivers are not supported.

QuoteReplyEditDelete

 

 

2010-07-16 15:55:35     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91365   

 

Mike: I can understand that blackstamp is out of date, but how about bf533-stamp or bf561-ezkit? I just looked at bf561-ezkit.c. There is no init there other than SDRAM init. Nothing whatsoever. I followed these examples.

 

I just looked again at http://docs.blackfin.uclinux.org/doku.php?id=hw:cards:ax88180 and indeed it says about init code. How I could have missed this information? It is right on that page. But I do not remember seeing it.

 

OK, let me now try modify my board code and see what happens.

QuoteReplyEditDelete

 

 

2010-07-16 15:58:55     Re: U-Boot does not see the ether

Mike Frysinger (UNITED STATES)

Message: 91366   

 

i didnt say the blackstamp is out of date, i said your whole tree is

 

the very latest trunk no longer has the issues you raise

QuoteReplyEditDelete

 

 

2010-07-16 16:21:21     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91367   

 

I installed from u-boot-2008.10-2009R1.1-rc1.tar.bz2. That was the latest stable release. I did this precisely because I wanted a stable code base as my starting point.

 

Anyway, with the latest modification the ether init function gets called. I can see my trace printouts in the serial window. So printf is working after all. Good. Bad news that the Marvell PHY does not get detected.

 

Before I go to another crusade, this time with Marvell, could you please tell me whether I should upgrade U-Boot right away before even trying to look at the Marvell issue? Was this part of the code also touched since UBoot 2009R1.1-rc1 was released?

 

If so, then where and how do I get the "trunk"? I have always used the .bz2 files. Is there something to read out there about trunks?

QuoteReplyEditDelete

 

 

2010-07-16 17:27:14     Re: U-Boot does not see the ether

Mike Frysinger (UNITED STATES)

Message: 91368   

 

a simple diff between trunk and 2009R1 branch shows the trunk supports one more PHY.  whether that PHY is the one you're using i have no idea.  either way, i doubt marvell will care if some random mac driver (e.g. ax88180) doesnt support some phy of theirs.

 

use the mii command to poke it directly to see if it's an electrical issue on your board or the asix driver needs someone to add support for the PHY you happen to have hooked up or maybe something else.

QuoteReplyEditDelete

 

 

2010-07-16 17:45:56     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91369   

 

Mike: I am using exact same PHY as your demo board. Same connections, and even the layout is almost the same. I actually started from the same Orcad file which you were using. I do not feel suicidal enough to try anything unknown which your group is not supporting.

 

Where do I find the mii command? I got the list of U-Boot commands and mii is not on the list. Another #define which I forgot?

QuoteReplyEditDelete

 

 

2010-07-17 05:28:53     Re: U-Boot does not see the ether

Mike Frysinger (UNITED STATES)

Message: 91393   

 

the driver in u-boot is not the driver we worked on.  we threw the old one away.  we havent tested the demo board against the recent tree nor do we plan to seeing as we dont make that part.

 

the u-boot wiki is pretty clear about how to use the mii command:

https://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:mii

QuoteReplyEditDelete

 

 

2010-07-17 18:16:53     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91400   

 

Mike:

 

thank you for the pointer to the mii command. I did not know about its existence, because it is neither mentioned in the U-Boot top level README, nor it is linked in the Wiki in the left column of topics. Hence, I never saw this page. I suggest that you link it in the Wiki under the U-Boot topics.

 

Needless to say, it does not work. The problem with PHY autodetection is that the MDIO wire is dormant on the board. I checked with a scope. The MDCK clock is active, but the MDIO is not. This may mean a dead chip, but this is pretty unlikely because all the other signals look OK with the scope. (The clocks and the EEPROM access.) The AX chip seems to be doing its duties. My suspicion is that the software driver has been improved to the point of not working, which was never detected because the new software was never tested with actual hardware. I do not know whether this is true, but on the other hand if something was not tested, it is not surprising that it does not work.

 

In order to finish my project I am now trying to roll back to the 2006 U-Boot driver from the ASIX web page http://www.asix.com.tw I commented out the #define CONFIG_NET_MULTI, hoping, that the old driver can be restored. This may sound crude, but my goal is to get this software to work in reality, not in theory.

 

At this point the old driver compiles, but it fails at the very last linking stage with the error messages. These messages are very strange to me, because the functions headers are declared in <net.h>. All four functions are implemented in the old driver .c file. I am a bit lost. According to my C knowledge, if the function is declared in the .h file and implemented in the .c file, it should get linked. But these four functions do not get linked. Any suggestions, what to do?

 

/home/uclinux/u-boot/net/net.c:705: undefined reference to `eth_send'

/home/uclinux/u-boot/net/net.c:771: undefined reference to `eth_halt'

/home/uclinux/u-boot/net/net.c:326: undefined reference to `eth_init'

//home/uclinux/u-boot/net/net.c:508: undefined reference to `eth_rx'

QuoteReplyEditDelete

 

 

2010-07-17 21:41:07     Re: U-Boot does not see the ether

Mike Frysinger (UNITED STATES)

Message: 91401   

 

it is linked and has been since it was written:

https://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot

 

the guy who makes the ibf-dsp561 board has an AX88180 driver and he says it works fine for him under trunk and the 2009R1.1 did not.  you might want to try that.

QuoteReplyEditDelete

 

 

2010-07-18 12:01:10     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91407   

 

Mike:

 

OK, I checked out the "trunk" according to instructions from http://docs.blackfin.uclinux.org/doku.php?id=version_control_systems&s[]=trunk

 

Svn created two directories under u-boot, u-boot-2010.03  and u-boot-2010.06. Which one should I use? I have chosen u-boot-2010.06 because it features a higher number. But this is just my guess. Perhaps this could be clarified on the above "trunk page".

 

I changed asm/blackfin-config-pre.h to config-pre.h, and I removed blackfin-config-post.h completely, because the compiler was complaining. This change is not documented in Wiki (as of a few days ago). Perhaps worth documenting.

 

And now I am trying to figure out the following error. I am guessing it has something to do with parallel flash because it mentions sectors (serial flashes do not have sectors). Why parallel flash, which my board does not have and never will? What am I supposed to do with hello_world, which is in no way related to my board?

 

make -C examples/standalone all

make[2]: Entering directory `/home/uclinux/u-boot/u-boot-2010.06/examples/standalone'

bfin-uclinux-gcc  -g  -Os   -ffixed-P3 -fomit-frame-pointer -mno-fdpic -ffunction-sections -fdata-sections -mcpu=bf561-0.5 -D__KERNEL__ -I/home/uclinux/u-boot/u-boot-2010.06/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2/include -pipe  -DCONFIG_BLACKFIN -Wall -Wstrict-prototypes -fno-stack-protector   \

                -o hello_world.o hello_world.c -c

In file included from /home/uclinux/u-boot/u-boot-2010.06/include/common.h:115,

                 from hello_world.c:24:

/home/uclinux/u-boot/u-boot-2010.06/include/flash.h:36: error: 'CONFIG_SYS_MAX_FLASH_SECT' undeclared here (not in a function)

make[2]: *** [hello_world.o] Error 1

QuoteReplyEditDelete

 

 

2010-07-18 13:16:24     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91409   

 

Mike:

 

hoping to fix the problem I tried to move the standalone director (which I do not need for my project) out of the way:

 

$ mv standalone standalone_hideMe

 

This did not help:

 

make[2]: Entering directory `/home/uclinux/u-boot/u-boot-2010.06/tools'

make[2]: Leaving directory `/home/uclinux/u-boot/u-boot-2010.06/tools'

make -C examples/standalone all

make: Entering an unknown directory

make: *** examples/standalone: No such file or directory.  Stop.

make: Leaving an unknown directory

make[1]: *** [examples/standalone] Error 2

 

 

In this project none of the standalone stuff is needed for anything at all. And yet I have to fix the compilation of this stuff. How interesting.

QuoteReplyEditDelete

 

 

2010-07-18 16:52:30     Re: U-Boot does not see the ether

Mike Frysinger (UNITED STATES)

Message: 91410   

 

the wiki reflects the latest release.  it will be updated only once the next release has been made.

 

if you have parallel flash, you should be defining CONFIG_SYS_MAX_FLASH_SECT in your board header.  if you dont have parallel flash, you need to disable support for it in your board header.

QuoteReplyEditDelete

 

 

2010-07-18 17:25:04     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91411   

 

Mike: I do not have parallel flash. I was sure that the support for it was disabled.

 

Given the state of confusion, I am now recreating the board files from known good board blackstamp, changing one line at a time, and recompiling after every change.

QuoteReplyEditDelete

 

 

2010-07-18 17:29:05     Re: U-Boot does not see the ether

Mike Frysinger (UNITED STATES)

Message: 91412   

 

assuming you use the trunk version of blackstamp, that should be OK

 

QuoteReplyEditDelete

 

 

2010-07-18 18:16:05     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91413   

 

Mike,

 

yes, I started with the trunk version. I threw away the previous one. While going one line at a time, I noticed that some CONFIG keywords have undergone subtle changes which probably rendered the previous .h file useless. For example, one of the CONFIGs now got the SYS which was not there before. Such a small change was impossible to spot by eye. I also noticed after the fact that the SDRAM init section is now gone from the .c file. It must have been one of those small changes which was getting in the way.

 

I now compiled the U-Boot and it reports the correct net chip. So there is definite progress. But the mii command still does not see the PHY. It may be a hardware problem which I will check with the scope. Pretty unlikely because PHY seems to be allright. (It does light the correct LEDs when connected to the PC.) Who knows what is going on. The battle is not over yet.

 

U-Boot 2010.06-svn2356 (ADI-2010R1-pre) (Jul 18 2010 - 17:58:33)

 

CPU:   ADSP bf561-0.5 (Detected Rev: 0.5) (spi flash boot)

Board: BlackVME Rev. 0

Clock: VCO: 200 MHz, Core: 200 MHz, System: 100 MHz

RAM:   64 MiB

SF: Detected M25P64 with page size 256, total 8 MiB

*** Warning - bad CRC, using default environment

 

In:    serial

Out:   serial

Err:   serial

Net:   ax88180

Hit any key to stop autoboot:  0

bfin> mii device

MII devices:

bfin>

QuoteReplyEditDelete

 

 

2010-07-18 18:26:49     Re: U-Boot does not see the ether

Mike Frysinger (UNITED STATES)

Message: 91414   

 

i thought the ax88180 driver registered itself with the miiphy framework, but guess i was wrong.  since the driver lacks a miiphy_register() call, it probably wont work with the "mii" command.

 

if you can 'ping' and 'tftp', then the device is working fine.

 

once you have things working, feel free to post the patch to the mailing list so i can merge it.

QuoteReplyEditDelete

 

 

2010-07-18 21:45:50     Re: U-Boot does not see the ether

Wojtek Skulski (UNITED STATES)

Message: 91415   

 

Mike:

 

ping is not working yet. Life would be too easy if it did. One step at a time. Since I have no idea, why ping is not working, I activated #define DEBUG in <common.h>. This produced lots of input on the serial boot console, and finally this:

 

ax88180: Found Marvell Alaska PHY family. (PHY Addr=0x18)

ax88180

### main_loop entered: bootdelay=5

 

This looks extremely promising to me. The PHY is indeed Alaska PHY type 88E1111 (same as your reference card). The mii command does not offer any further clue. But as you said, mii probably is not implemented (yet?).

 

At this point I am tempted to think that hardware is OK. The PHY link with the PC seems established: LEDs are blinking, and Windows complains about unplugged cable when I reset the board.

 

Since ping is not working, in all likelihood I have not configured the network properly. So now I am about to enter another uncharted territory, that is how on Earth do I setup the Blackfin network without incurring wrath from my Internet Service Provider. Looks like a lot of fun for me. Hopefully not for my ISP.

 

In any case, upgrading U-Boot was the right thing to do. Thank you so much for your patience!

Outcomes