2010-07-26 00:13:12     U-boot driver for gigabit AX88180 + M88E1111

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

2010-07-26 00:13:12     U-boot driver for gigabit AX88180 + M88E1111

Wojtek Skulski (UNITED STATES)

Message: 91710   

 

Robin and Mike:

 

problem seems solved. After several weeks of effort I succeeded in sending the packet from the gigabit AX88180 + M88E1111 to the PC (over 100M link, to be fair). This is the first time that any packet made it over one meter cable from the PHY to the PC.

 

The lack of communication (despite all the LEDs blinking) was due to improper initialization of Marvell PHY. This chip needs a proper "software reset". Otherwise the silicon may be put in indeterminate state where the TX portion of the chip is not working properly despite all the registers giving healthy responses.The driver from your "trunk" seems to be achieving just that. Your code unconditionally writes the following constant to the main control register (PHY register 0): BMCR_RESET | BMCR_ANENABLE. The numerical value of this constant is 0x09000.

 

The proper code would read the value of register 0, set the bit 15, and write back to register 0. The MSB of this register is triggering the "soft reset" of the chip, after which the silicon clears the bit. I have no clue whether other types of gigabit PHYs are reset the same way. Therefore, the following code is specific to M88E1111.

 

static int ax88180_phy_reset (struct eth_device *dev)  /*unimportant details deleted*/

{

        unsigned short regval;

 

        debug ("\n +++++ Entered ax88180_phy_reset\n");

        /* Original method */

        regval = (BMCR_RESET | BMCR_ANENABLE);

        /*  ax88180_mdio_write (dev, MII_BMCR, regval); old method */

        debug (" +++++ Old code would write 0x0%x to PHY reg %d (dec)\n",

               regval, MII_BMCR);

 

        printf(" +++++ New code for PHY M88E1111 ONLY\n");

 

        regval = ax88180_mdio_read (dev, 0);   /*read from control reg*/

        regval = regval | bmBit15;             /* set soft reset bit */

        ax88180_mdio_write (dev,  0, regval);  /* perform soft reset */

 

The execution trace looks as follows. Note that after writing  0x09140 to register 0, the next read again returns 0x1140 because the "soft reset bit" was automatically cleared.

 

+++++ Entered ax88180_phy_reset

+++++ Old code would write 0x09000 to PHY reg 0 (dec)

+++++ New code for PHY M88E1111 ONLY

ax88180_mdio_read: read 0x1140 from PHY regaddr 0 (dec)

+++++ Writing 0x09140 to PHY reg 0 (dec)

ax88180_mdio_read: read 0x1140 from PHY regaddr 0 (dec)

ax88180_phy_reset returning.

 

 

After doing this magic, Wireshark shows the ARP and ICMP packets on the PC side, and U-Boot ping finally returns the desired response "host 169.254.144.144 is alive".

 

This is not the end of the struggle because the current uCLinux kernel does not detect the PHY. So there is still something to fix in software. However, I can now safely declare that the hardware is working and we can assemble a few more of these boards for our astrophysics research.

QuoteReplyEditDelete

 

 

2010-07-26 02:10:49     Re: U-boot driver for gigabit AX88180 + M88E1111

Mike Frysinger (UNITED STATES)

Message: 91713   

 

just to clarify, this isnt "our" source nor is this "our" driver.  we had nothing to do with the creation or continued maintenance of this driver.

 

you should use defines from linux/mii.h instead of custom values.

QuoteReplyEditDelete

 

 

2010-07-26 10:12:25     Re: U-boot driver for gigabit AX88180 + M88E1111

Robin Getz (UNITED STATES)

Message: 91731   

 

Wojtek:

 

So - I just got the board on my desk this am - does your report mean you no longer need it?

 

-Robin

QuoteReplyEditDelete

 

 

2010-07-26 11:33:02     Re: U-boot driver for gigabit AX88180 + M88E1111

Wojtek Skulski (UNITED STATES)

Message: 91734   

 

Robin:

 

concerning the board, I want to thank you for your kind offer. It looks that I solved the problem, which would be just the same with your board as with ours. (The schematics are identical, as far as the ether chip is concerned..) The idea behind trying yours was to use good known hardware to rule out the PCB design issues. As it turned out, the issue was not the PCB design but rather incorrect register programming. Since this has been solved, the board is not needed.

 

At this point I want to say that providing Blackfin support for gigabit ethernet is not unimportant in this competitive world. We should expand the Blackfin gigabit support rather than try to get rid of it. Just look around at what the competition is doing. Trying to ignore this technology can become harmful to Blackfin in general.

 

Thank you one more time for your help.

QuoteReplyEditDelete

 

 

2010-07-26 13:39:43     Re: U-boot driver for gigabit AX88180 + M88E1111

Robin Getz (UNITED STATES)

Message: 91735   

 

Wojtek:

 

>providing Blackfin support for gigabit ethernet is not unimportant in this competitive world.

 

No one said it wasn't - it is just that we can only support software we wrote. While we make best efforts to make sure things work - we don't have the time/expertise to debug all random drivers. We don't maintain the SMSC ethernet parts - SMSC does. I'm not sure why it would be different for any other company (AXIS or Marvell in this case).

 

-Robin

QuoteReplyEditDelete

 

 

2010-07-26 15:28:41     Re: U-boot driver for gigabit AX88180 + M88E1111

Wojtek Skulski (UNITED STATES)

Message: 91738   

 

Robin:

 

some remarks in this discussion might have been understood as indicating that you want to drop the gigabit ethernet altogether.

 

Just to let you know how things look, I am attaching a photo of my board. I am tempted to open another project, but I have not decided yet.

 

BlackVME_board.jpg

QuoteReplyEditDelete

 

 

2010-07-26 15:47:32     Re: U-boot driver for gigabit AX88180 + M88E1111

Mike Frysinger (UNITED STATES)

Message: 91741   

 

our role with non ADI written software is more of advisement now.  i can guide you in where to look to fix things, but we're not really in the position to research & fix random drivers anymore.

 

so i can suggest what is incorrect with your patch and how to do it right, but ultimately it is on the end person to put it together for the most part.

QuoteReplyEditDelete

 

 

2010-07-26 15:52:02     Re: U-boot driver for gigabit AX88180 + M88E1111

Robin Getz (UNITED STATES)

Message: 91742   

 

Wojtek:

 

>some remarks in this discussion might have been understood as indicating that you want to drop the gigabit ethernet altogether.

 

I never said we weren't going to drop the AX88180 driver - It's possible that we might be forced to in the future -- if something that we didn't write, and don't maintain, breaks, and the person that did write it doesn't fix it - there isn't much we can do except to drop it...

 

We understand that it would be regretable - but the people to complain to are the manufacture of the chip - not us.

 

-Robin

QuoteReplyEditDelete

 

 

2010-07-26 17:24:18     Re: U-boot driver for gigabit AX88180 + M88E1111

Wojtek Skulski (UNITED STATES)

Message: 91745   

 

Robin and Mike:

 

I do understand your position. Please understand mine. The manufacturer of  the AX88180 went a bit ahead by releasing the drivers both for U-Boot and Linux, but they do not maintain them on regular basis. The current "trunk" U-boot is far from the ASIX original release. All this begs a usual Linux question "so who is maintaining the stuff"? The usual answer "the community" is only good as the starting point, but then someone has to actually bite the bullet.

 

My design decision to adopt the gigabit ether was based on the info from the KOOP website, the photos and such. If I did not trust you in advance and not used the gig ether, then our projects would be less likely to get funded. I do not think I could have followed your reservations (which I knew of) and used the non-gigabit ethernet and still get funded.

 

Let me also point out that Blackfin ucLinux depends on third-party PHY manuacturers for doing any ether at all, because ADI does not manufacture any PHY. I am thus proposing that you can add my board (or your own setup) to the test suite. Doing so will support a claim that Blackfin works with the gigabit ethernet. It can be useful.

QuoteReplyEditDelete

 

 

2010-07-26 17:47:04     Re: U-boot driver for gigabit AX88180 + M88E1111

Mike Frysinger (UNITED STATES)

Message: 91747   

 

and that is why we look at PHY bugs when we use the PHYs on our boards.  but the PHY you're using only makes sense with a gigabit MAC, and so we dont pay attention to it.

 

if the MAC you're buying has less than reliable support for their Linux/u-boot drivers, then telling us wont change a thing.  you need to write the manufacturer and let them know that the only reason you're buying their MAC is because of their open source drivers, but if they arent keeping them up, then they're going to continue to loose design ins.

 

before we can talk about adding boards to test framework, the relevant board ports need to be merged into trunk.  which means you'll need to post the patches to the relevant lists and they have to be of sufficient quality to merge.

Attachments

Outcomes