diff options
author | Aaron Williams <awilliams@marvell.com> | 2020-12-11 19:05:24 +0300 |
---|---|---|
committer | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2021-04-23 22:02:12 +0300 |
commit | e7bc6eabd1c8b3322d7aa4188d5abde8e08aa712 (patch) | |
tree | 68c003aa983aa600ac1c2ed2b681ec6566dc9e03 /arch/mips/mach-octeon/include/mach/cvmx-helper-fpa.h | |
parent | 2d80cbfb0556eea18f0e3a10a1c0fa48282429d1 (diff) | |
download | u-boot-e7bc6eabd1c8b3322d7aa4188d5abde8e08aa712.tar.xz |
mips: octeon: Add misc cvmx-helper header files
Import misc cvmx-helper header files from 2013 U-Boot. They will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.
Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/mips/mach-octeon/include/mach/cvmx-helper-fpa.h')
-rw-r--r-- | arch/mips/mach-octeon/include/mach/cvmx-helper-fpa.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/mips/mach-octeon/include/mach/cvmx-helper-fpa.h b/arch/mips/mach-octeon/include/mach/cvmx-helper-fpa.h new file mode 100644 index 0000000000..8b3a89bce4 --- /dev/null +++ b/arch/mips/mach-octeon/include/mach/cvmx-helper-fpa.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2020 Marvell International Ltd. + * + * Helper functions for FPA setup. + */ + +#ifndef __CVMX_HELPER_H_FPA__ +#define __CVMX_HELPER_H_FPA__ + +/** + * Allocate memory and initialize the FPA pools using memory + * from cvmx-bootmem. Sizes of each element in the pools is + * controlled by the cvmx-config.h header file. Specifying + * zero for any parameter will cause that FPA pool to not be + * setup. This is useful if you aren't using some of the + * hardware and want to save memory. + * + * @param packet_buffers + * Number of packet buffers to allocate + * @param work_queue_entries + * Number of work queue entries + * @param pko_buffers + * PKO Command buffers. You should at minimum have two per + * each PKO queue. + * @param tim_buffers + * TIM ring buffer command queues. At least two per timer bucket + * is recommended. + * @param dfa_buffers + * DFA command buffer. A relatively small (32 for example) + * number should work. + * @return Zero on success, non-zero if out of memory + */ +int cvmx_helper_initialize_fpa(int packet_buffers, int work_queue_entries, int pko_buffers, + int tim_buffers, int dfa_buffers); + +int __cvmx_helper_initialize_fpa_pool(int pool, u64 buffer_size, u64 buffers, const char *name); + +int cvmx_helper_shutdown_fpa_pools(int node); + +void cvmx_helper_fpa_dump(int node); + +#endif /* __CVMX_HELPER_H__ */ |