Lines Matching full:pcs

3  * Lynx PCS MDIO helpers
8 #include <linux/pcs-lynx.h>
11 #define SGMII_CLOCK_PERIOD_NS 8 /* PCS is clocked at 125 MHz */
24 struct phylink_pcs pcs; member
35 #define phylink_pcs_to_lynx(pl_pcs) container_of((pl_pcs), struct lynx_pcs, pcs)
36 #define lynx_to_phylink_pcs(lynx) (&(lynx)->pcs)
38 static void lynx_pcs_get_state_usxgmii(struct mdio_device *pcs, in lynx_pcs_get_state_usxgmii() argument
41 struct mii_bus *bus = pcs->bus; in lynx_pcs_get_state_usxgmii()
42 int addr = pcs->addr; in lynx_pcs_get_state_usxgmii()
61 static void lynx_pcs_get_state_2500basex(struct mdio_device *pcs, in lynx_pcs_get_state_2500basex() argument
66 bmsr = mdiodev_read(pcs, MII_BMSR); in lynx_pcs_get_state_2500basex()
82 static void lynx_pcs_get_state(struct phylink_pcs *pcs, in lynx_pcs_get_state() argument
85 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_pcs_get_state()
114 static int lynx_pcs_config_giga(struct mdio_device *pcs, in lynx_pcs_config_giga() argument
128 mdiodev_write(pcs, LINK_TIMER_LO, link_timer & 0xffff); in lynx_pcs_config_giga()
129 mdiodev_write(pcs, LINK_TIMER_HI, link_timer >> 16); in lynx_pcs_config_giga()
141 err = mdiodev_modify(pcs, IF_MODE, in lynx_pcs_config_giga()
147 return phylink_mii_c22_pcs_config(pcs, interface, advertising, in lynx_pcs_config_giga()
151 static int lynx_pcs_config_usxgmii(struct mdio_device *pcs, in lynx_pcs_config_usxgmii() argument
155 struct mii_bus *bus = pcs->bus; in lynx_pcs_config_usxgmii()
156 int addr = pcs->addr; in lynx_pcs_config_usxgmii()
159 dev_err(&pcs->dev, "USXGMII only supports in-band AN for now\n"); in lynx_pcs_config_usxgmii()
170 static int lynx_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode, in lynx_pcs_config() argument
174 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_pcs_config()
202 static void lynx_pcs_an_restart(struct phylink_pcs *pcs) in lynx_pcs_an_restart() argument
204 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_pcs_an_restart()
209 static void lynx_pcs_link_up_sgmii(struct mdio_device *pcs, in lynx_pcs_link_up_sgmii() argument
215 /* The PCS needs to be configured manually only in lynx_pcs_link_up_sgmii()
238 dev_err(&pcs->dev, "Invalid PCS speed %d\n", speed); in lynx_pcs_link_up_sgmii()
243 mdiodev_modify(pcs, IF_MODE, in lynx_pcs_link_up_sgmii()
264 static void lynx_pcs_link_up_2500basex(struct mdio_device *pcs, in lynx_pcs_link_up_2500basex() argument
271 dev_err(&pcs->dev, "AN not supported for 2500BaseX\n"); in lynx_pcs_link_up_2500basex()
279 mdiodev_modify(pcs, IF_MODE, in lynx_pcs_link_up_2500basex()
284 static void lynx_pcs_link_up(struct phylink_pcs *pcs, unsigned int neg_mode, in lynx_pcs_link_up() argument
288 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_pcs_link_up()
325 lynx->pcs.ops = &lynx_pcs_phylink_ops; in lynx_pcs_create()
326 lynx->pcs.neg_mode = true; in lynx_pcs_create()
327 lynx->pcs.poll = true; in lynx_pcs_create()
335 struct phylink_pcs *pcs; in lynx_pcs_create_mdiodev() local
341 pcs = lynx_pcs_create(mdio); in lynx_pcs_create_mdiodev()
351 return pcs; in lynx_pcs_create_mdiodev()
356 * lynx_pcs_create_fwnode() creates a lynx PCS instance from the fwnode
368 struct phylink_pcs *pcs; in lynx_pcs_create_fwnode() local
377 pcs = lynx_pcs_create(mdio); in lynx_pcs_create_fwnode()
387 return pcs; in lynx_pcs_create_fwnode()
391 void lynx_pcs_destroy(struct phylink_pcs *pcs) in lynx_pcs_destroy() argument
393 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_pcs_destroy()
400 MODULE_DESCRIPTION("NXP Lynx PCS phylink library");