1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2020 Marvell International Ltd.
5 * Functions for ILK initialization, configuration,
9 #ifndef __CVMX_HELPER_ILK_H__
10 #define __CVMX_HELPER_ILK_H__
12 int __cvmx_helper_ilk_enumerate(int interface);
16 * Clear all calendar entries to the xoff state. This
17 * means no data is sent or received.
19 * @param interface Interface whose calendar are to be initialized.
21 void __cvmx_ilk_clear_cal(int interface);
25 * Setup the channel's tx calendar entry.
27 * @param interface Interface channel belongs to
28 * @param channel Channel whose calendar entry is to be updated
29 * @param bpid Bpid assigned to the channel
31 void __cvmx_ilk_write_tx_cal_entry(int interface, int channel, unsigned char bpid);
35 * Setup the channel's rx calendar entry.
37 * @param interface Interface channel belongs to
38 * @param channel Channel whose calendar entry is to be updated
39 * @param pipe PKO assigned to the channel
41 void __cvmx_ilk_write_rx_cal_entry(int interface, int channel, unsigned char pipe);
45 * Probe a ILK interface and determine the number of ports
46 * connected to it. The ILK interface should still be down after
49 * @param xiface Interface to probe
51 * @return Number of ports on the interface. Zero to disable.
53 int __cvmx_helper_ilk_probe(int xiface);
57 * Bringup and enable a ILK interface. After this call packet
58 * I/O should be fully functional. This is called with IPD
59 * enabled but PKO disabled.
61 * @param xiface Interface to bring up
63 * @return Zero on success, negative on failure
65 int __cvmx_helper_ilk_enable(int xiface);
69 * Return the link state of an IPD/PKO port as returned by ILK link status.
71 * @param ipd_port IPD/PKO port to query
75 cvmx_helper_link_info_t __cvmx_helper_ilk_link_get(int ipd_port);
79 * Configure an IPD/PKO port for the specified link state. This
80 * function does not influence auto negotiation at the PHY level.
81 * The passed link state must always match the link state returned
82 * by cvmx_helper_link_get(). It is normally best to use
83 * cvmx_helper_link_autoconf() instead.
85 * @param ipd_port IPD/PKO port to configure
86 * @param link_info The new link state
88 * @return Zero on success, negative on failure
90 int __cvmx_helper_ilk_link_set(int ipd_port, cvmx_helper_link_info_t link_info);
92 void __cvmx_helper_ilk_show_stats(void);