Lines Matching full:pcs

3  * Lynx PCS MDIO helpers
8 #include <linux/pcs-lynx.h>
10 #define SGMII_CLOCK_PERIOD_NS 8 /* PCS is clocked at 125 MHz */
26 struct phylink_pcs pcs; member
37 #define phylink_pcs_to_lynx(pl_pcs) container_of((pl_pcs), struct lynx_pcs, pcs)
38 #define lynx_to_phylink_pcs(lynx) (&(lynx)->pcs)
40 struct mdio_device *lynx_get_mdio_device(struct phylink_pcs *pcs) in lynx_get_mdio_device() argument
42 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_get_mdio_device()
48 static void lynx_pcs_get_state_usxgmii(struct mdio_device *pcs, in lynx_pcs_get_state_usxgmii() argument
51 struct mii_bus *bus = pcs->bus; in lynx_pcs_get_state_usxgmii()
52 int addr = pcs->addr; in lynx_pcs_get_state_usxgmii()
71 static void lynx_pcs_get_state_2500basex(struct mdio_device *pcs, in lynx_pcs_get_state_2500basex() argument
76 bmsr = mdiodev_read(pcs, MII_BMSR); in lynx_pcs_get_state_2500basex()
77 lpa = mdiodev_read(pcs, MII_LPA); in lynx_pcs_get_state_2500basex()
93 static void lynx_pcs_get_state(struct phylink_pcs *pcs, in lynx_pcs_get_state() argument
96 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_pcs_get_state()
125 static int lynx_pcs_config_giga(struct mdio_device *pcs, unsigned int mode, in lynx_pcs_config_giga() argument
135 mdiodev_write(pcs, LINK_TIMER_LO, link_timer & 0xffff); in lynx_pcs_config_giga()
136 mdiodev_write(pcs, LINK_TIMER_HI, link_timer >> 16); in lynx_pcs_config_giga()
146 mdiodev_write(pcs, LINK_TIMER_LO, link_timer & 0xffff); in lynx_pcs_config_giga()
147 mdiodev_write(pcs, LINK_TIMER_HI, link_timer >> 16); in lynx_pcs_config_giga()
151 err = mdiodev_modify(pcs, IF_MODE, in lynx_pcs_config_giga()
157 return phylink_mii_c22_pcs_config(pcs, mode, interface, advertising); in lynx_pcs_config_giga()
160 static int lynx_pcs_config_usxgmii(struct mdio_device *pcs, unsigned int mode, in lynx_pcs_config_usxgmii() argument
163 struct mii_bus *bus = pcs->bus; in lynx_pcs_config_usxgmii()
164 int addr = pcs->addr; in lynx_pcs_config_usxgmii()
167 dev_err(&pcs->dev, "USXGMII only supports in-band AN for now\n"); in lynx_pcs_config_usxgmii()
178 static int lynx_pcs_config(struct phylink_pcs *pcs, unsigned int mode, in lynx_pcs_config() argument
183 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_pcs_config()
210 static void lynx_pcs_an_restart(struct phylink_pcs *pcs) in lynx_pcs_an_restart() argument
212 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_pcs_an_restart()
217 static void lynx_pcs_link_up_sgmii(struct mdio_device *pcs, unsigned int mode, in lynx_pcs_link_up_sgmii() argument
222 /* The PCS needs to be configured manually only in lynx_pcs_link_up_sgmii()
245 dev_err(&pcs->dev, "Invalid PCS speed %d\n", speed); in lynx_pcs_link_up_sgmii()
250 mdiodev_modify(pcs, IF_MODE, in lynx_pcs_link_up_sgmii()
271 static void lynx_pcs_link_up_2500basex(struct mdio_device *pcs, in lynx_pcs_link_up_2500basex() argument
278 dev_err(&pcs->dev, "AN not supported for 2500BaseX\n"); in lynx_pcs_link_up_2500basex()
286 mdiodev_modify(pcs, IF_MODE, in lynx_pcs_link_up_2500basex()
291 static void lynx_pcs_link_up(struct phylink_pcs *pcs, unsigned int mode, in lynx_pcs_link_up() argument
295 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_pcs_link_up()
331 lynx->pcs.ops = &lynx_pcs_phylink_ops; in lynx_pcs_create()
332 lynx->pcs.poll = true; in lynx_pcs_create()
338 void lynx_pcs_destroy(struct phylink_pcs *pcs) in lynx_pcs_destroy() argument
340 struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); in lynx_pcs_destroy()