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