One nice thing is that the Xilinx documentation for Zynq is excellent, as was the documentation from Texas Instruments for the BBB. Chapter 16 (page 484) in the TRM covers the ethernet controller. Appendix B has register details (page 1267).
The Zynq has two ethernet interfaces! My boards all just use one, so I am just ignoring the second one. Somebody someday could generalize the driver to support both, but doing it now would just be a waste of time and energy.
The controller is 10/100/1000 - and of course we also need to deal with a physical interface (Phy) chip -- and find a datasheet for it. Different boards use different Phy chips as follows:
Antminer S9 - Broadcom B50612E - 10/100/1000 Ebaz - IC plus electronics IP101GA - 10/100 Zybo - Realtek 8211E - 10/100/1000 Zedboard - Marvell M-88E1518-NNB2 - 10/100/1000So, four different boards and four different Phy chips. It will be beneficial to keep the ability in mind to easily switch Phy chip support in software. To start I just want to support the Antminer, but I will definitely want to support the Ebaz sooner rather than later.
All 4 chips have datasheets available online and I have placed copies in /u1/Projects/Zynq/Manuals.
Broadcom is always a nightmare as far as documentation. There seems to be no datasheet for the B50612E available online. I do find a datasheet for the B50612D chip, and I am hopeful that it will be useful (if not identical) but who knows.
I have a local copy of "u-boot-xlnx" in /u1/Projects/Zynq and will refer to that. My first trick with resspect to U-boot is to build it for the desired target. This leaves xxx.o files for only those files included in the build. These serve as invaluable "bread crumbs).
For example, the directory drivers/net has 86 different source files, but I only see 3 object files, one of which is for "zynq_gem.c". This is 1025 lines of code and the register names and offsets match the Zynq datasheet, so this looks good. A comment says that it is based on the Xilinx "gmac" driver (for what that might be worth).
The Phy drivers are in "drivers/net/phy".
Linux has a driver for the IP101GA in drivers/net/phy/icplus.c
Linux has a driver for the Broadcom 50610 in drivers/net/phy/broadcom.c
The comment says it is for BCM54xx chips, but code later checks for PHY_ID_BCM50610.
I only found a miserable 2 page "product brief" for the BCM5461S.
I found a decent 90 page datasheet for the BCM5221, which is only a 10/100 device, but maybe we can get an idea of how Broadcom does things using it. The date on this is 2002.
Net: Gem.e000b000So that confirms the zynq_gem.c driver and the address is for the first of the two ethernet interfaces. We also see this in bdinfo:
ethaddr = 00:0a:35:00:01:22There are two commands which could be useful: "mii" "mdio".
zynq-uboot> mdio list Gem.e000b000: 1 - Broadcom BCM5461S <--> Gem.e000b000Now this is interesting. There are no such markings on the actual chip. Searching only yields a 2 page "data brief".
Tom's Computer Info / tom@mmto.org