Or PHY Lib for U-Boot. This sequence of patches adds infrastructure for universally-available PHY drivers (and MDIO drivers). It piggy-backs on the existing miiphy code, for backwards compatibility, but it also creates a new set of APIs. This was necessary partly to provide cleaner interfaces for more robust driver support, and partly because one goal was to support 10G (802.3 Clause 45) MDIO buses, which has an extra argument for addressing PHY registers.
Special thanks goes to Mingkai Hu, who did a substantial amount of work up front to convert the tsec PHY code into something more usable, which I have mostly copied for the purposes of PHY Lib. In this version, I slightly re-architected the 10G support (mmds are now specified in the driver initialization, and the code which auto-detects the mmds is now its own function). I added a phy_reset() function, which works with 10G PHYs as well. I put a reset early in phy_connect(), so that many more PHYs work out of the box. I also fix the Marvell PHY code, which had dropped a number of the resets which were necessary. One last major change was to eliminate fsl_phy_enet_if, and replace it with the phy_interface_t enum. I've made this its own patch, as it touches many files. The new mdio command loses the "busname:addr" addressing mechanism, as "busname addr" felt more natural to me (though I expect most people will go with "ethname", as the ethernet names are much more visible. In addition, the <devad> argument is now optional by way of being combined with the reg argument: [<devad>.]<regnum>. This makes sense, as this is also how the registers are described in the specs and in the data sheets. ie: Register 7.1 - AN Status I've put the relevant changelogs in the patches. Enjoy! I pushed this new version to git://git.denx.de/u-boot/u-boot-mmc.git in the phylib branch Andy Fleming (7): Remove instances of phy_read/write miiphy: Fix some formatting issues Create PHY Lib for U-Boot phylib: Add a bunch of PHY drivers from tsec tsec: Convert tsec to use PHY Lib fsl: Change fsl_phy_enet_if to phy_interface_t Add mdio command for new PHY infrastructure Mingkai Hu (2): tsec: use IO accessors for IO accesses tsec: arrange the code to avoid useless function declaration arch/powerpc/cpu/mpc8xxx/fdt.c | 23 +- arch/powerpc/include/asm/config.h | 9 + arch/powerpc/include/asm/fsl_enet.h | 27 +- board/freescale/mpc8360emds/mpc8360emds.c | 10 +- board/freescale/mpc837xemds/mpc837xemds.c | 10 +- board/freescale/mpc8536ds/mpc8536ds.c | 6 + board/freescale/mpc8544ds/mpc8544ds.c | 30 + board/freescale/mpc8569mds/mpc8569mds.c | 4 +- board/freescale/mpc8572ds/mpc8572ds.c | 6 + board/freescale/p1022ds/p1022ds.c | 6 + board/freescale/p1_p2_rdb/p1_p2_rdb.c | 6 + board/freescale/p2020ds/p2020ds.c | 7 + common/Makefile | 4 + common/cmd_mdio.c | 286 +++++ common/miiphyutil.c | 311 +++-- drivers/net/Makefile | 2 +- drivers/net/dm9000x.c | 18 +- drivers/net/enc28j60.c | 24 +- drivers/net/fsl_mdio.c | 120 ++ drivers/net/phy/Makefile | 13 + drivers/net/phy/atheros.c | 48 + drivers/net/phy/broadcom.c | 286 +++++ drivers/net/phy/davicom.c | 98 ++ drivers/net/phy/generic_10g.c | 105 ++ drivers/net/phy/lxt.c | 87 ++ drivers/net/phy/marvell.c | 367 ++++++ drivers/net/phy/micrel.c | 40 + drivers/net/phy/natsemi.c | 96 ++ drivers/net/phy/phy.c | 753 +++++++++++ drivers/net/phy/realtek.c | 130 ++ drivers/net/phy/teranetics.c | 62 + drivers/net/phy/vitesse.c | 242 ++++ drivers/net/tsec.c | 1992 ++++------------------------- drivers/net/uli526x.c | 24 +- drivers/qe/uec.c | 59 +- drivers/qe/uec.h | 3 +- drivers/qe/uec_phy.c | 181 ++-- include/config_phylib_all_drivers.h | 32 + include/configs/MPC8323ERDB.h | 4 +- include/configs/MPC832XEMDS.h | 4 +- include/configs/MPC8360EMDS.h | 4 +- include/configs/MPC8360ERDK.h | 4 +- include/configs/MPC8568MDS.h | 4 +- include/configs/MPC8569MDS.h | 20 +- include/configs/kmeter1.h | 2 +- include/fsl_mdio.h | 62 + include/linux/ethtool.h | 721 +++++++++++ include/linux/mdio.h | 278 ++++ include/miiphy.h | 53 +- include/phy.h | 229 ++++ include/tsec.h | 302 +---- net/eth.c | 6 + 52 files changed, 4898 insertions(+), 2322 deletions(-) create mode 100644 common/cmd_mdio.c create mode 100644 drivers/net/fsl_mdio.c create mode 100644 drivers/net/phy/atheros.c create mode 100644 drivers/net/phy/broadcom.c create mode 100644 drivers/net/phy/davicom.c create mode 100644 drivers/net/phy/generic_10g.c create mode 100644 drivers/net/phy/lxt.c create mode 100644 drivers/net/phy/marvell.c create mode 100644 drivers/net/phy/micrel.c create mode 100644 drivers/net/phy/natsemi.c create mode 100644 drivers/net/phy/phy.c create mode 100644 drivers/net/phy/realtek.c create mode 100644 drivers/net/phy/teranetics.c create mode 100644 drivers/net/phy/vitesse.c create mode 100644 include/config_phylib_all_drivers.h create mode 100644 include/fsl_mdio.h create mode 100644 include/linux/ethtool.h create mode 100644 include/linux/mdio.h create mode 100644 include/phy.h _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot