Aaron Williams | 3bda89d | 2020-12-11 17:05:24 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (C) 2020 Marvell International Ltd. |
| 4 | * |
| 5 | * PKO helper, configuration API |
| 6 | */ |
| 7 | |
| 8 | #ifndef __CVMX_HELPER_PKO_H__ |
| 9 | #define __CVMX_HELPER_PKO_H__ |
| 10 | |
| 11 | /* CSR typedefs have been moved to cvmx-pko-defs.h */ |
| 12 | |
| 13 | /** |
| 14 | * cvmx_override_pko_queue_priority(int ipd_port, u64 |
| 15 | * priorities[16]) is a function pointer. It is meant to allow |
| 16 | * customization of the PKO queue priorities based on the port |
| 17 | * number. Users should set this pointer to a function before |
| 18 | * calling any cvmx-helper operations. |
| 19 | */ |
Stefan Roese | cbe6243 | 2022-04-07 09:11:10 +0200 | [diff] [blame] | 20 | extern void (*cvmx_override_pko_queue_priority)(int ipd_port, u8 *priorities); |
Aaron Williams | 3bda89d | 2020-12-11 17:05:24 +0100 | [diff] [blame] | 21 | |
| 22 | /** |
| 23 | * Gets the fpa pool number of pko pool |
| 24 | */ |
| 25 | s64 cvmx_fpa_get_pko_pool(void); |
| 26 | |
| 27 | /** |
| 28 | * Gets the buffer size of pko pool |
| 29 | */ |
| 30 | u64 cvmx_fpa_get_pko_pool_block_size(void); |
| 31 | |
| 32 | /** |
| 33 | * Gets the buffer size of pko pool |
| 34 | */ |
| 35 | u64 cvmx_fpa_get_pko_pool_buffer_count(void); |
| 36 | |
| 37 | int cvmx_helper_pko_init(void); |
| 38 | |
| 39 | /* |
| 40 | * This function is a no-op |
| 41 | * included here for backwards compatibility only. |
| 42 | */ |
| 43 | static inline int cvmx_pko_initialize_local(void) |
| 44 | { |
| 45 | return 0; |
| 46 | } |
| 47 | |
| 48 | int __cvmx_helper_pko_drain(void); |
| 49 | int __cvmx_helper_interface_setup_pko(int interface); |
| 50 | |
| 51 | #endif /* __CVMX_HELPER_PKO_H__ */ |