X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fphy.h;h=b5de14cbfc293d7b5fb1b67ff2cbf22e2ba91bef;hb=915f15ac5746739da0aa2ee2840c2d00dc65aaaa;hp=e50f56b6eb165a442928d23d678d9d5be0b68478;hpb=44fb0d6c9f5147a41c710032869e5e01b3c9e310;p=oweals%2Fu-boot.git diff --git a/include/phy.h b/include/phy.h index e50f56b6eb..b5de14cbfc 100644 --- a/include/phy.h +++ b/include/phy.h @@ -10,13 +10,17 @@ #define _PHY_H #include +#include #include #include #include #include +#include #include #define PHY_FIXED_ID 0xa5a55a5a +#define PHY_NCSI_ID 0xbeefcafe + /* * There is no actual id for this. * This is just a dummy id for gmii2rgmmi converter. @@ -115,6 +119,9 @@ struct phy_driver { u16 val); struct list_head list; + + /* driver private data */ + ulong data; }; struct phy_device { @@ -167,6 +174,11 @@ static inline int phy_read(struct phy_device *phydev, int devad, int regnum) { struct mii_dev *bus = phydev->bus; + if (!bus || !bus->read) { + debug("%s: No bus configured\n", __func__); + return -1; + } + return bus->read(bus, phydev->addr, devad, regnum); } @@ -175,6 +187,11 @@ static inline int phy_write(struct phy_device *phydev, int devad, int regnum, { struct mii_dev *bus = phydev->bus; + if (!bus || !bus->read) { + debug("%s: No bus configured\n", __func__); + return -1; + } + return bus->write(bus, phydev->addr, devad, regnum, val); } @@ -243,10 +260,15 @@ static inline int phy_write_mmd(struct phy_device *phydev, int devad, #ifdef CONFIG_PHYLIB_10G extern struct phy_driver gen10g_driver; -/* For now, XGMII is the only 10G interface */ +/* + * List all 10G interfaces here, the assumption being that PHYs on these + * interfaces are C45 + */ static inline int is_10g_interface(phy_interface_t interface) { - return interface == PHY_INTERFACE_MODE_XGMII; + return interface == PHY_INTERFACE_MODE_XGMII || + interface == PHY_INTERFACE_MODE_USXGMII || + interface == PHY_INTERFACE_MODE_XFI; } #endif @@ -396,6 +418,7 @@ int phy_vitesse_init(void); int phy_xilinx_init(void); int phy_mscc_init(void); int phy_fixed_init(void); +int phy_ncsi_init(void); int phy_xilinx_gmii2rgmii_init(void); int board_phy_config(struct phy_device *phydev);