blob: ca8d848bd1def5678cece75f81491d2c82d7cb5e [file] [log] [blame]
Aaron Williams3bda89d2020-12-11 17:05:24 +01001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2020 Marvell International Ltd.
4 */
5
6#ifndef __CVMX_HELPER_PKO3_H__
7#define __CVMX_HELPER_PKO3_H__
8
9/*
10 * Initialize PKO3 unit on the current node.
11 *
12 * Covers the common hardware, memory and global configuration.
13 * Per-interface initialization is performed separately.
14 *
15 * @return 0 on success.
16 *
17 */
18int cvmx_helper_pko3_init_global(unsigned int node);
19int __cvmx_helper_pko3_init_global(unsigned int node, u16 gaura);
20
21/**
22 * Initialize a simple interface with a a given number of
23 * fair or prioritized queues.
24 * This function will assign one channel per sub-interface.
25 */
26int __cvmx_pko3_config_gen_interface(int xiface, u8 subif, u8 num_queues, bool prioritized);
27
28/*
29 * Configure and initialize PKO3 for an interface
30 *
31 * @param interface is the interface number to configure
32 * @return 0 on success.
33 *
34 */
35int cvmx_helper_pko3_init_interface(int xiface);
36int __cvmx_pko3_helper_dqs_activate(int xiface, int index, bool min_pad);
37
38/**
39 * Uninitialize PKO3 interface
40 *
41 * Release all resources held by PKO for an interface.
42 * The shutdown code is the same for all supported interfaces.
43 */
44int cvmx_helper_pko3_shut_interface(int xiface);
45
46/**
47 * Shutdown PKO3
48 *
49 * Should be called after all interfaces have been shut down on the PKO3.
50 *
51 * Disables the PKO, frees all its buffers.
52 */
53int cvmx_helper_pko3_shutdown(unsigned int node);
54
55/**
56 * Show integrated PKO configuration.
57 *
58 * @param node node number
59 */
60int cvmx_helper_pko3_config_dump(unsigned int node);
61
62/**
63 * Show integrated PKO statistics.
64 *
65 * @param node node number
66 */
67int cvmx_helper_pko3_stats_dump(unsigned int node);
68
69/**
70 * Clear PKO statistics.
71 *
72 * @param node node number
73 */
74void cvmx_helper_pko3_stats_clear(unsigned int node);
75
76#endif /* __CVMX_HELPER_PKO3_H__ */