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

Commit 2e860bb6 authored by Sunil Paidimarri's avatar Sunil Paidimarri
Browse files

net: stmmac: Enable CRC clipping bit



When the bit is set the last four bytes of the ethernet
packet type is stripped and dropped before forwarding.

Change-Id: I740a513c90a85e3a390984602fd12539e567fc11
Acked-by: default avatarAbhishek Chauhan <abchauha@qti.qualcomm.com>
Signed-off-by: default avatarSunil Paidimarri <hisunil@codeaurora.org>
parent f20d9cb7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -116,6 +116,10 @@ Optional properties:
			- snps,high_credit: max write outstanding req. limit
			- snps,low_credit: max read outstanding req. limit
		- snps,priority: TX queue priority (Range: 0x0 to 0xF)
- snps,crc_strip: this enables the CRC stripping feature in the hardware and the
		  last four bytes of the ethernet packet type is stripped and
		  dropped before forwarding.

Examples:

	stmmac_axi_setup: stmmac-axi-config {
+1 −0
Original line number Diff line number Diff line
@@ -600,6 +600,7 @@ struct mac_device_info {
	unsigned int pcs;
	unsigned int pmt;
	unsigned int ps;
	unsigned int crc_strip_en;
};

struct stmmac_rx_routing {
+1 −0
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ enum power_event {
/* MAC config */
#define GMAC_CONFIG_IPC			BIT(27)
#define GMAC_CONFIG_2K			BIT(22)
#define GMAC_CONFIG_CRC			BIT(21)
#define GMAC_CONFIG_ACS			BIT(20)
#define GMAC_CONFIG_BE			BIT(18)
#define GMAC_CONFIG_JD			BIT(17)
+4 −1
Original line number Diff line number Diff line
@@ -35,10 +35,13 @@ static void dwmac4_core_init(struct mac_device_info *hw,
	if (mtu > 2000)
		value |= GMAC_CONFIG_JE;

	if (hw->crc_strip_en)
		value |= GMAC_CONFIG_CRC;

	if (hw->ps) {
		value |= GMAC_CONFIG_TE;

		value &= hw->link.speed_mask;
		value &= ~(hw->link.speed_mask);
		switch (hw->ps) {
		case SPEED_1000:
			value |= hw->link.speed1000;
+1 −0
Original line number Diff line number Diff line
@@ -2624,6 +2624,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
			priv->hw->ps = 0;
		}
	}
	priv->hw->crc_strip_en = priv->plat->crc_strip_en;

	/* Initialize the MAC Core */
	priv->hw->mac->core_init(priv->hw, dev);
Loading