1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2020 Marvell International Ltd.
5 * Helper functions for FPA setup.
8 #ifndef __CVMX_HELPER_H_FPA__
9 #define __CVMX_HELPER_H_FPA__
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.
19 * @param packet_buffers
20 * Number of packet buffers to allocate
21 * @param work_queue_entries
22 * Number of work queue entries
24 * PKO Command buffers. You should at minimum have two per
27 * TIM ring buffer command queues. At least two per timer bucket
30 * DFA command buffer. A relatively small (32 for example)
32 * Return: Zero on success, non-zero if out of memory
34 int cvmx_helper_initialize_fpa(int packet_buffers, int work_queue_entries, int pko_buffers,
35 int tim_buffers, int dfa_buffers);
37 int __cvmx_helper_initialize_fpa_pool(int pool, u64 buffer_size, u64 buffers, const char *name);
39 int cvmx_helper_shutdown_fpa_pools(int node);
41 void cvmx_helper_fpa_dump(int node);
43 #endif /* __CVMX_HELPER_H__ */