Aaron Williams | 1fd14ee | 2022-04-07 09:11:03 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (C) 2018-2022 Marvell International Ltd. |
| 4 | * |
| 5 | * Functions for AGL (RGMII) commong initialization, configuration. |
| 6 | */ |
| 7 | |
| 8 | #ifndef __CVMX_AGL_H__ |
| 9 | #define __CVMX_AGL_H__ |
| 10 | |
| 11 | /* |
| 12 | * @param port to enable |
| 13 | * |
| 14 | * @return Zero on success, negative on failure |
| 15 | */ |
| 16 | int cvmx_agl_enable(int port); |
| 17 | |
| 18 | cvmx_helper_link_info_t cvmx_agl_link_get(int port); |
| 19 | |
| 20 | /* |
| 21 | * Set MII/RGMII link based on mode. |
| 22 | * |
| 23 | * @param port interface port to set the link. |
| 24 | * @param link_info Link status |
| 25 | * |
| 26 | * @return 0 on success and 1 on failure |
| 27 | */ |
| 28 | int cvmx_agl_link_set(int port, cvmx_helper_link_info_t link_info); |
| 29 | |
| 30 | /** |
| 31 | * Disables the sending of flow control (pause) frames on the specified |
| 32 | * AGL (RGMII) port(s). |
| 33 | * |
| 34 | * @param interface Which interface (0 or 1) |
| 35 | * @param port_mask Mask (4bits) of which ports on the interface to disable |
| 36 | * backpressure on. |
| 37 | * 1 => disable backpressure |
| 38 | * 0 => enable backpressure |
| 39 | * |
| 40 | * @return 0 on success |
| 41 | * -1 on error |
| 42 | */ |
| 43 | int cvmx_agl_set_backpressure_override(u32 interface, uint32_t port_mask); |
| 44 | |
| 45 | #endif /* __CVMX_AGL_H__ */ |