cvmx-helper-srio.h 1.8 KB

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