1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2020 Synopsys, Inc. and/or its affiliates.
4 * Synopsys DesignWare XPCS helpers
7 #ifndef __LINUX_PCS_XPCS_H
8 #define __LINUX_PCS_XPCS_H
10 #include <linux/phy.h>
11 #include <linux/phylink.h>
13 #define NXP_SJA1105_XPCS_ID 0x00000010
14 #define NXP_SJA1110_XPCS_ID 0x00000020
18 #define DW_AN_C37_SGMII 2
19 #define DW_2500BASEX 3
24 struct mdio_device *mdiodev;
25 const struct xpcs_id *id;
26 struct phylink_pcs pcs;
29 int xpcs_get_an_mode(struct dw_xpcs *xpcs, phy_interface_t interface);
30 void xpcs_link_up(struct phylink_pcs *pcs, unsigned int mode,
31 phy_interface_t interface, int speed, int duplex);
32 int xpcs_do_config(struct dw_xpcs *xpcs, phy_interface_t interface,
34 void xpcs_validate(struct dw_xpcs *xpcs, unsigned long *supported,
35 struct phylink_link_state *state);
36 int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns,
38 struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
39 phy_interface_t interface);
40 void xpcs_destroy(struct dw_xpcs *xpcs);
42 #endif /* __LINUX_PCS_XPCS_H */