Lines Matching +full:d +full:- +full:phy
2 * Copyright (c) 2005-2008 Chelsio, Inc. All rights reserved.
14 * - Redistributions of source code must retain the above
18 * - Redistributions in binary form must reproduce the above
65 static int aq100x_reset(struct cphy *phy, int wait) in aq100x_reset() argument
71 int err = t3_phy_reset(phy, MDIO_MMD_VEND1, 3000); in aq100x_reset()
74 CH_WARN(phy->adapter, "PHY%d: reset failed (0x%x).\n", in aq100x_reset()
75 phy->mdio.prtad, err); in aq100x_reset()
80 static int aq100x_intr_enable(struct cphy *phy) in aq100x_intr_enable() argument
82 int err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AQ_IMASK_PMA, IMASK_PMA); in aq100x_intr_enable()
86 err = t3_mdio_write(phy, MDIO_MMD_VEND1, AQ_IMASK_GLOBAL, IMASK_GLOBAL); in aq100x_intr_enable()
90 static int aq100x_intr_disable(struct cphy *phy) in aq100x_intr_disable() argument
92 return t3_mdio_write(phy, MDIO_MMD_VEND1, AQ_IMASK_GLOBAL, 0); in aq100x_intr_disable()
95 static int aq100x_intr_clear(struct cphy *phy) in aq100x_intr_clear() argument
99 t3_mdio_read(phy, MDIO_MMD_VEND1, AQ_IFLAG_GLOBAL, &v); in aq100x_intr_clear()
100 t3_mdio_read(phy, MDIO_MMD_PMAPMD, MDIO_STAT1, &v); in aq100x_intr_clear()
105 static int aq100x_intr_handler(struct cphy *phy) in aq100x_intr_handler() argument
110 err = t3_mdio_read(phy, MDIO_MMD_VEND1, AQ_IFLAG_GLOBAL, &cause); in aq100x_intr_handler()
115 t3_mdio_read(phy, MDIO_MMD_PMAPMD, MDIO_STAT1, &v); in aq100x_intr_handler()
120 static int aq100x_power_down(struct cphy *phy, int off) in aq100x_power_down() argument
122 return mdio_set_flag(&phy->mdio, phy->mdio.prtad, in aq100x_power_down()
127 static int aq100x_autoneg_enable(struct cphy *phy) in aq100x_autoneg_enable() argument
131 err = aq100x_power_down(phy, 0); in aq100x_autoneg_enable()
133 err = mdio_set_flag(&phy->mdio, phy->mdio.prtad, in aq100x_autoneg_enable()
140 static int aq100x_autoneg_restart(struct cphy *phy) in aq100x_autoneg_restart() argument
144 err = aq100x_power_down(phy, 0); in aq100x_autoneg_restart()
146 err = mdio_set_flag(&phy->mdio, phy->mdio.prtad, in aq100x_autoneg_restart()
153 static int aq100x_advertise(struct cphy *phy, unsigned int advertise_map) in aq100x_advertise() argument
162 err = t3_mdio_change_bits(phy, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL, in aq100x_advertise()
173 err = t3_mdio_change_bits(phy, MDIO_MMD_AN, AQ_1G_CTRL, in aq100x_advertise()
188 err = t3_mdio_change_bits(phy, MDIO_MMD_AN, MDIO_AN_ADVERTISE, in aq100x_advertise()
194 static int aq100x_set_loopback(struct cphy *phy, int mmd, int dir, int enable) in aq100x_set_loopback() argument
196 return mdio_set_flag(&phy->mdio, phy->mdio.prtad, in aq100x_set_loopback()
201 static int aq100x_set_speed_duplex(struct cphy *phy, int speed, int duplex) in aq100x_set_speed_duplex() argument
204 return -1; in aq100x_set_speed_duplex()
207 static int aq100x_get_link_status(struct cphy *phy, int *link_ok, in aq100x_get_link_status() argument
214 err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, AQ_LINK_STAT, &v); in aq100x_get_link_status()
223 err = t3_mdio_read(phy, MDIO_MMD_AN, AQ_ANEG_STAT, &v); in aq100x_get_link_status()
266 int t3_aq100x_phy_prep(struct cphy *phy, struct adapter *adapter, int phy_addr, in t3_aq100x_phy_prep() argument
272 cphy_init(phy, adapter, phy_addr, &aq100x_ops, mdio_ops, in t3_aq100x_phy_prep()
275 "1000/10GBASE-T"); in t3_aq100x_phy_prep()
278 * The PHY has been out of reset ever since the system powered up. So in t3_aq100x_phy_prep()
292 err = t3_mdio_read(phy, MDIO_MMD_VEND1, MDIO_CTRL1, &v); in t3_aq100x_phy_prep()
297 CH_WARN(adapter, "PHY%d: reset failed (0x%x, 0x%x).\n", in t3_aq100x_phy_prep()
305 } while (v && --wait); in t3_aq100x_phy_prep()
307 CH_WARN(adapter, "PHY%d: reset timed out (0x%x).\n", in t3_aq100x_phy_prep()
314 wait = (500 - wait) * 10 + 1000; in t3_aq100x_phy_prep()
316 CH_WARN(adapter, "PHY%d: reset took %ums\n", phy_addr, wait); in t3_aq100x_phy_prep()
319 t3_mdio_read(phy, MDIO_MMD_VEND1, AQ_FW_VERSION, &v); in t3_aq100x_phy_prep()
321 CH_WARN(adapter, "PHY%d: unsupported firmware %d\n", in t3_aq100x_phy_prep()
325 * The PHY should start in really-low-power mode. Prepare it for normal in t3_aq100x_phy_prep()
328 err = t3_mdio_read(phy, MDIO_MMD_VEND1, MDIO_CTRL1, &v); in t3_aq100x_phy_prep()
332 err = t3_mdio_change_bits(phy, MDIO_MMD_VEND1, MDIO_CTRL1, in t3_aq100x_phy_prep()
338 CH_WARN(adapter, "PHY%d does not start in low power mode.\n", in t3_aq100x_phy_prep()
345 t3_mdio_read(phy, MDIO_MMD_PHYXS, AQ_XAUI_RX_CFG, &v); in t3_aq100x_phy_prep()
346 t3_mdio_read(phy, MDIO_MMD_PHYXS, AQ_XAUI_TX_CFG, &v2); in t3_aq100x_phy_prep()
349 "PHY%d: incorrect XAUI settings (0x%x, 0x%x).\n", in t3_aq100x_phy_prep()