cvmx-helper-pko3.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2020 Marvell International Ltd.
  4. */
  5. #ifndef __CVMX_HELPER_PKO3_H__
  6. #define __CVMX_HELPER_PKO3_H__
  7. /*
  8. * Initialize PKO3 unit on the current node.
  9. *
  10. * Covers the common hardware, memory and global configuration.
  11. * Per-interface initialization is performed separately.
  12. *
  13. * Return: 0 on success.
  14. *
  15. */
  16. int cvmx_helper_pko3_init_global(unsigned int node);
  17. int __cvmx_helper_pko3_init_global(unsigned int node, u16 gaura);
  18. /**
  19. * Initialize a simple interface with a a given number of
  20. * fair or prioritized queues.
  21. * This function will assign one channel per sub-interface.
  22. */
  23. int __cvmx_pko3_config_gen_interface(int xiface, u8 subif, u8 num_queues, bool prioritized);
  24. /*
  25. * Configure and initialize PKO3 for an interface
  26. *
  27. * @param interface is the interface number to configure
  28. * Return: 0 on success.
  29. *
  30. */
  31. int cvmx_helper_pko3_init_interface(int xiface);
  32. int __cvmx_pko3_helper_dqs_activate(int xiface, int index, bool min_pad);
  33. /**
  34. * Uninitialize PKO3 interface
  35. *
  36. * Release all resources held by PKO for an interface.
  37. * The shutdown code is the same for all supported interfaces.
  38. */
  39. int cvmx_helper_pko3_shut_interface(int xiface);
  40. /**
  41. * Shutdown PKO3
  42. *
  43. * Should be called after all interfaces have been shut down on the PKO3.
  44. *
  45. * Disables the PKO, frees all its buffers.
  46. */
  47. int cvmx_helper_pko3_shutdown(unsigned int node);
  48. /**
  49. * Show integrated PKO configuration.
  50. *
  51. * @param node node number
  52. */
  53. int cvmx_helper_pko3_config_dump(unsigned int node);
  54. /**
  55. * Show integrated PKO statistics.
  56. *
  57. * @param node node number
  58. */
  59. int cvmx_helper_pko3_stats_dump(unsigned int node);
  60. /**
  61. * Clear PKO statistics.
  62. *
  63. * @param node node number
  64. */
  65. void cvmx_helper_pko3_stats_clear(unsigned int node);
  66. #endif /* __CVMX_HELPER_PKO3_H__ */