cvmx-helper-ilk.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2020 Marvell International Ltd.
  4. *
  5. * Functions for ILK initialization, configuration,
  6. * and monitoring.
  7. */
  8. #ifndef __CVMX_HELPER_ILK_H__
  9. #define __CVMX_HELPER_ILK_H__
  10. int __cvmx_helper_ilk_enumerate(int interface);
  11. /**
  12. * @INTERNAL
  13. * Clear all calendar entries to the xoff state. This
  14. * means no data is sent or received.
  15. *
  16. * @param interface Interface whose calendar are to be initialized.
  17. */
  18. void __cvmx_ilk_clear_cal(int interface);
  19. /**
  20. * @INTERNAL
  21. * Setup the channel's tx calendar entry.
  22. *
  23. * @param interface Interface channel belongs to
  24. * @param channel Channel whose calendar entry is to be updated
  25. * @param bpid Bpid assigned to the channel
  26. */
  27. void __cvmx_ilk_write_tx_cal_entry(int interface, int channel, unsigned char bpid);
  28. /**
  29. * @INTERNAL
  30. * Setup the channel's rx calendar entry.
  31. *
  32. * @param interface Interface channel belongs to
  33. * @param channel Channel whose calendar entry is to be updated
  34. * @param pipe PKO assigned to the channel
  35. */
  36. void __cvmx_ilk_write_rx_cal_entry(int interface, int channel, unsigned char pipe);
  37. /**
  38. * @INTERNAL
  39. * Probe a ILK interface and determine the number of ports
  40. * connected to it. The ILK interface should still be down after
  41. * this call.
  42. *
  43. * @param xiface Interface to probe
  44. *
  45. * Return: Number of ports on the interface. Zero to disable.
  46. */
  47. int __cvmx_helper_ilk_probe(int xiface);
  48. /**
  49. * @INTERNAL
  50. * Bringup and enable a ILK interface. After this call packet
  51. * I/O should be fully functional. This is called with IPD
  52. * enabled but PKO disabled.
  53. *
  54. * @param xiface Interface to bring up
  55. *
  56. * Return: Zero on success, negative on failure
  57. */
  58. int __cvmx_helper_ilk_enable(int xiface);
  59. /**
  60. * @INTERNAL
  61. * Return the link state of an IPD/PKO port as returned by ILK link status.
  62. *
  63. * @param ipd_port IPD/PKO port to query
  64. *
  65. * Return: Link state
  66. */
  67. cvmx_helper_link_info_t __cvmx_helper_ilk_link_get(int ipd_port);
  68. /**
  69. * @INTERNAL
  70. * Configure an IPD/PKO port for the specified link state. This
  71. * function does not influence auto negotiation at the PHY level.
  72. * The passed link state must always match the link state returned
  73. * by cvmx_helper_link_get(). It is normally best to use
  74. * cvmx_helper_link_autoconf() instead.
  75. *
  76. * @param ipd_port IPD/PKO port to configure
  77. * @param link_info The new link state
  78. *
  79. * Return: Zero on success, negative on failure
  80. */
  81. int __cvmx_helper_ilk_link_set(int ipd_port, cvmx_helper_link_info_t link_info);
  82. void __cvmx_helper_ilk_show_stats(void);
  83. #endif