cvmx-helper-agl.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2020 Marvell International Ltd.
  4. *
  5. * Functions for AGL (RGMII) initialization, configuration,
  6. * and monitoring.
  7. */
  8. #ifndef __CVMX_HELPER_AGL_H__
  9. #define __CVMX_HELPER_AGL_H__
  10. int __cvmx_helper_agl_enumerate(int interface);
  11. int cvmx_helper_agl_get_port(int xiface);
  12. /**
  13. * @INTERNAL
  14. * Probe a RGMII interface and determine the number of ports
  15. * connected to it. The RGMII interface should still be down
  16. * after this call.
  17. *
  18. * @param interface Interface to probe
  19. *
  20. * Return: Number of ports on the interface. Zero to disable.
  21. */
  22. int __cvmx_helper_agl_probe(int interface);
  23. /**
  24. * @INTERNAL
  25. * Bringup and enable a RGMII interface. After this call packet
  26. * I/O should be fully functional. This is called with IPD
  27. * enabled but PKO disabled.
  28. *
  29. * @param interface Interface to bring up
  30. *
  31. * Return: Zero on success, negative on failure
  32. */
  33. int __cvmx_helper_agl_enable(int interface);
  34. /**
  35. * @INTERNAL
  36. * Return the link state of an IPD/PKO port as returned by
  37. * auto negotiation. The result of this function may not match
  38. * Octeon's link config if auto negotiation has changed since
  39. * the last call to cvmx_helper_link_set().
  40. *
  41. * @param ipd_port IPD/PKO port to query
  42. *
  43. * Return: Link state
  44. */
  45. cvmx_helper_link_info_t __cvmx_helper_agl_link_get(int ipd_port);
  46. /**
  47. * @INTERNAL
  48. * Configure an IPD/PKO port for the specified link state. This
  49. * function does not influence auto negotiation at the PHY level.
  50. * The passed link state must always match the link state returned
  51. * by cvmx_helper_link_get(). It is normally best to use
  52. * cvmx_helper_link_autoconf() instead.
  53. *
  54. * @param ipd_port IPD/PKO port to configure
  55. * @param link_info The new link state
  56. *
  57. * Return: Zero on success, negative on failure
  58. */
  59. int __cvmx_helper_agl_link_set(int ipd_port, cvmx_helper_link_info_t link_info);
  60. #endif /* __CVMX_HELPER_AGL_H__ */