Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f748be53 authored by Alexandre TORGUE's avatar Alexandre TORGUE Committed by David S. Miller
Browse files

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: default avatarAlexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ee2ae1ed
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -169,6 +169,9 @@ struct stmmac_extra_stats {
	unsigned long mtl_rx_fifo_ctrl_active;
	unsigned long mtl_rx_fifo_ctrl_active;
	unsigned long mac_rx_frame_ctrl_fifo;
	unsigned long mac_rx_frame_ctrl_fifo;
	unsigned long mac_gmii_rx_proto_engine;
	unsigned long mac_gmii_rx_proto_engine;
	/* TSO */
	unsigned long tx_tso_frames;
	unsigned long tx_tso_nfrags;
};
};


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


/**
/**
 * stmmac_get_synopsys_id - return the SYINID.
 * stmmac_get_synopsys_id - return the SYINID.
+5 −1
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@
#define __STMMAC_H__
#define __STMMAC_H__


#define STMMAC_RESOURCE_NAME   "stmmaceth"
#define STMMAC_RESOURCE_NAME   "stmmaceth"
#define DRV_MODULE_VERSION	"Oct_2015"
#define DRV_MODULE_VERSION	"Dec_2015"


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


	struct dma_desc *dma_rx	____cacheline_aligned_in_smp;
	struct dma_desc *dma_rx	____cacheline_aligned_in_smp;
	struct dma_extended_desc *dma_erx;
	struct dma_extended_desc *dma_erx;
@@ -129,6 +130,9 @@ struct stmmac_priv {
	int irq_wake;
	int irq_wake;
	spinlock_t ptp_lock;
	spinlock_t ptp_lock;
	void __iomem *mmcaddr;
	void __iomem *mmcaddr;
	u32 rx_tail_addr;
	u32 tx_tail_addr;
	u32 mss;


#ifdef CONFIG_DEBUG_FS
#ifdef CONFIG_DEBUG_FS
	struct dentry *dbgfs_dir;
	struct dentry *dbgfs_dir;
+4 −1
Original line number Original line Diff line number Diff line
@@ -161,6 +161,9 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
	STMMAC_STAT(mtl_rx_fifo_ctrl_active),
	STMMAC_STAT(mtl_rx_fifo_ctrl_active),
	STMMAC_STAT(mac_rx_frame_ctrl_fifo),
	STMMAC_STAT(mac_rx_frame_ctrl_fifo),
	STMMAC_STAT(mac_gmii_rx_proto_engine),
	STMMAC_STAT(mac_gmii_rx_proto_engine),
	/* TSO */
	STMMAC_STAT(tx_tso_frames),
	STMMAC_STAT(tx_tso_nfrags),
};
};
#define STMMAC_STATS_LEN ARRAY_SIZE(stmmac_gstrings_stats)
#define STMMAC_STATS_LEN ARRAY_SIZE(stmmac_gstrings_stats)


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


	/* Update the DMA HW counters for dwmac10/100 */
	/* Update the DMA HW counters for dwmac10/100 */
	if (!priv->plat->has_gmac)
	if (priv->hw->dma->dma_diagnostic_fr)
		priv->hw->dma->dma_diagnostic_fr(&dev->stats,
		priv->hw->dma->dma_diagnostic_fr(&dev->stats,
						 (void *) &priv->xstats,
						 (void *) &priv->xstats,
						 priv->ioaddr);
						 priv->ioaddr);
+431 −52

File changed.

Preview size limit exceeded, changes collapsed.