Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (c) 2020 Synopsys, Inc. and/or its affiliates.
0004  * Synopsys DesignWare XPCS helpers
0005  */
0006 
0007 #ifndef __LINUX_PCS_XPCS_H
0008 #define __LINUX_PCS_XPCS_H
0009 
0010 #include <linux/phy.h>
0011 #include <linux/phylink.h>
0012 
0013 #define NXP_SJA1105_XPCS_ID     0x00000010
0014 #define NXP_SJA1110_XPCS_ID     0x00000020
0015 
0016 /* AN mode */
0017 #define DW_AN_C73           1
0018 #define DW_AN_C37_SGMII         2
0019 #define DW_2500BASEX            3
0020 #define DW_AN_C37_1000BASEX     4
0021 
0022 struct xpcs_id;
0023 
0024 struct dw_xpcs {
0025     struct mdio_device *mdiodev;
0026     const struct xpcs_id *id;
0027     struct phylink_pcs pcs;
0028 };
0029 
0030 int xpcs_get_an_mode(struct dw_xpcs *xpcs, phy_interface_t interface);
0031 void xpcs_link_up(struct phylink_pcs *pcs, unsigned int mode,
0032           phy_interface_t interface, int speed, int duplex);
0033 int xpcs_do_config(struct dw_xpcs *xpcs, phy_interface_t interface,
0034            unsigned int mode, const unsigned long *advertising);
0035 void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces);
0036 int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns,
0037             int enable);
0038 struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
0039                 phy_interface_t interface);
0040 void xpcs_destroy(struct dw_xpcs *xpcs);
0041 
0042 #endif /* __LINUX_PCS_XPCS_H */