pcs-xpcs.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2020 Synopsys, Inc. and/or its affiliates.
  4. * Synopsys DesignWare XPCS helpers
  5. */
  6. #ifndef __LINUX_PCS_XPCS_H
  7. #define __LINUX_PCS_XPCS_H
  8. #include <linux/phy.h>
  9. #include <linux/phylink.h>
  10. #define NXP_SJA1105_XPCS_ID 0x00000010
  11. #define NXP_SJA1110_XPCS_ID 0x00000020
  12. /* AN mode */
  13. #define DW_AN_C73 1
  14. #define DW_AN_C37_SGMII 2
  15. #define DW_2500BASEX 3
  16. #define DW_AN_C37_1000BASEX 4
  17. struct xpcs_id;
  18. struct dw_xpcs {
  19. struct mdio_device *mdiodev;
  20. const struct xpcs_id *id;
  21. struct phylink_pcs pcs;
  22. };
  23. int xpcs_get_an_mode(struct dw_xpcs *xpcs, phy_interface_t interface);
  24. void xpcs_link_up(struct phylink_pcs *pcs, unsigned int mode,
  25. phy_interface_t interface, int speed, int duplex);
  26. int xpcs_do_config(struct dw_xpcs *xpcs, phy_interface_t interface,
  27. unsigned int mode, const unsigned long *advertising);
  28. void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces);
  29. int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns,
  30. int enable);
  31. struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
  32. phy_interface_t interface);
  33. void xpcs_destroy(struct dw_xpcs *xpcs);
  34. #endif /* __LINUX_PCS_XPCS_H */