hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/include/linux/stmmac.h
....@@ -1,24 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*******************************************************************************
23
34 Header file for stmmac platform data
45
56 Copyright (C) 2009 STMicroelectronics Ltd
67
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".
228
239 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
2410 *******************************************************************************/
....@@ -27,6 +13,7 @@
2713 #define __STMMAC_PLATFORM_DATA
2814
2915 #include <linux/platform_device.h>
16
+#include <linux/phy.h>
3017
3118 #define MTL_MAX_RX_QUEUES 8
3219 #define MTL_MAX_TX_QUEUES 8
....@@ -92,14 +79,11 @@
9279 /* Platfrom data for platform device structure's platform_data field */
9380
9481 struct stmmac_mdio_bus_data {
95
- int (*phy_reset)(void *priv);
9682 unsigned int phy_mask;
83
+ unsigned int has_xpcs;
9784 int *irqs;
9885 int probed_phy_irq;
99
-#ifdef CONFIG_OF
100
- int reset_gpio, active_low;
101
- u32 delays[3];
102
-#endif
86
+ bool needs_reset;
10387 };
10488
10589 struct stmmac_dma_cfg {
....@@ -110,6 +94,7 @@
11094 int fixed_burst;
11195 int mixed_burst;
11296 bool aal;
97
+ bool eame;
11398 };
11499
115100 #define AXI_BLEN 7
....@@ -123,6 +108,19 @@
123108 bool axi_fb;
124109 bool axi_mb;
125110 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;
126124 };
127125
128126 struct stmmac_rxq_cfg {
....@@ -143,16 +141,20 @@
143141 u32 low_credit;
144142 bool use_prio;
145143 u32 prio;
144
+ int tbs_en;
146145 };
147146
148147 struct plat_stmmacenet_data {
149148 int bus_id;
150149 int phy_addr;
151150 int interface;
151
+ phy_interface_t phy_interface;
152152 struct stmmac_mdio_bus_data *mdio_bus_data;
153153 struct device_node *phy_node;
154
+ struct device_node *phylink_node;
154155 struct device_node *mdio_node;
155156 struct stmmac_dma_cfg *dma_cfg;
157
+ struct stmmac_est *est;
156158 int clk_csr;
157159 int has_gmac;
158160 int enh_desc;
....@@ -169,6 +171,10 @@
169171 int unicast_filter_entries;
170172 int tx_fifo_size;
171173 int rx_fifo_size;
174
+ int dma_tx_size;
175
+ int dma_rx_size;
176
+ int flow_ctrl;
177
+ u32 addr64;
172178 u32 rx_queues_to_use;
173179 u32 tx_queues_to_use;
174180 u8 rx_sched_algorithm;
....@@ -176,6 +182,8 @@
176182 struct stmmac_rxq_cfg rx_queues_cfg[MTL_MAX_RX_QUEUES];
177183 struct stmmac_txq_cfg tx_queues_cfg[MTL_MAX_TX_QUEUES];
178184 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);
179187 int (*integrated_phy_power)(void *priv, bool up);
180188 int (*init)(struct platform_device *pdev, void *priv);
181189 void (*exit)(struct platform_device *pdev, void *priv);
....@@ -187,13 +195,20 @@
187195 struct clk *clk_ptp_ref;
188196 unsigned int clk_ptp_rate;
189197 unsigned int clk_ref_rate;
198
+ s32 ptp_max_adj;
190199 struct reset_control *stmmac_rst;
191200 struct stmmac_axi *axi;
192201 int has_gmac4;
193202 bool has_sun8i;
194203 bool tso_en;
204
+ int rss_en;
195205 int mac_port_sel_speed;
196206 bool en_tx_lpi_clockgating;
207
+ bool rx_clk_runs_in_lpi;
197208 int has_xgmac;
209
+ bool vlan_fail_q_en;
210
+ u8 vlan_fail_q;
211
+ unsigned int eee_usecs_rate;
212
+ bool sph_disable;
198213 };
199214 #endif