.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /******************************************************************************* |
---|
2 | 3 | |
---|
3 | 4 | Header file for stmmac platform data |
---|
4 | 5 | |
---|
5 | 6 | Copyright (C) 2009 STMicroelectronics Ltd |
---|
6 | 7 | |
---|
7 | | - This program is free software; you can redistribute it and/or modify it |
---|
8 | | - under the terms and conditions of the GNU General Public License, |
---|
9 | | - version 2, as published by the Free Software Foundation. |
---|
10 | | - |
---|
11 | | - This program is distributed in the hope it will be useful, but WITHOUT |
---|
12 | | - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
13 | | - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
14 | | - more details. |
---|
15 | | - |
---|
16 | | - You should have received a copy of the GNU General Public License along with |
---|
17 | | - this program; if not, write to the Free Software Foundation, Inc., |
---|
18 | | - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
---|
19 | | - |
---|
20 | | - The full GNU General Public License is included in this distribution in |
---|
21 | | - the file called "COPYING". |
---|
22 | 8 | |
---|
23 | 9 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
---|
24 | 10 | *******************************************************************************/ |
---|
.. | .. |
---|
27 | 13 | #define __STMMAC_PLATFORM_DATA |
---|
28 | 14 | |
---|
29 | 15 | #include <linux/platform_device.h> |
---|
| 16 | +#include <linux/phy.h> |
---|
30 | 17 | |
---|
31 | 18 | #define MTL_MAX_RX_QUEUES 8 |
---|
32 | 19 | #define MTL_MAX_TX_QUEUES 8 |
---|
.. | .. |
---|
92 | 79 | /* Platfrom data for platform device structure's platform_data field */ |
---|
93 | 80 | |
---|
94 | 81 | struct stmmac_mdio_bus_data { |
---|
95 | | - int (*phy_reset)(void *priv); |
---|
96 | 82 | unsigned int phy_mask; |
---|
| 83 | + unsigned int has_xpcs; |
---|
97 | 84 | int *irqs; |
---|
98 | 85 | int probed_phy_irq; |
---|
99 | | -#ifdef CONFIG_OF |
---|
100 | | - int reset_gpio, active_low; |
---|
101 | | - u32 delays[3]; |
---|
102 | | -#endif |
---|
| 86 | + bool needs_reset; |
---|
103 | 87 | }; |
---|
104 | 88 | |
---|
105 | 89 | struct stmmac_dma_cfg { |
---|
.. | .. |
---|
110 | 94 | int fixed_burst; |
---|
111 | 95 | int mixed_burst; |
---|
112 | 96 | bool aal; |
---|
| 97 | + bool eame; |
---|
113 | 98 | }; |
---|
114 | 99 | |
---|
115 | 100 | #define AXI_BLEN 7 |
---|
.. | .. |
---|
123 | 108 | bool axi_fb; |
---|
124 | 109 | bool axi_mb; |
---|
125 | 110 | bool axi_rb; |
---|
| 111 | +}; |
---|
| 112 | + |
---|
| 113 | +#define EST_GCL 1024 |
---|
| 114 | +struct stmmac_est { |
---|
| 115 | + struct mutex lock; |
---|
| 116 | + int enable; |
---|
| 117 | + u32 btr_offset[2]; |
---|
| 118 | + u32 btr[2]; |
---|
| 119 | + u32 ctr[2]; |
---|
| 120 | + u32 ter; |
---|
| 121 | + u32 gcl_unaligned[EST_GCL]; |
---|
| 122 | + u32 gcl[EST_GCL]; |
---|
| 123 | + u32 gcl_size; |
---|
126 | 124 | }; |
---|
127 | 125 | |
---|
128 | 126 | struct stmmac_rxq_cfg { |
---|
.. | .. |
---|
143 | 141 | u32 low_credit; |
---|
144 | 142 | bool use_prio; |
---|
145 | 143 | u32 prio; |
---|
| 144 | + int tbs_en; |
---|
146 | 145 | }; |
---|
147 | 146 | |
---|
148 | 147 | struct plat_stmmacenet_data { |
---|
149 | 148 | int bus_id; |
---|
150 | 149 | int phy_addr; |
---|
151 | 150 | int interface; |
---|
| 151 | + phy_interface_t phy_interface; |
---|
152 | 152 | struct stmmac_mdio_bus_data *mdio_bus_data; |
---|
153 | 153 | struct device_node *phy_node; |
---|
| 154 | + struct device_node *phylink_node; |
---|
154 | 155 | struct device_node *mdio_node; |
---|
155 | 156 | struct stmmac_dma_cfg *dma_cfg; |
---|
| 157 | + struct stmmac_est *est; |
---|
156 | 158 | int clk_csr; |
---|
157 | 159 | int has_gmac; |
---|
158 | 160 | int enh_desc; |
---|
.. | .. |
---|
169 | 171 | int unicast_filter_entries; |
---|
170 | 172 | int tx_fifo_size; |
---|
171 | 173 | int rx_fifo_size; |
---|
| 174 | + int dma_tx_size; |
---|
| 175 | + int dma_rx_size; |
---|
| 176 | + int flow_ctrl; |
---|
| 177 | + u32 addr64; |
---|
172 | 178 | u32 rx_queues_to_use; |
---|
173 | 179 | u32 tx_queues_to_use; |
---|
174 | 180 | u8 rx_sched_algorithm; |
---|
.. | .. |
---|
176 | 182 | struct stmmac_rxq_cfg rx_queues_cfg[MTL_MAX_RX_QUEUES]; |
---|
177 | 183 | struct stmmac_txq_cfg tx_queues_cfg[MTL_MAX_TX_QUEUES]; |
---|
178 | 184 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
---|
| 185 | + int (*serdes_powerup)(struct net_device *ndev, void *priv); |
---|
| 186 | + void (*serdes_powerdown)(struct net_device *ndev, void *priv); |
---|
179 | 187 | int (*integrated_phy_power)(void *priv, bool up); |
---|
180 | 188 | int (*init)(struct platform_device *pdev, void *priv); |
---|
181 | 189 | void (*exit)(struct platform_device *pdev, void *priv); |
---|
.. | .. |
---|
187 | 195 | struct clk *clk_ptp_ref; |
---|
188 | 196 | unsigned int clk_ptp_rate; |
---|
189 | 197 | unsigned int clk_ref_rate; |
---|
| 198 | + s32 ptp_max_adj; |
---|
190 | 199 | struct reset_control *stmmac_rst; |
---|
191 | 200 | struct stmmac_axi *axi; |
---|
192 | 201 | int has_gmac4; |
---|
193 | 202 | bool has_sun8i; |
---|
194 | 203 | bool tso_en; |
---|
| 204 | + int rss_en; |
---|
195 | 205 | int mac_port_sel_speed; |
---|
196 | 206 | bool en_tx_lpi_clockgating; |
---|
| 207 | + bool rx_clk_runs_in_lpi; |
---|
197 | 208 | int has_xgmac; |
---|
| 209 | + bool vlan_fail_q_en; |
---|
| 210 | + u8 vlan_fail_q; |
---|
| 211 | + unsigned int eee_usecs_rate; |
---|
| 212 | + bool sph_disable; |
---|
198 | 213 | }; |
---|
199 | 214 | #endif |
---|