xref: /openbmc/linux/include/linux/pcs/pcs-xpcs.h (revision 5673ef86)
12fa4e4b7SAndrew Lunn /* SPDX-License-Identifier: GPL-2.0 */
22fa4e4b7SAndrew Lunn /*
32fa4e4b7SAndrew Lunn  * Copyright (c) 2020 Synopsys, Inc. and/or its affiliates.
42fa4e4b7SAndrew Lunn  * Synopsys DesignWare XPCS helpers
52fa4e4b7SAndrew Lunn  */
62fa4e4b7SAndrew Lunn 
72fa4e4b7SAndrew Lunn #ifndef __LINUX_PCS_XPCS_H
82fa4e4b7SAndrew Lunn #define __LINUX_PCS_XPCS_H
92fa4e4b7SAndrew Lunn 
102fa4e4b7SAndrew Lunn #include <linux/phy.h>
112fa4e4b7SAndrew Lunn #include <linux/phylink.h>
122fa4e4b7SAndrew Lunn 
1307a4bc51SOng Boon Leong /* AN mode */
1407a4bc51SOng Boon Leong #define DW_AN_C73			1
15b97b5331SOng Boon Leong #define DW_AN_C37_SGMII			2
16f27abde3SVoon Weifeng #define DW_2500BASEX			3
1707a4bc51SOng Boon Leong 
189900074eSVladimir Oltean struct xpcs_id;
199900074eSVladimir Oltean 
20*5673ef86SVladimir Oltean struct dw_xpcs {
212cac15daSVladimir Oltean 	struct mdio_device *mdiodev;
229900074eSVladimir Oltean 	const struct xpcs_id *id;
2311059740SVladimir Oltean 	struct phylink_pcs pcs;
242fa4e4b7SAndrew Lunn };
252fa4e4b7SAndrew Lunn 
26*5673ef86SVladimir Oltean int xpcs_get_an_mode(struct dw_xpcs *xpcs, phy_interface_t interface);
27*5673ef86SVladimir Oltean void xpcs_validate(struct dw_xpcs *xpcs, unsigned long *supported,
28a1a753edSVladimir Oltean 		   struct phylink_link_state *state);
29*5673ef86SVladimir Oltean int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns,
3014b517cbSVladimir Oltean 		    int enable);
31*5673ef86SVladimir Oltean struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
322cac15daSVladimir Oltean 			    phy_interface_t interface);
33*5673ef86SVladimir Oltean void xpcs_destroy(struct dw_xpcs *xpcs);
342fa4e4b7SAndrew Lunn 
352fa4e4b7SAndrew Lunn #endif /* __LINUX_PCS_XPCS_H */
36