|
@@ -25,15 +25,26 @@
|
|
|
*******************************************************************************/
|
|
|
|
|
|
#include <linux/crc32.h>
|
|
|
+#include <net/dsa.h>
|
|
|
#include <asm/io.h>
|
|
|
#include "dwmac100.h"
|
|
|
|
|
|
-static void dwmac100_core_init(struct mac_device_info *hw, int mtu)
|
|
|
+static void dwmac100_core_init(struct mac_device_info *hw,
|
|
|
+ struct net_device *dev)
|
|
|
{
|
|
|
void __iomem *ioaddr = hw->pcsr;
|
|
|
u32 value = readl(ioaddr + MAC_CONTROL);
|
|
|
|
|
|
- writel((value | MAC_CORE_INIT), ioaddr + MAC_CONTROL);
|
|
|
+ value |= MAC_CORE_INIT;
|
|
|
+
|
|
|
+ /* Clear ASTP bit because Ethernet switch tagging formats such as
|
|
|
+ * Broadcom tags can look like invalid LLC/SNAP packets and cause the
|
|
|
+ * hardware to truncate packets on reception.
|
|
|
+ */
|
|
|
+ if (netdev_uses_dsa(dev))
|
|
|
+ value &= ~MAC_CONTROL_ASTP;
|
|
|
+
|
|
|
+ writel(value, ioaddr + MAC_CONTROL);
|
|
|
|
|
|
#ifdef STMMAC_VLAN_TAG_USED
|
|
|
writel(ETH_P_8021Q, ioaddr + MAC_VLAN1);
|