Skip to content

Commit f748be5

Browse files
atorguedavem330
authored andcommitted
stmmac: support new GMAC4
This patch adds the whole GMAC4 support inside the stmmac d.d. now able to use the new HW and some new features i.e.: TSO. It is missing the multi-queue and split Header support at this stage. This patch also updates the driver version and the stmmac.txt. Signed-off-by: Alexandre TORGUE <[email protected]> Signed-off-by: Giuseppe Cavallaro <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ee2ae1e commit f748be5

File tree

4 files changed

+444
-54
lines changed

4 files changed

+444
-54
lines changed

drivers/net/ethernet/stmicro/stmmac/common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ struct stmmac_extra_stats {
169169
unsigned long mtl_rx_fifo_ctrl_active;
170170
unsigned long mac_rx_frame_ctrl_fifo;
171171
unsigned long mac_gmii_rx_proto_engine;
172+
/* TSO */
173+
unsigned long tx_tso_frames;
174+
unsigned long tx_tso_nfrags;
172175
};
173176

174177
/* CSR Frequency Access Defines*/
@@ -545,6 +548,7 @@ void stmmac_dwmac4_set_mac(void __iomem *ioaddr, bool enable);
545548
void dwmac_dma_flush_tx_fifo(void __iomem *ioaddr);
546549
extern const struct stmmac_mode_ops ring_mode_ops;
547550
extern const struct stmmac_mode_ops chain_mode_ops;
551+
extern const struct stmmac_desc_ops dwmac4_desc_ops;
548552

549553
/**
550554
* stmmac_get_synopsys_id - return the SYINID.

drivers/net/ethernet/stmicro/stmmac/stmmac.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#define __STMMAC_H__
2525

2626
#define STMMAC_RESOURCE_NAME "stmmaceth"
27-
#define DRV_MODULE_VERSION "Oct_2015"
27+
#define DRV_MODULE_VERSION "Dec_2015"
2828

2929
#include <linux/clk.h>
3030
#include <linux/stmmac.h>
@@ -67,6 +67,7 @@ struct stmmac_priv {
6767
spinlock_t tx_lock;
6868
bool tx_path_in_lpi_mode;
6969
struct timer_list txtimer;
70+
bool tso;
7071

7172
struct dma_desc *dma_rx ____cacheline_aligned_in_smp;
7273
struct dma_extended_desc *dma_erx;
@@ -129,6 +130,9 @@ struct stmmac_priv {
129130
int irq_wake;
130131
spinlock_t ptp_lock;
131132
void __iomem *mmcaddr;
133+
u32 rx_tail_addr;
134+
u32 tx_tail_addr;
135+
u32 mss;
132136

133137
#ifdef CONFIG_DEBUG_FS
134138
struct dentry *dbgfs_dir;

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
161161
STMMAC_STAT(mtl_rx_fifo_ctrl_active),
162162
STMMAC_STAT(mac_rx_frame_ctrl_fifo),
163163
STMMAC_STAT(mac_gmii_rx_proto_engine),
164+
/* TSO */
165+
STMMAC_STAT(tx_tso_frames),
166+
STMMAC_STAT(tx_tso_nfrags),
164167
};
165168
#define STMMAC_STATS_LEN ARRAY_SIZE(stmmac_gstrings_stats)
166169

@@ -499,7 +502,7 @@ static void stmmac_get_ethtool_stats(struct net_device *dev,
499502
int i, j = 0;
500503

501504
/* Update the DMA HW counters for dwmac10/100 */
502-
if (!priv->plat->has_gmac)
505+
if (priv->hw->dma->dma_diagnostic_fr)
503506
priv->hw->dma->dma_diagnostic_fr(&dev->stats,
504507
(void *) &priv->xstats,
505508
priv->ioaddr);

0 commit comments

Comments
 (0)