cvmx-helper-fpa.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2020 Marvell International Ltd.
  4. *
  5. * Helper functions for FPA setup.
  6. */
  7. #ifndef __CVMX_HELPER_H_FPA__
  8. #define __CVMX_HELPER_H_FPA__
  9. /**
  10. * Allocate memory and initialize the FPA pools using memory
  11. * from cvmx-bootmem. Sizes of each element in the pools is
  12. * controlled by the cvmx-config.h header file. Specifying
  13. * zero for any parameter will cause that FPA pool to not be
  14. * setup. This is useful if you aren't using some of the
  15. * hardware and want to save memory.
  16. *
  17. * @param packet_buffers
  18. * Number of packet buffers to allocate
  19. * @param work_queue_entries
  20. * Number of work queue entries
  21. * @param pko_buffers
  22. * PKO Command buffers. You should at minimum have two per
  23. * each PKO queue.
  24. * @param tim_buffers
  25. * TIM ring buffer command queues. At least two per timer bucket
  26. * is recommended.
  27. * @param dfa_buffers
  28. * DFA command buffer. A relatively small (32 for example)
  29. * number should work.
  30. * Return: Zero on success, non-zero if out of memory
  31. */
  32. int cvmx_helper_initialize_fpa(int packet_buffers, int work_queue_entries, int pko_buffers,
  33. int tim_buffers, int dfa_buffers);
  34. int __cvmx_helper_initialize_fpa_pool(int pool, u64 buffer_size, u64 buffers, const char *name);
  35. int cvmx_helper_shutdown_fpa_pools(int node);
  36. void cvmx_helper_fpa_dump(int node);
  37. #endif /* __CVMX_HELPER_H__ */