提交 106c314c 编写于 作者: F Fugang Duan 提交者: David S. Miller

net:fec: Disable enet-avb MAC instead of reset MAC

For i.MX6SX enet use AXI bus, reset MAC will make system bus dead
if ENET-AXI bus has pending access (AHB bus should not have such issue).
So, disable enet with AVB MAC instead of reset MAC itself.
Signed-off-by: NFugang Duan <B38611@freescale.com>
Signed-off-by: NFrank Li <Frank.Li@freescale.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 59d0f746
...@@ -945,9 +945,16 @@ fec_restart(struct net_device *ndev) ...@@ -945,9 +945,16 @@ fec_restart(struct net_device *ndev)
u32 rcntl = OPT_FRAME_SIZE | 0x04; u32 rcntl = OPT_FRAME_SIZE | 0x04;
u32 ecntl = 0x2; /* ETHEREN */ u32 ecntl = 0x2; /* ETHEREN */
/* Whack a reset. We should wait for this. */ /* Whack a reset. We should wait for this.
writel(1, fep->hwp + FEC_ECNTRL); * For i.MX6SX SOC, enet use AXI bus, we use disable MAC
udelay(10); * instead of reset MAC itself.
*/
if (id_entry && id_entry->driver_data & FEC_QUIRK_HAS_AVB) {
writel(0, fep->hwp + FEC_ECNTRL);
} else {
writel(1, fep->hwp + FEC_ECNTRL);
udelay(10);
}
/* /*
* enet-mac reset will reset mac address registers too, * enet-mac reset will reset mac address registers too,
...@@ -1118,9 +1125,16 @@ fec_stop(struct net_device *ndev) ...@@ -1118,9 +1125,16 @@ fec_stop(struct net_device *ndev)
netdev_err(ndev, "Graceful transmit stop did not complete!\n"); netdev_err(ndev, "Graceful transmit stop did not complete!\n");
} }
/* Whack a reset. We should wait for this. */ /* Whack a reset. We should wait for this.
writel(1, fep->hwp + FEC_ECNTRL); * For i.MX6SX SOC, enet use AXI bus, we use disable MAC
udelay(10); * instead of reset MAC itself.
*/
if (id_entry && id_entry->driver_data & FEC_QUIRK_HAS_AVB) {
writel(0, fep->hwp + FEC_ECNTRL);
} else {
writel(1, fep->hwp + FEC_ECNTRL);
udelay(10);
}
writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED); writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK); writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册